CollectionDeployer

0x34aad5959bdf60cab97e2605672b7be99d85d33c

Verification
Verified
v0.8.17+commit.8df45f5f
Type
Contract
21,457 bytes
ABI entries
4
1 read · 1 write
License
none

Contract information

Address
0x34aad5959bdf60cab97e2605672b7be99d85d33c
Chain
Robinhood Chain (4663)
Compiler
v0.8.17+commit.8df45f5f
Optimization
Enabled
Creation tx
0x4c2622f279…d4a9d662e0

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (1)

configAddress()address

Events (1)

CollectionDeployed

ABI

[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "_configAddress",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "collection",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "bytes32",
        "name": "launchId",
        "type": "bytes32"
      }
    ],
    "name": "CollectionDeployed",
    "type": "event"
  },
  {
    "inputs": [],
    "name": "configAddress",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "string",
            "name": "name",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "symbol",
            "type": "string"
          },
          {
            "internalType": "uint256",
            "name": "quantity",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "mintThreshold",
            "type": "uint256"
          },
          {
            "internalType": "address",
            "name": "creator",
            "type": "address"
          },
          {
            "internalType": "string",
            "name": "baseTokenURI",
            "type": "string"
          },
          {
            "internalType": "bool",
            "name": "isEdition",
            "type": "bool"
          },
          {
            "internalType": "uint256",
            "name": "reservedQuantity",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "lpPercentage",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "mintPrice",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "phaseCount",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "phaseDuration",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "publicMintDuration",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "startTime",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "txMax",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "purchasableWlPercentage",
            "type": "uint256"
          },
          {
            "internalType": "bytes32",
            "name": "launchId",
            "type": "bytes32"
          },
          {
            "internalType": "bytes32",
            "name": "deploymentSalt",
            "type": "bytes32"
          }
        ],
        "internalType": "struct CollectionDeployer.LaunchParameters",
        "name": "parameters",
        "type": "tuple"
      }
    ],
    "name": "deploy",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "./BulletCollection.sol";
import "./interfaces/IBulletConfig.sol";
import "./interfaces/IMintManager.sol";

contract CollectionDeployer {

  address public immutable configAddress;

  struct LaunchParameters {
    string name;
    string symbol;
    uint256 quantity;
    uint256 mintThreshold;
    address creator;
    string baseTokenURI;
    bool isEdition;
    uint256 reservedQuantity;
    uint256 lpPercentage;
    uint256 mintPrice;
    uint256 phaseCount;
    uint256 phaseDuration;
    uint256 publicMintDuration;
    uint256 startTime;
    uint256 txMax;
    uint256 purchasableWlPercentage;
    bytes32 launchId;
    bytes32 deploymentSalt;
  }

  event CollectionDeployed(
    address indexed collection,
    address indexed owner,
    bytes32 indexed launchId
  );

  constructor(address _configAddress) {
    require(_configAddress != address(0) && _configAddress.code.length > 0, "Invalid config.");
    configAddress = _configAddress;
  }

  function deploy(LaunchParameters calldata parameters) public returns (address) {
    require(parameters.launchId != bytes32(0), "Invalid launch ID.");
    require(parameters.deploymentSalt != bytes32(0), "Invalid deployment salt.");
    require(parameters.creator != address(0), "Invalid creator.");

    bytes32 scopedSalt = keccak256(
      abi.encode(msg.sender, parameters.deploymentSalt)
    );
    BulletCollection collection = new BulletCollection{
      salt: scopedSalt
    }(
      parameters.name,
      parameters.symbol,
      parameters.quantity,
      parameters.mintThreshold,
      configAddress,
      address(this)
    );

    collection.setContentDetails(
      parameters.creator,
      parameters.baseTokenURI,
      parameters.isEdition
    );
    collection.configureFor(
      parameters.reservedQuantity,
      parameters.lpPercentage,
      msg.sender
    );

    address mintManagerAddress = collection.mintManagerAddress();
    require(mintManagerAddress != address(0), "Mint manager is not configured.");
    IMintManager(mintManagerAddress).configureMint(
      address(collection),
      parameters.mintPrice,
      parameters.phaseCount,
      parameters.phaseDuration,
      parameters.publicMintDuration,
      parameters.startTime,
      parameters.txMax,
      parameters.purchasableWlPercentage
    );
    collection.completeInitialOwnershipTransfer(msg.sender);

    emit CollectionDeployed(address(collection), msg.sender, parameters.launchId);

    return address(collection);
  }

}
Chain explorer3402msChain node108ms