ETH Price: $3,340.96 (+0.59%)

Contract

0x4e57a7CE50336FA69C25C86d32d541aE0B9fB235
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw All144013222022-03-17 2:23:541017 days ago1647483834IN
0x4e57a7CE...E0B9fB235
0 ETH0.0009581229.15785643
Mint Public143901392022-03-15 8:39:281018 days ago1647333568IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0004597115.97113542
Set Allow List M...143880332022-03-15 0:38:231019 days ago1647304703IN
0x4e57a7CE...E0B9fB235
0 ETH0.0008156834.16900188
Mint Allow List143880242022-03-15 0:35:511019 days ago1647304551IN
0x4e57a7CE...E0B9fB235
1.554 ETH0.0135887727.1816245
Set Public Mint ...143878712022-03-15 0:03:031019 days ago1647302583IN
0x4e57a7CE...E0B9fB235
0 ETH0.0006537722.7559203
Mint Public143878492022-03-14 23:59:151019 days ago1647302355IN
0x4e57a7CE...E0B9fB235
0.1554 ETH0.006969534.0159899
Mint Public143878482022-03-14 23:59:001019 days ago1647302340IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.005309435.60872431
Mint Public143877932022-03-14 23:46:411019 days ago1647301601IN
0x4e57a7CE...E0B9fB235
0.777 ETH0.0124949238.35623107
Mint Public143876872022-03-14 23:21:111019 days ago1647300071IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.003539226.37614879
Mint Public143876222022-03-14 23:09:221019 days ago1647299362IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0056112739.60776939
Mint Public143876142022-03-14 23:07:031019 days ago1647299223IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.005320530.22550299
Mint Public143876062022-03-14 23:05:491019 days ago1647299149IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0051607636.09658117
Mint Public143875642022-03-14 22:56:131019 days ago1647298573IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0073369336.20514677
Mint Public143875002022-03-14 22:43:521019 days ago1647297832IN
0x4e57a7CE...E0B9fB235
0.6993 ETH0.0130107340.2369506
Mint Public143874972022-03-14 22:42:541019 days ago1647297774IN
0x4e57a7CE...E0B9fB235
0.1554 ETH0.0060313637.43513953
Mint Public143873042022-03-14 21:58:341019 days ago1647295114IN
0x4e57a7CE...E0B9fB235
0.5439 ETH0.0091811337.1229377
Mint Public143869392022-03-14 20:37:391019 days ago1647290259IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0056834832.32374369
Mint Public143860992022-03-14 17:29:351019 days ago1647278975IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0048283227.4601675
Mint Public143857712022-03-14 16:23:091019 days ago1647274989IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0099166656.37412813
Mint Public143857422022-03-14 16:15:021019 days ago1647274502IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.00825344.94217745
Mint Public143827382022-03-14 5:01:211020 days ago1647234081IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0033422219.00830217
Mint Public143825682022-03-14 4:24:021020 days ago1647231842IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.003516620
Mint Public143819342022-03-14 2:02:501020 days ago1647223370IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0046828223.11570826
Mint Public143819082022-03-14 1:58:301020 days ago1647223110IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0049243426.81581122
Mint Public143818812022-03-14 1:50:591020 days ago1647222659IN
0x4e57a7CE...E0B9fB235
0.0777 ETH0.0042710524.26572343
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
144013222022-03-17 2:23:541017 days ago1647483834
0x4e57a7CE...E0B9fB235
69.8523 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ADBoosterPacks

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion, MIT license
File 1 of 22 : ADBoosterPacks.sol
//SPDX-License-Identifier: MIT
/*
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -- -- - -- - -- - -- - -- - -- - -- - --
-  ______     __   __     ______     __  __     _____     ______     __    __     __     ______     __   __     -
- /\  __ \   /\ "-.\ \   /\  ___\   /\ \/ /    /\  __-.  /\  __ \   /\ "-./  \   /\ \   /\  __ \   /\ "-.\ \    -
- \ \  __ \  \ \ \-.  \  \ \  __\   \ \  _"-.  \ \ \/\ \ \ \  __ \  \ \ \-./\ \  \ \ \  \ \  __ \  \ \ \-.  \   -
-  \ \_\ \_\  \ \_\\"\_\  \ \_____\  \ \_\ \_\  \ \____-  \ \_\ \_\  \ \_\ \ \_\  \ \_\  \ \_\ \_\  \ \_\\"\_\  -
-   \/_/\/_/   \/_/ \/_/   \/_____/   \/_/\/_/   \/____/   \/_/\/_/   \/_/  \/_/   \/_/   \/_/\/_/   \/_/ \/_/  -
-                                                                                                               -    
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -- -- - -- - -- - -- - -- - -- - -- - --


*/
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

interface IADToken {
    function mint(uint256, address) external;
}

contract ADBoosterPacks is Ownable, ReentrancyGuard {
    IADToken private adTrainers;
    IADToken private adElementals;
    address public signerAddress;
    uint256 public constant tokenPrice = 0.0777 ether;
    uint256 public constant MAX_SUPPLY = 7770;
    uint256 public constant MAX_RESERVED = 100;
    uint256 public totalSupply = 0;
    uint256 public publicMintPerTxLimit = 2;
    uint256 public reserved;

    bool public allowListMintActive;
    bool public publicMintActive;

    mapping(address => uint256) public presaleMinted;

    modifier callerIsUser() {
        require(msg.sender == tx.origin, "Failed EOA check");
        _;
    }

    // ============ OWNER-ONLY ADMIN FUNCTIONS ============

    function setTokenAddresses(
        address _adElementalAddress,
        address _adTrainerAddress
    ) external onlyOwner {
        adElementals = IADToken(_adElementalAddress);
        adTrainers = IADToken(_adTrainerAddress);
    }

    function setPublicMintPerTxLimit(uint256 _limit) external onlyOwner {
        publicMintPerTxLimit = _limit;
    }

    function setPublicMintActive(bool val) public onlyOwner {
        publicMintActive = val;
    }

    function setAllowListMintActive(bool val) public onlyOwner {
        allowListMintActive = val;
    }

    function setSignerAddress(address _signerAddress) external onlyOwner {
        signerAddress = _signerAddress;
    }

    function withdrawAll() public onlyOwner nonReentrant {
        uint256 balance = address(this).balance;
        require(balance > 0);
        _widthdraw(owner(), address(this).balance);
    }

    function _widthdraw(address _address, uint256 _amount) private {
        (bool success, ) = _address.call{value: _amount}("");
        require(success, "Transfer failed");
    }

    // ============ PUBLIC FUNCTIONS FOR MINTING ============

    function mintPublic(uint256 _amount)
        external
        payable
        callerIsUser
        nonReentrant
    {
        require(publicMintActive, "Public mint has not started");
        require(
            _amount <= publicMintPerTxLimit,
            "Exceeded public mint per tx limit"
        );

        unchecked {
            uint256 supply = totalSupply;
            require(supply + _amount <= MAX_SUPPLY, "Exceeded max supply");
            totalSupply = supply + _amount;

            require(msg.value == _amount * tokenPrice, "Invalid amount of ETH");
        }

        _mint(_amount, msg.sender);
    }

    function mintAllowList(
        uint256 _amount,
        bytes memory _signature,
        uint256 _eligibleAmount
    ) external payable callerIsUser nonReentrant {
        require(allowListMintActive, "Allowlist mint has not started");
        require(
            verifySignature(
                keccak256(abi.encodePacked(msg.sender, _eligibleAmount)),
                _signature
            ),
            "Invalid signature"
        );
        require(
            _amount <= _eligibleAmount,
            "Mint amount exceeds eligible amount"
        );

        unchecked {
            uint256 minted = presaleMinted[msg.sender];
            require(
                minted + _amount <= _eligibleAmount,
                "Exceeded alowlist mint limit"
            );
            presaleMinted[msg.sender] = minted + _amount;

            uint256 supply = totalSupply;
            require(supply + _amount <= MAX_SUPPLY, "Exceeded max supply");
            totalSupply = supply + _amount;

            require(msg.value == _amount * tokenPrice, "Invalid amount of ETH");
        }

        _mint(_amount, msg.sender);
    }

    function reserve(uint256 _amount, address _to)
        external
        nonReentrant
        onlyOwner
    {
        unchecked {
            require(
                reserved + _amount <= MAX_RESERVED,
                "Exceeds maximum number of reserved tokens"
            );
            require(totalSupply + _amount <= MAX_SUPPLY, "Insufficient supply");
            totalSupply += _amount;
            reserved += _amount;
        }

        _mint(_amount, _to);
    }

    // ============ INTERNAL UTIL FUNCTIONS ============

    function _mint(uint256 _amount, address _to) private {
        adTrainers.mint(_amount, _to);
        adElementals.mint(_amount, _to);
    }

    function verifySignature(bytes32 _hash, bytes memory _signature)
        internal
        view
        returns (bool)
    {
        address recoveredAddress = ECDSA.recover(
            ECDSA.toEthSignedMessageHash(_hash),
            _signature
        );
        return (recoveredAddress != address(0) &&
            recoveredAddress == signerAddress);
    }
}

File 2 of 22 : 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 3 of 22 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 22 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 5 of 22 : 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 6 of 22 : 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 7 of 22 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
 *
 * Does not support burning tokens to address(0).
 *
 * Assumes that an owner cannot have more than the 2**128 - 1 (max value of uint128) of supply
 */
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;

    struct TokenOwnership {
        address addr;
        uint64 startTimestamp;
    }

    struct AddressData {
        uint128 balance;
        uint128 numberMinted;
    }

    uint256 internal currentIndex;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

    // 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;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return currentIndex;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        require(index < totalSupply(), 'ERC721A: global index out of bounds');
        return index;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        require(index < balanceOf(owner), 'ERC721A: owner index out of bounds');
        uint256 numMintedSoFar = totalSupply();
        uint256 tokenIdsIdx;
        address currOwnershipAddr;

        // Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        revert('ERC721A: unable to get token of owner by index');
    }

    /**
     * @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 ||
            interfaceId == type(IERC721Enumerable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        require(owner != address(0), 'ERC721A: balance query for the zero address');
        return uint256(_addressData[owner].balance);
    }

    function _numberMinted(address owner) internal view returns (uint256) {
        require(owner != address(0), 'ERC721A: number minted query for the zero address');
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        require(_exists(tokenId), 'ERC721A: owner query for nonexistent token');

        unchecked {
            for (uint256 curr = tokenId; curr >= 0; curr--) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (ownership.addr != address(0)) {
                    return ownership;
                }
            }
        }

        revert('ERC721A: unable to determine the owner of token');
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return ownershipOf(tokenId).addr;
    }

    /**
     * @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 override {
        address owner = ERC721A.ownerOf(tokenId);
        require(to != owner, 'ERC721A: approval to current owner');

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            'ERC721A: approve caller is not owner nor approved for all'
        );

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        require(_exists(tokenId), 'ERC721A: approved query for nonexistent token');

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public override {
        require(operator != _msgSender(), 'ERC721A: approve to caller');

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_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 override {
        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public override {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, _data),
            'ERC721A: 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`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return tokenId < currentIndex;
    }

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity, _data, true);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = currentIndex;
        require(to != address(0), 'ERC721A: mint to the zero address');
        require(quantity != 0, 'ERC721A: quantity must be greater than 0');

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
        // updatedIndex overflows if currentIndex + quantity > 1.56e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint128(quantity);
            _addressData[to].numberMinted += uint128(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;

            for (uint256 i; i < quantity; i++) {
                emit Transfer(address(0), to, updatedIndex);
                if (safe) {
                    require(
                        _checkOnERC721Received(address(0), to, updatedIndex, _data),
                        'ERC721A: transfer to non ERC721Receiver implementer'
                    );
                }

                updatedIndex++;
            }

            currentIndex = updatedIndex;
        }

        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) private {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
            getApproved(tokenId) == _msgSender() ||
            isApprovedForAll(prevOwnership.addr, _msgSender()));

        require(isApprovedOrOwner, 'ERC721A: transfer caller is not owner nor approved');

        require(prevOwnership.addr == from, 'ERC721A: transfer from incorrect owner');
        require(to != address(0), 'ERC721A: transfer to the zero address');

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, prevOwnership.addr);

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            _ownerships[tokenId].addr = to;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                if (_exists(nextTokenId)) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        address owner
    ) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @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(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert('ERC721A: transfer to non ERC721Receiver implementer');
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * 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`.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

File 8 of 22 : 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 9 of 22 : 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 10 of 22 : 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 11 of 22 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 tokenId);

    /**
     * @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 12 of 22 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 13 of 22 : 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 14 of 22 : 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 15 of 22 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 16 of 22 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

    // Mapping from account to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC1155).interfaceId ||
            interfaceId == type(IERC1155MetadataURI).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC1155-isApprovedForAll}.
     */
    function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[account][operator];
    }

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);
    }

    /**
     * @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, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

File 17 of 22 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 18 of 22 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 19 of 22 : ERC1155Supply.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Supply.sol)

pragma solidity ^0.8.0;

import "../ERC1155.sol";

/**
 * @dev Extension of ERC1155 that adds tracking of total supply per id.
 *
 * Useful for scenarios where Fungible and Non-fungible tokens have to be
 * clearly identified. Note: While a totalSupply of 1 might mean the
 * corresponding is an NFT, there is no guarantees that no other token with the
 * same id are not going to be minted.
 */
abstract contract ERC1155Supply is ERC1155 {
    mapping(uint256 => uint256) private _totalSupply;

    /**
     * @dev Total amount of tokens in with a given id.
     */
    function totalSupply(uint256 id) public view virtual returns (uint256) {
        return _totalSupply[id];
    }

    /**
     * @dev Indicates whether any token exist with a given id, or not.
     */
    function exists(uint256 id) public view virtual returns (bool) {
        return ERC1155Supply.totalSupply(id) > 0;
    }

    /**
     * @dev See {ERC1155-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                _totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                _totalSupply[ids[i]] -= amounts[i];
            }
        }
    }
}

File 20 of 22 : ADElementals.sol
// SPDX-License-Identifier: MIT
/*
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -- -- - -- - -- - -- - -- - -- - -- - --
-  ______     __   __     ______     __  __     _____     ______     __    __     __     ______     __   __     -
- /\  __ \   /\ "-.\ \   /\  ___\   /\ \/ /    /\  __-.  /\  __ \   /\ "-./  \   /\ \   /\  __ \   /\ "-.\ \    -
- \ \  __ \  \ \ \-.  \  \ \  __\   \ \  _"-.  \ \ \/\ \ \ \  __ \  \ \ \-./\ \  \ \ \  \ \  __ \  \ \ \-.  \   -
-  \ \_\ \_\  \ \_\\"\_\  \ \_____\  \ \_\ \_\  \ \____-  \ \_\ \_\  \ \_\ \ \_\  \ \_\  \ \_\ \_\  \ \_\\"\_\  -
-   \/_/\/_/   \/_/ \/_/   \/_____/   \/_/\/_/   \/____/   \/_/\/_/   \/_/  \/_/   \/_/   \/_/\/_/   \/_/ \/_/  -
-                                                                                                               -    
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -- -- - -- - -- - -- - -- - -- - -- - --


*/

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

interface IADRandomizer {
    function rand(address) external view returns (uint256);
}

contract ADElementals is ERC1155Supply, ERC1155Burnable, Ownable {
    using Strings for uint256;

    // Token IDs
    uint256 public constant GRASS = 0;
    uint256 public constant WATER = 1;
    uint256 public constant FIRE = 2;
    uint256 public constant PSYCHIC = 3;
    uint256 public constant SPECIAL = 4;

    uint256 public constant ELEMENTALS_PER_BATCH = 3;

    string private name_;
    string private symbol_;

    address public adBoosterPackAddress;
    address private adRandomizerAddress;

    IADRandomizer adRandomizer;

    // ============ ACCESS CONTROL/SANITY MODIFIERS ============

    modifier callerIsADBoosterPack() {
        require(
            msg.sender == adBoosterPackAddress,
            "Caller is not ADBoosterPack contract"
        );
        _;
    }

    constructor(
        address _adBoosterPackAddress,
        address _adRandomizerAddress,
        string memory _name,
        string memory _symbol,
        string memory _uri
    ) ERC1155(_uri) {
        adBoosterPackAddress = _adBoosterPackAddress;
        adRandomizer = IADRandomizer(_adRandomizerAddress);
        name_ = _name;
        symbol_ = _symbol;
    }

    // ============ PUBLIC FUNCTIONS FOR MINTING ============

    /**
     * @dev Generic mint function to be called by the ADBoosterPacks contract for both
     * whitelist and public sales.
     * Can only be called by the ADBoosterPacks contract.
     * Probability of minting each Elemental card:
     * - special 3%
     * - psychic 12%
     * - fire 15%
     * - water 30%
     * - grass 40%
     */
    function mint(uint256 _batch, address _to) external callerIsADBoosterPack {
        unchecked {
            uint256 numElementals = _batch * ELEMENTALS_PER_BATCH;
            uint256[] memory randomValues = expandRandomness(
                rand(_to),
                numElementals
            );
            for (uint256 i = 0; i < numElementals; i++) {
                uint256 rarityScore = randomValues[i] % 100;

                if (rarityScore < 40) {
                    _mint(_to, GRASS, 1, "");
                } else if (rarityScore < 70) {
                    _mint(_to, WATER, 1, "");
                } else if (rarityScore < 85) {
                    _mint(_to, FIRE, 1, "");
                } else if (rarityScore < 97) {
                    _mint(_to, PSYCHIC, 1, "");
                } else {
                    _mint(_to, SPECIAL, 1, "");
                }
            }
        }
    }

    // ============ PUBLIC READ-ONLY FUNCTIONS ============

    function name() public view returns (string memory) {
        return name_;
    }

    function symbol() public view returns (string memory) {
        return symbol_;
    }

    function uri(uint256 _id) public view override returns (string memory) {
        require(exists(_id), "Nonexistent token");

        return string(abi.encodePacked(super.uri(_id), _id.toString()));
    }

    // ============ INTERNAL UTIL FUNCTIONS ============

    function expandRandomness(uint256 randomValue, uint256 n)
        internal
        pure
        returns (uint256[] memory expandedValues)
    {
        expandedValues = new uint256[](n);
        for (uint256 i = 0; i < n; i++) {
            expandedValues[i] = uint256(keccak256(abi.encode(randomValue, i)));
        }
        return expandedValues;
    }

    function rand(address _to) internal view returns (uint256 randomValue) {
        randomValue = adRandomizer.rand(_to);
    }

    // ============ OWNER-ONLY ADMIN FUNCTIONS ============

    function setADBoosterPackAddress(address _adBoosterPackAddress)
        external
        onlyOwner
    {
        adBoosterPackAddress = _adBoosterPackAddress;
    }

    function setADRandomizerAddress(address _adRandomizerAddress)
        external
        onlyOwner
    {
        adRandomizerAddress = _adRandomizerAddress;
    }

    function setBaseURI(string memory _baseURI) external onlyOwner {
        _setURI(_baseURI);
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override(ERC1155, ERC1155Supply) {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }
}

File 21 of 22 : ERC1155Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC1155.sol";

/**
 * @dev Extension of {ERC1155} that allows token holders to destroy both their
 * own tokens and those that they have been approved to use.
 *
 * _Available since v3.1._
 */
abstract contract ERC1155Burnable is ERC1155 {
    function burn(
        address account,
        uint256 id,
        uint256 value
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burn(account, id, value);
    }

    function burnBatch(
        address account,
        uint256[] memory ids,
        uint256[] memory values
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burnBatch(account, ids, values);
    }
}

File 22 of 22 : ADTrainers.sol
//SPDX-License-Identifier: MIT
/*
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -- -- - -- - -- - -- - -- - -- - -- - --
-  ______     __   __     ______     __  __     _____     ______     __    __     __     ______     __   __     -
- /\  __ \   /\ "-.\ \   /\  ___\   /\ \/ /    /\  __-.  /\  __ \   /\ "-./  \   /\ \   /\  __ \   /\ "-.\ \    -
- \ \  __ \  \ \ \-.  \  \ \  __\   \ \  _"-.  \ \ \/\ \ \ \  __ \  \ \ \-./\ \  \ \ \  \ \  __ \  \ \ \-.  \   -
-  \ \_\ \_\  \ \_\\"\_\  \ \_____\  \ \_\ \_\  \ \____-  \ \_\ \_\  \ \_\ \ \_\  \ \_\  \ \_\ \_\  \ \_\\"\_\  -
-   \/_/\/_/   \/_/ \/_/   \/_____/   \/_/\/_/   \/____/   \/_/\/_/   \/_/  \/_/   \/_/   \/_/\/_/   \/_/ \/_/  -
-                                                                                                               -    
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -- -- - -- - -- - -- - -- - -- - -- - --


*/

pragma solidity ^0.8.4;

import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract ADTrainers is ERC721A, Ownable {
    address public adBoosterPackAddress;
    uint256 public constant MAX_SUPPLY = 7770;
    bool public revealed;

    // URI settings
    string public baseTokenURI;
    string public placeholderURI;

    // These proxy address will be approved to interact
    // with ADTrainers for future staking and gaming features
    mapping(address => bool) public proxyToApprove;

    constructor(
        address _adBoosterPackAddress,
        string memory _name,
        string memory _symbol
    ) ERC721A(_name, _symbol) {
        adBoosterPackAddress = _adBoosterPackAddress;
    }

    // ============ ACCESS CONTROL/SANITY MODIFIERS ============

    modifier callerIsADBoosterPack() {
        require(
            msg.sender == adBoosterPackAddress,
            "Caller is not ADBoosterPack contract"
        );
        _;
    }

    // ============ PUBLIC FUNCTIONS FOR MINTING ============

    /**
     * @dev Generic mint function to be called by the ADBoosterPacks contract for both
     * whitelist and public sales.
     * Can only be called by the ADBoosterPacks contract.
     */
    function mint(uint256 _quantity, address _to)
        external
        callerIsADBoosterPack
    {
        require(
            totalSupply() + _quantity <= MAX_SUPPLY,
            "Max supply has been reached"
        );
        _safeMint(_to, _quantity);
    }

    // ============ PUBLIC READ-ONLY FUNCTIONS ============

    function tokenURI(uint256 _id)
        public
        view
        virtual
        override
        returns (string memory)
    {
        require(_exists(_id), "Nonexistent token");

        return revealed ? super.tokenURI(_id) : placeholderURI;
    }

    function numberMinted(address _owner) public view returns (uint256) {
        return _numberMinted(_owner);
    }

    function tokensOfOwner(address _owner)
        external
        view
        returns (uint256[] memory)
    {
        uint256 tokenCount = balanceOf(_owner);

        uint256[] memory tokensIds = new uint256[](tokenCount);
        for (uint256 i; i < tokenCount; i++) {
            tokensIds[i] = tokenOfOwnerByIndex(_owner, i);
        }
        return tokensIds;
    }

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

    function isApprovedForAll(address _owner, address _operator)
        public
        view
        override
        returns (bool)
    {
        if (proxyToApprove[_operator]) {
            return true;
        }

        return super.isApprovedForAll(_owner, _operator);
    }

    // ============ OWNER-ONLY ADMIN FUNCTIONS ============

    function setADBoosterPackAddress(address _adBoosterPackAddress)
        external
        onlyOwner
    {
        adBoosterPackAddress = _adBoosterPackAddress;
    }

    function setBaseURI(string calldata _URI) external onlyOwner {
        baseTokenURI = _URI;
    }

    function setPlaceholderURI(string memory _URI) external onlyOwner {
        placeholderURI = _URI;
    }

    function flipRevealed() external onlyOwner {
        revealed = !revealed;
    }

    function flipProxyState(address _proxyAddress) external onlyOwner {
        proxyToApprove[_proxyAddress] = !proxyToApprove[_proxyAddress];
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 500
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_RESERVED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowListMintActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"uint256","name":"_eligibleAmount","type":"uint256"}],"name":"mintAllowList","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"presaleMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintPerTxLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"reserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserved","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"val","type":"bool"}],"name":"setAllowListMintActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"val","type":"bool"}],"name":"setPublicMintActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"setPublicMintPerTxLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signerAddress","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_adElementalAddress","type":"address"},{"internalType":"address","name":"_adTrainerAddress","type":"address"}],"name":"setTokenAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000600555600260065534801561001a57600080fd5b506100243361002d565b6001805561007d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6116578061008c6000396000f3fe6080604052600436106101555760003560e01c80637ff9b596116100bb578063b67c25a31161007f578063f2fde38b11610059578063f2fde38b146103a4578063f3340be9146103c4578063fe60d12c146103de57600080fd5b8063b67c25a314610335578063bc660cac14610364578063efd0cbf91461039157600080fd5b80637ff9b596146102b0578063853828b6146102cc5780638da5cb5b146102e15780639f93a16f146102ff578063a89c8c5e1461031557600080fd5b80634a5360301161011d5780636c387d94116100f75780636c387d9414610268578063715018a61461028857806377e9227a1461029d57600080fd5b80634a536030146101fb5780635b7633d01461021b5780636ba90c6e1461025357600080fd5b806303339bcb1461015a578063046dc1661461017c57806318160ddd1461019c5780632b707c71146101c557806332cb6b0c146101e5575b600080fd5b34801561016657600080fd5b5061017a61017536600461150b565b6103f4565b005b34801561018857600080fd5b5061017a610197366004611480565b610578565b3480156101a857600080fd5b506101b260055481565b6040519081526020015b60405180910390f35b3480156101d157600080fd5b5061017a6101e03660046114d3565b6105e2565b3480156101f157600080fd5b506101b2611e5a81565b34801561020757600080fd5b5061017a6102163660046114d3565b610644565b34801561022757600080fd5b5060045461023b906001600160a01b031681565b6040516001600160a01b0390911681526020016101bc565b34801561025f57600080fd5b506101b2606481565b34801561027457600080fd5b5061017a6102833660046114f3565b61069f565b34801561029457600080fd5b5061017a6106ec565b61017a6102ab36600461152d565b610740565b3480156102bc57600080fd5b506101b26701140bbd030c400081565b3480156102d857600080fd5b5061017a610a48565b3480156102ed57600080fd5b506000546001600160a01b031661023b565b34801561030b57600080fd5b506101b260065481565b34801561032157600080fd5b5061017a6103303660046114a1565b610b15565b34801561034157600080fd5b5060085461035490610100900460ff1681565b60405190151581526020016101bc565b34801561037057600080fd5b506101b261037f366004611480565b60096020526000908152604090205481565b61017a61039f3660046114f3565b610b8b565b3480156103b057600080fd5b5061017a6103bf366004611480565b610d87565b3480156103d057600080fd5b506008546103549060ff1681565b3480156103ea57600080fd5b506101b260075481565b6002600154141561044c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001556000546001600160a01b031633146104995760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b6064826007540111156105005760405162461bcd60e51b815260206004820152602960248201527f45786365656473206d6178696d756d206e756d626572206f6620726573657276604482015268656420746f6b656e7360b81b6064820152608401610443565b611e5a826005540111156105565760405162461bcd60e51b815260206004820152601360248201527f496e73756666696369656e7420737570706c79000000000000000000000000006044820152606401610443565b600580548301905560078054830190556105708282610e40565b505060018055565b6000546001600160a01b031633146105c05760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062a5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600880549115156101000261ff0019909216919091179055565b6000546001600160a01b0316331461068c5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b6008805460ff1916911515919091179055565b6000546001600160a01b031633146106e75760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600655565b6000546001600160a01b031633146107345760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b61073e6000610f10565b565b3332146107825760405162461bcd60e51b815260206004820152601060248201526f4661696c656420454f4120636865636b60801b6044820152606401610443565b600260015414156107d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610443565b600260015560085460ff1661082c5760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f776c697374206d696e7420686173206e6f74207374617274656400006044820152606401610443565b6040516bffffffffffffffffffffffff193360601b16602082015260348101829052610871906054016040516020818303038152906040528051906020012083610f60565b6108bd5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610443565b808311156109195760405162461bcd60e51b815260206004820152602360248201527f4d696e7420616d6f756e74206578636565647320656c696769626c6520616d6f6044820152621d5b9d60ea1b6064820152608401610443565b3360009081526009602052604090205483810182101561097b5760405162461bcd60e51b815260206004820152601c60248201527f457863656564656420616c6f776c697374206d696e74206c696d6974000000006044820152606401610443565b3360009081526009602052604090208185019055600554611e5a81860111156109dc5760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b6044820152606401610443565b808501600555346701140bbd030c4000860214610a335760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840c2dadeeadce840decc408aa89605b1b6044820152606401610443565b5050610a3f8333610e40565b50506001805550565b6000546001600160a01b03163314610a905760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b60026001541415610ae35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610443565b60026001554780610af357600080fd5b610b0e610b086000546001600160a01b031690565b47610ff2565b5060018055565b6000546001600160a01b03163314610b5d5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600380546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b333214610bcd5760405162461bcd60e51b815260206004820152601060248201526f4661696c656420454f4120636865636b60801b6044820152606401610443565b60026001541415610c205760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610443565b6002600155600854610100900460ff16610c7c5760405162461bcd60e51b815260206004820152601b60248201527f5075626c6963206d696e7420686173206e6f74207374617274656400000000006044820152606401610443565b600654811115610cd85760405162461bcd60e51b815260206004820152602160248201527f4578636565646564207075626c6963206d696e7420706572207478206c696d696044820152601d60fa1b6064820152608401610443565b600554611e5a8282011115610d255760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b6044820152606401610443565b808201600555346701140bbd030c4000830214610d7c5760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840c2dadeeadce840decc408aa89605b1b6044820152606401610443565b50610b0e8133610e40565b6000546001600160a01b03163314610dcf5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b6001600160a01b038116610e345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610443565b610e3d81610f10565b50565b6002546040516394bf804d60e01b8152600481018490526001600160a01b038381166024830152909116906394bf804d90604401600060405180830381600087803b158015610e8e57600080fd5b505af1158015610ea2573d6000803e3d6000fd5b50506003546040516394bf804d60e01b8152600481018690526001600160a01b03858116602483015290911692506394bf804d9150604401600060405180830381600087803b158015610ef457600080fd5b505af1158015610f08573d6000803e3d6000fd5b505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080610fc3610fbd856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b8461109a565b90506001600160a01b03811615801590610fea57506004546001600160a01b038281169116145b949350505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461103f576040519150601f19603f3d011682016040523d82523d6000602084013e611044565b606091505b50509050806110955760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606401610443565b505050565b60008060006110a985856110be565b915091506110b68161112e565b509392505050565b6000808251604114156110f55760208301516040840151606085015160001a6110e98782858561132f565b94509450505050611127565b82516040141561111f576020830151604084015161111486838361141c565b935093505050611127565b506000905060025b9250929050565b600081600481111561115057634e487b7160e01b600052602160045260246000fd5b14156111595750565b600181600481111561117b57634e487b7160e01b600052602160045260246000fd5b14156111c95760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610443565b60028160048111156111eb57634e487b7160e01b600052602160045260246000fd5b14156112395760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610443565b600381600481111561125b57634e487b7160e01b600052602160045260246000fd5b14156112b45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610443565b60048160048111156112d657634e487b7160e01b600052602160045260246000fd5b1415610e3d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610443565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113665750600090506003611413565b8460ff16601b1415801561137e57508460ff16601c14155b1561138f5750600090506004611413565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156113e3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661140c57600060019250925050611413565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b016114568782888561132f565b935093505050935093915050565b80356001600160a01b038116811461147b57600080fd5b919050565b600060208284031215611491578081fd5b61149a82611464565b9392505050565b600080604083850312156114b3578081fd5b6114bc83611464565b91506114ca60208401611464565b90509250929050565b6000602082840312156114e4578081fd5b8135801515811461149a578182fd5b600060208284031215611504578081fd5b5035919050565b6000806040838503121561151d578182fd5b823591506114ca60208401611464565b600080600060608486031215611541578081fd5b83359250602084013567ffffffffffffffff8082111561155f578283fd5b818601915086601f830112611572578283fd5b813581811115611584576115846115eb565b604051601f8201601f19908116603f011681019083821181831017156115ac576115ac6115eb565b816040528281528960208487010111156115c4578586fd5b82602086016020830137918201602001949094529497949650505050604092909201359150565b634e487b7160e01b600052604160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220996fe4df7537cc8ae814ee4497e96df7aec4136334aa329cb9833fcea09b20b964736f6c63430008040033

Deployed Bytecode

0x6080604052600436106101555760003560e01c80637ff9b596116100bb578063b67c25a31161007f578063f2fde38b11610059578063f2fde38b146103a4578063f3340be9146103c4578063fe60d12c146103de57600080fd5b8063b67c25a314610335578063bc660cac14610364578063efd0cbf91461039157600080fd5b80637ff9b596146102b0578063853828b6146102cc5780638da5cb5b146102e15780639f93a16f146102ff578063a89c8c5e1461031557600080fd5b80634a5360301161011d5780636c387d94116100f75780636c387d9414610268578063715018a61461028857806377e9227a1461029d57600080fd5b80634a536030146101fb5780635b7633d01461021b5780636ba90c6e1461025357600080fd5b806303339bcb1461015a578063046dc1661461017c57806318160ddd1461019c5780632b707c71146101c557806332cb6b0c146101e5575b600080fd5b34801561016657600080fd5b5061017a61017536600461150b565b6103f4565b005b34801561018857600080fd5b5061017a610197366004611480565b610578565b3480156101a857600080fd5b506101b260055481565b6040519081526020015b60405180910390f35b3480156101d157600080fd5b5061017a6101e03660046114d3565b6105e2565b3480156101f157600080fd5b506101b2611e5a81565b34801561020757600080fd5b5061017a6102163660046114d3565b610644565b34801561022757600080fd5b5060045461023b906001600160a01b031681565b6040516001600160a01b0390911681526020016101bc565b34801561025f57600080fd5b506101b2606481565b34801561027457600080fd5b5061017a6102833660046114f3565b61069f565b34801561029457600080fd5b5061017a6106ec565b61017a6102ab36600461152d565b610740565b3480156102bc57600080fd5b506101b26701140bbd030c400081565b3480156102d857600080fd5b5061017a610a48565b3480156102ed57600080fd5b506000546001600160a01b031661023b565b34801561030b57600080fd5b506101b260065481565b34801561032157600080fd5b5061017a6103303660046114a1565b610b15565b34801561034157600080fd5b5060085461035490610100900460ff1681565b60405190151581526020016101bc565b34801561037057600080fd5b506101b261037f366004611480565b60096020526000908152604090205481565b61017a61039f3660046114f3565b610b8b565b3480156103b057600080fd5b5061017a6103bf366004611480565b610d87565b3480156103d057600080fd5b506008546103549060ff1681565b3480156103ea57600080fd5b506101b260075481565b6002600154141561044c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001556000546001600160a01b031633146104995760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b6064826007540111156105005760405162461bcd60e51b815260206004820152602960248201527f45786365656473206d6178696d756d206e756d626572206f6620726573657276604482015268656420746f6b656e7360b81b6064820152608401610443565b611e5a826005540111156105565760405162461bcd60e51b815260206004820152601360248201527f496e73756666696369656e7420737570706c79000000000000000000000000006044820152606401610443565b600580548301905560078054830190556105708282610e40565b505060018055565b6000546001600160a01b031633146105c05760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062a5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600880549115156101000261ff0019909216919091179055565b6000546001600160a01b0316331461068c5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b6008805460ff1916911515919091179055565b6000546001600160a01b031633146106e75760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600655565b6000546001600160a01b031633146107345760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b61073e6000610f10565b565b3332146107825760405162461bcd60e51b815260206004820152601060248201526f4661696c656420454f4120636865636b60801b6044820152606401610443565b600260015414156107d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610443565b600260015560085460ff1661082c5760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f776c697374206d696e7420686173206e6f74207374617274656400006044820152606401610443565b6040516bffffffffffffffffffffffff193360601b16602082015260348101829052610871906054016040516020818303038152906040528051906020012083610f60565b6108bd5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610443565b808311156109195760405162461bcd60e51b815260206004820152602360248201527f4d696e7420616d6f756e74206578636565647320656c696769626c6520616d6f6044820152621d5b9d60ea1b6064820152608401610443565b3360009081526009602052604090205483810182101561097b5760405162461bcd60e51b815260206004820152601c60248201527f457863656564656420616c6f776c697374206d696e74206c696d6974000000006044820152606401610443565b3360009081526009602052604090208185019055600554611e5a81860111156109dc5760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b6044820152606401610443565b808501600555346701140bbd030c4000860214610a335760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840c2dadeeadce840decc408aa89605b1b6044820152606401610443565b5050610a3f8333610e40565b50506001805550565b6000546001600160a01b03163314610a905760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b60026001541415610ae35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610443565b60026001554780610af357600080fd5b610b0e610b086000546001600160a01b031690565b47610ff2565b5060018055565b6000546001600160a01b03163314610b5d5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b600380546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b333214610bcd5760405162461bcd60e51b815260206004820152601060248201526f4661696c656420454f4120636865636b60801b6044820152606401610443565b60026001541415610c205760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610443565b6002600155600854610100900460ff16610c7c5760405162461bcd60e51b815260206004820152601b60248201527f5075626c6963206d696e7420686173206e6f74207374617274656400000000006044820152606401610443565b600654811115610cd85760405162461bcd60e51b815260206004820152602160248201527f4578636565646564207075626c6963206d696e7420706572207478206c696d696044820152601d60fa1b6064820152608401610443565b600554611e5a8282011115610d255760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b6044820152606401610443565b808201600555346701140bbd030c4000830214610d7c5760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840c2dadeeadce840decc408aa89605b1b6044820152606401610443565b50610b0e8133610e40565b6000546001600160a01b03163314610dcf5760405162461bcd60e51b815260206004820181905260248201526000805160206116028339815191526044820152606401610443565b6001600160a01b038116610e345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610443565b610e3d81610f10565b50565b6002546040516394bf804d60e01b8152600481018490526001600160a01b038381166024830152909116906394bf804d90604401600060405180830381600087803b158015610e8e57600080fd5b505af1158015610ea2573d6000803e3d6000fd5b50506003546040516394bf804d60e01b8152600481018690526001600160a01b03858116602483015290911692506394bf804d9150604401600060405180830381600087803b158015610ef457600080fd5b505af1158015610f08573d6000803e3d6000fd5b505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080610fc3610fbd856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b8461109a565b90506001600160a01b03811615801590610fea57506004546001600160a01b038281169116145b949350505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461103f576040519150601f19603f3d011682016040523d82523d6000602084013e611044565b606091505b50509050806110955760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606401610443565b505050565b60008060006110a985856110be565b915091506110b68161112e565b509392505050565b6000808251604114156110f55760208301516040840151606085015160001a6110e98782858561132f565b94509450505050611127565b82516040141561111f576020830151604084015161111486838361141c565b935093505050611127565b506000905060025b9250929050565b600081600481111561115057634e487b7160e01b600052602160045260246000fd5b14156111595750565b600181600481111561117b57634e487b7160e01b600052602160045260246000fd5b14156111c95760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610443565b60028160048111156111eb57634e487b7160e01b600052602160045260246000fd5b14156112395760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610443565b600381600481111561125b57634e487b7160e01b600052602160045260246000fd5b14156112b45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610443565b60048160048111156112d657634e487b7160e01b600052602160045260246000fd5b1415610e3d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610443565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113665750600090506003611413565b8460ff16601b1415801561137e57508460ff16601c14155b1561138f5750600090506004611413565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156113e3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661140c57600060019250925050611413565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b016114568782888561132f565b935093505050935093915050565b80356001600160a01b038116811461147b57600080fd5b919050565b600060208284031215611491578081fd5b61149a82611464565b9392505050565b600080604083850312156114b3578081fd5b6114bc83611464565b91506114ca60208401611464565b90509250929050565b6000602082840312156114e4578081fd5b8135801515811461149a578182fd5b600060208284031215611504578081fd5b5035919050565b6000806040838503121561151d578182fd5b823591506114ca60208401611464565b600080600060608486031215611541578081fd5b83359250602084013567ffffffffffffffff8082111561155f578283fd5b818601915086601f830112611572578283fd5b813581811115611584576115846115eb565b604051601f8201601f19908116603f011681019083821181831017156115ac576115ac6115eb565b816040528281528960208487010111156115c4578586fd5b82602086016020830137918201602001949094529497949650505050604092909201359150565b634e487b7160e01b600052604160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220996fe4df7537cc8ae814ee4497e96df7aec4136334aa329cb9833fcea09b20b964736f6c63430008040033

Deployed Bytecode Sourcemap

1230:4659:18:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4845:472;;;;;;;;;;-1:-1:-1;4845:472:18;;;;;:::i;:::-;;:::i;:::-;;2518:116;;;;;;;;;;-1:-1:-1;2518:116:18;;;;;:::i;:::-;;:::i;1540:30::-;;;;;;;;;;;;;;;;;;;11442:25:22;;;11430:2;11415:18;1540:30:18;;;;;;;;2310:95;;;;;;;;;;-1:-1:-1;2310:95:18;;;;;:::i;:::-;;:::i;1445:41::-;;;;;;;;;;;;1482:4;1445:41;;2411:101;;;;;;;;;;-1:-1:-1;2411:101:18;;;;;:::i;:::-;;:::i;1356:28::-;;;;;;;;;;-1:-1:-1;1356:28:18;;;;-1:-1:-1;;;;;1356:28:18;;;;;;-1:-1:-1;;;;;3618:55:22;;;3600:74;;3588:2;3573:18;1356:28:18;3555:125:22;1492:42:18;;;;;;;;;;;;1531:3;1492:42;;2190:114;;;;;;;;;;-1:-1:-1;2190:114:18;;;;;:::i;:::-;;:::i;1668:101:0:-;;;;;;;;;;;;;:::i;3711:1128:18:-;;;;;;:::i;:::-;;:::i;1390:49::-;;;;;;;;;;;;1427:12;1390:49;;2640:191;;;;;;;;;;;;;:::i;1036:85:0:-;;;;;;;;;;-1:-1:-1;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;1036:85;;1576:39:18;;;;;;;;;;;;;;;;1949:235;;;;;;;;;;-1:-1:-1;1949:235:18;;;;;:::i;:::-;;:::i;1688:28::-;;;;;;;;;;-1:-1:-1;1688:28:18;;;;;;;;;;;;;;3850:14:22;;3843:22;3825:41;;3813:2;3798:18;1688:28:18;3780:92:22;1723:48:18;;;;;;;;;;-1:-1:-1;1723:48:18;;;;;:::i;:::-;;;;;;;;;;;;;;3083:622;;;;;;:::i;:::-;;:::i;1918:198:0:-;;;;;;;;;;-1:-1:-1;1918:198:0;;;;;:::i;:::-;;:::i;1651:31:18:-;;;;;;;;;;-1:-1:-1;1651:31:18;;;;;;;;1621:23;;;;;;;;;;;;;;;;4845:472;1744:1:1;2325:7;;:19;;2317:63;;;;-1:-1:-1;;;2317:63:1;;11138:2:22;2317:63:1;;;11120:21:22;11177:2;11157:18;;;11150:30;11216:33;11196:18;;;11189:61;11267:18;;2317:63:1;;;;;;;;;1744:1;2455:7;:18;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0::1;1240:68;;;::::0;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0::1;::::0;::::1;9648:21:22::0;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0::1;9638:182:22::0;1240:68:0::1;1531:3:18::2;5022:7;5011:8;;:18;:34;;4986:134;;;::::0;-1:-1:-1;;;4986:134:18;;7803:2:22;4986:134:18::2;::::0;::::2;7785:21:22::0;7842:2;7822:18;;;7815:30;7881:34;7861:18;;;7854:62;-1:-1:-1;;;7932:18:22;;;7925:39;7981:19;;4986:134:18::2;7775:231:22::0;4986:134:18::2;1482:4;5156:7;5142:11;;:21;:35;;5134:67;;;::::0;-1:-1:-1;;;5134:67:18;;9318:2:22;5134:67:18::2;::::0;::::2;9300:21:22::0;9357:2;9337:18;;;9330:30;9396:21;9376:18;;;9369:49;9435:18;;5134:67:18::2;9290:169:22::0;5134:67:18::2;5215:11;:22:::0;;;::::2;::::0;;5251:8:::2;:19:::0;;;::::2;::::0;;5291::::2;5230:7:::0;5306:3;5291:5:::2;:19::i;:::-;-1:-1:-1::0;;1701:1:1;2628:22;;4845:472:18:o;2518:116::-;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;2597:13:18::1;:30:::0;;-1:-1:-1;;;;;;2597:30:18::1;-1:-1:-1::0;;;;;2597:30:18;;;::::1;::::0;;;::::1;::::0;;2518:116::o;2310:95::-;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;2376:16:18::1;:22:::0;;;::::1;;;;-1:-1:-1::0;;2376:22:18;;::::1;::::0;;;::::1;::::0;;2310:95::o;2411:101::-;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;2480:19:18::1;:25:::0;;-1:-1:-1;;2480:25:18::1;::::0;::::1;;::::0;;;::::1;::::0;;2411:101::o;2190:114::-;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;2268:20:18::1;:29:::0;2190:114::o;1668:101:0:-;1082:7;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;1732:30:::1;1759:1;1732:18;:30::i;:::-;1668:101::o:0;3711:1128:18:-;1820:10;1834:9;1820:23;1812:52;;;;-1:-1:-1;;;1812:52:18;;8213:2:22;1812:52:18;;;8195:21:22;8252:2;8232:18;;;8225:30;-1:-1:-1;;;8271:18:22;;;8264:46;8327:18;;1812:52:18;8185:166:22;1812:52:18;1744:1:1::1;2325:7;;:19;;2317:63;;;::::0;-1:-1:-1;;;2317:63:1;;11138:2:22;2317:63:1::1;::::0;::::1;11120:21:22::0;11177:2;11157:18;;;11150:30;11216:33;11196:18;;;11189:61;11267:18;;2317:63:1::1;11110:181:22::0;2317:63:1::1;1744:1;2455:7;:18:::0;3892:19:18::2;::::0;::::2;;3884:62;;;::::0;-1:-1:-1;;;3884:62:18;;10779:2:22;3884:62:18::2;::::0;::::2;10761:21:22::0;10818:2;10798:18;;;10791:30;10857:32;10837:18;;;10830:60;10907:18;;3884:62:18::2;10751:180:22::0;3884:62:18::2;4020:45;::::0;-1:-1:-1;;4037:10:18::2;2737:2:22::0;2733:15;2729:53;4020:45:18::2;::::0;::::2;2717:66:22::0;2799:12;;;2792:28;;;3977:131:18::2;::::0;2836:12:22;;4020:45:18::2;;;;;;;;;;;;4010:56;;;;;;4084:10;3977:15;:131::i;:::-;3956:195;;;::::0;-1:-1:-1;;;3956:195:18;;7054:2:22;3956:195:18::2;::::0;::::2;7036:21:22::0;7093:2;7073:18;;;7066:30;7132:19;7112:18;;;7105:47;7169:18;;3956:195:18::2;7026:167:22::0;3956:195:18::2;4193:15;4182:7;:26;;4161:108;;;::::0;-1:-1:-1;;;4161:108:18;;10375:2:22;4161:108:18::2;::::0;::::2;10357:21:22::0;10414:2;10394:18;;;10387:30;10453:34;10433:18;;;10426:62;-1:-1:-1;;;10504:18:22;;;10497:33;10547:19;;4161:108:18::2;10347:225:22::0;4161:108:18::2;4335:10;4304:14;4321:25:::0;;;:13:::2;:25;::::0;;;;;4385:16;;::::2;:35:::0;-1:-1:-1;4385:35:18::2;4360:122;;;::::0;-1:-1:-1;;;4360:122:18;;8961:2:22;4360:122:18::2;::::0;::::2;8943:21:22::0;9000:2;8980:18;;;8973:30;9039;9019:18;;;9012:58;9087:18;;4360:122:18::2;8933:178:22::0;4360:122:18::2;4510:10;4496:25;::::0;;;:13:::2;:25;::::0;;;;4524:16;;::::2;4496:44:::0;;4572:11:::2;::::0;1482:4:::2;4605:16:::0;;::::2;:30;;4597:62;;;::::0;-1:-1:-1;;;4597:62:18;;10027:2:22;4597:62:18::2;::::0;::::2;10009:21:22::0;10066:2;10046:18;;;10039:30;-1:-1:-1;;;10085:18:22;;;10078:49;10144:18;;4597:62:18::2;9999:169:22::0;4597:62:18::2;4687:16:::0;;::::2;4673:11;:30:::0;4726:9:::2;1427:12;4739:20:::0;::::2;4726:33;4718:67;;;::::0;-1:-1:-1;;;4718:67:18;;5946:2:22;4718:67:18::2;::::0;::::2;5928:21:22::0;5985:2;5965:18;;;5958:30;-1:-1:-1;;;6004:18:22;;;5997:51;6065:18;;4718:67:18::2;5918:171:22::0;4718:67:18::2;2484:1:1;;4806:26:18;4812:7;4821:10;4806:5;:26::i;:::-;-1:-1:-1::0;;1701:1:1::1;2628:22:::0;;-1:-1:-1;3711:1128:18:o;2640:191::-;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;1744:1:1::1;2325:7;;:19;;2317:63;;;::::0;-1:-1:-1;;;2317:63:1;;11138:2:22;2317:63:1::1;::::0;::::1;11120:21:22::0;11177:2;11157:18;;;11150:30;11216:33;11196:18;;;11189:61;11267:18;;2317:63:1::1;11110:181:22::0;2317:63:1::1;1744:1;2455:7;:18:::0;2721:21:18::2;2760:11:::0;2752:20:::2;;;::::0;::::2;;2782:42;2793:7;1082::0::0;1108:6;-1:-1:-1;;;;;1108:6:0;;1036:85;2793:7:18::2;2802:21;2782:10;:42::i;:::-;-1:-1:-1::0;1701:1:1::1;2628:22:::0;;2640:191:18:o;1949:235::-;1082:7:0;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;2083:12:18::1;:44:::0;;-1:-1:-1;;;;;2083:44:18;;::::1;-1:-1:-1::0;;;;;;2083:44:18;;::::1;;::::0;;;2137:10:::1;:40:::0;;;;;::::1;::::0;::::1;;::::0;;1949:235::o;3083:622::-;1820:10;1834:9;1820:23;1812:52;;;;-1:-1:-1;;;1812:52:18;;8213:2:22;1812:52:18;;;8195:21:22;8252:2;8232:18;;;8225:30;-1:-1:-1;;;8271:18:22;;;8264:46;8327:18;;1812:52:18;8185:166:22;1812:52:18;1744:1:1::1;2325:7;;:19;;2317:63;;;::::0;-1:-1:-1;;;2317:63:1;;11138:2:22;2317:63:1::1;::::0;::::1;11120:21:22::0;11177:2;11157:18;;;11150:30;11216:33;11196:18;;;11189:61;11267:18;;2317:63:1::1;11110:181:22::0;2317:63:1::1;1744:1;2455:7;:18:::0;3217:16:18::2;::::0;::::2;::::0;::::2;;;3209:56;;;::::0;-1:-1:-1;;;3209:56:18;;6698:2:22;3209:56:18::2;::::0;::::2;6680:21:22::0;6737:2;6717:18;;;6710:30;6776:29;6756:18;;;6749:57;6823:18;;3209:56:18::2;6670:177:22::0;3209:56:18::2;3307:20;;3296:7;:31;;3275:111;;;::::0;-1:-1:-1;;;3275:111:18;;6296:2:22;3275:111:18::2;::::0;::::2;6278:21:22::0;6335:2;6315:18;;;6308:30;6374:34;6354:18;;;6347:62;-1:-1:-1;;;6425:18:22;;;6418:31;6466:19;;3275:111:18::2;6268:223:22::0;3275:111:18::2;3438:11;::::0;1482:4:::2;3471:16:::0;;::::2;:30;;3463:62;;;::::0;-1:-1:-1;;;3463:62:18;;10027:2:22;3463:62:18::2;::::0;::::2;10009:21:22::0;10066:2;10046:18;;;10039:30;-1:-1:-1;;;10085:18:22;;;10078:49;10144:18;;3463:62:18::2;9999:169:22::0;3463:62:18::2;3553:16:::0;;::::2;3539:11;:30:::0;3592:9:::2;1427:12;3605:20:::0;::::2;3592:33;3584:67;;;::::0;-1:-1:-1;;;3584:67:18;;5946:2:22;3584:67:18::2;::::0;::::2;5928:21:22::0;5985:2;5965:18;;;5958:30;-1:-1:-1;;;6004:18:22;;;5997:51;6065:18;;3584:67:18::2;5918:171:22::0;3584:67:18::2;2484:1:1;3672:26:18;3678:7;3687:10;3672:5;:26::i;1918:198:0:-:0;1082:7;1108:6;-1:-1:-1;;;;;1108:6:0;719:10:13;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;9666:2:22;1240:68:0;;;9648:21:22;;;9685:18;;;9678:30;-1:-1:-1;;;;;;;;;;;9724:18:22;;;9717:62;9796:18;;1240:68:0;9638:182:22;1240:68:0;-1:-1:-1;;;;;2006:22:0;::::1;1998:73;;;::::0;-1:-1:-1;;;1998:73:0;;5195:2:22;1998:73:0::1;::::0;::::1;5177:21:22::0;5234:2;5214:18;;;5207:30;5273:34;5253:18;;;5246:62;-1:-1:-1;;;5324:18:22;;;5317:36;5370:19;;1998:73:0::1;5167:228:22::0;1998:73:0::1;2081:28;2100:8;2081:18;:28::i;:::-;1918:198:::0;:::o;5381:140:18:-;5444:10;;:29;;-1:-1:-1;;;5444:29:18;;;;;11652:25:22;;;-1:-1:-1;;;;;11713:55:22;;;11693:18;;;11686:83;5444:10:18;;;;:15;;11625:18:22;;5444:29:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;5483:12:18;;:31;;-1:-1:-1;;;5483:31:18;;;;;11652:25:22;;;-1:-1:-1;;;;;11713:55:22;;;11693:18;;;11686:83;5483:12:18;;;;-1:-1:-1;5483:17:18;;-1:-1:-1;11625:18:22;;5483:31:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5381:140;;:::o;2270:187:0:-;2343:16;2362:6;;-1:-1:-1;;;;;2378:17:0;;;-1:-1:-1;;;;;;2378:17:0;;;;;;2410:40;;2362:6;;;;;;;2410:40;;2343:16;2410:40;2270:187;;:::o;5527:360:18:-;5639:4;5659:24;5686:96;5713:35;5742:5;8239:58:15;;3101:66:22;8239:58:15;;;3089:79:22;3184:12;;;3177:28;;;8109:7:15;;3221:12:22;;8239:58:15;;;;;;;;;;;;8229:69;;;;;;8222:76;;8040:265;;;;5713:35:18;5762:10;5686:13;:96::i;:::-;5659:123;-1:-1:-1;;;;;;5800:30:18;;;;;;:79;;-1:-1:-1;5866:13:18;;-1:-1:-1;;;;;5846:33:18;;;5866:13;;5846:33;5800:79;5792:88;5527:360;-1:-1:-1;;;;5527:360:18:o;2837:177::-;2911:12;2929:8;-1:-1:-1;;;;;2929:13:18;2950:7;2929:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2910:52;;;2980:7;2972:35;;;;-1:-1:-1;;;2972:35:18;;5602:2:22;2972:35:18;;;5584:21:22;5641:2;5621:18;;;5614:30;5680:17;5660:18;;;5653:45;5715:18;;2972:35:18;5574:165:22;2972:35:18;2837:177;;;:::o;4293:227:15:-;4371:7;4391:17;4410:18;4432:27;4443:4;4449:9;4432:10;:27::i;:::-;4390:69;;;;4469:18;4481:5;4469:11;:18::i;:::-;-1:-1:-1;4504:9:15;4293:227;-1:-1:-1;;;4293:227:15:o;2228:1279::-;2309:7;2318:12;2539:9;:16;2559:2;2539:22;2535:966;;;2828:4;2813:20;;2807:27;2877:4;2862:20;;2856:27;2934:4;2919:20;;2913:27;2577:9;2905:36;2975:25;2986:4;2905:36;2807:27;2856;2975:10;:25::i;:::-;2968:32;;;;;;;;;2535:966;3021:9;:16;3041:2;3021:22;3017:484;;;3290:4;3275:20;;3269:27;3340:4;3325:20;;3319:27;3380:23;3391:4;3269:27;3319;3380:10;:23::i;:::-;3373:30;;;;;;;;3017:484;-1:-1:-1;3450:1:15;;-1:-1:-1;3454:35:15;3017:484;2228:1279;;;;;:::o;533:631::-;610:20;601:5;:29;;;;;;-1:-1:-1;;;601:29:15;;;;;;;;;;597:561;;;533:631;:::o;597:561::-;706:29;697:5;:38;;;;;;-1:-1:-1;;;697:38:15;;;;;;;;;;693:465;;;751:34;;-1:-1:-1;;;751:34:15;;4482:2:22;751:34:15;;;4464:21:22;4521:2;4501:18;;;4494:30;4560:26;4540:18;;;4533:54;4604:18;;751:34:15;4454:174:22;693:465:15;815:35;806:5;:44;;;;;;-1:-1:-1;;;806:44:15;;;;;;;;;;802:356;;;866:41;;-1:-1:-1;;;866:41:15;;4835:2:22;866:41:15;;;4817:21:22;4874:2;4854:18;;;4847:30;4913:33;4893:18;;;4886:61;4964:18;;866:41:15;4807:181:22;802:356:15;937:30;928:5;:39;;;;;;-1:-1:-1;;;928:39:15;;;;;;;;;;924:234;;;983:44;;-1:-1:-1;;;983:44:15;;7400:2:22;983:44:15;;;7382:21:22;7439:2;7419:18;;;7412:30;7478:34;7458:18;;;7451:62;-1:-1:-1;;;7529:18:22;;;7522:32;7571:19;;983:44:15;7372:224:22;924:234:15;1057:30;1048:5;:39;;;;;;-1:-1:-1;;;1048:39:15;;;;;;;;;;1044:114;;;1103:44;;-1:-1:-1;;;1103:44:15;;8558:2:22;1103:44:15;;;8540:21:22;8597:2;8577:18;;;8570:30;8636:34;8616:18;;;8609:62;-1:-1:-1;;;8687:18:22;;;8680:32;8729:19;;1103:44:15;8530:224:22;5744:1603:15;5870:7;;6794:66;6781:79;;6777:161;;;-1:-1:-1;6892:1:15;;-1:-1:-1;6896:30:15;6876:51;;6777:161;6951:1;:7;;6956:2;6951:7;;:18;;;;;6962:1;:7;;6967:2;6962:7;;6951:18;6947:100;;;-1:-1:-1;7001:1:15;;-1:-1:-1;7005:30:15;6985:51;;6947:100;7158:24;;;7141:14;7158:24;;;;;;;;;4104:25:22;;;4177:4;4165:17;;4145:18;;;4138:45;;;;4199:18;;;4192:34;;;4242:18;;;4235:34;;;7158:24:15;;4076:19:22;;7158:24:15;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;7158:24:15;;-1:-1:-1;;7158:24:15;;;-1:-1:-1;;;;;;;7196:20:15;;7192:101;;7248:1;7252:29;7232:50;;;;;;;7192:101;7311:6;-1:-1:-1;7319:20:15;;-1:-1:-1;5744:1603:15;;;;;;;;:::o;4774:379::-;4884:7;;4989:66;4981:75;;5082:3;5078:12;;;5092:2;5074:21;5121:25;5132:4;5074:21;5141:1;4981:75;5121:10;:25::i;:::-;5114:32;;;;;;4774:379;;;;;;:::o;14:196:22:-;82:20;;-1:-1:-1;;;;;131:54:22;;121:65;;111:2;;200:1;197;190:12;111:2;63:147;;;:::o;215:196::-;274:6;327:2;315:9;306:7;302:23;298:32;295:2;;;348:6;340;333:22;295:2;376:29;395:9;376:29;:::i;:::-;366:39;285:126;-1:-1:-1;;;285:126:22:o;416:270::-;484:6;492;545:2;533:9;524:7;520:23;516:32;513:2;;;566:6;558;551:22;513:2;594:29;613:9;594:29;:::i;:::-;584:39;;642:38;676:2;665:9;661:18;642:38;:::i;:::-;632:48;;503:183;;;;;:::o;691:293::-;747:6;800:2;788:9;779:7;775:23;771:32;768:2;;;821:6;813;806:22;768:2;865:9;852:23;918:5;911:13;904:21;897:5;894:32;884:2;;945:6;937;930:22;989:190;1048:6;1101:2;1089:9;1080:7;1076:23;1072:32;1069:2;;;1122:6;1114;1107:22;1069:2;-1:-1:-1;1150:23:22;;1059:120;-1:-1:-1;1059:120:22:o;1184:264::-;1252:6;1260;1313:2;1301:9;1292:7;1288:23;1284:32;1281:2;;;1334:6;1326;1319:22;1281:2;1375:9;1362:23;1352:33;;1404:38;1438:2;1427:9;1423:18;1404:38;:::i;1453:1102::-;1539:6;1547;1555;1608:2;1596:9;1587:7;1583:23;1579:32;1576:2;;;1629:6;1621;1614:22;1576:2;1670:9;1657:23;1647:33;;1731:2;1720:9;1716:18;1703:32;1754:18;1795:2;1787:6;1784:14;1781:2;;;1816:6;1808;1801:22;1781:2;1859:6;1848:9;1844:22;1834:32;;1904:7;1897:4;1893:2;1889:13;1885:27;1875:2;;1931:6;1923;1916:22;1875:2;1972;1959:16;1994:2;1990;1987:10;1984:2;;;2000:18;;:::i;:::-;2075:2;2069:9;2043:2;2129:13;;-1:-1:-1;;2125:22:22;;;2149:2;2121:31;2117:40;2105:53;;;2173:18;;;2193:22;;;2170:46;2167:2;;;2219:18;;:::i;:::-;2259:10;2255:2;2248:22;2294:2;2286:6;2279:18;2334:7;2329:2;2324;2320;2316:11;2312:20;2309:33;2306:2;;;2360:6;2352;2345:22;2306:2;2421;2416;2412;2408:11;2403:2;2395:6;2391:15;2378:46;2444:15;;;2461:2;2440:24;2433:40;;;;1566:989;;2448:6;;-1:-1:-1;;;;2545:2:22;2530:18;;;;2517:32;;-1:-1:-1;1566:989:22:o;11780:127::-;11841:10;11836:3;11832:20;11829:1;11822:31;11872:4;11869:1;11862:15;11896:4;11893:1;11886:15

Swarm Source

ipfs://996fe4df7537cc8ae814ee4497e96df7aec4136334aa329cb9833fcea09b20b9

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.