Address Contract Verified
Address
0x86153A0d9c060BE48A0cfc2daEed3Eee957C9DD7
Balance
0.121000 ETH
Nonce
1
Code Size
7604 bytes
Creator
0x64321052...6a63 at tx 0xe040331e...7175a8
Indexed Transactions
0
Contract Bytecode
7604 bytes
0x6080604052600436106101805760003560e01c806368bcdef9116100d657806398b0eff61161007f578063f2fde38b11610059578063f2fde38b146103e7578063f725575114610407578063fc710f0e1461041c57600080fd5b806398b0eff614610374578063ba6f7388146103a4578063bab60e79146103c757600080fd5b80638456cb59116100b05780638456cb591461031c5780638d6cc56d146103315780638da5cb5b1461035157600080fd5b806368bcdef9146102d4578063715018a6146102e757806376cb79b2146102fc57600080fd5b80632727d0891161013857806347ccca021161011257806347ccca02146102645780635be68e931461029c5780635c975abb146102bc57600080fd5b80632727d089146102265780632f8cbb1b146102395780633f4ba83a1461024f57600080fd5b80630ab68e64116101695780630ab68e64146101c35780631f88b405146101f3578063228f1bb31461020657600080fd5b80630446a91d146101855780630a705575146101ae575b600080fd5b34801561019157600080fd5b5061019b60065481565b6040519081526020015b60405180910390f35b6101c16101bc36600461178e565b61043c565b005b3480156101cf57600080fd5b506101e36101de366004611807565b610741565b60405190151581526020016101a5565b6101c1610201366004611870565b6107e8565b34801561021257600080fd5b506101c16102213660046118f3565b6108a2565b6101c161023436600461178e565b610907565b34801561024557600080fd5b5061019b60075481565b34801561025b57600080fd5b506101c1610bda565b34801561027057600080fd5b50600554610284906001600160a01b031681565b6040516001600160a01b0390911681526020016101a5565b3480156102a857600080fd5b506101c16102b736600461190c565b610c96565b3480156102c857600080fd5b5060005460ff166101e3565b6101c16102e2366004611870565b610d86565b3480156102f357600080fd5b506101c1610e37565b34801561030857600080fd5b506101e361031736600461178e565b610ea1565b34801561032857600080fd5b506101c1610f4b565b34801561033d57600080fd5b506101c161034c3660046118f3565b610ff9565b34801561035d57600080fd5b5060005461010090046001600160a01b0316610284565b34801561038057600080fd5b506101e361038f3660046118f3565b60086020526000908152604090205460ff1681565b3480156103b057600080fd5b506103b961105e565b6040516101a5929190611930565b3480156103d357600080fd5b506101c16103e236600461198d565b6110f5565b3480156103f357600080fd5b506101c161040236600461190c565b6111e6565b34801561041357600080fd5b506103b96112ce565b34801561042857600080fd5b506101c16104373660046119b9565b6112e2565b60005460ff16156104875760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064015b60405180910390fd5b6006543410156104c35760405162461bcd60e51b815260206004820152600760248201526645544820706c7360c81b604482015260640161047e565b6001600160a01b038416158015906104e457506001600160a01b0384163014155b61051a5760405162461bcd60e51b8152602060048201526007602482015266109b1bd8dad95960ca1b604482015260640161047e565b6000833561052b6040860186611a14565b86602001356040516020016105439493929190611a5b565b60408051601f1981840301815291815281516020928301206000818152600890935291205490915060ff16156105a85760405162461bcd60e51b815260206004820152600a602482015269141c9bdbd9881d5cd95960b21b604482015260640161047e565b6105e98383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060035491508490506113a2565b6106255760405162461bcd60e51b815260206004820152600d60248201526c141c9bdbd9881a5b9d985b1a59609a1b604482015260640161047e565b60008181526008602052604090819020805460ff191660011790556005546001600160a01b03169063d4264af090879087359061066490890189611a14565b89602001356040518663ffffffff1660e01b8152600401610689959493929190611a76565b6020604051808303816000875af11580156106a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106cc9190611ac6565b6107015760405162461bcd60e51b815260206004820152600660248201526511985a5b195960d21b604482015260640161047e565b6001600160a01b03851660005b6040518635907f15eff4996d3c9160e38eed2df5a6cddeba586b6891115844313113c0b37eb59290600090a45050505050565b60008084356107536040870187611a14565b876020013560405160200161076b9493929190611a5b565b6040516020818303038152906040528051906020012090506107c48484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060035491508490506113a2565b80156107df575060008181526008602052604090205460ff16155b95945050505050565b8280158015906108045750806007546108019190611b14565b34145b61083a5760405162461bcd60e51b815260206004820152600760248201526645544820706c7360c81b604482015260640161047e565b60005b81811015610899576108918787878481811061085b5761085b611b33565b905060200281019061086d9190611b49565b86868581811061087f5761087f611b33565b90506020028101906102349190611b69565b60010161083d565b50505050505050565b6000546001600160a01b036101009091041633146109025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b600755565b60005460ff161561094d5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161047e565b6007543410156109895760405162461bcd60e51b815260206004820152600760248201526645544820706c7360c81b604482015260640161047e565b6001600160a01b038416158015906109aa57506001600160a01b0384163014155b6109e05760405162461bcd60e51b8152602060048201526007602482015266109b1bd8dad95960ca1b604482015260640161047e565b60008484356109f26040870187611a14565b8760200135604051602001610a0b959493929190611bb3565b60408051601f1981840301815291815281516020928301206000818152600890935291205490915060ff1615610a705760405162461bcd60e51b815260206004820152600a602482015269141c9bdbd9881d5cd95960b21b604482015260640161047e565b610ab18383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060015491508490506113a2565b610aed5760405162461bcd60e51b815260206004820152600d60248201526c141c9bdbd9881a5b9d985b1a59609a1b604482015260640161047e565b60008181526008602052604090819020805460ff191660011790556005546001600160a01b03169063d4264af0908790873590610b2c90890189611a14565b89602001356040518663ffffffff1660e01b8152600401610b51959493929190611a76565b6020604051808303816000875af1158015610b70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b949190611ac6565b610bc95760405162461bcd60e51b815260206004820152600660248201526511985a5b195960d21b604482015260640161047e565b6001600160a01b038516600161070e565b6000546001600160a01b03610100909104163314610c3a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b60005460ff16610c8c5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161047e565b610c946113b8565b565b6000546001600160a01b03610100909104163314610cf65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b6001600160a01b038116610d4c5760405162461bcd60e51b815260206004820152600b60248201527f496e76616c6964206e6674000000000000000000000000000000000000000000604482015260640161047e565b600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b828015801590610da2575080600654610d9f9190611b14565b34145b610dd85760405162461bcd60e51b815260206004820152600760248201526645544820706c7360c81b604482015260640161047e565b60005b8181101561089957610e2f87878784818110610df957610df9611b33565b9050602002810190610e0b9190611b49565b868685818110610e1d57610e1d611b33565b90506020028101906101bc9190611b69565b600101610ddb565b6000546001600160a01b03610100909104163314610e975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b610c946000611454565b600080858535610eb46040880188611a14565b8860200135604051602001610ecd959493929190611bb3565b604051602081830303815290604052805190602001209050610f268484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060015491508490506113a2565b8015610f41575060008181526008602052604090205460ff16155b9695505050505050565b6000546001600160a01b03610100909104163314610fab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b60005460ff1615610ff15760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161047e565b610c946114c4565b6000546001600160a01b036101009091041633146110595760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b600655565b600380546004805491929161107290611be7565b80601f016020809104026020016040519081016040528092919081815260200182805461109e90611be7565b80156110eb5780601f106110c0576101008083540402835291602001916110eb565b820191906000526020600020905b8154815290600101906020018083116110ce57829003601f168201915b5050505050905082565b6000546001600160a01b036101009091041633146111555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b6001600160a01b0382166111ab5760405162461bcd60e51b815260206004820152601160248201527f496e76616c696420726563697069656e74000000000000000000000000000000604482015260640161047e565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156111e1573d6000803e3d6000fd5b505050565b6000546001600160a01b036101009091041633146112465760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b6001600160a01b0381166112c25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161047e565b6112cb81611454565b50565b600180546002805491929161107290611be7565b6000546001600160a01b036101009091041633146113425760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b60005460ff166113945760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161047e565b61139e828261153f565b5050565b6000826113af8584611669565b14949350505050565b60005460ff1661140a5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161047e565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166101008181027fffffffffffffffffffffff0000000000000000000000000000000000000000ff851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60005460ff161561150a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161047e565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114373390565b61154c6020830183611a14565b9050602e1461159d5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c696420686173680000000000000000000000000000000000000000604482015260640161047e565b81356115eb5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c696420726f6f740000000000000000000000000000000000000000604482015260640161047e565b60018160018111156115ff576115ff611ae8565b141561161a578160016116128282611c6a565b90505061162a565b8160036116278282611c6a565b50505b80600181111561163c5761163c611ae8565b6040517ff6938419cc5de77aaa6a8a71a245d573813c8a1f692e543e08cbb71fa995bf7f90600090a25050565b600081815b845181101561170d57600085828151811061168b5761168b611b33565b602002602001015190508083116116cd5760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506116fa565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061170581611d63565b91505061166e565b509392505050565b6001600160a01b03811681146112cb57600080fd5b60006060828403121561173c57600080fd5b50919050565b60008083601f84011261175457600080fd5b50813567ffffffffffffffff81111561176c57600080fd5b6020830191508360208260051b850101111561178757600080fd5b9250929050565b600080600080606085870312156117a457600080fd5b84356117af81611715565b9350602085013567ffffffffffffffff808211156117cc57600080fd5b6117d88883890161172a565b945060408701359150808211156117ee57600080fd5b506117fb87828801611742565b95989497509550505050565b60008060006040848603121561181c57600080fd5b833567ffffffffffffffff8082111561183457600080fd5b6118408783880161172a565b9450602086013591508082111561185657600080fd5b5061186386828701611742565b9497909650939450505050565b60008060008060006060868803121561188857600080fd5b853561189381611715565b9450602086013567ffffffffffffffff808211156118b057600080fd5b6118bc89838a01611742565b909650945060408801359150808211156118d557600080fd5b506118e288828901611742565b969995985093965092949392505050565b60006020828403121561190557600080fd5b5035919050565b60006020828403121561191e57600080fd5b813561192981611715565b9392505050565b82815260006020604081840152835180604085015260005b8181101561196457858101830151858201606001528201611948565b81811115611976576000606083870101525b50601f01601f191692909201606001949350505050565b600080604083850312156119a057600080fd5b82356119ab81611715565b946020939093013593505050565b600080604083850312156119cc57600080fd5b823567ffffffffffffffff8111156119e357600080fd5b8301604081860312156119f557600080fd5b9150602083013560028110611a0957600080fd5b809150509250929050565b6000808335601e19843603018112611a2b57600080fd5b83018035915067ffffffffffffffff821115611a4657600080fd5b60200191503681900382131561178757600080fd5b84815282846020830137602092019182015260400192915050565b6001600160a01b038616815284602082015260806040820152826080820152828460a0830137600060a08483010152600060a0601f19601f86011683010190508260608301529695505050505050565b600060208284031215611ad857600080fd5b8151801515811461192957600080fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611b2e57611b2e611afe565b500290565b634e487b7160e01b600052603260045260246000fd5b60008235605e19833603018112611b5f57600080fd5b9190910192915050565b6000808335601e19843603018112611b8057600080fd5b83018035915067ffffffffffffffff821115611b9b57600080fd5b6020019150600581901b360382131561178757600080fd5b6bffffffffffffffffffffffff198660601b1681528460148201528284603483013760349201918201526054019392505050565b600181811c90821680611bfb57607f821691505b6020821081141561173c57634e487b7160e01b600052602260045260246000fd5b601f8211156111e157600081815260208120601f850160051c81016020861015611c435750805b601f850160051c820191505b81811015611c6257828155600101611c4f565b505050505050565b813581556001808201602080850135601e19863603018112611c8b57600080fd5b8501803567ffffffffffffffff811115611ca457600080fd5b8036038383011315611cb557600080fd5b611cc981611cc38654611be7565b86611c1c565b6000601f821160018114611cff5760008315611ce757508382018501355b600019600385901b1c1916600184901b178655611d58565b600086815260209020601f19841690835b82811015611d2f57868501880135825593870193908901908701611d10565b5084821015611d4e5760001960f88660031b161c198785880101351681555b50508683881b0186555b505050505050505050565b6000600019821415611d7757611d77611afe565b506001019056fea26469706673582212200dca79250be9d60f93e38218195803d75f88a83e7746cf91b8474e7e00934c7b64736f6c634300080c0033
Verified Source Code Full Match
Compiler: v0.8.12+commit.f00d7308
EVM: london
Optimization: Yes (1000 runs)
IKaijuNFT.sol 9 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
interface IKaijuNFT {
function mintTo(address to, bytes32 nfcId, string calldata tokenURI, uint256 birthDate)
external
returns (bool);
}
MerkleMinter.sol 140 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import { IKaijuNFT } from "./IKaijuNFT.sol";
/// @title Merkle tree driven minting of Kaiju NFTs
contract MerkleMinter is Pausable, Ownable {
event MerkleTreeUpdated(TreeType indexed treeType);
event Purchased(bytes32 indexed nfcId, TreeType indexed treeType, address indexed recipient);
enum TreeType { OPEN, GATED }
struct KaijuDNA { bytes32 nfcId; uint256 birthday; string tokenUri; }
struct MerkleTreeMetadata { bytes32 root; string dataIPFSHash; }
MerkleTreeMetadata public gatedMerkleTreeMetadata; // single claim to a Kaiju by a specific address
MerkleTreeMetadata public openMerkleTreeMetadata; // first come first serve Kaiju NFT
IKaijuNFT public nft;
uint256 public pricePerNFTInETH;
uint256 public gatedMintPricePerNFTInETH;
mapping(bytes32 => bool) public proofUsed;
constructor(IKaijuNFT _nft, uint256 _pricePerNFTInETH, uint256 _gatedMintPricePerNFTInETH, address _owner) {
require(address(_nft) != address(0), "Invalid nft");
require(_owner != address(0) && _owner != address(_nft) && _owner != address(this), "Invalid owner");
nft = _nft;
pricePerNFTInETH = _pricePerNFTInETH;
gatedMintPricePerNFTInETH = _gatedMintPricePerNFTInETH;
_transferOwnership(_owner);
_pause();
}
function canOpenMint(KaijuDNA calldata _dna, bytes32[] calldata _merkleProof) external view returns (bool) {
bytes32 node = keccak256(abi.encodePacked(_dna.nfcId, _dna.tokenUri, _dna.birthday));
return MerkleProof.verify(_merkleProof, openMerkleTreeMetadata.root, node) && !proofUsed[node];
}
function openMint(address _recipient, KaijuDNA calldata _dna, bytes32[] calldata _merkleProof)
public whenNotPaused payable {
require(msg.value >= pricePerNFTInETH, "ETH pls");
require(_recipient != address(0) && _recipient != address(this), "Blocked");
bytes32 node = keccak256(abi.encodePacked(_dna.nfcId, _dna.tokenUri, _dna.birthday));
require(!proofUsed[node], "Proof used");
require(MerkleProof.verify(_merkleProof, openMerkleTreeMetadata.root, node), "Proof invalid");
proofUsed[node] = true;
require(nft.mintTo(_recipient, _dna.nfcId, _dna.tokenUri, _dna.birthday), "Failed");
emit Purchased(_dna.nfcId, TreeType.OPEN, _recipient);
}
function multiOpenMint(address _recipient, KaijuDNA[] calldata _dnas, bytes32[][] calldata _merkleProofs)
external payable {
uint256 numItemsToMint = _dnas.length;
require(numItemsToMint > 0 && msg.value == (pricePerNFTInETH * numItemsToMint), "ETH pls");
unchecked {
for (uint256 i; i < numItemsToMint; ++i) {
openMint(_recipient, _dnas[i], _merkleProofs[i]);
}
}
}
function canGatedMint(address _recipient, KaijuDNA calldata _dna, bytes32[] calldata _merkleProof) external view returns (bool) {
bytes32 node = keccak256(abi.encodePacked(_recipient, _dna.nfcId, _dna.tokenUri, _dna.birthday));
return MerkleProof.verify(_merkleProof, gatedMerkleTreeMetadata.root, node) && !proofUsed[node];
}
function gatedMint(address _recipient, KaijuDNA calldata _dna, bytes32[] calldata _merkleProof)
public whenNotPaused payable {
require(msg.value >= gatedMintPricePerNFTInETH, "ETH pls");
require(_recipient != address(0) && _recipient != address(this), "Blocked");
bytes32 node = keccak256(abi.encodePacked(_recipient, _dna.nfcId, _dna.tokenUri, _dna.birthday));
require(!proofUsed[node], "Proof used");
require(MerkleProof.verify(_merkleProof, gatedMerkleTreeMetadata.root, node), "Proof invalid");
proofUsed[node] = true;
require(nft.mintTo(_recipient, _dna.nfcId, _dna.tokenUri, _dna.birthday), "Failed");
emit Purchased(_dna.nfcId, TreeType.GATED, _recipient);
}
function multiGatedMint(address _recipient, KaijuDNA[] calldata _dnas, bytes32[][] calldata _merkleProofs)
external payable {
uint256 numItemsToMint = _dnas.length;
require(numItemsToMint > 0 && msg.value == (gatedMintPricePerNFTInETH * numItemsToMint), "ETH pls");
unchecked {
for (uint256 i; i < numItemsToMint; ++i) {
gatedMint(_recipient, _dnas[i], _merkleProofs[i]);
}
}
}
function pause() onlyOwner whenNotPaused external { _pause(); }
function unpause() onlyOwner whenPaused external { _unpause(); }
function withdrawSaleProceeds(address payable _recipient, uint256 _amount) external onlyOwner {
require(_recipient != address(0), "Invalid recipient");
_recipient.transfer(_amount);
}
function updateMerkleTree(MerkleTreeMetadata calldata _metadata, TreeType _treeType) external onlyOwner whenPaused {
_updateMerkleTree(_metadata, _treeType);
}
function updatePrice(uint256 _newPrice) external onlyOwner {
pricePerNFTInETH = _newPrice;
}
function updateGatedPrice(uint256 _newPrice) external onlyOwner {
gatedMintPricePerNFTInETH = _newPrice;
}
function updateNFT(IKaijuNFT _nft) external onlyOwner {
require(address(_nft) != address(0), "Invalid nft");
nft = _nft;
}
function _updateMerkleTree(MerkleTreeMetadata calldata _metadata, TreeType _treeType) private {
require(bytes(_metadata.dataIPFSHash).length == 46, "Invalid hash");
require(_metadata.root != bytes32(0), "Invalid root");
if (_treeType == TreeType.GATED) {
gatedMerkleTreeMetadata = _metadata;
} else {
openMerkleTreeMetadata = _metadata;
}
emit MerkleTreeUpdated(_treeType);
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Pausable.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
MerkleProof.sol 52 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
Read Contract
canGatedMint 0xe537c00c → bool
canOpenMint 0xd04d8052 → bool
gatedMerkleTreeMetadata 0xf7255751 → bytes32, string
gatedMintPricePerNFTInETH 0x2f8cbb1b → uint256
nft 0x47ccca02 → address
openMerkleTreeMetadata 0xba6f7388 → bytes32, string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
pricePerNFTInETH 0x0446a91d → uint256
proofUsed 0x98b0eff6 → bool
Write Contract 13 functions
These functions modify contract state and require a wallet transaction to execute.
gatedMint 0x0e65fa06
address _recipient
tuple _dna
bytes32[] _merkleProof
multiGatedMint 0x406b5ed3
address _recipient
tuple[] _dnas
bytes32[][] _merkleProofs
multiOpenMint 0xda595258
address _recipient
tuple[] _dnas
bytes32[][] _merkleProofs
openMint 0x87457b6e
address _recipient
tuple _dna
bytes32[] _merkleProof
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
updateGatedPrice 0x228f1bb3
uint256 _newPrice
updateMerkleTree 0x426a3a63
tuple _metadata
uint8 _treeType
updateNFT 0x5be68e93
address _nft
updatePrice 0x8d6cc56d
uint256 _newPrice
withdrawSaleProceeds 0xbab60e79
address _recipient
uint256 _amount
Recent Transactions
No transactions found for this address