ERC721SeaDropCloneFactory

0x008ebccae39d001200c3003c3225ce0a00690066

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

Contract information

Address
0x008ebccae39d001200c3003c3225ce0a00690066
Chain
Robinhood Chain (4663)
Compiler
v0.8.17+commit.8df45f5f
Optimization
Enabled
Creation tx
0xddc2b9dc87…945c547e36

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (2)

DEFAULT_SEADROP()address
seaDropCloneableUpgradeableImplementation()address

ABI

[
  {
    "inputs": [],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "DEFAULT_SEADROP",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "string",
        "name": "name",
        "type": "string"
      },
      {
        "internalType": "string",
        "name": "symbol",
        "type": "string"
      },
      {
        "internalType": "bytes32",
        "name": "salt",
        "type": "bytes32"
      }
    ],
    "name": "createClone",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "seaDropCloneableUpgradeableImplementation",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  }
]

Source code

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

import { ERC721SeaDropCloneable } from "./ERC721SeaDropCloneable.sol";

import { Clones } from "openzeppelin-contracts/proxy/Clones.sol";

contract ERC721SeaDropCloneFactory {
    address public immutable seaDropCloneableUpgradeableImplementation;
    address public constant DEFAULT_SEADROP =
        0x00005EA00Ac477B1030CE78506496e8C2dE24bf5;

    constructor() {
        ERC721SeaDropCloneable impl = new ERC721SeaDropCloneable();
        impl.initialize("", "", new address[](0), address(this));
        seaDropCloneableUpgradeableImplementation = address(impl);
    }

    function createClone(
        string memory name,
        string memory symbol,
        bytes32 salt
    ) external returns (address) {
        // Derive a pseudo-random salt, so clone addresses don't collide
        // across chains.
        bytes32 cloneSalt = keccak256(
            abi.encodePacked(salt, blockhash(block.number))
        );

        address instance = Clones.cloneDeterministic(
            seaDropCloneableUpgradeableImplementation,
            cloneSalt
        );
        address[] memory allowedSeaDrop = new address[](1);
        allowedSeaDrop[0] = DEFAULT_SEADROP;
        ERC721SeaDropCloneable(instance).initialize(
            name,
            symbol,
            allowedSeaDrop,
            msg.sender
        );
        return instance;
    }
}
Chain explorer5281msChain node74ms