ETH Price: $3,339.88 (-0.71%)

Token

DerivedAPE (DAPE)
 

Overview

Max Total Supply

934 DAPE

Holders

352

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
3 DAPE
0x2beee8b322b5733f8f2dda311c184bb963a34a79
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DerivedAPE

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : DerivedAPE.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

import "hardhat/console.sol";
import "./MintPassOptimized.sol";
import "./DerivedERC2981Royalty.sol";

abstract contract UriChanger is Ownable {
    address private _uriChanger;

    event UriChangerUpdated(address indexed previousAddress, address indexed newAddress);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor(address _newUriChanger) {
        _updateUriChanger(_newUriChanger);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function uriChanger() internal view returns (address) {
        return _uriChanger;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyUriChanger() {
        require(uriChanger() == _msgSender(), "UriChanger: caller is not allowed");
        _;
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function updateUriChanger(address newAddress) public virtual onlyOwner {
        require(newAddress != address(0), "UriChanger: Address required");
        _updateUriChanger(newAddress);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _updateUriChanger(address newAddress) internal virtual {
        address oldAddress = _uriChanger;
        _uriChanger = newAddress;
        emit UriChangerUpdated(oldAddress, newAddress);
    }
}

contract DerivedAPE is ERC721URIStorage, UriChanger, DerivedERC2981Royalty, IERC721Enumerable {

    using Strings for uint256;
    using Address for address;

    using Counters for Counters.Counter;

    struct ERC721s {
        address erc721;
        uint256 tokenId;
    }

    struct mintData {
        uint256 tokenId;
        uint256 mintpassId;
    }

    struct mintDataWithUri {
        uint256 tokenId;
        uint256 mintpassId;
        string tokenURI;
    }

    mapping(uint256 => ERC721s) private _parents;

    // relation of combined contract_and_id to tokenIds, kind of Enumerable
    mapping(uint256 => uint256[]) private _childrenArr;
    mapping(uint256 => uint256) private _childrenIndex;
    mapping(uint256 => uint256) private _childrenCounter;

    string constant JSON_FILE = ".json";
    string constant _metadataURI = "https://niftytailor.com/";
    address immutable BAYC;
    address immutable MAYC;
    address RoyaltyReceiver;
    address _mintPassAddress;

    uint256 mintStartTimestamp;
    uint256 mintEndTimestamp;

    Counters.Counter private _tokenIdCounter;

    event MintPassUsed(uint indexed currentId, uint indexed mintpassId, address indexed owner, address parent, uint256 tokenId, uint256 currentOriginIndex);
    event NewMintPassAddress( address indexed newAddress );
    event BaseUriUpdate( string uri );
    event MintStartUpdate( uint timestamp );
    event MintEndUpdate( uint timestamp );
    event RoyaltyContractUpdate( address indexed newAddress );
    event PermanentURI(string _value, uint256 indexed _id);
    

    // Base URI
    string private __baseURI;

    // count burnt token number to calc totalSupply()
    uint256 private _burnt;

    address private _uriUpdater;

    constructor(string memory name_, string memory symbol_, address _bayc, address _mayc, address _rr, address _newUriChanger) ERC721(name_, symbol_) UriChanger(_newUriChanger) {
        BAYC = _bayc;
        MAYC = _mayc;

        _setRoyaltyContract( _rr );

        // TODO set correct roaylty amount
        _setRoyalty(500);// 100 = 1%

        uint256 startTimestamp = block.timestamp + 60 * 60 * 24 * 7;
        _setMintStartTime( startTimestamp ); // minting allowed in a week
        _setMintEndTime( startTimestamp + 60 * 60 * 24 * 30 * 6 ); // minting allowed for 6 months

        // make it start from 1
        _tokenIdCounter.increment();

    }

    function baseURI() public view virtual returns (string memory) {
        return _baseURI();
    }

    function _baseURI() internal view override returns (string memory) {
        return __baseURI;
    }

    function setBaseURI(string memory baseURI_) public onlyUriChanger {
        _setBaseURI(baseURI_);
    }

    function _setBaseURI(string memory baseURI_) internal virtual {
        emit BaseUriUpdate(baseURI_);
        __baseURI = baseURI_;
    }

    function setTokenURI(uint256 tokenId, string memory _tokenURI) external onlyUriChanger{
        _setTokenURI(tokenId, _tokenURI);
        emit PermanentURI(_tokenURI, tokenId);
    }

    function setMintStartTime(uint256 timestamp) external onlyOwner {
        _setMintStartTime( timestamp );
    }

    function _setMintStartTime(uint256 timestamp) internal {
        emit MintStartUpdate(timestamp);
        mintStartTimestamp = timestamp;
    }

    function getMintStartTime() external view returns (uint256) {
        return mintStartTimestamp ;
    }

    function setMintEndTime(uint256 timestamp) external onlyOwner {
        _setMintEndTime( timestamp );
    }

    function _setMintEndTime(uint256 timestamp) internal {
        emit MintEndUpdate(timestamp);
        mintEndTimestamp = timestamp;
    }

    function getMintEndTime() external view returns (uint256) {
        return mintEndTimestamp ;
    }

    function setMintPass(address addr) public onlyOwner {
        emit NewMintPassAddress(addr);
        _mintPassAddress = addr;
    }

    // Form combination of address & tokenId for unique pointer to NFT - Address is 160 bits (20*8) + TokenId 96 bits
    function getPonter(address c, uint256 tokenId) internal pure returns (uint256) {
        require(tokenId < (1 << 96), "Too big tokenId");
        return (uint256(uint160(c)) << (256-20*8)) + tokenId ;
    }

    function tokenOfOriginByIndex(address erc721, uint256 tokenId, uint256 index) public view returns (uint256) {
        uint256 pointer = getPonter(erc721, tokenId);
        require(index < _childrenArr[pointer].length, "Index out of bounds");
        return _childrenArr[pointer][index];
    }

    function tokenOfOriginCount(address erc721, uint256 tokenId) public view returns (uint256) {
        uint256 pointer = getPonter(erc721, tokenId);
        return _childrenArr[pointer].length;
    }

    function tokenOfOriginCounter(address erc721, uint256 tokenId) public view returns (uint256) {
        uint256 pointer = getPonter(erc721, tokenId);
        return _childrenCounter[pointer] - 1;
    }

    // required to solve inheritance
    function _burn(uint256 tokenId) internal virtual override {

        ERC721s memory parent = getParent(tokenId);
        uint256 pointer = getPonter(parent.erc721, parent.tokenId);

        uint256 tokenIndex = _childrenIndex[tokenId];

        uint256 lastTokenIndex = _childrenArr[pointer].length - 1;

        //If required, swap the token to be burned and the token at the head of the stack
        //then use pop to remove the head of the _childrenArr stack mapping
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _childrenArr[pointer][lastTokenIndex];

            _childrenArr[pointer][tokenIndex] = lastTokenId;

            _childrenIndex[lastTokenId] = tokenIndex;

        }

        _childrenArr[pointer].pop();
        delete _childrenIndex[tokenId];

        delete _parents[tokenId];
        ERC721URIStorage._burn(tokenId);
    }

    function burn(uint256 tokenId) external {
        require (_isApprovedOrOwner(_msgSender(), tokenId), "Not approved and not owner");
        _burnt++;
        _burn(tokenId);
    }

    // required to solve inheritance
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165,ERC721, DerivedERC2981Royalty) returns (bool) {
        return 
        interfaceId == type(IERC721Enumerable).interfaceId 
        || ERC721.supportsInterface(interfaceId) 
        || DerivedERC2981Royalty.supportsInterface(interfaceId);
    }

    function royaltyInfo(uint256 tokenId, uint256 salePrice) external virtual override view
    returns (address receiver, uint256 royaltyAmount) {
        require(_exists(tokenId), "Token doesnt exist.");
        receiver = RoyaltyReceiver;
        royaltyAmount = (_getRoyalty() * salePrice) / 10000;
    }

    function setRoyaltyContract(address newAddress) external onlyOwner {
        _setRoyaltyContract( newAddress );
    }

    function _setRoyaltyContract(address newAddress) internal {
        require(newAddress.isContract(), "Only Contract allowed");
        emit RoyaltyContractUpdate(newAddress);
        RoyaltyReceiver = newAddress;
    }

    function withdraw() public onlyOwner {
        uint balance = address(this).balance;
        (bool sent, ) = _msgSender().call{value: balance}("");
        require(sent, "Failed to send Ether");
    }

    function _isTokenOwner(address _contract, uint256 tokenId) internal view returns (bool) {
        ERC721 t = ERC721(_contract);
        return _msgSender() == t.ownerOf(tokenId);
    }

    // We dont use tokenURI param. its just for external use, but should be attached to the request to connect token with temporary URI
    function mintDerivedBAYCWithURI(mintDataWithUri[] calldata data) external {
        uint i;
        for (i=0 ; i < data.length; i++) {
            _mintDerived( data[i].tokenId, data[i].mintpassId, BAYC );
        }
    }

    // We dont use tokenURI param. its just for external use, but should be attached to the request to connect token with temporary URI
    function mintDerivedMAYCWithURI(mintDataWithUri[] calldata data) external {
        uint i;
        for (i=0 ; i < data.length; i++) {
            _mintDerived( data[i].tokenId, data[i].mintpassId, MAYC );
        }
    }

    function mintDerivedBAYC( mintData[] calldata data )  external {
        uint i;
        for (i=0 ; i < data.length; i++) {
            _mintDerived( data[i].tokenId, data[i].mintpassId, BAYC );
        }
    }

    function mintDerivedMAYC( mintData[] calldata data )  external {
        uint i;
        for (i=0 ; i < data.length; i++) {
            _mintDerived( data[i].tokenId, data[i].mintpassId, MAYC );
        }
    }

    function _mintDerived( uint256 tokenId, uint256 mintpassId, address erc721 )  internal returns (uint256 newTokenId) {
        require( block.timestamp >= mintStartTimestamp, "Minting has not started");
        require( block.timestamp <= mintEndTimestamp, "Minting finished");
        require( _isTokenOwner(erc721, tokenId), "Need to be an owner to mint");

        MintPassOptimized mp = MintPassOptimized(_mintPassAddress);
        bool result = mp.useToken(mintpassId, _msgSender());
        require (result, "Mintpass Already used");

        newTokenId = _tokenIdCounter.current();
        
        _parents[newTokenId] = ERC721s(erc721, tokenId);

        uint256 pointer = getPonter(erc721, tokenId); // Get unique 256 bit pointer to specific originating Token (masked address + tokenId)
        uint256 newTokenIndex = _childrenCounter[pointer]; // How many tokens are currently dervied from the specific originating Token

        _childrenArr[pointer].push(newTokenId); // create mapping of derived tokenIds for each originating Token
        _childrenIndex[newTokenId] = _childrenArr[pointer].length - 1;
        _childrenCounter[pointer] = newTokenIndex + 1; 

        emit MintPassUsed(newTokenId, mintpassId, _msgSender(), erc721, tokenId, newTokenIndex);

        _safeMint(_msgSender(), _tokenIdCounter.current());
        _tokenIdCounter.increment();
        
    }

    function getParent(uint256 tokenId) public view returns(ERC721s memory) {
        require(_exists(tokenId), "Non-existent token");
        return _parents[tokenId];
    }

    function contractURI() public pure returns (string memory) {
        return string(abi.encodePacked(_metadataURI, "contracts/dape.json"));
    }

    /**
     * Foreach all minted tokens until reached appropriate index
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < balanceOf(owner), "DAPE: owner index out of bounds");

        uint256 numMinted = _tokenIdCounter.current();
        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i = 1; i < numMinted; i++) {

                if (_exists(i) && (ownerOf(i) == owner) ){

                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx = tokenIdsIdx + 1;
                }
            }
        }

        // Execution should never reach this point.
        assert(false);
        // added to stop compiler warnings
        return 0;
    }

    function totalSupply() public view virtual override returns (uint256) {
        return _tokenIdCounter.current() - _burnt - 1;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        uint256 numMintedSoFar = _tokenIdCounter.current();

        require(index < totalSupply(), "DAPE: index out of bounds");

        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i = 1; i < numMintedSoFar; i++) {
                if (_exists(i)){
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        // Execution should never reach this point.
        assert(false);
        return 0;
    }

}

File 2 of 20 : ERC721URIStorage.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721URIStorage.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorage is ERC721 {
    using Strings for uint256;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token");

        string memory _tokenURI = _tokenURIs[tokenId];
        string memory base = _baseURI();

        // If there is no base URI, return the token URI.
        if (bytes(base).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(base, _tokenURI));
        }

        return super.tokenURI(tokenId);
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
        require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @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 override {
        super._burn(tokenId);

        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }
    }
}

File 3 of 20 : IERC721Enumerable.sol
// 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);
}

File 4 of 20 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 5 of 20 : Strings.sol
// 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);
    }
}

File 6 of 20 : Address.sol
// 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);
            }
        }
    }
}

File 7 of 20 : Ownable.sol
// 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);
    }
}

File 8 of 20 : console.sol
// SPDX-License-Identifier: MIT
pragma solidity >= 0.4.22 <0.9.0;

library console {
	address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);

	function _sendLogPayload(bytes memory payload) private view {
		uint256 payloadLength = payload.length;
		address consoleAddress = CONSOLE_ADDRESS;
		assembly {
			let payloadStart := add(payload, 32)
			let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0)
		}
	}

	function log() internal view {
		_sendLogPayload(abi.encodeWithSignature("log()"));
	}

	function logInt(int p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(int)", p0));
	}

	function logUint(uint p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
	}

	function logString(string memory p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string)", p0));
	}

	function logBool(bool p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
	}

	function logAddress(address p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address)", p0));
	}

	function logBytes(bytes memory p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes)", p0));
	}

	function logBytes1(bytes1 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0));
	}

	function logBytes2(bytes2 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0));
	}

	function logBytes3(bytes3 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0));
	}

	function logBytes4(bytes4 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0));
	}

	function logBytes5(bytes5 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0));
	}

	function logBytes6(bytes6 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0));
	}

	function logBytes7(bytes7 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0));
	}

	function logBytes8(bytes8 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0));
	}

	function logBytes9(bytes9 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0));
	}

	function logBytes10(bytes10 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0));
	}

	function logBytes11(bytes11 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0));
	}

	function logBytes12(bytes12 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0));
	}

	function logBytes13(bytes13 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0));
	}

	function logBytes14(bytes14 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0));
	}

	function logBytes15(bytes15 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0));
	}

	function logBytes16(bytes16 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0));
	}

	function logBytes17(bytes17 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0));
	}

	function logBytes18(bytes18 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0));
	}

	function logBytes19(bytes19 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0));
	}

	function logBytes20(bytes20 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0));
	}

	function logBytes21(bytes21 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0));
	}

	function logBytes22(bytes22 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0));
	}

	function logBytes23(bytes23 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0));
	}

	function logBytes24(bytes24 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0));
	}

	function logBytes25(bytes25 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0));
	}

	function logBytes26(bytes26 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0));
	}

	function logBytes27(bytes27 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0));
	}

	function logBytes28(bytes28 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0));
	}

	function logBytes29(bytes29 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0));
	}

	function logBytes30(bytes30 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0));
	}

	function logBytes31(bytes31 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0));
	}

	function logBytes32(bytes32 p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0));
	}

	function log(uint p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
	}

	function log(string memory p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string)", p0));
	}

	function log(bool p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
	}

	function log(address p0) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address)", p0));
	}

	function log(uint p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1));
	}

	function log(uint p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1));
	}

	function log(uint p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1));
	}

	function log(uint p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1));
	}

	function log(string memory p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1));
	}

	function log(string memory p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1));
	}

	function log(string memory p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1));
	}

	function log(string memory p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1));
	}

	function log(bool p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1));
	}

	function log(bool p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1));
	}

	function log(bool p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1));
	}

	function log(bool p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1));
	}

	function log(address p0, uint p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1));
	}

	function log(address p0, string memory p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1));
	}

	function log(address p0, bool p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1));
	}

	function log(address p0, address p1) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1));
	}

	function log(uint p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2));
	}

	function log(uint p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2));
	}

	function log(uint p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2));
	}

	function log(uint p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2));
	}

	function log(uint p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2));
	}

	function log(uint p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2));
	}

	function log(uint p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2));
	}

	function log(uint p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2));
	}

	function log(uint p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2));
	}

	function log(uint p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2));
	}

	function log(uint p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2));
	}

	function log(uint p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2));
	}

	function log(uint p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2));
	}

	function log(string memory p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2));
	}

	function log(string memory p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2));
	}

	function log(string memory p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2));
	}

	function log(string memory p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2));
	}

	function log(string memory p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2));
	}

	function log(string memory p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2));
	}

	function log(string memory p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2));
	}

	function log(bool p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2));
	}

	function log(bool p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2));
	}

	function log(bool p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2));
	}

	function log(bool p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2));
	}

	function log(bool p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2));
	}

	function log(bool p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2));
	}

	function log(bool p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2));
	}

	function log(bool p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2));
	}

	function log(bool p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2));
	}

	function log(bool p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2));
	}

	function log(bool p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2));
	}

	function log(bool p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2));
	}

	function log(bool p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2));
	}

	function log(address p0, uint p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2));
	}

	function log(address p0, uint p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2));
	}

	function log(address p0, uint p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2));
	}

	function log(address p0, uint p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2));
	}

	function log(address p0, string memory p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2));
	}

	function log(address p0, string memory p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2));
	}

	function log(address p0, string memory p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2));
	}

	function log(address p0, string memory p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2));
	}

	function log(address p0, bool p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2));
	}

	function log(address p0, bool p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2));
	}

	function log(address p0, bool p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2));
	}

	function log(address p0, bool p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2));
	}

	function log(address p0, address p1, uint p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2));
	}

	function log(address p0, address p1, string memory p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2));
	}

	function log(address p0, address p1, bool p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2));
	}

	function log(address p0, address p1, address p2) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2));
	}

	function log(uint p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3));
	}

	function log(uint p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3));
	}

	function log(string memory p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3));
	}

	function log(bool p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, uint p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, string memory p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, bool p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, uint p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, string memory p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, bool p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, uint p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, string memory p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, bool p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3));
	}

	function log(address p0, address p1, address p2, address p3) internal view {
		_sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3));
	}

}

File 9 of 20 : MintPassOptimized.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

import "@openzeppelin/contracts/utils/Address.sol";

import "hardhat/console.sol";
import "./DerivedERC2981Royalty.sol";

contract MintPassOptimized is ERC721, Ownable,  DerivedERC2981Royalty, IERC721Enumerable {
    using SafeMath for uint256;
    using Address for address;

    using Counters for Counters.Counter;
    mapping(uint256 => uint256) private mintedMAYC;
    mapping(uint256 => uint256) private mintedBAYC;

    address immutable BAYC;
    address immutable MAYC;
    address immutable DAPE;
    address RoyaltyReceiver;

    string constant _contractURI = "https://niftytailor.com/contracts/mintpass.json";
    string constant _tokenURI = "https://niftytailor.com/token/mintpass.json";

    uint256 constant AllowedNumberOfMintpasses = 10;
    uint256 constant MintPrice = 1 ether * 69 / 1000 ;
    uint256 constant MaxPerAddress = 50;
    uint256 constant MaxAllowed = 2500;

    Counters.Counter private _tokenIdCounter;
    uint256 immutable mintStartTime;

    // count burnt token number to calc totalSupply()
    uint256 private _burnt;

    event MintpassesMinted(address indexed requestor, uint indexed number, uint256 origins);
    event RoyaltyContractUpdate( address indexed newAddress );

    // mapping(uint256 => uint256) private _originsMintedCounters;
    mapping(address => uint256) private _mintedPerAddress;

    // function initialize(string memory name_, string memory symbol_, address perionAddress, address perionAdminAddress) public initializer
    constructor(string memory name_, string memory symbol_, address _bayc, address _mayc, address _dape, address _rr, uint256 _mintStartTime) ERC721(name_, symbol_) Ownable(){
        BAYC = _bayc;
        MAYC = _mayc;
        DAPE = _dape;
        _setRoyaltyContract(_rr);

        _tokenIdCounter.increment();

        // TODO update royalty value
        _setRoyalty(200); // 100 = 1%

        mintStartTime = _mintStartTime;
    }


    // required to solve inheritance
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721, DerivedERC2981Royalty) returns (bool) {
        return ERC721.supportsInterface(interfaceId) || DerivedERC2981Royalty.supportsInterface(interfaceId);
    }

    function royaltyInfo(uint256 tokenId, uint256 salePrice) external virtual override view
    returns (address receiver, uint256 royaltyAmount) {
        require(_exists(tokenId), "Token doesnt exist.");
        // receiver = _getTokenOwner(tokenId);
        receiver = RoyaltyReceiver;
        royaltyAmount = (_getRoyalty() * salePrice) / 10000;
    }

    function setRoyaltyContract(address newAddress) external onlyOwner {
        _setRoyaltyContract( newAddress );
    }

    function _setRoyaltyContract(address newAddress) internal {
        require(newAddress.isContract(), "Only Contract allowed");
        emit RoyaltyContractUpdate(newAddress);
        RoyaltyReceiver = newAddress;
    }

    function withdraw() public onlyOwner {
        uint balance = address(this).balance;
        (bool sent, ) = _msgSender().call{value: balance}("");
        require(sent, "Failed to send Ether");
    }

    function _getBalance(address _contract) internal view returns (uint256) {
        ERC721 t = ERC721(_contract);
        return t.balanceOf(_msgSender());
    }

    function mintedTotal() external view returns (uint256)  {
        return _tokenIdCounter.current() - 1;
    }

    function mintedForAddress( address addr ) external view returns (uint256)  {
        return _mintedPerAddress[addr];
    }

    function getMintStartTime() external view returns (uint256){
        return mintStartTime;
    }

    function mintMintPass( uint256 mintpassNumber ) external payable {
        require(block.timestamp >= mintStartTime, "Minting not started");
        _mintFor( mintpassNumber);
    }

    function _mintFor( uint256 mintpassNumber )  internal {
        // uint256 currentBalance = ERC721Upgradeable.balanceOf(_msgSender());
        uint256 minted = _mintedPerAddress[_msgSender()];

        require( MintPrice.mul(mintpassNumber) <= msg.value, "Ether value sent is not correct");
        
        require( MaxPerAddress >= (minted + mintpassNumber), "Too much MintPasses requested");
        require( MaxAllowed >= (_tokenIdCounter.current() - 1 + mintpassNumber), "Limit reached");
        // require( _isTokenOwner(erc721, tokenId), "Sender not an owner");

        uint256 originsNumber = _getBalance(BAYC) + _getBalance(MAYC);

        require(originsNumber * AllowedNumberOfMintpasses > minted, "Not enough origins.");
        require(originsNumber * AllowedNumberOfMintpasses - minted >= mintpassNumber, "Not enough origins");

        _mintedPerAddress[_msgSender()] = minted + mintpassNumber;
        
        for (uint i = 0; i < mintpassNumber; i++) {
            __mint(_msgSender());
        }

        emit MintpassesMinted( _msgSender(), mintpassNumber, originsNumber);
    }

    function useToken(uint256 tokenId, address sender) external returns (bool) {
        require (_msgSender() == DAPE, "Only Derived APE allowed");
        require (_exists(tokenId), "Non-existent token"); 
        require ( ownerOf(tokenId) == sender, "Requested by Non-owner"); 
        _burnt++;
        _burn(tokenId);
        return true;
    }

    // function setDAPE( address _dape) external onlyOwner {
    //     require (_dape != address(0), "Zero not allowed");
    //     DAPE = _dape;
    // }

    function contractURI() public pure returns (string memory) {
        return _contractURI;
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        return _tokenURI;
    }

    function __mint(address to) internal returns (uint256 currentId) {
        currentId = _tokenIdCounter.current();
        _tokenIdCounter.increment();
        _mint(to, currentId);
    }

        /**
     * Foreach all minted tokens until reached appropriate index
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < balanceOf(owner), "MP: owner index out of bounds");

        uint256 numMinted = _tokenIdCounter.current();
        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i = 1; i < numMinted; i++) {

                if (_exists(i) && (ownerOf(i) == owner) ){

                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx = tokenIdsIdx + 1;
                }
            }
        }

        // Execution should never reach this point.
        assert(false);
        // added to stop compiler warnings
        return 0;
    }

    function totalSupply() public view virtual override returns (uint256) {
        return _tokenIdCounter.current() - _burnt - 1;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        uint256 numMintedSoFar = _tokenIdCounter.current();

        require(index < totalSupply(), "MP: index out of bounds");

        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i = 1; i < numMintedSoFar; i++) {
                if (_exists(i)){
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        // Execution should never reach this point.
        assert(false);
        return 0;
    }

}

File 10 of 20 : DerivedERC2981Royalty.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/interfaces/IERC2981.sol";

// Max royalty value is 10000 (100%)
abstract contract DerivedERC2981Royalty is IERC2981 {

    event RoyaltyUpdated(uint256 value);

    uint256 private _royalty;

    function _setRoyalty(uint256 value ) internal {
        require(value <= 10000, "Royalty more that 100%" );
        emit RoyaltyUpdated(value);
        _royalty = value;
    }

    function _getRoyalty() internal view returns(uint256){
        return _royalty;
    }

    /// @dev Support for IERC-2981, royalties
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool)
    {
        return interfaceId == type(IERC2981).interfaceId;
    }
}

File 11 of 20 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 overriden 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 || getApproved(tokenId) == spender || isApprovedForAll(owner, 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 {}
}

File 12 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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 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);

    /**
     * @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;
}

File 13 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 14 of 20 : IERC721Metadata.sol
// 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);
}

File 15 of 20 : Context.sol
// 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;
    }
}

File 16 of 20 : ERC165.sol
// 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;
    }
}

File 17 of 20 : IERC165.sol
// 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);
}

File 18 of 20 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 19 of 20 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "./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 payed in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 20 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"_bayc","type":"address"},{"internalType":"address","name":"_mayc","type":"address"},{"internalType":"address","name":"_rr","type":"address"},{"internalType":"address","name":"_newUriChanger","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":"string","name":"uri","type":"string"}],"name":"BaseUriUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"MintEndUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"currentId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"mintpassId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"parent","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentOriginIndex","type":"uint256"}],"name":"MintPassUsed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"MintStartUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"NewMintPassAddress","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":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"RoyaltyContractUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"RoyaltyUpdated","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":true,"internalType":"address","name":"previousAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"UriChangerUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","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":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getParent","outputs":[{"components":[{"internalType":"address","name":"erc721","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct DerivedAPE.ERC721s","name":"","type":"tuple"}],"stateMutability":"view","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":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"mintpassId","type":"uint256"}],"internalType":"struct DerivedAPE.mintData[]","name":"data","type":"tuple[]"}],"name":"mintDerivedBAYC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"mintpassId","type":"uint256"},{"internalType":"string","name":"tokenURI","type":"string"}],"internalType":"struct DerivedAPE.mintDataWithUri[]","name":"data","type":"tuple[]"}],"name":"mintDerivedBAYCWithURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"mintpassId","type":"uint256"}],"internalType":"struct DerivedAPE.mintData[]","name":"data","type":"tuple[]"}],"name":"mintDerivedMAYC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"mintpassId","type":"uint256"},{"internalType":"string","name":"tokenURI","type":"string"}],"internalType":"struct DerivedAPE.mintDataWithUri[]","name":"data","type":"tuple[]"}],"name":"mintDerivedMAYCWithURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","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":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"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":"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":"uint256","name":"timestamp","type":"uint256"}],"name":"setMintEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setMintPass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"setMintStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setRoyaltyContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","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":"erc721","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOriginByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc721","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenOfOriginCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc721","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenOfOriginCounter","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":"address","name":"newAddress","type":"address"}],"name":"updateUriChanger","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b50604051620036ca380380620036ca833981016040819052620000349162000527565b80868681600090805190602001906200004f92919062000397565b5080516200006590600190602084019062000397565b505050620000826200007c6200011460201b60201c565b62000118565b6200008d816200016a565b506001600160a01b03808516608052831660a052620000ac82620001bc565b620000b96101f462000283565b6000620000ca4262093a80620005da565b9050620000d7816200030f565b620000f0620000ea8262ed4e00620005da565b62000347565b6200010760126200037f60201b620015bd1760201c565b505050505050506200063e565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f440b22f2c347b1fb7b850f182e7defb88ed393ebeb024d7b5e519d230c71e8f190600090a35050565b620001db816001600160a01b03166200038860201b620015c61760201c565b6200022d5760405162461bcd60e51b815260206004820152601560248201527f4f6e6c7920436f6e747261637420616c6c6f776564000000000000000000000060448201526064015b60405180910390fd5b6040516001600160a01b038216907fa76c8e48f977185bf48376c42b42ab1a673a562da65ec5d780c16a2977bad33190600090a2600e80546001600160a01b0319166001600160a01b0392909216919091179055565b612710811115620002d75760405162461bcd60e51b815260206004820152601660248201527f526f79616c7479206d6f72652074686174203130302500000000000000000000604482015260640162000224565b6040518181527f244ea8d7627f5a08f4299862bd5a45752842c183aee5b0fb0d1e4887bfa605b39060200160405180910390a1600955565b6040518181527f749367f044d538a4042f08aaaedf937cd4916a8130b0ee712ee0d38aa25c1fb59060200160405180910390a1601055565b6040518181527f7fca291d94792a53688201f27144e6f0e1a05bedfb1335b1ab220a7b15f2b30b9060200160405180910390a1601155565b80546001019055565b6001600160a01b03163b151590565b828054620003a59062000601565b90600052602060002090601f016020900481019282620003c9576000855562000414565b82601f10620003e457805160ff191683800117855562000414565b8280016001018555821562000414579182015b8281111562000414578251825591602001919060010190620003f7565b506200042292915062000426565b5090565b5b8082111562000422576000815560010162000427565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200046557600080fd5b81516001600160401b03808211156200048257620004826200043d565b604051601f8301601f19908116603f01168101908282118183101715620004ad57620004ad6200043d565b81604052838152602092508683858801011115620004ca57600080fd5b600091505b83821015620004ee5785820183015181830184015290820190620004cf565b83821115620005005760008385830101525b9695505050505050565b80516001600160a01b03811681146200052257600080fd5b919050565b60008060008060008060c087890312156200054157600080fd5b86516001600160401b03808211156200055957600080fd5b620005678a838b0162000453565b975060208901519150808211156200057e57600080fd5b506200058d89828a0162000453565b9550506200059e604088016200050a565b9350620005ae606088016200050a565b9250620005be608088016200050a565b9150620005ce60a088016200050a565b90509295509295509295565b60008219821115620005fc57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c908216806200061657607f821691505b602082108114156200063857634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a0516130586200067260003960008181610dd801526113cb015260008181610fb2015261149201526130586000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c80636352211e11610146578063b7dccd49116100c3578063d95ba0f811610087578063d95ba0f814610524578063d9aa187c14610537578063e723176a1461054a578063e8a3d4851461055d578063e985e9c514610565578063f2fde38b146105a157600080fd5b8063b7dccd49146104d0578063b88d4fde146104e3578063c87b56dd146104f6578063d0f72a7114610509578063d5b3621b1461051157600080fd5b80638065bcf11161010a5780638065bcf11461047e5780638da5cb5b1461049157806395d89b41146104a2578063a22cb465146104aa578063b2a9cfa6146104bd57600080fd5b80636352211e146104355780636bc6d6b4146104485780636c0360eb1461045b57806370a0823114610463578063715018a61461047657600080fd5b80632b9fcb96116101d457806342842e0e1161019857806342842e0e146103d657806342966c68146103e95780634ae3cc76146103fc5780634f6ccce71461040f57806355f804b31461042257600080fd5b80632b9fcb96146103695780632f745c591461037157806337b9db81146103845780633ccfd60b14610397578063414533de1461039f57600080fd5b8063162094c41161021b578063162094c4146102e857806317f37495146102fb57806318160ddd1461030e57806323b872dd146103245780632a55205a1461033757600080fd5b806301ffc9a71461025857806306fdde0314610280578063081812fc14610295578063095ea7b3146102c05780630a9d3ee6146102d5575b600080fd5b61026b610266366004612829565b6105b4565b60405190151581526020015b60405180910390f35b6102886105fa565b604051610277919061289e565b6102a86102a33660046128b1565b61068c565b6040516001600160a01b039091168152602001610277565b6102d36102ce3660046128df565b610719565b005b6102d36102e336600461290b565b61082f565b6102d36102f63660046129d4565b6108bb565b6102d36103093660046128b1565b61092b565b61031661095e565b604051908152602001610277565b6102d3610332366004612a1b565b610987565b61034a610345366004612a5c565b6109b9565b604080516001600160a01b039093168352602083019190915201610277565b601054610316565b61031661037f3660046128df565b610a3f565b610316610392366004612a7e565b610b1a565b6102d3610bb2565b6103b26103ad3660046128b1565b610c71565b6040805182516001600160a01b031681526020928301519281019290925201610277565b6102d36103e4366004612a1b565b610d02565b6102d36103f73660046128b1565b610d1d565b6102d361040a366004612ab3565b610d90565b61031661041d3660046128b1565b610e0f565b6102d3610430366004612b28565b610ec0565b6102a86104433660046128b1565b610ef3565b6102d3610456366004612ab3565b610f6a565b610288610fe9565b61031661047136600461290b565b610ff3565b6102d361107a565b61031661048c3660046128df565b6110b0565b6007546001600160a01b03166102a8565b6102886110e3565b6102d36104b8366004612b6b565b6110f2565b6102d36104cb36600461290b565b6110fd565b6103166104de3660046128df565b61117d565b6102d36104f1366004612ba4565b6111a1565b6102886105043660046128b1565b6111d9565b601154610316565b6102d361051f3660046128b1565b61133b565b6102d3610532366004612c24565b61136e565b6102d361054536600461290b565b611402565b6102d3610558366004612c24565b611435565b6102886114c9565b61026b610573366004612c87565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102d36105af36600461290b565b611525565b60006001600160e01b0319821663780e9d6360e01b14806105d957506105d9826115d5565b806105f4575063152a902d60e11b6001600160e01b03198316145b92915050565b60606000805461060990612cb5565b80601f016020809104026020016040519081016040528092919081815260200182805461063590612cb5565b80156106825780601f1061065757610100808354040283529160200191610682565b820191906000526020600020905b81548152906001019060200180831161066557829003601f168201915b5050505050905090565b600061069782611625565b6106fd5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061072482610ef3565b9050806001600160a01b0316836001600160a01b031614156107925760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106f4565b336001600160a01b03821614806107ae57506107ae8133610573565b6108205760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016106f4565b61082a8383611642565b505050565b6007546001600160a01b031633146108595760405162461bcd60e51b81526004016106f490612cf0565b6001600160a01b0381166108af5760405162461bcd60e51b815260206004820152601c60248201527f5572694368616e6765723a20416464726573732072657175697265640000000060448201526064016106f4565b6108b8816116b0565b50565b6008546001600160a01b031633146108e55760405162461bcd60e51b81526004016106f490612d25565b6108ef8282611702565b817fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b556572078260405161091f919061289e565b60405180910390a25050565b6007546001600160a01b031633146109555760405162461bcd60e51b81526004016106f490612cf0565b6108b88161178d565b6000600160145461096e60125490565b6109789190612d7c565b6109829190612d7c565b905090565b610992335b826117c5565b6109ae5760405162461bcd60e51b81526004016106f490612d93565b61082a8383836118ab565b6000806109c584611625565b610a075760405162461bcd60e51b81526020600482015260136024820152722a37b5b2b7103237b2b9b73a1032bc34b9ba1760691b60448201526064016106f4565b600e546001600160a01b0316915061271083610a2260095490565b610a2c9190612de4565b610a369190612e19565b90509250929050565b6000610a4a83610ff3565b8210610a985760405162461bcd60e51b815260206004820152601f60248201527f444150453a206f776e657220696e646578206f7574206f6620626f756e64730060448201526064016106f4565b6000610aa360125490565b9050600060015b82811015610b0657610abb81611625565b8015610ae05750856001600160a01b0316610ad582610ef3565b6001600160a01b0316145b15610afe5784821415610af75792506105f4915050565b8160010191505b600101610aaa565b50610b0f612e2d565b506000949350505050565b600080610b278585611a47565b6000818152600b60205260409020549091508310610b7d5760405162461bcd60e51b8152602060048201526013602482015272496e646578206f7574206f6620626f756e647360681b60448201526064016106f4565b6000818152600b60205260409020805484908110610b9d57610b9d612e43565b90600052602060002001549150509392505050565b6007546001600160a01b03163314610bdc5760405162461bcd60e51b81526004016106f490612cf0565b6040514790600090339083908381818185875af1925050503d8060008114610c20576040519150601f19603f3d011682016040523d82523d6000602084013e610c25565b606091505b5050905080610c6d5760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016106f4565b5050565b6040805180820190915260008082526020820152610c8e82611625565b610ccf5760405162461bcd60e51b81526020600482015260126024820152712737b716b2bc34b9ba32b73a103a37b5b2b760711b60448201526064016106f4565b506000908152600a6020908152604091829020825180840190935280546001600160a01b03168352600101549082015290565b61082a838383604051806020016040528060008152506111a1565b610d263361098c565b610d725760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420617070726f76656420616e64206e6f74206f776e657200000000000060448201526064016106f4565b60148054906000610d8283612e59565b91905055506108b881611ab2565b60005b8181101561082a57610dfc838383818110610db057610db0612e43565b90506040020160000135848484818110610dcc57610dcc612e43565b905060400201602001357f0000000000000000000000000000000000000000000000000000000000000000611beb565b5080610e0781612e59565b915050610d93565b600080610e1b60125490565b9050610e2561095e565b8310610e735760405162461bcd60e51b815260206004820152601960248201527f444150453a20696e646578206f7574206f6620626f756e64730000000000000060448201526064016106f4565b600060015b82811015610ead57610e8981611625565b15610ea55784821415610e9e57949350505050565b6001909101905b600101610e78565b50610eb6612e2d565b5060009392505050565b6008546001600160a01b03163314610eea5760405162461bcd60e51b81526004016106f490612d25565b6108b881611ef1565b6000818152600260205260408120546001600160a01b0316806105f45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016106f4565b60005b8181101561082a57610fd6838383818110610f8a57610f8a612e43565b90506040020160000135848484818110610fa657610fa6612e43565b905060400201602001357f0000000000000000000000000000000000000000000000000000000000000000611beb565b5080610fe181612e59565b915050610f6d565b6060610982611f3b565b60006001600160a01b03821661105e5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016106f4565b506001600160a01b031660009081526003602052604090205490565b6007546001600160a01b031633146110a45760405162461bcd60e51b81526004016106f490612cf0565b6110ae6000611f4a565b565b6000806110bd8484611a47565b6000818152600d60205260409020549091506110db90600190612d7c565b949350505050565b60606001805461060990612cb5565b610c6d338383611f9c565b6007546001600160a01b031633146111275760405162461bcd60e51b81526004016106f490612cf0565b6040516001600160a01b038216907faeda1ed6563e1cb2e00b9aebc2ab86176349d2d6433eb3f8fa2890a84b97e79290600090a2600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60008061118a8484611a47565b6000908152600b6020526040902054949350505050565b6111ab33836117c5565b6111c75760405162461bcd60e51b81526004016106f490612d93565b6111d38484848461206b565b50505050565b60606111e482611625565b61124a5760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b60648201526084016106f4565b6000828152600660205260408120805461126390612cb5565b80601f016020809104026020016040519081016040528092919081815260200182805461128f90612cb5565b80156112dc5780601f106112b1576101008083540402835291602001916112dc565b820191906000526020600020905b8154815290600101906020018083116112bf57829003601f168201915b5050505050905060006112ed611f3b565b9050805160001415611300575092915050565b81511561133257808260405160200161131a929190612e74565b60405160208183030381529060405292505050919050565b6110db8461209e565b6007546001600160a01b031633146113655760405162461bcd60e51b81526004016106f490612cf0565b6108b881612168565b60005b8181101561082a576113ef83838381811061138e5761138e612e43565b90506020028101906113a09190612ea3565b358484848181106113b3576113b3612e43565b90506020028101906113c59190612ea3565b602001357f0000000000000000000000000000000000000000000000000000000000000000611beb565b50806113fa81612e59565b915050611371565b6007546001600160a01b0316331461142c5760405162461bcd60e51b81526004016106f490612cf0565b6108b8816121a0565b60005b8181101561082a576114b683838381811061145557611455612e43565b90506020028101906114679190612ea3565b3584848481811061147a5761147a612e43565b905060200281019061148c9190612ea3565b602001357f0000000000000000000000000000000000000000000000000000000000000000611beb565b50806114c181612e59565b915050611438565b60606040518060400160405280601881526020017f68747470733a2f2f6e696674797461696c6f722e636f6d2f00000000000000008152506040516020016115119190612ec3565b604051602081830303815290604052905090565b6007546001600160a01b0316331461154f5760405162461bcd60e51b81526004016106f490612cf0565b6001600160a01b0381166115b45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106f4565b6108b881611f4a565b80546001019055565b6001600160a01b03163b151590565b60006001600160e01b031982166380ac58cd60e01b148061160657506001600160e01b03198216635b5e139f60e01b145b806105f457506301ffc9a760e01b6001600160e01b03198316146105f4565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061167782610ef3565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f440b22f2c347b1fb7b850f182e7defb88ed393ebeb024d7b5e519d230c71e8f190600090a35050565b61170b82611625565b61176e5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016106f4565b6000828152600660209081526040909120825161082a92840190612744565b6040518181527f7fca291d94792a53688201f27144e6f0e1a05bedfb1335b1ab220a7b15f2b30b9060200160405180910390a1601155565b60006117d082611625565b6118315760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016106f4565b600061183c83610ef3565b9050806001600160a01b0316846001600160a01b031614806118775750836001600160a01b031661186c8461068c565b6001600160a01b0316145b806110db57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff166110db565b826001600160a01b03166118be82610ef3565b6001600160a01b0316146119225760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016106f4565b6001600160a01b0382166119845760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106f4565b61198f600082611642565b6001600160a01b03831660009081526003602052604081208054600192906119b8908490612d7c565b90915550506001600160a01b03821660009081526003602052604081208054600192906119e6908490612efa565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000600160601b8210611a8e5760405162461bcd60e51b815260206004820152600f60248201526e151bdbc8189a59c81d1bdad95b9259608a1b60448201526064016106f4565b611aab826bffffffffffffffffffffffff19606086901b16612efa565b9392505050565b6000611abd82610c71565b90506000611ad382600001518360200151611a47565b6000848152600c6020908152604080832054848452600b90925282205492935091611b0090600190612d7c565b9050808214611b7b576000838152600b60205260408120805483908110611b2957611b29612e43565b9060005260206000200154905080600b60008681526020019081526020016000208481548110611b5b57611b5b612e43565b6000918252602080832090910192909255918252600c9052604090208290555b6000838152600b60205260409020805480611b9857611b98612f12565b600082815260208082208301600019908101839055909201909255868252600c81526040808320839055600a909152812080546001600160a01b031916815560010155611be485612245565b5050505050565b6000601054421015611c3f5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e6720686173206e6f74207374617274656400000000000000000060448201526064016106f4565b601154421115611c845760405162461bcd60e51b815260206004820152601060248201526f135a5b9d1a5b99c8199a5b9a5cda195960821b60448201526064016106f4565b611c8e8285612285565b611cda5760405162461bcd60e51b815260206004820152601b60248201527f4e65656420746f20626520616e206f776e657220746f206d696e74000000000060448201526064016106f4565b600f546001600160a01b031660008163f5a1b95986336040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381600087803b158015611d3757600080fd5b505af1158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6f9190612f28565b905080611db65760405162461bcd60e51b8152602060048201526015602482015274135a5b9d1c185cdcc8105b1c9958591e481d5cd959605a1b60448201526064016106f4565b6012546040805180820182526001600160a01b03878116825260208083018b81526000868152600a909252938120925183546001600160a01b03191692169190911782559151600190910155909350611e0f8588611a47565b6000818152600d6020908152604080832054600b8352908320805460018181018355828652938520018990559284905291549293509091611e509190612d7c565b6000868152600c6020526040902055611e6a816001612efa565b6000838152600d602052604090205533604080516001600160a01b038981168252602082018c9052918101849052911690889087907fa91dc1cd6acefbca2bdcd553b165aee2f9d2e8ef82fb0e2079d8cf95f26ccff99060600160405180910390a4611ed83360125461231e565b611ee6601280546001019055565b505050509392505050565b7fc35611e34b3940869a5132c8bc8ec4854192b0bfea25d0b9b38bcdeec2c09a7f81604051611f20919061289e565b60405180910390a18051610c6d906013906020840190612744565b60606013805461060990612cb5565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611ffe5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106f4565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6120768484846118ab565b61208284848484612338565b6111d35760405162461bcd60e51b81526004016106f490612f45565b60606120a982611625565b61210d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016106f4565b6000612117611f3b565b905060008151116121375760405180602001604052806000815250611aab565b8061214184612445565b604051602001612152929190612e74565b6040516020818303038152906040529392505050565b6040518181527f749367f044d538a4042f08aaaedf937cd4916a8130b0ee712ee0d38aa25c1fb59060200160405180910390a1601055565b6001600160a01b0381163b6121ef5760405162461bcd60e51b815260206004820152601560248201527413db9b1e4810dbdb9d1c9858dd08185b1b1bddd959605a1b60448201526064016106f4565b6040516001600160a01b038216907fa76c8e48f977185bf48376c42b42ab1a673a562da65ec5d780c16a2977bad33190600090a2600e80546001600160a01b0319166001600160a01b0392909216919091179055565b61224e81612543565b6000818152600660205260409020805461226790612cb5565b1590506108b85760008181526006602052604081206108b8916127c8565b6040516331a9108f60e11b81526004810182905260009083906001600160a01b03821690636352211e9060240160206040518083038186803b1580156122ca57600080fd5b505afa1580156122de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123029190612f97565b6001600160a01b0316336001600160a01b031614949350505050565b610c6d8282604051806020016040528060008152506125de565b60006001600160a01b0384163b1561243a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061237c903390899088908890600401612fb4565b602060405180830381600087803b15801561239657600080fd5b505af19250505080156123c6575060408051601f3d908101601f191682019092526123c391810190612ff1565b60015b612420573d8080156123f4576040519150601f19603f3d011682016040523d82523d6000602084013e6123f9565b606091505b5080516124185760405162461bcd60e51b81526004016106f490612f45565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506110db565b506001949350505050565b6060816124695750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612493578061247d81612e59565b915061248c9050600a83612e19565b915061246d565b60008167ffffffffffffffff8111156124ae576124ae612928565b6040519080825280601f01601f1916602001820160405280156124d8576020820181803683370190505b5090505b84156110db576124ed600183612d7c565b91506124fa600a8661300e565b612505906030612efa565b60f81b81838151811061251a5761251a612e43565b60200101906001600160f81b031916908160001a90535061253c600a86612e19565b94506124dc565b600061254e82610ef3565b905061255b600083611642565b6001600160a01b0381166000908152600360205260408120805460019290612584908490612d7c565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6125e88383612611565b6125f56000848484612338565b61082a5760405162461bcd60e51b81526004016106f490612f45565b6001600160a01b0382166126675760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106f4565b61267081611625565b156126bd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106f4565b6001600160a01b03821660009081526003602052604081208054600192906126e6908490612efa565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461275090612cb5565b90600052602060002090601f01602090048101928261277257600085556127b8565b82601f1061278b57805160ff19168380011785556127b8565b828001600101855582156127b8579182015b828111156127b857825182559160200191906001019061279d565b506127c49291506127fe565b5090565b5080546127d490612cb5565b6000825580601f106127e4575050565b601f0160209004906000526020600020908101906108b891905b5b808211156127c457600081556001016127ff565b6001600160e01b0319811681146108b857600080fd5b60006020828403121561283b57600080fd5b8135611aab81612813565b60005b83811015612861578181015183820152602001612849565b838111156111d35750506000910152565b6000815180845261288a816020860160208601612846565b601f01601f19169290920160200192915050565b602081526000611aab6020830184612872565b6000602082840312156128c357600080fd5b5035919050565b6001600160a01b03811681146108b857600080fd5b600080604083850312156128f257600080fd5b82356128fd816128ca565b946020939093013593505050565b60006020828403121561291d57600080fd5b8135611aab816128ca565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561295957612959612928565b604051601f8501601f19908116603f0116810190828211818310171561298157612981612928565b8160405280935085815286868601111561299a57600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126129c557600080fd5b611aab8383356020850161293e565b600080604083850312156129e757600080fd5b82359150602083013567ffffffffffffffff811115612a0557600080fd5b612a11858286016129b4565b9150509250929050565b600080600060608486031215612a3057600080fd5b8335612a3b816128ca565b92506020840135612a4b816128ca565b929592945050506040919091013590565b60008060408385031215612a6f57600080fd5b50508035926020909101359150565b600080600060608486031215612a9357600080fd5b8335612a9e816128ca565b95602085013595506040909401359392505050565b60008060208385031215612ac657600080fd5b823567ffffffffffffffff80821115612ade57600080fd5b818501915085601f830112612af257600080fd5b813581811115612b0157600080fd5b8660208260061b8501011115612b1657600080fd5b60209290920196919550909350505050565b600060208284031215612b3a57600080fd5b813567ffffffffffffffff811115612b5157600080fd5b6110db848285016129b4565b80151581146108b857600080fd5b60008060408385031215612b7e57600080fd5b8235612b89816128ca565b91506020830135612b9981612b5d565b809150509250929050565b60008060008060808587031215612bba57600080fd5b8435612bc5816128ca565b93506020850135612bd5816128ca565b925060408501359150606085013567ffffffffffffffff811115612bf857600080fd5b8501601f81018713612c0957600080fd5b612c188782356020840161293e565b91505092959194509250565b60008060208385031215612c3757600080fd5b823567ffffffffffffffff80821115612c4f57600080fd5b818501915085601f830112612c6357600080fd5b813581811115612c7257600080fd5b8660208260051b8501011115612b1657600080fd5b60008060408385031215612c9a57600080fd5b8235612ca5816128ca565b91506020830135612b99816128ca565b600181811c90821680612cc957607f821691505b60208210811415612cea57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f5572694368616e6765723a2063616c6c6572206973206e6f7420616c6c6f77656040820152601960fa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015612d8e57612d8e612d66565b500390565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000816000190483118215151615612dfe57612dfe612d66565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612e2857612e28612e03565b500490565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600019821415612e6d57612e6d612d66565b5060010190565b60008351612e86818460208801612846565b835190830190612e9a818360208801612846565b01949350505050565b60008235605e19833603018112612eb957600080fd5b9190910192915050565b60008251612ed5818460208701612846565b7231b7b73a3930b1ba3997b230b832973539b7b760691b920191825250601301919050565b60008219821115612f0d57612f0d612d66565b500190565b634e487b7160e01b600052603160045260246000fd5b600060208284031215612f3a57600080fd5b8151611aab81612b5d565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060208284031215612fa957600080fd5b8151611aab816128ca565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612fe790830184612872565b9695505050505050565b60006020828403121561300357600080fd5b8151611aab81612813565b60008261301d5761301d612e03565b50069056fea2646970667358221220319dccdb32e10f08bdbf823a3315de6ee0d7ef82923ab6af26c9d1bdd1a0fb0364736f6c6343000809003300000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d00000000000000000000000060e4d786628fea6478f785a6d7e704777c86a7c60000000000000000000000003d4f91ff3cbea085640a6964f062b445c2174f3b0000000000000000000000005814cf68dcb994e7ec81bb9097593a8ca540cf3e000000000000000000000000000000000000000000000000000000000000000a446572697665644150450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044441504500000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102535760003560e01c80636352211e11610146578063b7dccd49116100c3578063d95ba0f811610087578063d95ba0f814610524578063d9aa187c14610537578063e723176a1461054a578063e8a3d4851461055d578063e985e9c514610565578063f2fde38b146105a157600080fd5b8063b7dccd49146104d0578063b88d4fde146104e3578063c87b56dd146104f6578063d0f72a7114610509578063d5b3621b1461051157600080fd5b80638065bcf11161010a5780638065bcf11461047e5780638da5cb5b1461049157806395d89b41146104a2578063a22cb465146104aa578063b2a9cfa6146104bd57600080fd5b80636352211e146104355780636bc6d6b4146104485780636c0360eb1461045b57806370a0823114610463578063715018a61461047657600080fd5b80632b9fcb96116101d457806342842e0e1161019857806342842e0e146103d657806342966c68146103e95780634ae3cc76146103fc5780634f6ccce71461040f57806355f804b31461042257600080fd5b80632b9fcb96146103695780632f745c591461037157806337b9db81146103845780633ccfd60b14610397578063414533de1461039f57600080fd5b8063162094c41161021b578063162094c4146102e857806317f37495146102fb57806318160ddd1461030e57806323b872dd146103245780632a55205a1461033757600080fd5b806301ffc9a71461025857806306fdde0314610280578063081812fc14610295578063095ea7b3146102c05780630a9d3ee6146102d5575b600080fd5b61026b610266366004612829565b6105b4565b60405190151581526020015b60405180910390f35b6102886105fa565b604051610277919061289e565b6102a86102a33660046128b1565b61068c565b6040516001600160a01b039091168152602001610277565b6102d36102ce3660046128df565b610719565b005b6102d36102e336600461290b565b61082f565b6102d36102f63660046129d4565b6108bb565b6102d36103093660046128b1565b61092b565b61031661095e565b604051908152602001610277565b6102d3610332366004612a1b565b610987565b61034a610345366004612a5c565b6109b9565b604080516001600160a01b039093168352602083019190915201610277565b601054610316565b61031661037f3660046128df565b610a3f565b610316610392366004612a7e565b610b1a565b6102d3610bb2565b6103b26103ad3660046128b1565b610c71565b6040805182516001600160a01b031681526020928301519281019290925201610277565b6102d36103e4366004612a1b565b610d02565b6102d36103f73660046128b1565b610d1d565b6102d361040a366004612ab3565b610d90565b61031661041d3660046128b1565b610e0f565b6102d3610430366004612b28565b610ec0565b6102a86104433660046128b1565b610ef3565b6102d3610456366004612ab3565b610f6a565b610288610fe9565b61031661047136600461290b565b610ff3565b6102d361107a565b61031661048c3660046128df565b6110b0565b6007546001600160a01b03166102a8565b6102886110e3565b6102d36104b8366004612b6b565b6110f2565b6102d36104cb36600461290b565b6110fd565b6103166104de3660046128df565b61117d565b6102d36104f1366004612ba4565b6111a1565b6102886105043660046128b1565b6111d9565b601154610316565b6102d361051f3660046128b1565b61133b565b6102d3610532366004612c24565b61136e565b6102d361054536600461290b565b611402565b6102d3610558366004612c24565b611435565b6102886114c9565b61026b610573366004612c87565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102d36105af36600461290b565b611525565b60006001600160e01b0319821663780e9d6360e01b14806105d957506105d9826115d5565b806105f4575063152a902d60e11b6001600160e01b03198316145b92915050565b60606000805461060990612cb5565b80601f016020809104026020016040519081016040528092919081815260200182805461063590612cb5565b80156106825780601f1061065757610100808354040283529160200191610682565b820191906000526020600020905b81548152906001019060200180831161066557829003601f168201915b5050505050905090565b600061069782611625565b6106fd5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061072482610ef3565b9050806001600160a01b0316836001600160a01b031614156107925760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106f4565b336001600160a01b03821614806107ae57506107ae8133610573565b6108205760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016106f4565b61082a8383611642565b505050565b6007546001600160a01b031633146108595760405162461bcd60e51b81526004016106f490612cf0565b6001600160a01b0381166108af5760405162461bcd60e51b815260206004820152601c60248201527f5572694368616e6765723a20416464726573732072657175697265640000000060448201526064016106f4565b6108b8816116b0565b50565b6008546001600160a01b031633146108e55760405162461bcd60e51b81526004016106f490612d25565b6108ef8282611702565b817fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b556572078260405161091f919061289e565b60405180910390a25050565b6007546001600160a01b031633146109555760405162461bcd60e51b81526004016106f490612cf0565b6108b88161178d565b6000600160145461096e60125490565b6109789190612d7c565b6109829190612d7c565b905090565b610992335b826117c5565b6109ae5760405162461bcd60e51b81526004016106f490612d93565b61082a8383836118ab565b6000806109c584611625565b610a075760405162461bcd60e51b81526020600482015260136024820152722a37b5b2b7103237b2b9b73a1032bc34b9ba1760691b60448201526064016106f4565b600e546001600160a01b0316915061271083610a2260095490565b610a2c9190612de4565b610a369190612e19565b90509250929050565b6000610a4a83610ff3565b8210610a985760405162461bcd60e51b815260206004820152601f60248201527f444150453a206f776e657220696e646578206f7574206f6620626f756e64730060448201526064016106f4565b6000610aa360125490565b9050600060015b82811015610b0657610abb81611625565b8015610ae05750856001600160a01b0316610ad582610ef3565b6001600160a01b0316145b15610afe5784821415610af75792506105f4915050565b8160010191505b600101610aaa565b50610b0f612e2d565b506000949350505050565b600080610b278585611a47565b6000818152600b60205260409020549091508310610b7d5760405162461bcd60e51b8152602060048201526013602482015272496e646578206f7574206f6620626f756e647360681b60448201526064016106f4565b6000818152600b60205260409020805484908110610b9d57610b9d612e43565b90600052602060002001549150509392505050565b6007546001600160a01b03163314610bdc5760405162461bcd60e51b81526004016106f490612cf0565b6040514790600090339083908381818185875af1925050503d8060008114610c20576040519150601f19603f3d011682016040523d82523d6000602084013e610c25565b606091505b5050905080610c6d5760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064016106f4565b5050565b6040805180820190915260008082526020820152610c8e82611625565b610ccf5760405162461bcd60e51b81526020600482015260126024820152712737b716b2bc34b9ba32b73a103a37b5b2b760711b60448201526064016106f4565b506000908152600a6020908152604091829020825180840190935280546001600160a01b03168352600101549082015290565b61082a838383604051806020016040528060008152506111a1565b610d263361098c565b610d725760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420617070726f76656420616e64206e6f74206f776e657200000000000060448201526064016106f4565b60148054906000610d8283612e59565b91905055506108b881611ab2565b60005b8181101561082a57610dfc838383818110610db057610db0612e43565b90506040020160000135848484818110610dcc57610dcc612e43565b905060400201602001357f00000000000000000000000060e4d786628fea6478f785a6d7e704777c86a7c6611beb565b5080610e0781612e59565b915050610d93565b600080610e1b60125490565b9050610e2561095e565b8310610e735760405162461bcd60e51b815260206004820152601960248201527f444150453a20696e646578206f7574206f6620626f756e64730000000000000060448201526064016106f4565b600060015b82811015610ead57610e8981611625565b15610ea55784821415610e9e57949350505050565b6001909101905b600101610e78565b50610eb6612e2d565b5060009392505050565b6008546001600160a01b03163314610eea5760405162461bcd60e51b81526004016106f490612d25565b6108b881611ef1565b6000818152600260205260408120546001600160a01b0316806105f45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016106f4565b60005b8181101561082a57610fd6838383818110610f8a57610f8a612e43565b90506040020160000135848484818110610fa657610fa6612e43565b905060400201602001357f000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d611beb565b5080610fe181612e59565b915050610f6d565b6060610982611f3b565b60006001600160a01b03821661105e5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016106f4565b506001600160a01b031660009081526003602052604090205490565b6007546001600160a01b031633146110a45760405162461bcd60e51b81526004016106f490612cf0565b6110ae6000611f4a565b565b6000806110bd8484611a47565b6000818152600d60205260409020549091506110db90600190612d7c565b949350505050565b60606001805461060990612cb5565b610c6d338383611f9c565b6007546001600160a01b031633146111275760405162461bcd60e51b81526004016106f490612cf0565b6040516001600160a01b038216907faeda1ed6563e1cb2e00b9aebc2ab86176349d2d6433eb3f8fa2890a84b97e79290600090a2600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60008061118a8484611a47565b6000908152600b6020526040902054949350505050565b6111ab33836117c5565b6111c75760405162461bcd60e51b81526004016106f490612d93565b6111d38484848461206b565b50505050565b60606111e482611625565b61124a5760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b60648201526084016106f4565b6000828152600660205260408120805461126390612cb5565b80601f016020809104026020016040519081016040528092919081815260200182805461128f90612cb5565b80156112dc5780601f106112b1576101008083540402835291602001916112dc565b820191906000526020600020905b8154815290600101906020018083116112bf57829003601f168201915b5050505050905060006112ed611f3b565b9050805160001415611300575092915050565b81511561133257808260405160200161131a929190612e74565b60405160208183030381529060405292505050919050565b6110db8461209e565b6007546001600160a01b031633146113655760405162461bcd60e51b81526004016106f490612cf0565b6108b881612168565b60005b8181101561082a576113ef83838381811061138e5761138e612e43565b90506020028101906113a09190612ea3565b358484848181106113b3576113b3612e43565b90506020028101906113c59190612ea3565b602001357f00000000000000000000000060e4d786628fea6478f785a6d7e704777c86a7c6611beb565b50806113fa81612e59565b915050611371565b6007546001600160a01b0316331461142c5760405162461bcd60e51b81526004016106f490612cf0565b6108b8816121a0565b60005b8181101561082a576114b683838381811061145557611455612e43565b90506020028101906114679190612ea3565b3584848481811061147a5761147a612e43565b905060200281019061148c9190612ea3565b602001357f000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d611beb565b50806114c181612e59565b915050611438565b60606040518060400160405280601881526020017f68747470733a2f2f6e696674797461696c6f722e636f6d2f00000000000000008152506040516020016115119190612ec3565b604051602081830303815290604052905090565b6007546001600160a01b0316331461154f5760405162461bcd60e51b81526004016106f490612cf0565b6001600160a01b0381166115b45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106f4565b6108b881611f4a565b80546001019055565b6001600160a01b03163b151590565b60006001600160e01b031982166380ac58cd60e01b148061160657506001600160e01b03198216635b5e139f60e01b145b806105f457506301ffc9a760e01b6001600160e01b03198316146105f4565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061167782610ef3565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f440b22f2c347b1fb7b850f182e7defb88ed393ebeb024d7b5e519d230c71e8f190600090a35050565b61170b82611625565b61176e5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016106f4565b6000828152600660209081526040909120825161082a92840190612744565b6040518181527f7fca291d94792a53688201f27144e6f0e1a05bedfb1335b1ab220a7b15f2b30b9060200160405180910390a1601155565b60006117d082611625565b6118315760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016106f4565b600061183c83610ef3565b9050806001600160a01b0316846001600160a01b031614806118775750836001600160a01b031661186c8461068c565b6001600160a01b0316145b806110db57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff166110db565b826001600160a01b03166118be82610ef3565b6001600160a01b0316146119225760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016106f4565b6001600160a01b0382166119845760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106f4565b61198f600082611642565b6001600160a01b03831660009081526003602052604081208054600192906119b8908490612d7c565b90915550506001600160a01b03821660009081526003602052604081208054600192906119e6908490612efa565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000600160601b8210611a8e5760405162461bcd60e51b815260206004820152600f60248201526e151bdbc8189a59c81d1bdad95b9259608a1b60448201526064016106f4565b611aab826bffffffffffffffffffffffff19606086901b16612efa565b9392505050565b6000611abd82610c71565b90506000611ad382600001518360200151611a47565b6000848152600c6020908152604080832054848452600b90925282205492935091611b0090600190612d7c565b9050808214611b7b576000838152600b60205260408120805483908110611b2957611b29612e43565b9060005260206000200154905080600b60008681526020019081526020016000208481548110611b5b57611b5b612e43565b6000918252602080832090910192909255918252600c9052604090208290555b6000838152600b60205260409020805480611b9857611b98612f12565b600082815260208082208301600019908101839055909201909255868252600c81526040808320839055600a909152812080546001600160a01b031916815560010155611be485612245565b5050505050565b6000601054421015611c3f5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e6720686173206e6f74207374617274656400000000000000000060448201526064016106f4565b601154421115611c845760405162461bcd60e51b815260206004820152601060248201526f135a5b9d1a5b99c8199a5b9a5cda195960821b60448201526064016106f4565b611c8e8285612285565b611cda5760405162461bcd60e51b815260206004820152601b60248201527f4e65656420746f20626520616e206f776e657220746f206d696e74000000000060448201526064016106f4565b600f546001600160a01b031660008163f5a1b95986336040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381600087803b158015611d3757600080fd5b505af1158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6f9190612f28565b905080611db65760405162461bcd60e51b8152602060048201526015602482015274135a5b9d1c185cdcc8105b1c9958591e481d5cd959605a1b60448201526064016106f4565b6012546040805180820182526001600160a01b03878116825260208083018b81526000868152600a909252938120925183546001600160a01b03191692169190911782559151600190910155909350611e0f8588611a47565b6000818152600d6020908152604080832054600b8352908320805460018181018355828652938520018990559284905291549293509091611e509190612d7c565b6000868152600c6020526040902055611e6a816001612efa565b6000838152600d602052604090205533604080516001600160a01b038981168252602082018c9052918101849052911690889087907fa91dc1cd6acefbca2bdcd553b165aee2f9d2e8ef82fb0e2079d8cf95f26ccff99060600160405180910390a4611ed83360125461231e565b611ee6601280546001019055565b505050509392505050565b7fc35611e34b3940869a5132c8bc8ec4854192b0bfea25d0b9b38bcdeec2c09a7f81604051611f20919061289e565b60405180910390a18051610c6d906013906020840190612744565b60606013805461060990612cb5565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03161415611ffe5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106f4565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6120768484846118ab565b61208284848484612338565b6111d35760405162461bcd60e51b81526004016106f490612f45565b60606120a982611625565b61210d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016106f4565b6000612117611f3b565b905060008151116121375760405180602001604052806000815250611aab565b8061214184612445565b604051602001612152929190612e74565b6040516020818303038152906040529392505050565b6040518181527f749367f044d538a4042f08aaaedf937cd4916a8130b0ee712ee0d38aa25c1fb59060200160405180910390a1601055565b6001600160a01b0381163b6121ef5760405162461bcd60e51b815260206004820152601560248201527413db9b1e4810dbdb9d1c9858dd08185b1b1bddd959605a1b60448201526064016106f4565b6040516001600160a01b038216907fa76c8e48f977185bf48376c42b42ab1a673a562da65ec5d780c16a2977bad33190600090a2600e80546001600160a01b0319166001600160a01b0392909216919091179055565b61224e81612543565b6000818152600660205260409020805461226790612cb5565b1590506108b85760008181526006602052604081206108b8916127c8565b6040516331a9108f60e11b81526004810182905260009083906001600160a01b03821690636352211e9060240160206040518083038186803b1580156122ca57600080fd5b505afa1580156122de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123029190612f97565b6001600160a01b0316336001600160a01b031614949350505050565b610c6d8282604051806020016040528060008152506125de565b60006001600160a01b0384163b1561243a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061237c903390899088908890600401612fb4565b602060405180830381600087803b15801561239657600080fd5b505af19250505080156123c6575060408051601f3d908101601f191682019092526123c391810190612ff1565b60015b612420573d8080156123f4576040519150601f19603f3d011682016040523d82523d6000602084013e6123f9565b606091505b5080516124185760405162461bcd60e51b81526004016106f490612f45565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506110db565b506001949350505050565b6060816124695750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612493578061247d81612e59565b915061248c9050600a83612e19565b915061246d565b60008167ffffffffffffffff8111156124ae576124ae612928565b6040519080825280601f01601f1916602001820160405280156124d8576020820181803683370190505b5090505b84156110db576124ed600183612d7c565b91506124fa600a8661300e565b612505906030612efa565b60f81b81838151811061251a5761251a612e43565b60200101906001600160f81b031916908160001a90535061253c600a86612e19565b94506124dc565b600061254e82610ef3565b905061255b600083611642565b6001600160a01b0381166000908152600360205260408120805460019290612584908490612d7c565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6125e88383612611565b6125f56000848484612338565b61082a5760405162461bcd60e51b81526004016106f490612f45565b6001600160a01b0382166126675760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106f4565b61267081611625565b156126bd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106f4565b6001600160a01b03821660009081526003602052604081208054600192906126e6908490612efa565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461275090612cb5565b90600052602060002090601f01602090048101928261277257600085556127b8565b82601f1061278b57805160ff19168380011785556127b8565b828001600101855582156127b8579182015b828111156127b857825182559160200191906001019061279d565b506127c49291506127fe565b5090565b5080546127d490612cb5565b6000825580601f106127e4575050565b601f0160209004906000526020600020908101906108b891905b5b808211156127c457600081556001016127ff565b6001600160e01b0319811681146108b857600080fd5b60006020828403121561283b57600080fd5b8135611aab81612813565b60005b83811015612861578181015183820152602001612849565b838111156111d35750506000910152565b6000815180845261288a816020860160208601612846565b601f01601f19169290920160200192915050565b602081526000611aab6020830184612872565b6000602082840312156128c357600080fd5b5035919050565b6001600160a01b03811681146108b857600080fd5b600080604083850312156128f257600080fd5b82356128fd816128ca565b946020939093013593505050565b60006020828403121561291d57600080fd5b8135611aab816128ca565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561295957612959612928565b604051601f8501601f19908116603f0116810190828211818310171561298157612981612928565b8160405280935085815286868601111561299a57600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126129c557600080fd5b611aab8383356020850161293e565b600080604083850312156129e757600080fd5b82359150602083013567ffffffffffffffff811115612a0557600080fd5b612a11858286016129b4565b9150509250929050565b600080600060608486031215612a3057600080fd5b8335612a3b816128ca565b92506020840135612a4b816128ca565b929592945050506040919091013590565b60008060408385031215612a6f57600080fd5b50508035926020909101359150565b600080600060608486031215612a9357600080fd5b8335612a9e816128ca565b95602085013595506040909401359392505050565b60008060208385031215612ac657600080fd5b823567ffffffffffffffff80821115612ade57600080fd5b818501915085601f830112612af257600080fd5b813581811115612b0157600080fd5b8660208260061b8501011115612b1657600080fd5b60209290920196919550909350505050565b600060208284031215612b3a57600080fd5b813567ffffffffffffffff811115612b5157600080fd5b6110db848285016129b4565b80151581146108b857600080fd5b60008060408385031215612b7e57600080fd5b8235612b89816128ca565b91506020830135612b9981612b5d565b809150509250929050565b60008060008060808587031215612bba57600080fd5b8435612bc5816128ca565b93506020850135612bd5816128ca565b925060408501359150606085013567ffffffffffffffff811115612bf857600080fd5b8501601f81018713612c0957600080fd5b612c188782356020840161293e565b91505092959194509250565b60008060208385031215612c3757600080fd5b823567ffffffffffffffff80821115612c4f57600080fd5b818501915085601f830112612c6357600080fd5b813581811115612c7257600080fd5b8660208260051b8501011115612b1657600080fd5b60008060408385031215612c9a57600080fd5b8235612ca5816128ca565b91506020830135612b99816128ca565b600181811c90821680612cc957607f821691505b60208210811415612cea57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f5572694368616e6765723a2063616c6c6572206973206e6f7420616c6c6f77656040820152601960fa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015612d8e57612d8e612d66565b500390565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000816000190483118215151615612dfe57612dfe612d66565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612e2857612e28612e03565b500490565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600019821415612e6d57612e6d612d66565b5060010190565b60008351612e86818460208801612846565b835190830190612e9a818360208801612846565b01949350505050565b60008235605e19833603018112612eb957600080fd5b9190910192915050565b60008251612ed5818460208701612846565b7231b7b73a3930b1ba3997b230b832973539b7b760691b920191825250601301919050565b60008219821115612f0d57612f0d612d66565b500190565b634e487b7160e01b600052603160045260246000fd5b600060208284031215612f3a57600080fd5b8151611aab81612b5d565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060208284031215612fa957600080fd5b8151611aab816128ca565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612fe790830184612872565b9695505050505050565b60006020828403121561300357600080fd5b8151611aab81612813565b60008261301d5761301d612e03565b50069056fea2646970667358221220319dccdb32e10f08bdbf823a3315de6ee0d7ef82923ab6af26c9d1bdd1a0fb0364736f6c63430008090033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d00000000000000000000000060e4d786628fea6478f785a6d7e704777c86a7c60000000000000000000000003d4f91ff3cbea085640a6964f062b445c2174f3b0000000000000000000000005814cf68dcb994e7ec81bb9097593a8ca540cf3e000000000000000000000000000000000000000000000000000000000000000a446572697665644150450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044441504500000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): DerivedAPE
Arg [1] : symbol_ (string): DAPE
Arg [2] : _bayc (address): 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D
Arg [3] : _mayc (address): 0x60E4d786628Fea6478F785A6d7e704777c86a7c6
Arg [4] : _rr (address): 0x3d4f91FF3cbEa085640A6964F062B445c2174f3b
Arg [5] : _newUriChanger (address): 0x5814cf68Dcb994e7Ec81bB9097593a8cA540Cf3E

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d
Arg [3] : 00000000000000000000000060e4d786628fea6478f785a6d7e704777c86a7c6
Arg [4] : 0000000000000000000000003d4f91ff3cbea085640a6964f062b445c2174f3b
Arg [5] : 0000000000000000000000005814cf68dcb994e7ec81bb9097593a8ca540cf3e
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 4465726976656441504500000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [9] : 4441504500000000000000000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.