Overview ERC721
Total Supply:
6,000 MADSKULLZ
Holders:
605 addresses
Transfers:
-
Contract:
Official Site:
[ Download CSV Export ]
[ Download CSV Export ]
OVERVIEW
MadSkullz live in their own world. A reality where life is peaceful and where neighbors are friendly: SkullzCity. One day, this peaceful life gets interrupted when what seems to be an interdimensional portal appears in the city.Update? Click here to update the token ICO / general information
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
MadSkullz
Compiler Version
v0.8.14+commit.80d49f37
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./lib/layerZero/ONFT721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./utils/StringUtils.sol"; /// @custom:security-contact [email protected] contract MadSkullz is ONFT721, ERC721Enumerable, ERC721Royalty, AccessControl, Pausable { using Strings for uint256; using StringUtils for string; struct Skullz { uint256 id; uint256 xp; } enum ContractSteps { CLOSED, OPEN_HOLDER, OPEN_WHITELIST, OPEN_PUBLIC, SOLDOUT } event Claimed(uint256 timestamp, address claimer, uint256 amountClaimed); event Minted( uint256 timestamp, address minter, uint256 amountMinted, uint256 totalCost, uint256 remaining ); event Revealed( uint256 timestamp, address revealer, uint256 id, uint256 tokenId ); event ContractStepChanged(uint256 timestamp, ContractSteps step); event SkullzEarnedXp( uint256 timestamp, uint256 id, uint256 xp, uint256 totalXp ); bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant XP_ROLE = keccak256("XP_ROLE"); uint256 public constant MAX_SUPPLY = 6666; uint256 public constant FREEMINT_AMOUNT = 666; uint256 public constant MAX_MINTABLE_PER_TX = 10; uint256 public constant ROYALTIES_VALUE = 500; uint256 public constant INITIAL_BELIEVERZ_PRICE = 1.8 ether; uint256 public constant INITIAL_PUBLIC_PRICE = 2 ether; ContractSteps public step = ContractSteps.CLOSED; string public baseUri; mapping(address => bool) private _holders; mapping(address => bool) private _whitelist; mapping(address => uint16) private _freemints; uint16 private _totalFreemints = 0; uint16 private _totalClaimedFreemints = 0; // random token id map mapping(uint256 => uint256) private _indexer; uint256 private _indexerLength = MAX_SUPPLY; // { 0: 3159, 1: 141, ... } mapping(uint256 => uint256) private _tokenIDMap; mapping(uint256 => uint8) private _takenImages; mapping(uint256 => Skullz) madSkullz; mapping(uint256 => bool) reveals; bool autoRevealed = false; /// @notice Constructor for the MadSkullz contract /// @param baseTokenURI base URI for MadSkullz NFTs /// @param _royaltyRecipient royalty recipient address /// @param _layerZeroEndpoint handles message transmission across chains constructor( string memory baseTokenURI, address _royaltyRecipient, uint256 _creatorzAmount, address _layerZeroEndpoint ) ONFT721("MadSkullz", "MADSKULLZ", _layerZeroEndpoint) { _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); _grantRole(ADMIN_ROLE, _msgSender()); _grantRole(PAUSER_ROLE, _msgSender()); _grantRole(MINTER_ROLE, _msgSender()); _grantRole(XP_ROLE, _msgSender()); baseUri = baseTokenURI; _setDefaultRoyalty(_royaltyRecipient, uint96(ROYALTIES_VALUE)); // Honoraries mint for (uint256 i = 0; i < _creatorzAmount; i++) { _totalFreemints++; _tokenIDMap[i] = getNextImageID(i + 1); _safeMint(_msgSender(), i); } } /* ********************************** */ /* Claim */ /* ********************************** */ function claim(uint256 amount) public whenNotPaused { require(step >= ContractSteps.OPEN_HOLDER, "1001"); require(amount <= remainingFreemints(), "1002"); for (uint256 i = 0; i < amount; i++) { _freemints[_msgSender()]--; _totalClaimedFreemints++; randomMint(_msgSender(), totalSupply()); } emit Claimed(block.timestamp, _msgSender(), amount); } /* ********************************** */ /* Mint */ /* ********************************** */ // Think of it as an array of 6666 elements, where we take // a random index, and then we want to make sure we don't // pick it again. // If it hasn't been picked, the mapping points to 0, otherwise // it will point to the index which took its place function getNextImageID(uint256 index) internal returns (uint256) { uint256 nextImageID = _indexer[index]; // if it's 0, means it hasn't been picked yet if (nextImageID == 0) { nextImageID = index; } // Swap last one with the picked one. // Last one can be a previously picked one as well, thats why we check if (_indexer[_indexerLength - 1] == 0) { _indexer[index] = _indexerLength - 1; } else { _indexer[index] = _indexer[_indexerLength - 1]; } _indexerLength -= 1; return nextImageID; } function enoughRandom() internal view returns (uint256) { if (MAX_SUPPLY - totalSupply() == 0) return 0; return uint256( keccak256( abi.encodePacked( block.difficulty, block.timestamp, _msgSender(), blockhash(block.number) ) ) ) % (_indexerLength); } function randomMint(address receiver, uint256 nextTokenIndex) internal { uint256 nextIndexerId = enoughRandom(); uint256 nextImageID = getNextImageID(nextIndexerId); assert(_takenImages[nextImageID] == 0); _takenImages[nextImageID] = 1; _tokenIDMap[nextTokenIndex] = nextImageID; _safeMint(receiver, nextTokenIndex); } function holderMint(uint256 amount) external payable whenNotPaused { require(isHolder(), "1003"); require(step >= ContractSteps.OPEN_HOLDER, "1001"); _mint(amount); } function whitelistMint(uint256 amount) external payable whenNotPaused { require(isWhitelist(), "1004"); require(step >= ContractSteps.OPEN_WHITELIST, "1001"); _mint(amount); } function publicMint(uint256 amount) external payable whenNotPaused { require(step >= ContractSteps.OPEN_PUBLIC, "1001"); _mint(amount); } function _mint(uint256 amount) internal whenNotPaused { uint256 totalCost = price(amount); require(msg.value >= totalCost, "1005"); require( MAX_SUPPLY - FREEMINT_AMOUNT - totalSupply() - amount > 0, "1006" ); require(amount <= MAX_MINTABLE_PER_TX, "1007"); require(amount > 0, "1008"); for (uint256 i = 0; i < amount; i++) { randomMint(_msgSender(), totalSupply()); } emit Minted( block.timestamp, _msgSender(), amount, totalCost, MAX_SUPPLY - totalSupply() ); } // Called by the Hulkz function safeMint(uint256 amount, address to) public whenNotPaused onlyRole(MINTER_ROLE) { require( MAX_SUPPLY - FREEMINT_AMOUNT - totalSupply() - amount > 0, "1006" ); require(amount <= MAX_MINTABLE_PER_TX, "1007"); require(amount > 0, "1008"); for (uint256 i = 0; i < amount; i++) { randomMint(to, totalSupply()); } emit Minted( block.timestamp, _msgSender(), amount, 0 ether, MAX_SUPPLY - totalSupply() ); } function _safeMint(address to, uint256 tokenId) internal virtual override { super._safeMint(to, tokenId); if (totalSupply() >= MAX_SUPPLY) { step = ContractSteps.SOLDOUT; } } function withdraw() external onlyRole(ADMIN_ROLE) { require(address(this).balance > 0, "Nothing to withdraw"); payable(_msgSender()).transfer(address(this).balance); } /* ********************************** */ /* Reveal */ /* ********************************** */ function reveal(uint256 tokenId) external whenNotPaused returns (uint256) { require(_exists(tokenId), "1009"); require(ownerOf(tokenId) == _msgSender(), "1010"); require(!(reveals[tokenId]), "1011"); Skullz memory revealedSkullz = Skullz({id: tokenId, xp: 0}); madSkullz[tokenId] = revealedSkullz; reveals[tokenId] = true; emit Revealed( block.timestamp, _msgSender(), tokenId, _tokenIDMap[tokenId] ); return _tokenIDMap[tokenId]; } function autoReveal() external onlyRole(ADMIN_ROLE) { require(step >= ContractSteps.SOLDOUT, "1012"); require(!autoRevealed, "1013"); for (uint256 i = 0; i < totalSupply(); i++) { if (!isRevealed(i)) { emit Revealed(block.timestamp, _msgSender(), i, _tokenIDMap[i]); } } autoRevealed = true; } /* ********************************** */ /* Skullz */ /* ********************************** */ function getSkullz(uint256 tokenId) public view whenNotPaused returns (Skullz memory) { require(_exists(tokenId), "1014"); require(step >= ContractSteps.SOLDOUT, "1015"); return madSkullz[tokenId]; } function earnXp(uint256 tokenId, uint256 xp) public whenNotPaused onlyRole(XP_ROLE) { require(_exists(tokenId), "1016"); madSkullz[tokenId].xp += xp; emit SkullzEarnedXp( block.timestamp, tokenId, xp, madSkullz[tokenId].xp + xp ); } function resetXp(uint256 tokenId) public whenNotPaused onlyRole(XP_ROLE) { require(_exists(tokenId), "1017"); madSkullz[tokenId].xp = 0; } /* ********************************** */ /* Getters */ /* ********************************** */ /// @notice Returns the Uniform Resource Identifier (URI) for a token Id /// @param tokenId: token Id /// @return string: Metadata URI function tokenURI(uint256 tokenId) public view virtual override(ERC721) returns (string memory) { require(_exists(tokenId), "1018"); string memory _baseUri = baseUri; if (bytes(_baseUri).length > 0) { if (isRevealed(tokenId)) { uint256 imageID = _tokenIDMap[tokenId]; return string( abi.encodePacked( _baseUri, imageID.toString().padStart(4, "0"), ".json" ) ); } return string(abi.encodePacked(_baseUri, "madSkullzKey.json")); } return ""; } function isRevealed(uint256 tokenId) public view returns (bool) { return reveals[tokenId] || autoRevealed; } function isHolder() public view returns (bool) { return _holders[_msgSender()]; } function isWhitelist() public view returns (bool) { return _whitelist[_msgSender()]; } function remainingFreemints() public view returns (uint256) { return _freemints[_msgSender()]; } /// @notice Calculates how many mints are left, without counting the freemints /// @return uint256: the return variables of a contract’s function state variable function remainingPaidMints() public view returns (uint256) { return MAX_SUPPLY - totalSupply() - (FREEMINT_AMOUNT - _totalClaimedFreemints); } /* ********************************** */ /* Setters */ /* ********************************** */ function setBaseURI(string memory _baseUri) external onlyRole(ADMIN_ROLE) { baseUri = _baseUri; } function setRoyaltyRecipient(address _royaltyRecipient) external onlyRole(ADMIN_ROLE) { _setDefaultRoyalty(_royaltyRecipient, uint96(ROYALTIES_VALUE)); } function setContractStep(uint8 _step) external onlyRole(ADMIN_ROLE) { step = ContractSteps(_step); emit ContractStepChanged(block.timestamp, step); } function addHolders(address[] calldata holders) external onlyRole(ADMIN_ROLE) { for (uint256 i = 0; i < holders.length; i++) { _holders[holders[i]] = true; } } function removeHolders(address[] calldata holders) external onlyRole(ADMIN_ROLE) { for (uint256 i = 0; i < holders.length; i++) { _holders[holders[i]] = false; } } function addWhitelist(address[] calldata whitelist) external onlyRole(ADMIN_ROLE) { for (uint256 i = 0; i < whitelist.length; i++) { _whitelist[whitelist[i]] = true; } } function removeWhitelist(address[] calldata whitelist) external onlyRole(ADMIN_ROLE) { for (uint256 i = 0; i < whitelist.length; i++) { _whitelist[whitelist[i]] = false; } } function setFreemints( address[] calldata beneficiaries, uint16[] calldata amounts ) external onlyRole(ADMIN_ROLE) { require(beneficiaries.length == amounts.length, "1019"); for (uint16 i = 0; i < beneficiaries.length; i++) { require(_totalFreemints + amounts[i] <= FREEMINT_AMOUNT, "1020"); _freemints[beneficiaries[i]] = amounts[i]; _totalFreemints += amounts[i]; } } function removeFreemints(address beneficiary) external onlyRole(ADMIN_ROLE) { _totalFreemints -= _freemints[beneficiary]; _freemints[beneficiary] = 0; } /* ********************************** */ /* Helpers */ /* ********************************** */ function price(uint256 amount) internal view returns (uint256) { uint256 startingPrice = 2 ether; if (isHolder()) { startingPrice = 1.8 ether; } return startingPrice * amount - (0.1 ether * ((amount * amount - amount) / 2)); } /* ********************************** */ /* Pauser */ /* ********************************** */ function pause() public onlyRole(PAUSER_ROLE) { _pause(); } function unpause() public onlyRole(PAUSER_ROLE) { _unpause(); } /* ********************************** */ /* Mandatory */ /* ********************************** */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) whenNotPaused { super._beforeTokenTransfer(from, to, tokenId); } function _burn(uint256 tokenId) internal override(ERC721, ERC721Royalty) { super._burn(tokenId); } // @inheritdoc ERC165 function supportsInterface(bytes4 interfaceId) public view override(ONFT721, ERC721Enumerable, ERC721Royalty, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library StringUtils { /** * @dev Pads on the left of a `string` as many `value` character as `amount` quantity. */ function padStart( string memory baseString, uint256 amount, string memory value ) internal pure returns (string memory) { for (uint256 i = bytes(baseString).length; i < amount; i++) { baseString = string(abi.encodePacked(value, baseString)); } return baseString; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./LzApp.sol"; /* * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress) */ abstract contract NonblockingLzApp is LzApp { constructor(address _endpoint) LzApp(_endpoint) {} mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages; event MessageFailed( uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload ); // overriding the virtual function in LzReceiver function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual override { // try-catch all errors/exceptions try this.nonblockingLzReceive( _srcChainId, _srcAddress, _nonce, _payload ) { // do nothing } catch { // error / exception failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256( _payload ); emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload); } } function nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) public virtual { // only internal transaction require( _msgSender() == address(this), "NonblockingLzApp: caller must be LzApp" ); _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } //@notice override this function function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual; function retryMessage( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) public payable virtual { // assert there is message to retry bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce]; require( payloadHash != bytes32(0), "NonblockingLzApp: no stored message" ); require( keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload" ); // clear the stored message failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0); // execute the message. revert if it fails again _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/ILayerZeroReceiver.sol"; import "../interfaces/ILayerZeroUserApplicationConfig.sol"; import "../interfaces/ILayerZeroEndpoint.sol"; /* * a generic LzReceiver implementation */ abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig { ILayerZeroEndpoint public immutable lzEndpoint; mapping(uint16 => bytes) public trustedRemoteLookup; event SetTrustedRemote(uint16 _srcChainId, bytes _srcAddress); constructor(address _endpoint) { lzEndpoint = ILayerZeroEndpoint(_endpoint); } function lzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) public virtual override { // lzReceive must be called by the endpoint for security require( _msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller" ); bytes memory trustedRemote = trustedRemoteLookup[_srcChainId]; // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote. require( _srcAddress.length == trustedRemote.length && keccak256(_srcAddress) == keccak256(trustedRemote), "LzApp: invalid source sending contract" ); _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual; function _lzSend( uint16 _dstChainId, bytes memory _payload, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) internal virtual { bytes memory trustedRemote = trustedRemoteLookup[_dstChainId]; require( trustedRemote.length != 0, "LzApp: destination chain is not a trusted source" ); lzEndpoint.send{value: msg.value}( _dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams ); } //---------------------------UserApplication config---------------------------------------- function getConfig( uint16 _version, uint16 _chainId, address, uint256 _configType ) external view returns (bytes memory) { return lzEndpoint.getConfig( _version, _chainId, address(this), _configType ); } // generic config for LayerZero user Application function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external override onlyOwner { lzEndpoint.setConfig(_version, _chainId, _configType, _config); } function setSendVersion(uint16 _version) external override onlyOwner { lzEndpoint.setSendVersion(_version); } function setReceiveVersion(uint16 _version) external override onlyOwner { lzEndpoint.setReceiveVersion(_version); } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner { lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress); } // allow owner to set it multiple times. function setTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external onlyOwner { trustedRemoteLookup[_srcChainId] = _srcAddress; emit SetTrustedRemote(_srcChainId, _srcAddress); } //--------------------------- VIEW FUNCTION ---------------------------------------- function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) { bytes memory trustedSource = trustedRemoteLookup[_srcChainId]; return keccak256(trustedSource) == keccak256(_srcAddress); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ILayerZeroUserApplicationConfig { // @notice set the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _configType - type of configuration. every messaging library has its own convention. // @param _config - configuration in the bytes. can encode arbitrary content. function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external; // @notice set the send() LayerZero messaging library version to _version // @param _version - new messaging library version function setSendVersion(uint16 _version) external; // @notice set the lzReceive() LayerZero messaging library version to _version // @param _version - new messaging library version function setReceiveVersion(uint16 _version) external; // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload // @param _srcChainId - the chainId of the source chain // @param _srcAddress - the contract address of the source contract at the source chain function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ILayerZeroReceiver { // @notice LayerZero endpoint will invoke this function to deliver the message on the destination // @param _srcChainId - the source endpoint identifier // @param _srcAddress - the source sending contract address from the source chain // @param _nonce - the ordered message nonce // @param _payload - the signed payload is the UA bytes has encoded to be sent function lzReceive( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "./ILayerZeroUserApplicationConfig.sol"; interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig { // @notice send a LayerZero message to the specified address at a LayerZero endpoint. // @param _dstChainId - the destination chain identifier // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains // @param _payload - a custom bytes payload to send to the destination contract // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination function send( uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams ) external payable; // @notice used by the messaging library to publish verified payload // @param _srcChainId - the source chain identifier // @param _srcAddress - the source contract (as bytes) at the source chain // @param _dstAddress - the address on destination chain // @param _nonce - the unbound message ordering nonce // @param _gasLimit - the gas limit for external contract execution // @param _payload - verified payload to send to the destination contract function receivePayload( uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint256 _gasLimit, bytes calldata _payload ) external; // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64); // @notice get the outboundNonce from this source chain which, consequently, is always an EVM // @param _srcAddress - the source chain contract address function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64); // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery // @param _dstChainId - the destination chain identifier // @param _userApplication - the user app address on this EVM chain // @param _payload - the custom message to send over LayerZero // @param _payInZRO - if false, user app pays the protocol fee in native token // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain function estimateFees( uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam ) external view returns (uint256 nativeFee, uint256 zroFee); // @notice get this Endpoint's immutable source identifier function getChainId() external view returns (uint16); // @notice the interface to retry failed message on this Endpoint destination // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address // @param _payload - the payload to be retried function retryPayload( uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload ) external; // @notice query if any STORED payload (message blocking) at the endpoint. // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool); // @notice query if the _libraryAddress is valid for sending msgs. // @param _userApplication - the user app address on this EVM chain function getSendLibraryAddress(address _userApplication) external view returns (address); // @notice query if the _libraryAddress is valid for receiving msgs. // @param _userApplication - the user app address on this EVM chain function getReceiveLibraryAddress(address _userApplication) external view returns (address); // @notice query if the non-reentrancy guard for send() is on // @return true if the guard is on. false otherwise function isSendingPayload() external view returns (bool); // @notice query if the non-reentrancy guard for receive() is on // @return true if the guard is on. false otherwise function isReceivingPayload() external view returns (bool); // @notice get the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _userApplication - the contract address of the user application // @param _configType - type of configuration. every messaging library has its own convention. function getConfig( uint16 _version, uint16 _chainId, address _userApplication, uint256 _configType ) external view returns (bytes memory); // @notice get the send() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getSendVersion(address _userApplication) external view returns (uint16); // @notice get the lzReceive() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getReceiveVersion(address _userApplication) external view returns (uint16); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IONFT721Core.sol"; import "./lzApp/NonblockingLzApp.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; abstract contract ONFT721Core is NonblockingLzApp, ERC165, IONFT721Core { constructor(address _lzEndpoint) NonblockingLzApp(_lzEndpoint) {} function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IONFT721Core).interfaceId || super.supportsInterface(interfaceId); } function estimateSendFee( uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, bool _useZro, bytes memory _adapterParams ) public view virtual override returns (uint256 nativeFee, uint256 zroFee) { // mock the payload for send() bytes memory payload = abi.encode(_toAddress, _tokenId); return lzEndpoint.estimateFees( _dstChainId, address(this), payload, _useZro, _adapterParams ); } function sendFrom( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) public payable virtual override { _send( _from, _dstChainId, _toAddress, _tokenId, _refundAddress, _zroPaymentAddress, _adapterParams ); } function _send( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) internal virtual { _debitFrom(_from, _dstChainId, _toAddress, _tokenId); bytes memory payload = abi.encode(_toAddress, _tokenId); _lzSend( _dstChainId, payload, _refundAddress, _zroPaymentAddress, _adapterParams ); uint64 nonce = lzEndpoint.getOutboundNonce(_dstChainId, address(this)); emit SendToChain(_from, _dstChainId, _toAddress, _tokenId, nonce); } function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual override { // decode and load the toAddress (bytes memory toAddressBytes, uint256 tokenId) = abi.decode( _payload, (bytes, uint256) ); address toAddress; assembly { toAddress := mload(add(toAddressBytes, 20)) } _creditTo(_srcChainId, toAddress, tokenId); emit ReceiveFromChain( _srcChainId, _srcAddress, toAddress, tokenId, _nonce ); } function _debitFrom( address _from, uint16 _dstChainId, bytes memory _toAddress, uint256 _tokenId ) internal virtual; function _creditTo( uint16 _srcChainId, address _toAddress, uint256 _tokenId ) internal virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IONFT721.sol"; import "./ONFT721Core.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; // NOTE: this ONFT contract has no public minting logic. // must implement your own minting logic in child classes contract ONFT721 is ONFT721Core, ERC721, IONFT721 { constructor( string memory _name, string memory _symbol, address _lzEndpoint ) ERC721(_name, _symbol) ONFT721Core(_lzEndpoint) {} function supportsInterface(bytes4 interfaceId) public view virtual override(ONFT721Core, ERC721, IERC165) returns (bool) { return interfaceId == type(IONFT721).interfaceId || super.supportsInterface(interfaceId); } function _debitFrom( address _from, uint16, bytes memory, uint256 _tokenId ) internal virtual override { require( _isApprovedOrOwner(_msgSender(), _tokenId), "ONFT721: send caller is not owner nor approved" ); require( ERC721.ownerOf(_tokenId) == _from, "ONFT721: send from incorrect owner" ); _burn(_tokenId); } function _creditTo( uint16, address _toAddress, uint256 _tokenId ) internal virtual override { _safeMint(_toAddress, _tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Interface of the ONFT Core standard */ interface IONFT721Core is IERC165 { /** * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`) * _dstChainId - L0 defined chain id to send tokens too * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain * _tokenId - token Id to transfer * _useZro - indicates to use zro to pay L0 fees * _adapterParams - flexible bytes array to indicate messaging adapter services in L0 */ function estimateSendFee( uint16 _dstChainId, bytes calldata _toAddress, uint256 _tokenId, bool _useZro, bytes calldata _adapterParams ) external view returns (uint256 nativeFee, uint256 zroFee); /** * @dev send token `_tokenId` to (`_dstChainId`, `_toAddress`) from `_from` * `_toAddress` can be any size depending on the `dstChainId`. * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token) * `_adapterParams` is a flexible bytes array to indicate messaging adapter services */ function sendFrom( address _from, uint16 _dstChainId, bytes calldata _toAddress, uint256 _tokenId, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams ) external payable; /** * @dev Emitted when `_tokenId` are moved from the `_sender` to (`_dstChainId`, `_toAddress`) * `_nonce` is the outbound nonce from */ event SendToChain( address indexed _sender, uint16 indexed _dstChainId, bytes indexed _toAddress, uint256 _tokenId, uint64 _nonce ); /** * @dev Emitted when `_tokenId` are sent from `_srcChainId` to the `_toAddress` at this chain. `_nonce` is the inbound nonce. */ event ReceiveFromChain( uint16 indexed _srcChainId, bytes indexed _srcAddress, address indexed _toAddress, uint256 _tokenId, uint64 _nonce ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IONFT721Core.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; /** * @dev Interface of the ONFT standard */ interface IONFT721 is IONFT721Core, IERC721 { }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `tokenId` must be already minted. * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/ERC721Royalty.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../common/ERC2981.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev Extension of ERC721 with the ERC2981 NFT Royalty Standard, a standardized way to retrieve royalty payment * information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC721Royalty is ERC2981, ERC721 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev See {ERC721-_burn}. This override additionally clears the royalty information for the token. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); _resetTokenRoyalty(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// 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()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"baseTokenURI","type":"string"},{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint256","name":"_creatorzAmount","type":"uint256"},{"internalType":"address","name":"_layerZeroEndpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"address","name":"claimer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountClaimed","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"enum MadSkullz.ContractSteps","name":"step","type":"uint8"}],"name":"ContractStepChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountMinted","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalCost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remaining","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"_toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"}],"name":"ReceiveFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"address","name":"revealer","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Revealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"}],"name":"SendToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"xp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalXp","type":"uint256"}],"name":"SkullzEarnedXp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FREEMINT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INITIAL_BELIEVERZ_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INITIAL_PUBLIC_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINTABLE_PER_TX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROYALTIES_VALUE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"XP_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"holders","type":"address[]"}],"name":"addHolders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"whitelist","type":"address[]"}],"name":"addWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"xp","type":"uint256"}],"name":"earnXp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSkullz","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"xp","type":"uint256"}],"internalType":"struct MadSkullz.Skullz","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"holderMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isHolder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isRevealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"remainingFreemints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingPaidMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"removeFreemints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"holders","type":"address[]"}],"name":"removeHolders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"whitelist","type":"address[]"}],"name":"removeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetXp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"reveal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseUri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_step","type":"uint8"}],"name":"setContractStep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"beneficiaries","type":"address[]"},{"internalType":"uint16[]","name":"amounts","type":"uint16[]"}],"name":"setFreemints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyRecipient","type":"address"}],"name":"setRoyaltyRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"step","outputs":[{"internalType":"enum MadSkullz.ContractSteps","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040526010805461ff00191690556015805463ffffffff19169055611a0a601755601c805460ff191690553480156200003957600080fd5b5060405162006ef838038062006ef88339810160408190526200005c9162000d60565b6040518060400160405280600981526020016826b0b229b5bab6363d60b91b8152506040518060400160405280600981526020016826a0a229a5aaa6262d60b91b815250828282828080620000c0620000ba6200027e60201b60201c565b62000282565b6001600160a01b031660805250508151620000e390600590602085019062000c54565b508051620000f990600690602084019062000c54565b50506010805460ff191690555062000119925060009150339050620002d2565b620001457fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533620002d2565b620001717f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33620002d2565b6200019d7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633620002d2565b620001c97f2fdac51cdf0426bc6ad4182f323789f562ee3018082dc81e74fcd7ec0650c22933620002d2565b8351620001de90601190602087019062000c54565b50620001ed836101f462000377565b60005b8281101562000273576015805461ffff169060006200020f8362000e5f565b91906101000a81548161ffff021916908361ffff16021790555050620002438160016200023d919062000e83565b6200047c565b6000828152601860205260409020556200025e33826200053f565b806200026a8162000e9e565b915050620001f0565b505050505062000fc5565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000828152600f602090815260408083206001600160a01b038516845290915290205460ff1662000373576000828152600f602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620003323390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6127106001600160601b0382161115620003eb5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620004435760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620003e2565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b600081815260166020526040812054808203620004965750815b601660006001601754620004ab919062000eba565b815260200190815260200160002054600003620004e8576001601754620004d3919062000eba565b6000848152601660205260409020556200051e565b601660006001601754620004fd919062000eba565b81526020808201929092526040908101600090812054868252601690935220555b60016017600082825462000533919062000eba565b90915550909392505050565b6200055682826200057c60201b620032ad1760201c565b611a0a62000563600d5490565b10620003735750506010805461ff001916610400179055565b620003738282604051806020016040528060008152506200059e60201b60201c565b620005aa838362000616565b620005b960008484846200076c565b620006115760405162461bcd60e51b8152602060048201526032602482015260008051602062006ed883398151915260448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401620003e2565b505050565b6001600160a01b0382166200066e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401620003e2565b6000818152600760205260409020546001600160a01b031615620006d55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401620003e2565b620006e360008383620008c8565b6001600160a01b03821660009081526008602052604081208054600192906200070e90849062000e83565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006200078d846001600160a01b03166200092860201b620032c71760201c565b15620008bc57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290620007c790339089908890889060040162000ed4565b6020604051808303816000875af192505050801562000805575060408051601f3d908101601f19168201909252620008029181019062000f2a565b60015b620008a1573d80801562000836576040519150601f19603f3d011682016040523d82523d6000602084013e6200083b565b606091505b508051600003620008995760405162461bcd60e51b8152602060048201526032602482015260008051602062006ed883398151915260448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401620003e2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050620008c0565b5060015b949350505050565b60105460ff1615620009105760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401620003e2565b620006118383836200093760201b620032d61760201c565b6001600160a01b03163b151590565b6200094f8383836200061160201b620013821760201c565b6001600160a01b038316620009ad57620009a781600d80546000838152600e60205260408120829055600182018355919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155565b620009d3565b816001600160a01b0316836001600160a01b031614620009d357620009d3838262000a13565b6001600160a01b038216620009ed57620006118162000ac0565b826001600160a01b0316826001600160a01b031614620006115762000611828262000b7a565b6000600162000a2d8462000bcb60201b6200238e1760201c565b62000a39919062000eba565b6000838152600c602052604090205490915080821462000a8d576001600160a01b0384166000908152600b602090815260408083208584528252808320548484528184208190558352600c90915290208190555b506000918252600c602090815260408084208490556001600160a01b039094168352600b81528383209183525290812055565b600d5460009062000ad49060019062000eba565b6000838152600e6020526040812054600d805493945090928490811062000aff5762000aff62000f5d565b9060005260206000200154905080600d838154811062000b235762000b2362000f5d565b6000918252602080832090910192909255828152600e9091526040808220849055858252812055600d80548062000b5e5762000b5e62000f73565b6001900381819060005260206000200160009055905550505050565b600062000b928362000bcb60201b6200238e1760201c565b6001600160a01b039093166000908152600b602090815260408083208684528252808320859055938252600c9052919091209190915550565b60006001600160a01b03821662000c385760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401620003e2565b506001600160a01b031660009081526008602052604090205490565b82805462000c629062000f89565b90600052602060002090601f01602090048101928262000c86576000855562000cd1565b82601f1062000ca157805160ff191683800117855562000cd1565b8280016001018555821562000cd1579182015b8281111562000cd157825182559160200191906001019062000cb4565b5062000cdf92915062000ce3565b5090565b5b8082111562000cdf576000815560010162000ce4565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000d2d57818101518382015260200162000d13565b8381111562000d3d576000848401525b50505050565b80516001600160a01b038116811462000d5b57600080fd5b919050565b6000806000806080858703121562000d7757600080fd5b84516001600160401b038082111562000d8f57600080fd5b818701915087601f83011262000da457600080fd5b81518181111562000db95762000db962000cfa565b604051601f8201601f19908116603f0116810190838211818310171562000de45762000de462000cfa565b816040528281528a602084870101111562000dfe57600080fd5b62000e1183602083016020880162000d10565b809850505050505062000e276020860162000d43565b92506040850151915062000e3e6060860162000d43565b905092959194509250565b634e487b7160e01b600052601160045260246000fd5b600061ffff80831681810362000e795762000e7962000e49565b6001019392505050565b6000821982111562000e995762000e9962000e49565b500190565b60006001820162000eb35762000eb362000e49565b5060010190565b60008282101562000ecf5762000ecf62000e49565b500390565b600060018060a01b03808716835280861660208401525083604083015260806060830152825180608084015262000f138160a085016020870162000d10565b601f01601f19169190910160a00195945050505050565b60006020828403121562000f3d57600080fd5b81516001600160e01b03198116811462000f5657600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600181811c9082168062000f9e57607f821691505b60208210810362000fbf57634e487b7160e01b600052602260045260246000fd5b50919050565b608051615eb86200102060003960008181610bdb01528181610eff01528181611189015281816114040152818161156501528181611d4c01528181612bd0015281816131c401528181613ce401526147950152615eb86000f3fe60806040526004361061047d5760003560e01c80636352211e11610255578063c2ca0ac511610144578063e35a860c116100c1578063edac985b11610085578063edac985b14610e53578063f2fde38b14610e73578063f3d4216514610e93578063f5ecbdbc14610eb3578063ff89168a14610ed3578063ffa04ace14610ee657600080fd5b8063e35a860c14610d84578063e3e9ca3114610d9a578063e63ab1e914610db6578063e985e9c514610dea578063eb8d72b714610e3357600080fd5b8063d1deba1f11610108578063d1deba1f14610cbd578063d4af9ff014610cd0578063d539139314610d04578063d547741f14610d38578063e25fe17514610d5857600080fd5b8063c2ca0ac514610c1d578063c87b56dd14610c3d578063cbed8b9c14610c5d578063cf01c91914610c7d578063d161ee6a14610c9d57600080fd5b80638da5cb5b116101d2578063a217fddf11610196578063a217fddf14610b74578063a22cb46514610b89578063a89f99fe14610ba9578063b353aaa714610bc9578063b88d4fde14610bfd57600080fd5b80638da5cb5b14610ae657806391d1485414610b0457806394078e2014610b2457806395d89b4114610b4a5780639abc832014610b5f57600080fd5b806375b238fc1161021957806375b238fc14610a605780637d8d06be14610a8257806383801f5614610aa25780638456cb5914610abe578063868ff4a214610ad357600080fd5b80636352211e146109cb57806366ad5c8a146109eb57806370a0823114610a0b578063715018a614610a2b5780637533d78814610a4057600080fd5b8063353c83a41161037157806342d65a8d116102ee5780635b77557a116102b25780635b77557a146108f45780635b8c41e61461092f5780635c975abb1461097e57806361b6ef801461099657806362bdfceb146109ab57600080fd5b806342d65a8d146108615780634f6ccce7146108815780635055fbc3146108a157806351905636146108c157806355f804b3146108d457600080fd5b80633d8b38f6116103355780633d8b38f6146107d75780633f4ba83a146107f75780634146ed0a1461080c57806341e42f301461082157806342842e0e1461084157600080fd5b8063353c83a41461074257806336568abe14610762578063379607f51461078257806339d1a129146107a25780633ccfd60b146107c257600080fd5b806323245216116103ff5780632db11544116103c35780632db11544146106c45780632f2ff15d146106d75780632f745c59146106f7578063306e8f0c1461071757806332cb6b0c1461072c57600080fd5b806323245216146105e057806323b872dd14610600578063248a9ca3146106205780632a205e3d146106505780632a55205a1461068557600080fd5b8063095ea7b311610446578063095ea7b3146105535780630da24df91461057357806310ddb1371461059657806312494160146105b657806318160ddd146105cb57600080fd5b80621d35671461048257806301ffc9a7146104a457806306fdde03146104d957806307e0db17146104fb578063081812fc1461051b575b600080fd5b34801561048e57600080fd5b506104a261049d366004614f92565b610efc565b005b3480156104b057600080fd5b506104c46104bf366004615030565b6110a3565b60405190151581526020015b60405180910390f35b3480156104e557600080fd5b506104ee6110b4565b6040516104d091906150a5565b34801561050757600080fd5b506104a26105163660046150b8565b611146565b34801561052757600080fd5b5061053b6105363660046150d3565b6111ea565b6040516001600160a01b0390911681526020016104d0565b34801561055f57600080fd5b506104a261056e366004615101565b611272565b34801561057f57600080fd5b50610588611387565b6040519081526020016104d0565b3480156105a257600080fd5b506104a26105b13660046150b8565b6113c1565b3480156105c257600080fd5b506104c461143b565b3480156105d757600080fd5b50600d54610588565b3480156105ec57600080fd5b506104a26105fb366004615171565b611464565b34801561060c57600080fd5b506104a261061b3660046151b2565b6114f4565b34801561062c57600080fd5b5061058861063b3660046150d3565b6000908152600f602052604090206001015490565b34801561065c57600080fd5b5061067061066b366004615203565b611526565b604080519283526020830191909152016104d0565b34801561069157600080fd5b506106a56106a0366004615291565b6115f1565b604080516001600160a01b0390931683526020830191909152016104d0565b6104a26106d23660046150d3565b61169f565b3480156106e357600080fd5b506104a26106f23660046152b3565b611724565b34801561070357600080fd5b50610588610712366004615101565b611749565b34801561072357600080fd5b50610588600a81565b34801561073857600080fd5b50610588611a0a81565b34801561074e57600080fd5b506104a261075d3660046150d3565b6117df565b34801561076e57600080fd5b506104a261077d3660046152b3565b61187f565b34801561078e57600080fd5b506104a261079d3660046150d3565b6118fd565b3480156107ae57600080fd5b506104a26107bd3660046152e3565b611aad565b3480156107ce57600080fd5b506104a2611b38565b3480156107e357600080fd5b506104c46107f2366004615341565b611bc2565b34801561080357600080fd5b506104a2611c8f565b34801561081857600080fd5b506104c4611cc1565b34801561082d57600080fd5b506104a261083c3660046152e3565b611ccc565b34801561084d57600080fd5b506104a261085c3660046151b2565b611cf0565b34801561086d57600080fd5b506104a261087c366004615341565b611d0b565b34801561088d57600080fd5b5061058861089c3660046150d3565b611dbc565b3480156108ad57600080fd5b506104c46108bc3660046150d3565b611e4f565b6104a26108cf366004615393565b611e73565b3480156108e057600080fd5b506104a26108ef36600461544c565b611e82565b34801561090057600080fd5b5061091461090f3660046150d3565b611ead565b604080518251815260209283015192810192909252016104d0565b34801561093b57600080fd5b5061058861094a366004615494565b6002602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561098a57600080fd5b5060105460ff166104c4565b3480156109a257600080fd5b506104a2611fa4565b3480156109b757600080fd5b506104a26109c63660046152b3565b6120ea565b3480156109d757600080fd5b5061053b6109e63660046150d3565b6122ad565b3480156109f757600080fd5b506104a2610a06366004614f92565b612324565b348015610a1757600080fd5b50610588610a263660046152e3565b61238e565b348015610a3757600080fd5b506104a2612415565b348015610a4c57600080fd5b506104ee610a5b3660046150b8565b61244b565b348015610a6c57600080fd5b50610588600080516020615e6383398151915281565b348015610a8e57600080fd5b506104a2610a9d3660046154f5565b6124e5565b348015610aae57600080fd5b506105886718fae27693b4000081565b348015610aca57600080fd5b506104a26126b6565b6104a2610ae13660046150d3565b6126e8565b348015610af257600080fd5b506000546001600160a01b031661053b565b348015610b1057600080fd5b506104c4610b1f3660046152b3565b61274f565b348015610b3057600080fd5b503360009081526014602052604090205461ffff16610588565b348015610b5657600080fd5b506104ee61277a565b348015610b6b57600080fd5b506104ee612789565b348015610b8057600080fd5b50610588600081565b348015610b9557600080fd5b506104a2610ba4366004615560565b612796565b348015610bb557600080fd5b506104a2610bc4366004615171565b6127a1565b348015610bd557600080fd5b5061053b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610c0957600080fd5b506104a2610c18366004615595565b61282b565b348015610c2957600080fd5b50610588610c383660046150d3565b61285d565b348015610c4957600080fd5b506104ee610c583660046150d3565b6129f9565b348015610c6957600080fd5b506104a2610c783660046155f4565b612b8f565b348015610c8957600080fd5b506104a2610c98366004615291565b612c46565b348015610ca957600080fd5b506104a2610cb8366004615171565b612d5c565b6104a2610ccb366004614f92565b612de6565b348015610cdc57600080fd5b506105887f2fdac51cdf0426bc6ad4182f323789f562ee3018082dc81e74fcd7ec0650c22981565b348015610d1057600080fd5b506105887f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b348015610d4457600080fd5b506104a2610d533660046152b3565b612f38565b348015610d6457600080fd5b50601054610d7790610100900460ff1681565b6040516104d0919061569a565b348015610d9057600080fd5b506105886101f481565b348015610da657600080fd5b50610588671bc16d674ec8000081565b348015610dc257600080fd5b506105887f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610df657600080fd5b506104c4610e053660046156a8565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205460ff1690565b348015610e3f57600080fd5b506104a2610e4e366004615341565b612f5d565b348015610e5f57600080fd5b506104a2610e6e366004615171565b612fd9565b348015610e7f57600080fd5b506104a2610e8e3660046152e3565b613063565b348015610e9f57600080fd5b506104a2610eae3660046156d6565b6130fb565b348015610ebf57600080fd5b506104ee610ece3660046156f9565b613193565b6104a2610ee13660046150d3565b613246565b348015610ef257600080fd5b5061058861029a81565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614610f795760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff841660009081526001602052604081208054610f9790615746565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc390615746565b80156110105780601f10610fe557610100808354040283529160200191611010565b820191906000526020600020905b815481529060010190602001808311610ff357829003601f168201915b5050505050905080518451148015611035575080805190602001208480519060200120145b6110905760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608401610f70565b61109c8585858561338e565b5050505050565b60006110ae8261347f565b92915050565b6060600580546110c390615746565b80601f01602080910402602001604051908101604052809291908181526020018280546110ef90615746565b801561113c5780601f106111115761010080835404028352916020019161113c565b820191906000526020600020905b81548152906001019060200180831161111f57829003601f168201915b5050505050905090565b6000546001600160a01b031633146111705760405162461bcd60e51b8152600401610f7090615780565b6040516307e0db1760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906307e0db17906024015b600060405180830381600087803b1580156111d657600080fd5b505af115801561109c573d6000803e3d6000fd5b60006111f5826134a4565b6112565760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610f70565b506000908152600960205260409020546001600160a01b031690565b600061127d826122ad565b9050806001600160a01b0316836001600160a01b0316036112ea5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610f70565b336001600160a01b038216148061130657506113068133610e05565b6113785760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610f70565b61138283836134c1565b505050565b6015546000906113a39062010000900461ffff1661029a6157cb565b600d546113b290611a0a6157cb565b6113bc91906157cb565b905090565b6000546001600160a01b031633146113eb5760405162461bcd60e51b8152600401610f7090615780565b6040516310ddb13760e01b815261ffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906310ddb137906024016111bc565b6000601281335b6001600160a01b0316815260208101919091526040016000205460ff16919050565b600080516020615e6383398151915261147c8161352f565b60005b828110156114ee5760006013600086868581811061149f5761149f6157e2565b90506020020160208101906114b491906152e3565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806114e6816157f8565b91505061147f565b50505050565b6114ff335b82613539565b61151b5760405162461bcd60e51b8152600401610f7090615811565b611382838383613622565b6000806000868660405160200161153e929190615862565b60408051601f198184030181529082905263040a7bb160e41b825291506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340a7bb10906115a2908b90309086908b908b90600401615884565b6040805180830381865afa1580156115be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115e291906158d8565b92509250509550959350505050565b60008281526004602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916116665750604080518082019091526003546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090611685906001600160601b0316876158fc565b61168f9190615931565b91519350909150505b9250929050565b60105460ff16156116c25760405162461bcd60e51b8152600401610f7090615945565b60035b601054610100900460ff1660048111156116e1576116e1615662565b10156117185760405162461bcd60e51b8152600401610f70906020808252600490820152633130303160e01b604082015260600190565b611721816137c9565b50565b6000828152600f602052604090206001015461173f8161352f565b611382838361399a565b60006117548361238e565b82106117b65760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610f70565b506001600160a01b03919091166000908152600b60209081526040808320938352929052205490565b60105460ff16156118025760405162461bcd60e51b8152600401610f7090615945565b7f2fdac51cdf0426bc6ad4182f323789f562ee3018082dc81e74fcd7ec0650c22961182c8161352f565b611835826134a4565b61186a5760405162461bcd60e51b8152600401610f70906020808252600490820152633130313760e01b604082015260600190565b506000908152601a6020526040812060010155565b6001600160a01b03811633146118ef5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610f70565b6118f98282613a20565b5050565b60105460ff16156119205760405162461bcd60e51b8152600401610f7090615945565b6001601054610100900460ff16600481111561193e5761193e615662565b10156119755760405162461bcd60e51b8152600401610f70906020808252600490820152633130303160e01b604082015260600190565b3360009081526014602052604090205461ffff168111156119c15760405162461bcd60e51b8152600401610f70906020808252600490820152631898181960e11b604082015260600190565b60005b81811015611a6a57336000908152601460205260408120805461ffff16916119eb8361596f565b91906101000a81548161ffff021916908361ffff160217905550506015600281819054906101000a900461ffff1680929190611a269061598d565b91906101000a81548161ffff021916908361ffff16021790555050611a58611a4b3390565b600d54613a87565b613a87565b80611a62816157f8565b9150506119c4565b506040805142815233602082015280820183905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a150565b600080516020615e63833981519152611ac58161352f565b6001600160a01b0382166000908152601460205260408120546015805461ffff928316939192611af7918591166159ae565b825461ffff9182166101009390930a928302919092021990911617905550506001600160a01b03166000908152601460205260409020805461ffff19169055565b600080516020615e63833981519152611b508161352f565b60004711611b965760405162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20776974686472617760681b6044820152606401610f70565b60405133904780156108fc02916000818181858888f193505050501580156118f9573d6000803e3d6000fd5b61ffff831660009081526001602052604081208054829190611be390615746565b80601f0160208091040260200160405190810160405280929190818152602001828054611c0f90615746565b8015611c5c5780601f10611c3157610100808354040283529160200191611c5c565b820191906000526020600020905b815481529060010190602001808311611c3f57829003601f168201915b505050505090508383604051611c739291906159d1565b60405180910390208180519060200120149150505b9392505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611cb98161352f565b611721613af3565b600060138133611442565b600080516020615e63833981519152611ce48161352f565b6118f9826101f4613b86565b6113828383836040518060200160405280600081525061282b565b6000546001600160a01b03163314611d355760405162461bcd60e51b8152600401610f7090615780565b6040516342d65a8d60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342d65a8d90611d8590869086908690600401615a0a565b600060405180830381600087803b158015611d9f57600080fd5b505af1158015611db3573d6000803e3d6000fd5b50505050505050565b6000611dc7600d5490565b8210611e2a5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610f70565b600d8281548110611e3d57611e3d6157e2565b90600052602060002001549050919050565b6000818152601b602052604081205460ff16806110ae5750601c5460ff1692915050565b611db387878787878787613c83565b600080516020615e63833981519152611e9a8161352f565b8151611382906011906020850190614d93565b604080518082019091526000808252602082015260105460ff1615611ee45760405162461bcd60e51b8152600401610f7090615945565b611eed826134a4565b611f225760405162461bcd60e51b8152600401610f70906020808252600490820152630c4c0c4d60e21b604082015260600190565b6004601054610100900460ff166004811115611f4057611f40615662565b1015611f775760405162461bcd60e51b8152600401610f70906020808252600490820152633130313560e01b604082015260600190565b506000818152601a602090815260409182902082518084019093528054835260010154908201525b919050565b600080516020615e63833981519152611fbc8161352f565b6004601054610100900460ff166004811115611fda57611fda615662565b10156120115760405162461bcd60e51b8152600401610f70906020808252600490820152631898189960e11b604082015260600190565b601c5460ff161561204d5760405162461bcd60e51b8152600401610f70906020808252600490820152633130313360e01b604082015260600190565b60005b600d548110156120d95761206381611e4f565b6120c7577f63ab6e5dc98a7d72f7b887b4479c584f5d1cc5e644f8b756c1213bc8e32f4f4242336000848152601860209081526040918290205482519485526001600160a01b03909316908401528201849052606082015260800160405180910390a15b806120d1816157f8565b915050612050565b5050601c805460ff19166001179055565b60105460ff161561210d5760405162461bcd60e51b8152600401610f7090615945565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66121378161352f565b600083612143600d5490565b61215161029a611a0a6157cb565b61215b91906157cb565b61216591906157cb565b1161219b5760405162461bcd60e51b8152600401610f70906020808252600490820152631898181b60e11b604082015260600190565b600a8311156121d55760405162461bcd60e51b8152600401610f70906020808252600490820152633130303760e01b604082015260600190565b6000831161220e5760405162461bcd60e51b8152600401610f70906020808252600490820152630626060760e31b604082015260600190565b60005b838110156122385761222683611a53600d5490565b80612230816157f8565b915050612211565b507fb458411fe9a80409ed5a4d6c5e07678352095ebf89e8a611de08a8862c85e9034233856000612268600d5490565b61227490611a0a6157cb565b604080519586526001600160a01b039094166020860152928401919091526060830152608082015260a0015b60405180910390a1505050565b6000818152600760205260408120546001600160a01b0316806110ae5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610f70565b3330146123825760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b6064820152608401610f70565b6114ee84848484613dcb565b60006001600160a01b0382166123f95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610f70565b506001600160a01b031660009081526008602052604090205490565b6000546001600160a01b0316331461243f5760405162461bcd60e51b8152600401610f7090615780565b6124496000613e66565b565b6001602052600090815260409020805461246490615746565b80601f016020809104026020016040519081016040528092919081815260200182805461249090615746565b80156124dd5780601f106124b2576101008083540402835291602001916124dd565b820191906000526020600020905b8154815290600101906020018083116124c057829003601f168201915b505050505081565b600080516020615e638339815191526124fd8161352f565b8382146125355760405162461bcd60e51b8152600401610f70906020808252600490820152633130313960e01b604082015260600190565b60005b61ffff81168511156126ae5761029a84848361ffff1681811061255d5761255d6157e2565b905060200201602081019061257291906150b8565b601554612583919061ffff16615a28565b61ffff1611156125be5760405162461bcd60e51b8152600401610f70906020808252600490820152630313032360e41b604082015260600190565b83838261ffff168181106125d4576125d46157e2565b90506020020160208101906125e991906150b8565b6014600088888561ffff16818110612603576126036157e2565b905060200201602081019061261891906152e3565b6001600160a01b031681526020810191909152604001600020805461ffff191661ffff928316179055849084908316818110612656576126566157e2565b905060200201602081019061266b91906150b8565b6015805460009061268190849061ffff16615a28565b92506101000a81548161ffff021916908361ffff16021790555080806126a69061598d565b915050612538565b505050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6126e08161352f565b611721613eb6565b60105460ff161561270b5760405162461bcd60e51b8152600401610f7090615945565b612713611cc1565b6127485760405162461bcd60e51b8152600401610f70906020808252600490820152630c4c0c0d60e21b604082015260600190565b60026116c5565b6000918252600f602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600680546110c390615746565b6011805461246490615746565b6118f9338383613f0e565b600080516020615e638339815191526127b98161352f565b60005b828110156114ee576001601260008686858181106127dc576127dc6157e2565b90506020020160208101906127f191906152e3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580612823816157f8565b9150506127bc565b6128353383613539565b6128515760405162461bcd60e51b8152600401610f7090615811565b6114ee84848484613fdc565b600061286b60105460ff1690565b156128885760405162461bcd60e51b8152600401610f7090615945565b612891826134a4565b6128c65760405162461bcd60e51b8152600401610f70906020808252600490820152633130303960e01b604082015260600190565b336128d0836122ad565b6001600160a01b03161461290f5760405162461bcd60e51b8152600401610f70906020808252600490820152630313031360e41b604082015260600190565b6000828152601b602052604090205460ff16156129575760405162461bcd60e51b8152600401610f70906020808252600490820152633130313160e01b604082015260600190565b60408051808201825283815260006020808301828152868352601a8252848320845181559051600191820155601b8252848320805460ff19169091179055601881529083902054835142815233928101929092528184018690526060820152915190917f63ab6e5dc98a7d72f7b887b4479c584f5d1cc5e644f8b756c1213bc8e32f4f42919081900360800190a1505060009081526018602052604090205490565b6060612a04826134a4565b612a395760405162461bcd60e51b8152600401610f70906020808252600490820152630626062760e31b604082015260600190565b600060118054612a4890615746565b80601f0160208091040260200160405190810160405280929190818152602001828054612a7490615746565b8015612ac15780601f10612a9657610100808354040283529160200191612ac1565b820191906000526020600020905b815481529060010190602001808311612aa457829003601f168201915b50505050509050600081511115612b7957612adb83611e4f565b15612b515760006018600085815260200190815260200160002054905081612b286004604051806040016040528060018152602001600360fc1b815250612b218561400f565b919061410f565b604051602001612b39929190615a4e565b60405160208183030381529060405292505050919050565b80604051602001612b629190615a8d565b604051602081830303815290604052915050919050565b5050604080516020810190915260008152919050565b6000546001600160a01b03163314612bb95760405162461bcd60e51b8152600401610f7090615780565b6040516332fb62e760e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cbed8b9c90612c0d9088908890889088908890600401615ac2565b600060405180830381600087803b158015612c2757600080fd5b505af1158015612c3b573d6000803e3d6000fd5b505050505050505050565b60105460ff1615612c695760405162461bcd60e51b8152600401610f7090615945565b7f2fdac51cdf0426bc6ad4182f323789f562ee3018082dc81e74fcd7ec0650c229612c938161352f565b612c9c836134a4565b612cd15760405162461bcd60e51b8152600401610f70906020808252600490820152631898189b60e11b604082015260600190565b6000838152601a602052604081206001018054849290612cf2908490615afb565b90915550506000838152601a60205260409020600101547f4580bdb044327c65e0ccdb3a6f65cd4b659475ef0c5e0fb6baefef92e2c40f6390429085908590612d3c908290615afb565b6040805194855260208501939093529183015260608201526080016122a0565b600080516020615e63833981519152612d748161352f565b60005b828110156114ee57600060126000868685818110612d9757612d976157e2565b9050602002016020810190612dac91906152e3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580612dde816157f8565b915050612d77565b61ffff84166000908152600260205260408082209051612e07908690615b13565b90815260408051602092819003830190206001600160401b03861660009081529252902054905080612e875760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b6064820152608401610f70565b815160208301208114612ee65760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b6064820152608401610f70565b61ffff85166000908152600260205260408082209051612f07908790615b13565b90815260408051602092819003830190206001600160401b0387166000908152925290205561109c85858585613dcb565b6000828152600f6020526040902060010154612f538161352f565b6113828383613a20565b6000546001600160a01b03163314612f875760405162461bcd60e51b8152600401610f7090615780565b61ffff83166000908152600160205260409020612fa5908383614e17565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab8383836040516122a093929190615a0a565b600080516020615e63833981519152612ff18161352f565b60005b828110156114ee57600160136000868685818110613014576130146157e2565b905060200201602081019061302991906152e3565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061305b816157f8565b915050612ff4565b6000546001600160a01b0316331461308d5760405162461bcd60e51b8152600401610f7090615780565b6001600160a01b0381166130f25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610f70565b61172181613e66565b600080516020615e638339815191526131138161352f565b8160ff16600481111561312857613128615662565b6010805461ff00191661010083600481111561314657613146615662565b02179055506010546040517f9d9d30eac03468f7a112a215a51f6a0fdbbb60f2efcb2e40e247eb350835a5b491613187914291610100900460ff1690615b2f565b60405180910390a15050565b604051633d7b2f6f60e21b815261ffff808616600483015284166024820152306044820152606481018290526060907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f5ecbdbc90608401600060405180830381865afa158015613213573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261323b9190810190615b88565b90505b949350505050565b60105460ff16156132695760405162461bcd60e51b8152600401610f7090615945565b61327161143b565b6132a65760405162461bcd60e51b8152600401610f70906020808252600490820152633130303360e01b604082015260600190565b60016116c5565b6118f982826040518060200160405280600081525061415d565b6001600160a01b03163b151590565b6001600160a01b0383166133315761332c81600d80546000838152600e60205260408120829055600182018355919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155565b613354565b816001600160a01b0316836001600160a01b031614613354576133548382614190565b6001600160a01b03821661336b576113828161422d565b826001600160a01b0316826001600160a01b0316146113825761138282826142dc565b604051633356ae4560e11b815230906366ad5c8a906133b7908790879087908790600401615bbc565b600060405180830381600087803b1580156133d157600080fd5b505af19250505080156133e2575060015b6114ee578080519060200120600260008661ffff1661ffff168152602001908152602001600020846040516134179190615b13565b9081526040805191829003602090810183206001600160401b0387166000908152915220919091557fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d90613472908690869086908690615bbc565b60405180910390a16114ee565b60006001600160e01b03198216637965db0b60e01b14806110ae57506110ae82614320565b6000908152600760205260409020546001600160a01b0316151590565b600081815260096020526040902080546001600160a01b0319166001600160a01b03841690811790915581906134f6826122ad565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611721813361432b565b6000613544826134a4565b6135a55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610f70565b60006135b0836122ad565b9050806001600160a01b0316846001600160a01b031614806135f757506001600160a01b038082166000908152600a602090815260408083209388168352929052205460ff165b8061323e5750836001600160a01b0316613610846111ea565b6001600160a01b031614949350505050565b826001600160a01b0316613635826122ad565b6001600160a01b0316146136995760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610f70565b6001600160a01b0382166136fb5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610f70565b61370683838361438f565b6137116000826134c1565b6001600160a01b038316600090815260086020526040812080546001929061373a9084906157cb565b90915550506001600160a01b0382166000908152600860205260408120805460019290613768908490615afb565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60105460ff16156137ec5760405162461bcd60e51b8152600401610f7090615945565b60006137f7826143bd565b9050803410156138325760405162461bcd60e51b8152600401610f70906020808252600490820152633130303560e01b604082015260600190565b60008261383e600d5490565b61384c61029a611a0a6157cb565b61385691906157cb565b61386091906157cb565b116138965760405162461bcd60e51b8152600401610f70906020808252600490820152631898181b60e11b604082015260600190565b600a8211156138d05760405162461bcd60e51b8152600401610f70906020808252600490820152633130303760e01b604082015260600190565b600082116139095760405162461bcd60e51b8152600401610f70906020808252600490820152630626060760e31b604082015260600190565b60005b8281101561392f5761391d33611a4b565b80613927816157f8565b91505061390c565b507fb458411fe9a80409ed5a4d6c5e07678352095ebf89e8a611de08a8862c85e9034233848461395e600d5490565b61396a90611a0a6157cb565b604080519586526001600160a01b039094166020860152928401919091526060830152608082015260a001613187565b6139a4828261274f565b6118f9576000828152600f602090815260408083206001600160a01b03851684529091529020805460ff191660011790556139dc3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613a2a828261274f565b156118f9576000828152600f602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000613a91614427565b90506000613a9e826144a8565b60008181526019602052604090205490915060ff1615613ac057613ac0615bfa565b6000818152601960209081526040808320805460ff19166001179055858352601890915290208190556114ee8484614560565b60105460ff16613b3c5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610f70565b6010805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6127106001600160601b0382161115613bf45760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610f70565b6001600160a01b038216613c4a5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610f70565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b613c8f8787878761458e565b60008585604051602001613ca4929190615862565b6040516020818303038152906040529050613cc28782868686614677565b604051630f428ae960e31b815261ffff881660048201523060248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637a14574890604401602060405180830381865afa158015613d33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d579190615c10565b905086604051613d679190615b13565b604080519182900382208883526001600160401b03841660208401529161ffff8b16916001600160a01b038d16917f024797cc77ce15dc717112d54fb1df125fdfd8c81344fb046c5e074427ce1543910160405180910390a4505050505050505050565b60008082806020019051810190613de29190615c2d565b60148201519193509150613df7878284614810565b806001600160a01b031686604051613e0f9190615b13565b604080519182900382208583526001600160401b03891660208401529161ffff8b16917f64e10c37f404d128982dce114f5d233c14c5c7f6d8db93099e3d99dacb9e27ba910160405180910390a450505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60105460ff1615613ed95760405162461bcd60e51b8152600401610f7090615945565b6010805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613b693390565b816001600160a01b0316836001600160a01b031603613f6f5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610f70565b6001600160a01b038381166000818152600a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613fe7848484613622565b613ff38484848461481a565b6114ee5760405162461bcd60e51b8152600401610f7090615c73565b6060816000036140365750506040805180820190915260018152600360fc1b602082015290565b8160005b8115614060578061404a816157f8565b91506140599050600a83615931565b915061403a565b6000816001600160401b0381111561407a5761407a614eb2565b6040519080825280601f01601f1916602001820160405280156140a4576020820181803683370190505b5090505b841561323e576140b96001836157cb565b91506140c6600a86615cc5565b6140d1906030615afb565b60f81b8183815181106140e6576140e66157e2565b60200101906001600160f81b031916908160001a905350614108600a86615931565b94506140a8565b82516060905b83811015614154578285604051602001614130929190615cd9565b6040516020818303038152906040529450808061414c906157f8565b915050614115565b50929392505050565b6141678383614918565b614174600084848461481a565b6113825760405162461bcd60e51b8152600401610f7090615c73565b6000600161419d8461238e565b6141a791906157cb565b6000838152600c60205260409020549091508082146141fa576001600160a01b0384166000908152600b602090815260408083208584528252808320548484528184208190558352600c90915290208190555b506000918252600c602090815260408084208490556001600160a01b039094168352600b81528383209183525290812055565b600d5460009061423f906001906157cb565b6000838152600e6020526040812054600d8054939450909284908110614267576142676157e2565b9060005260206000200154905080600d8381548110614288576142886157e2565b6000918252602080832090910192909255828152600e9091526040808220849055858252812055600d8054806142c0576142c0615cff565b6001900381819060005260206000200160009055905550505050565b60006142e78361238e565b6001600160a01b039093166000908152600b602090815260408083208684528252808320859055938252600c9052919091209190915550565b60006110ae82614a57565b614335828261274f565b6118f95761434d816001600160a01b03166014614a7c565b614358836020614a7c565b604051602001614369929190615d15565b60408051601f198184030181529082905262461bcd60e51b8252610f70916004016150a5565b60105460ff16156143b25760405162461bcd60e51b8152600401610f7090615945565b6113828383836132d6565b6000671bc16d674ec800006143d061143b565b156143e057506718fae27693b400005b6002836143ed81806158fc565b6143f791906157cb565b6144019190615931565b6144139067016345785d8a00006158fc565b61441d84836158fc565b611c8891906157cb565b6000614432600d5490565b61443e90611a0a6157cb565b60000361444b5750600090565b6017544442336040805160208101949094528301919091526bffffffffffffffffffffffff19606091821b1690820152434060748201526094016040516020818303038152906040528051906020012060001c6113bc9190615cc5565b6000818152601660205260408120548082036144c15750815b6016600060016017546144d491906157cb565b81526020019081526020016000205460000361450d5760016017546144f991906157cb565b600084815260166020526040902055614541565b60166000600160175461452091906157cb565b81526020808201929092526040908101600090812054868252601690935220555b60016017600082825461455491906157cb565b90915550909392505050565b61456a82826132ad565b611a0a614576600d5490565b106118f95750506010805461ff001916610400179055565b614597336114f9565b6145fa5760405162461bcd60e51b815260206004820152602e60248201527f4f4e46543732313a2073656e642063616c6c6572206973206e6f74206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610f70565b836001600160a01b031661460d826122ad565b6001600160a01b03161461466e5760405162461bcd60e51b815260206004820152602260248201527f4f4e46543732313a2073656e642066726f6d20696e636f7272656374206f776e60448201526132b960f11b6064820152608401610f70565b6114ee81614c17565b61ffff85166000908152600160205260408120805461469590615746565b80601f01602080910402602001604051908101604052809291908181526020018280546146c190615746565b801561470e5780601f106146e35761010080835404028352916020019161470e565b820191906000526020600020905b8154815290600101906020018083116146f157829003601f168201915b50505050509050805160000361477f5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b6064820152608401610f70565b60405162c5803160e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c58031009034906147d6908a9086908b908b908b908b90600401615d8a565b6000604051808303818588803b1580156147ef57600080fd5b505af1158015614803573d6000803e3d6000fd5b5050505050505050505050565b6113828282614560565b60006001600160a01b0384163b1561491057604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061485e903390899088908890600401615df1565b6020604051808303816000875af1925050508015614899575060408051601f3d908101601f1916820190925261489691810190615e2e565b60015b6148f6573d8080156148c7576040519150601f19603f3d011682016040523d82523d6000602084013e6148cc565b606091505b5080516000036148ee5760405162461bcd60e51b8152600401610f7090615c73565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061323e565b50600161323e565b6001600160a01b03821661496e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610f70565b614977816134a4565b156149c45760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610f70565b6149d06000838361438f565b6001600160a01b03821660009081526008602052604081208054600192906149f9908490615afb565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b0319821663780e9d6360e01b14806110ae57506110ae82614c20565b60606000614a8b8360026158fc565b614a96906002615afb565b6001600160401b03811115614aad57614aad614eb2565b6040519080825280601f01601f191660200182016040528015614ad7576020820181803683370190505b509050600360fc1b81600081518110614af257614af26157e2565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614b2157614b216157e2565b60200101906001600160f81b031916908160001a9053506000614b458460026158fc565b614b50906001615afb565b90505b6001811115614bc8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614b8457614b846157e2565b1a60f81b828281518110614b9a57614b9a6157e2565b60200101906001600160f81b031916908160001a90535060049490941c93614bc181615e4b565b9050614b53565b508315611c885760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610f70565b61172181614c3d565b60006001600160e01b0319821615806110ae57506110ae82614c57565b614c4681614c97565b600090815260046020526040812055565b60006001600160e01b031982166380ac58cd60e01b1480614c8857506001600160e01b03198216635b5e139f60e01b145b806110ae57506110ae82614d3e565b6000614ca2826122ad565b9050614cb08160008461438f565b614cbb6000836134c1565b6001600160a01b0381166000908152600860205260408120805460019290614ce49084906157cb565b909155505060008281526007602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160e01b0319821663152a902d60e11b14806110ae57506110ae8260006001600160e01b03198216637bb0080b60e01b14806110ae57506301ffc9a760e01b6001600160e01b03198316146110ae565b828054614d9f90615746565b90600052602060002090601f016020900481019282614dc15760008555614e07565b82601f10614dda57805160ff1916838001178555614e07565b82800160010185558215614e07579182015b82811115614e07578251825591602001919060010190614dec565b50614e13929150614e8b565b5090565b828054614e2390615746565b90600052602060002090601f016020900481019282614e455760008555614e07565b82601f10614e5e5782800160ff19823516178555614e07565b82800160010185558215614e07579182015b82811115614e07578235825591602001919060010190614e70565b5b80821115614e135760008155600101614e8c565b803561ffff81168114611f9f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614ef057614ef0614eb2565b604052919050565b60006001600160401b03821115614f1157614f11614eb2565b50601f01601f191660200190565b6000614f32614f2d84614ef8565b614ec8565b9050828152838383011115614f4657600080fd5b828260208301376000602084830101529392505050565b600082601f830112614f6e57600080fd5b611c8883833560208501614f1f565b6001600160401b038116811461172157600080fd5b60008060008060808587031215614fa857600080fd5b614fb185614ea0565b935060208501356001600160401b0380821115614fcd57600080fd5b614fd988838901614f5d565b945060408701359150614feb82614f7d565b9092506060860135908082111561500157600080fd5b5061500e87828801614f5d565b91505092959194509250565b6001600160e01b03198116811461172157600080fd5b60006020828403121561504257600080fd5b8135611c888161501a565b60005b83811015615068578181015183820152602001615050565b838111156114ee5750506000910152565b6000815180845261509181602086016020860161504d565b601f01601f19169290920160200192915050565b602081526000611c886020830184615079565b6000602082840312156150ca57600080fd5b611c8882614ea0565b6000602082840312156150e557600080fd5b5035919050565b6001600160a01b038116811461172157600080fd5b6000806040838503121561511457600080fd5b823561511f816150ec565b946020939093013593505050565b60008083601f84011261513f57600080fd5b5081356001600160401b0381111561515657600080fd5b6020830191508360208260051b850101111561169857600080fd5b6000806020838503121561518457600080fd5b82356001600160401b0381111561519a57600080fd5b6151a68582860161512d565b90969095509350505050565b6000806000606084860312156151c757600080fd5b83356151d2816150ec565b925060208401356151e2816150ec565b929592945050506040919091013590565b80358015158114611f9f57600080fd5b600080600080600060a0868803121561521b57600080fd5b61522486614ea0565b945060208601356001600160401b038082111561524057600080fd5b61524c89838a01614f5d565b955060408801359450615261606089016151f3565b9350608088013591508082111561527757600080fd5b5061528488828901614f5d565b9150509295509295909350565b600080604083850312156152a457600080fd5b50508035926020909101359150565b600080604083850312156152c657600080fd5b8235915060208301356152d8816150ec565b809150509250929050565b6000602082840312156152f557600080fd5b8135611c88816150ec565b60008083601f84011261531257600080fd5b5081356001600160401b0381111561532957600080fd5b60208301915083602082850101111561169857600080fd5b60008060006040848603121561535657600080fd5b61535f84614ea0565b925060208401356001600160401b0381111561537a57600080fd5b61538686828701615300565b9497909650939450505050565b600080600080600080600060e0888a0312156153ae57600080fd5b87356153b9816150ec565b96506153c760208901614ea0565b955060408801356001600160401b03808211156153e357600080fd5b6153ef8b838c01614f5d565b965060608a0135955060808a01359150615408826150ec565b90935060a08901359061541a826150ec565b90925060c0890135908082111561543057600080fd5b5061543d8a828b01614f5d565b91505092959891949750929550565b60006020828403121561545e57600080fd5b81356001600160401b0381111561547457600080fd5b8201601f8101841361548557600080fd5b61323e84823560208401614f1f565b6000806000606084860312156154a957600080fd5b6154b284614ea0565b925060208401356001600160401b038111156154cd57600080fd5b6154d986828701614f5d565b92505060408401356154ea81614f7d565b809150509250925092565b6000806000806040858703121561550b57600080fd5b84356001600160401b038082111561552257600080fd5b61552e8883890161512d565b9096509450602087013591508082111561554757600080fd5b506155548782880161512d565b95989497509550505050565b6000806040838503121561557357600080fd5b823561557e816150ec565b915061558c602084016151f3565b90509250929050565b600080600080608085870312156155ab57600080fd5b84356155b6816150ec565b935060208501356155c6816150ec565b92506040850135915060608501356001600160401b038111156155e857600080fd5b61500e87828801614f5d565b60008060008060006080868803121561560c57600080fd5b61561586614ea0565b945061562360208701614ea0565b93506040860135925060608601356001600160401b0381111561564557600080fd5b61565188828901615300565b969995985093965092949392505050565b634e487b7160e01b600052602160045260246000fd5b6005811061569657634e487b7160e01b600052602160045260246000fd5b9052565b602081016110ae8284615678565b600080604083850312156156bb57600080fd5b82356156c6816150ec565b915060208301356152d8816150ec565b6000602082840312156156e857600080fd5b813560ff81168114611c8857600080fd5b6000806000806080858703121561570f57600080fd5b61571885614ea0565b935061572660208601614ea0565b92506040850135615736816150ec565b9396929550929360600135925050565b600181811c9082168061575a57607f821691505b60208210810361577a57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156157dd576157dd6157b5565b500390565b634e487b7160e01b600052603260045260246000fd5b60006001820161580a5761580a6157b5565b5060010190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6040815260006158756040830185615079565b90508260208301529392505050565b61ffff861681526001600160a01b038516602082015260a0604082018190526000906158b290830186615079565b841515606084015282810360808401526158cc8185615079565b98975050505050505050565b600080604083850312156158eb57600080fd5b505080516020909101519092909150565b6000816000190483118215151615615916576159166157b5565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826159405761594061591b565b500490565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b600061ffff821680615983576159836157b5565b6000190192915050565b600061ffff8083168181036159a4576159a46157b5565b6001019392505050565b600061ffff838116908316818110156159c9576159c96157b5565b039392505050565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8416815260406020820152600061323b6040830184866159e1565b600061ffff808316818516808303821115615a4557615a456157b5565b01949350505050565b60008351615a6081846020880161504d565b835190830190615a7481836020880161504d565b64173539b7b760d91b9101908152600501949350505050565b60008251615a9f81846020870161504d565b7036b0b229b5bab6363d25b2bc973539b7b760791b920191825250601101919050565b600061ffff808816835280871660208401525084604083015260806060830152615af06080830184866159e1565b979650505050505050565b60008219821115615b0e57615b0e6157b5565b500190565b60008251615b2581846020870161504d565b9190910192915050565b82815260408101611c886020830184615678565b600082601f830112615b5457600080fd5b8151615b62614f2d82614ef8565b818152846020838601011115615b7757600080fd5b61323e82602083016020870161504d565b600060208284031215615b9a57600080fd5b81516001600160401b03811115615bb057600080fd5b61323e84828501615b43565b61ffff85168152608060208201526000615bd96080830186615079565b6001600160401b03851660408401528281036060840152615af08185615079565b634e487b7160e01b600052600160045260246000fd5b600060208284031215615c2257600080fd5b8151611c8881614f7d565b60008060408385031215615c4057600080fd5b82516001600160401b03811115615c5657600080fd5b615c6285828601615b43565b925050602083015190509250929050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082615cd457615cd461591b565b500690565b60008351615ceb81846020880161504d565b835190830190615a4581836020880161504d565b634e487b7160e01b600052603160045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615d4d81601785016020880161504d565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d7e81602884016020880161504d565b01602801949350505050565b61ffff8716815260c060208201526000615da760c0830188615079565b8281036040840152615db98188615079565b6001600160a01b0387811660608601528616608085015283810360a08501529050615de48185615079565b9998505050505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615e2490830184615079565b9695505050505050565b600060208284031215615e4057600080fd5b8151611c888161501a565b600081615e5a57615e5a6157b5565b50600019019056fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212206d680160388f48199312c11ff769619cba40c832960d04ff3895fc536270981a64736f6c634300080e00334552433732313a207472616e7366657220746f206e6f6e2045524337323152650000000000000000000000000000000000000000000000000000000000000080000000000000000000000000cafbcfd3fe93bccf1e15fa831f7d98ecfab4e28100000000000000000000000000000000000000000000000000000000000000060000000000000000000000003c2269811836af69497e5f486a85d7316753cf62000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f63646e2e6d6164736b756c6c7a2e696f2f6d6164736b756c6c7a2f6d657461646174612f0000000000000000000000000000000000000000
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000cafbcfd3fe93bccf1e15fa831f7d98ecfab4e28100000000000000000000000000000000000000000000000000000000000000060000000000000000000000003c2269811836af69497e5f486a85d7316753cf62000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f63646e2e6d6164736b756c6c7a2e696f2f6d6164736b756c6c7a2f6d657461646174612f0000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : baseTokenURI (string): https://cdn.madskullz.io/madskullz/metadata/
Arg [1] : _royaltyRecipient (address): 0xcafbcfd3fe93bccf1e15fa831f7d98ecfab4e281
Arg [2] : _creatorzAmount (uint256): 6
Arg [3] : _layerZeroEndpoint (address): 0x3c2269811836af69497e5f486a85d7316753cf62
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 000000000000000000000000cafbcfd3fe93bccf1e15fa831f7d98ecfab4e281
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [3] : 0000000000000000000000003c2269811836af69497e5f486a85d7316753cf62
Arg [4] : 000000000000000000000000000000000000000000000000000000000000002c
Arg [5] : 68747470733a2f2f63646e2e6d6164736b756c6c7a2e696f2f6d6164736b756c
Arg [6] : 6c7a2f6d657461646174612f0000000000000000000000000000000000000000