ETH Price: $3,280.24 (-1.80%)

Token

 

Overview

Max Total Supply

1,278

Holders

912

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
030725.eth
0xda704b2e18d989003b139cbc5d4fc978a6d81064
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
HATVaultsNFT

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : HATVaultsNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./interfaces/IHATVaultsData.sol";

/*
An NFT contract that mints specail tokens for each vault of
the HATVaults system.
@note: Thoroughout the whole contract, the HATVaults address 
       should always be the wrapper contract, not the actual
       HATVaults contract
*/
contract HATVaultsNFT is ERC1155, Ownable {
    using Strings for uint256;
    using Counters for Counters.Counter;

    bytes32 public root;
    Counters.Counter public totalSupplyCounter;
    uint256 public deadline;

    uint256 public constant HUNDRED_PERCENT = 10000;
    uint256 public constant TIERS = 3;

    mapping(bytes32 => bool) public pausedVaults;
    mapping(bytes32 => bool) public vaultsRegistered;
    mapping(uint256 => mapping(address => bool)) public tokensRedeemed;

    mapping(uint256 => string) public uris;

    event MerkleTreeChanged(string merkleTreeIPFSRef, bytes32 root, uint256 deadline);
    event VaultPaused(address indexed hatVaults, uint256 indexed pid);
    event VaultResumed(address indexed hatVaults, uint256 indexed pid);

    modifier notPaused(address hatVaults, uint256 pid) {
        require(!pausedVaults[keccak256(abi.encodePacked(hatVaults, pid))], "Vault paused");
        _;
    }

    constructor(
        string memory _merkleTreeIPFSRef,
        bytes32 _root,
        uint256 _deadline
    // solhint-disable-next-line func-visibility
    ) ERC1155("") {
        // solhint-disable-next-line not-rely-on-time
        require(block.timestamp < _deadline, "Deadline already passed");
        root = _root;
        deadline = _deadline;
        emit MerkleTreeChanged(_merkleTreeIPFSRef, _root, _deadline);
    }

    function addVault(address hatVaults, uint256 pid, string memory _uri) external onlyOwner {
        require(!vaultsRegistered[getVaultId(hatVaults, pid)], "Vault already exists");
        vaultsRegistered[getVaultId(hatVaults, pid)] = true;
        for(uint8 i = 1; i <= TIERS; i++) {
            uris[getTokenId(hatVaults, pid, i)] = string(abi.encodePacked(_uri, Strings.toString(i)));
        }
    }

    function pauseVault(address hatVaults, uint256 pid) external onlyOwner {
        pausedVaults[keccak256(abi.encodePacked(hatVaults, pid))] = true;
        emit VaultPaused(hatVaults, pid);
    }


    function resumeVault(address hatVaults, uint256 pid) external onlyOwner {
        pausedVaults[keccak256(abi.encodePacked(hatVaults, pid))] = false;
        emit VaultResumed(hatVaults, pid);
    }

    /**
     * @dev Update the merkle tree root only after 
     * the deadline for minting has been reached.
     * @param _merkleTreeIPFSRef new merkle tree ipfs reference.
     * @param _root new merkle tree root to use for verifying.
     * @param _deadline number of days to the next minting deadline.
     */
    function updateTree(string memory _merkleTreeIPFSRef, bytes32 _root, uint256 _deadline) external onlyOwner {
        // solhint-disable-next-line not-rely-on-time
        require(block.timestamp > deadline, "Minting deadline was not reached");
        // solhint-disable-next-line not-rely-on-time
        require(block.timestamp < _deadline, "New deadline already passed");
        root = _root;
        deadline = _deadline;
        emit MerkleTreeChanged(_merkleTreeIPFSRef, _root, _deadline);
    }

    function redeemMultipleFromTree(
        address[] calldata hatVaults,
        uint256[] calldata pids,
        address account,
        uint8[] calldata tiers,
        bytes32[][] calldata proofs
    ) external {
        uint256 arraysLength = hatVaults.length;
        require(arraysLength == pids.length, "Arrays lengths must match");
        require(arraysLength == tiers.length, "Arrays lengths must match");
        require(arraysLength == proofs.length, "Arrays lengths must match");
        for (uint256 i = 0; i < arraysLength; i++) {
            redeemSingleFromTree(hatVaults[i], pids[i], account, tiers[i], proofs[i]);
        }
    }

    function redeemSingleFromTree(
        address hatVaults,
        uint256 pid,
        address account,
        uint8 tier,
        bytes32[] calldata proof
    ) public notPaused(hatVaults, pid) {
        // solhint-disable-next-line not-rely-on-time
        require(block.timestamp < deadline, "Minting deadline passed");
        require(_verify(proof, _leaf(hatVaults, pid, account, tier)), "Invalid merkle proof");
        _mintTokens(hatVaults, pid, account, tier);
    }

    function redeemMultipleFromShares(
        address[] calldata hatVaults,
        uint256[] calldata pids,
        address account
    ) external {
        uint256 arraysLength = hatVaults.length;
        require(arraysLength == pids.length, "Arrays lengths must match");
        for (uint256 i = 0; i < arraysLength; i++) {
            redeemSingleFromShares(hatVaults[i], pids[i], account);
        }
    }

    function redeemSingleFromShares(
        address hatVaults,
        uint256 pid,
        address account
    ) public {
        uint8 tier = getTierFromShares(hatVaults, pid, account);
        if (tier != 0) {
            _mintTokens(hatVaults, pid, account, tier);
        } 
    }

    function _mintTokens(
        address hatVaults,
        uint256 pid,
        address account,
        uint8 tier
    ) internal {
        require(vaultsRegistered[getVaultId(hatVaults, pid)], "Token does not exist");
        for(uint8 i = 1; i <= tier; i++) {
            if (!tokensRedeemed[getTokenId(hatVaults, pid, i)][account]) {
                tokensRedeemed[getTokenId(hatVaults, pid, i)][account] = true;
                _mint(account, getTokenId(hatVaults, pid, i));
            }
        }
    }

    function _leaf(address _hatVaults, uint256 _pid, address _account, uint8 _tier) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(_hatVaults, _pid, _account, _tier));
    }

    function _verify(bytes32[] calldata proof, bytes32 leaf) internal view returns (bool) {
        return MerkleProof.verifyCalldata(proof, root, leaf);
    }

    function _mint(address to, uint256 id) internal {
        totalSupplyCounter.increment();
        super._mint(to, id, 1, "");
    }

    function getTierFromShares(
        address hatVaults,
        uint256 pid,
        address account
    ) public view notPaused(hatVaults, pid) returns(uint8) {
        uint256 shares = IHATVaultsData(hatVaults).getShares(pid, account);
        uint256 totalShares = IHATVaultsData(hatVaults).getTotalShares(pid);
        require(totalShares != 0, "Pool is empty");
        uint16[3] memory tierPercents = [10, 100, 1500];
        uint8 tier = 0;

        for(uint8 i = 0; i < tierPercents.length; i++) {
            if (shares < totalShares * tierPercents[i] / HUNDRED_PERCENT) {
                break;
            }
            tier++;
        }

        return tier;
    }

    function getTiersToRedeemFromShares(
        address hatVaults,
        uint256 pid,
        address account
    ) external view returns(bool[3] memory tiers) {
        require(vaultsRegistered[getVaultId(hatVaults, pid)], "Token does not exist");
        for(uint8 i = 1; i <= getTierFromShares(hatVaults, pid, account); i++) {
            if (!tokensRedeemed[getTokenId(hatVaults, pid, i)][account]) {
                tiers[i - 1] = true;
            }
        }
    }

    function isEligible(
        address hatVaults,
        uint256 pid,
        address account
    ) external view returns(bool) {
        uint8 tier = getTierFromShares(hatVaults, pid, account);
        return tier != 0 && (vaultsRegistered[getVaultId(hatVaults, pid)] && !tokensRedeemed[getTokenId(hatVaults, pid, tier)][account]);
    }

    function getTokenId(
        address hatVaults,
        uint256 pid,
        uint8 tier
    ) public pure returns(uint256) {
        return uint256(keccak256(abi.encodePacked(hatVaults, pid, tier)));
    }

    function getVaultId(
        address hatVaults,
        uint256 pid
    ) public pure returns(bytes32) {
        return keccak256(abi.encodePacked(hatVaults, pid));
    }

    /**
        @dev Returns thze total tokens minted so far.
     */
    function totalSupply() public view returns (uint256) {
        return totalSupplyCounter.current();
    }

    function uri(uint256 tokenId) public view override returns (string memory) {
        return uris[tokenId];
    }
}

File 2 of 14 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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: address zero is not a valid owner");
        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 token 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: caller is not token 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();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, to, ids, amounts, 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);

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

        _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);

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

        _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();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

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

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

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * 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 _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);

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

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

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * 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();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * 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);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {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 `ids` and `amounts` 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 {}

    /**
     * @dev Hook that is called after 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 _afterTokenTransfer(
        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 3 of 14 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
     * consuming from one or the other at each step according to the instructions given by
     * `proofFlags`.
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 4 of 14 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 5 of 14 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 6 of 14 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 7 of 14 : IHATVaultsData.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

interface IHATVaultsData {
    
    function getTotalShares(uint256 _pid) external view returns (uint256 totalShares);

    function getShares(uint256 _pid, address _user) external view returns (uint256 shares);
}

File 8 of 14 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 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 9 of 14 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (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.
     *
     * NOTE: 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.
     *
     * NOTE: 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 10 of 14 : 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 11 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 12 of 14 : 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 13 of 14 : 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 14 : 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_merkleTreeIPFSRef","type":"string"},{"internalType":"bytes32","name":"_root","type":"bytes32"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"merkleTreeIPFSRef","type":"string"},{"indexed":false,"internalType":"bytes32","name":"root","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"MerkleTreeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"hatVaults","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"VaultPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"hatVaults","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"VaultResumed","type":"event"},{"inputs":[],"name":"HUNDRED_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"addVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"getTierFromShares","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"getTiersToRedeemFromShares","outputs":[{"internalType":"bool[3]","name":"tiers","type":"bool[3]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint8","name":"tier","type":"uint8"}],"name":"getTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"getVaultId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"isEligible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"pauseVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"pausedVaults","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"hatVaults","type":"address[]"},{"internalType":"uint256[]","name":"pids","type":"uint256[]"},{"internalType":"address","name":"account","type":"address"}],"name":"redeemMultipleFromShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"hatVaults","type":"address[]"},{"internalType":"uint256[]","name":"pids","type":"uint256[]"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint8[]","name":"tiers","type":"uint8[]"},{"internalType":"bytes32[][]","name":"proofs","type":"bytes32[][]"}],"name":"redeemMultipleFromTree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"redeemSingleFromShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"redeemSingleFromTree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"hatVaults","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"resumeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"root","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"tokensRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyCounter","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_merkleTreeIPFSRef","type":"string"},{"internalType":"bytes32","name":"_root","type":"bytes32"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"updateTree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uris","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"vaultsRegistered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620032aa380380620032aa8339810160408190526200003491620001ac565b6040805160208101909152600081526200004e81620000ff565b506200005a3362000111565b804210620000ae5760405162461bcd60e51b815260206004820152601760248201527f446561646c696e6520616c726561647920706173736564000000000000000000604482015260640160405180910390fd5b600482905560068190556040517f0321d29aa78655def372c63c55cdf9813510b8e8f5263d109dc5554a405b4ed890620000ee9085908590859062000277565b60405180910390a150505062000416565b60026200010d82826200034a565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001965781810151838201526020016200017c565b83811115620001a6576000848401525b50505050565b600080600060608486031215620001c257600080fd5b83516001600160401b0380821115620001da57600080fd5b818601915086601f830112620001ef57600080fd5b81518181111562000204576200020462000163565b604051601f8201601f19908116603f011681019083821181831017156200022f576200022f62000163565b816040528281528960208487010111156200024957600080fd5b6200025c83602083016020880162000179565b6020890151604090990151909a989950979650505050505050565b60608152600084518060608401526200029881608085016020890162000179565b60208301949094525060408101919091526080601f909201601f19160101919050565b600181811c90821680620002d057607f821691505b602082108103620002f157634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200034557600081815260208120601f850160051c81016020861015620003205750805b601f850160051c820191505b8181101562000341578281556001016200032c565b5050505b505050565b81516001600160401b0381111562000366576200036662000163565b6200037e81620003778454620002bb565b84620002f7565b602080601f831160018114620003b657600084156200039d5750858301515b600019600386901b1c1916600185901b17855562000341565b600085815260208120601f198616915b82811015620003e757888601518255948401946001909101908401620003c6565b5085821015620004065787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b612e8480620004266000396000f3fe608060405234801561001057600080fd5b50600436106102055760003560e01c80636ed93dd01161011a578063d01f5932116100ad578063e985e9c51161007c578063e985e9c514610494578063ebf0c717146104d0578063f242432a146104d9578063f2fde38b146104ec578063f9beb740146104ff57600080fd5b8063d01f593214610448578063db833f001461045b578063df773e341461046e578063e591ed891461048157600080fd5b8063a22cb465116100e9578063a22cb465146103e1578063a943840a146103f4578063c9e7d50a14610407578063ceb120fa1461043557600080fd5b80636ed93dd0146103a2578063715018a6146103ab5780637c7cd785146103b35780638da5cb5b146103c657600080fd5b8063230ad5cc1161019d5780633917dac51161016c5780633917dac51461033457806339731d911461035457806339efae52146103675780634e1273f41461037a5780636e748f971461039a57600080fd5b8063230ad5cc146102d05780632335570b146102f357806329dcb0cf146103185780632eb2c2d61461032157600080fd5b80631253c546116101d95780631253c5461461028857806318160ddd1461029b57806319636585146102a3578063204a875a146102c657600080fd5b8062fdd58e1461020a57806301ffc9a71461023057806302524936146102535780630e89341c14610268575b600080fd5b61021d610218366004611fae565b610512565b6040519081526020015b60405180910390f35b61024361023e366004611fee565b6105a8565b6040519015158152602001610227565b610266610261366004612056565b6105fa565b005b61027b61027636600461212f565b610711565b60405161022791906121a0565b61027b61029636600461212f565b6107b3565b61021d61084d565b6102436102b136600461212f565b60076020526000908152604090205460ff1681565b60055461021d9081565b6102436102de36600461212f565b60086020526000908152604090205460ff1681565b6103066103013660046121b3565b61085d565b60405160ff9091168152602001610227565b61021d60065481565b61026661032f366004612338565b610a9b565b6103476103423660046121b3565b610ae7565b60405161022791906123e1565b61021d610362366004612425565b610bf0565b61021d610375366004611fae565b610c43565b61038d610388366004612458565b610c76565b604051610227919061255d565b61021d600381565b61021d61271081565b610266610d97565b6102666103c1366004612570565b610dab565b6003546040516001600160a01b039091168152602001610227565b6102666103ef3660046125f0565b610e3a565b610266610402366004611fae565b610e49565b61024361041536600461262c565b600960209081526000928352604080842090915290825290205460ff1681565b610266610443366004612658565b610ee0565b6102666104563660046126a5565b610fd3565b610266610469366004611fae565b6110ed565b61026661047c3660046121b3565b611184565b61024361048f3660046121b3565b6111a8565b6102436104a23660046126fb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b61021d60045481565b6102666104e7366004612725565b611232565b6102666104fa366004612789565b611277565b61026661050d3660046127a4565b6112f0565b60006001600160a01b0383166105825760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b14806105d957506001600160e01b031982166303a24d0760e21b145b806105f457506301ffc9a760e01b6001600160e01b03198316145b92915050565b8786811461061a5760405162461bcd60e51b815260040161057990612822565b8084146106395760405162461bcd60e51b815260040161057990612822565b8082146106585760405162461bcd60e51b815260040161057990612822565b60005b81811015610704576106f28b8b8381811061067857610678612859565b905060200201602081019061068d9190612789565b8a8a8481811061069f5761069f612859565b90506020020135898989868181106106b9576106b9612859565b90506020020160208101906106ce919061286f565b8888878181106106e0576106e0612859565b905060200281019061050d919061288a565b806106fc816128e9565b91505061065b565b5050505050505050505050565b6000818152600a6020526040902080546060919061072e90612902565b80601f016020809104026020016040519081016040528092919081815260200182805461075a90612902565b80156107a75780601f1061077c576101008083540402835291602001916107a7565b820191906000526020600020905b81548152906001019060200180831161078a57829003601f168201915b50505050509050919050565b600a60205260009081526040902080546107cc90612902565b80601f01602080910402602001604051908101604052809291908181526020018280546107f890612902565b80156108455780601f1061081a57610100808354040283529160200191610845565b820191906000526020600020905b81548152906001019060200180831161082857829003601f168201915b505050505081565b600061085860055490565b905090565b6000838360076000838360405160200161087892919061293c565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff16156108dd5760405162461bcd60e51b815260206004820152600c60248201526b15985d5b1d081c185d5cd95960a21b6044820152606401610579565b604051633ae05cff60e11b8152600481018690526001600160a01b038581166024830152600091908816906375c0b9fe90604401602060405180830381865afa15801561092e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109529190612959565b6040516310bfff0b60e31b8152600481018890529091506000906001600160a01b038916906385fff85890602401602060405180830381865afa15801561099d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c19190612959565b905080600003610a035760405162461bcd60e51b815260206004820152600d60248201526c506f6f6c20697320656d70747960981b6044820152606401610579565b60408051606081018252600a8152606460208201526105dc918101919091526000805b60038160ff161015610a8d57612710838260ff1660038110610a4a57610a4a612859565b6020020151610a5d9061ffff1686612972565b610a6791906129a7565b8510610a8d5781610a77816129bb565b9250508080610a85906129bb565b915050610a26565b509998505050505050505050565b6001600160a01b038516331480610ab75750610ab785336104a2565b610ad35760405162461bcd60e51b8152600401610579906129da565b610ae0858585858561147f565b5050505050565b610aef611f74565b60086000610afd8686610c43565b815260208101919091526040016000205460ff16610b545760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610579565b60015b610b6285858561085d565b60ff168160ff1611610be85760096000610b7d878785610bf0565b8152602080820192909252604090810160009081206001600160a01b038716825290925290205460ff16610bd657600182610bb88284612a29565b60ff1660038110610bcb57610bcb612859565b911515602090920201525b80610be0816129bb565b915050610b57565b509392505050565b6040805160609490941b6001600160601b031916602080860191909152603485019390935260f89190911b6001600160f81b03191660548401528051603581850301815260559093019052815191012090565b60008282604051602001610c5892919061293c565b60405160208183030381529060405280519060200120905092915050565b60608151835114610cdb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610579565b600083516001600160401b03811115610cf657610cf66121ef565b604051908082528060200260200182016040528015610d1f578160200160208202803683370190505b50905060005b8451811015610be857610d6a858281518110610d4357610d43612859565b6020026020010151858381518110610d5d57610d5d612859565b6020026020010151610512565b828281518110610d7c57610d7c612859565b6020908102919091010152610d90816128e9565b9050610d25565b610d9f61165c565b610da960006116b6565b565b83828114610dcb5760405162461bcd60e51b815260040161057990612822565b60005b81811015610e3157610e1f878783818110610deb57610deb612859565b9050602002016020810190610e009190612789565b868684818110610e1257610e12612859565b9050602002013585611184565b80610e29816128e9565b915050610dce565b50505050505050565b610e45338383611708565b5050565b610e5161165c565b6000600760008484604051602001610e6a92919061293c565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555080826001600160a01b03167f5e8526ee3954b37e3817ddd2a2af5028e0bd006511f190d1deeb43d15d0a18cd60405160405180910390a35050565b610ee861165c565b6006544211610f395760405162461bcd60e51b815260206004820181905260248201527f4d696e74696e6720646561646c696e6520776173206e6f7420726561636865646044820152606401610579565b804210610f885760405162461bcd60e51b815260206004820152601b60248201527f4e657720646561646c696e6520616c72656164792070617373656400000000006044820152606401610579565b600482905560068190556040517f0321d29aa78655def372c63c55cdf9813510b8e8f5263d109dc5554a405b4ed890610fc690859085908590612a4c565b60405180910390a1505050565b610fdb61165c565b60086000610fe98585610c43565b815260208101919091526040016000205460ff16156110415760405162461bcd60e51b81526020600482015260146024820152735661756c7420616c72656164792065786973747360601b6044820152606401610579565b6001600860006110518686610c43565b81526020810191909152604001600020805460ff191691151591909117905560015b60038160ff16116110e7578161108b8260ff166117e8565b60405160200161109c929190612a71565b604051602081830303815290604052600a60006110ba878786610bf0565b815260200190815260200160002090816110d49190612aeb565b50806110df816129bb565b915050611073565b50505050565b6110f561165c565b600160076000848460405160200161110e92919061293c565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555080826001600160a01b03167f57847ecb0caf57ab272aebf4d12c2e00b717d17e11280577d5302fd2f6a901ae60405160405180910390a35050565b600061119184848461085d565b905060ff8116156110e7576110e7848484846118f0565b6000806111b685858561085d565b905060ff8116158015906112295750600860006111d38787610c43565b815260208101919091526040016000205460ff1680156112295750600960006111fd878785610bf0565b8152602080820192909252604090810160009081206001600160a01b038716825290925290205460ff16155b95945050505050565b6001600160a01b03851633148061124e575061124e85336104a2565b61126a5760405162461bcd60e51b8152600401610579906129da565b610ae08585858585611a0e565b61127f61165c565b6001600160a01b0381166112e45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610579565b6112ed816116b6565b50565b858560076000838360405160200161130992919061293c565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161561136e5760405162461bcd60e51b815260206004820152600c60248201526b15985d5b1d081c185d5cd95960a21b6044820152606401610579565b60065442106113bf5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e6720646561646c696e65207061737365640000000000000000006044820152606401610579565b6040805160608a811b6001600160601b0319908116602080850191909152603484018c9052918a901b16605483015260f888901b6001600160f81b031916606883015282516049818403018152606990920190925280519101206114269085908590611b38565b6114695760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610579565b611475888888886118f0565b5050505050505050565b81518351146114e15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610579565b6001600160a01b0384166115075760405162461bcd60e51b815260040161057990612baa565b3360005b84518110156115ee57600085828151811061152857611528612859565b60200260200101519050600085838151811061154657611546612859565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156115965760405162461bcd60e51b815260040161057990612bef565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906115d3908490612c39565b92505081905550505050806115e7906128e9565b905061150b565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161163e929190612c51565b60405180910390a4611654818787878787611b48565b505050505050565b6003546001600160a01b03163314610da95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610579565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03160361177b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610579565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000361180f5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156118395780611823816128e9565b91506118329050600a836129a7565b9150611813565b6000816001600160401b03811115611853576118536121ef565b6040519080825280601f01601f19166020018201604052801561187d576020820181803683370190505b5090505b84156118e857611892600183612c76565b915061189f600a86612c8d565b6118aa906030612c39565b60f81b8183815181106118bf576118bf612859565b60200101906001600160f81b031916908160001a9053506118e1600a866129a7565b9450611881565b949350505050565b600860006118fe8686610c43565b815260208101919091526040016000205460ff166119555760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610579565b60015b8160ff168160ff1611610ae05760096000611974878785610bf0565b8152602080820192909252604090810160009081206001600160a01b038716825290925290205460ff166119fc576001600960006119b3888886610bf0565b8152602080820192909252604090810160009081206001600160a01b03881682529092529020805460ff19169115159190911790556119fc836119f7878785610bf0565b611ca3565b80611a06816129bb565b915050611958565b6001600160a01b038416611a345760405162461bcd60e51b815260040161057990612baa565b336000611a4085611ccd565b90506000611a4d85611ccd565b90506000868152602081815260408083206001600160a01b038c16845290915290205485811015611a905760405162461bcd60e51b815260040161057990612bef565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611acd908490612c39565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611b2d848a8a8a8a8a611d18565b505050505050505050565b60006118e8848460045485611dd3565b6001600160a01b0384163b156116545760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611b8c9089908990889088908890600401612ca1565b6020604051808303816000875af1925050508015611bc7575060408051601f3d908101601f19168201909252611bc491810190612cff565b60015b611c7357611bd3612d1c565b806308c379a003611c0c5750611be7612d38565b80611bf25750611c0e565b8060405162461bcd60e51b815260040161057991906121a0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610579565b6001600160e01b0319811663bc197c8160e01b14610e315760405162461bcd60e51b815260040161057990612dc1565b611cb1600580546001019055565b610e458282600160405180602001604052806000815250611deb565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611d0757611d07612859565b602090810291909101015292915050565b6001600160a01b0384163b156116545760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611d5c9089908990889088908890600401612e09565b6020604051808303816000875af1925050508015611d97575060408051601f3d908101601f19168201909252611d9491810190612cff565b60015b611da357611bd3612d1c565b6001600160e01b0319811663f23a6e6160e01b14610e315760405162461bcd60e51b815260040161057990612dc1565b600082611de1868685611ef6565b1495945050505050565b6001600160a01b038416611e4b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610579565b336000611e5785611ccd565b90506000611e6485611ccd565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290611e96908490612c39565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610e3183600089898989611d18565b600081815b84811015611f3957611f2582878784818110611f1957611f19612859565b90506020020135611f42565b915080611f31816128e9565b915050611efb565b50949350505050565b6000818310611f5e576000828152602084905260409020611f6d565b60008381526020839052604090205b9392505050565b60405180606001604052806003906020820280368337509192915050565b80356001600160a01b0381168114611fa957600080fd5b919050565b60008060408385031215611fc157600080fd5b611fca83611f92565b946020939093013593505050565b6001600160e01b0319811681146112ed57600080fd5b60006020828403121561200057600080fd5b8135611f6d81611fd8565b60008083601f84011261201d57600080fd5b5081356001600160401b0381111561203457600080fd5b6020830191508360208260051b850101111561204f57600080fd5b9250929050565b600080600080600080600080600060a08a8c03121561207457600080fd5b89356001600160401b038082111561208b57600080fd5b6120978d838e0161200b565b909b50995060208c01359150808211156120b057600080fd5b6120bc8d838e0161200b565b90995097508791506120d060408d01611f92565b965060608c01359150808211156120e657600080fd5b6120f28d838e0161200b565b909650945060808c013591508082111561210b57600080fd5b506121188c828d0161200b565b915080935050809150509295985092959850929598565b60006020828403121561214157600080fd5b5035919050565b60005b8381101561216357818101518382015260200161214b565b838111156110e75750506000910152565b6000815180845261218c816020860160208601612148565b601f01601f19169290920160200192915050565b602081526000611f6d6020830184612174565b6000806000606084860312156121c857600080fd5b6121d184611f92565b9250602084013591506121e660408501611f92565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561222a5761222a6121ef565b6040525050565b60006001600160401b0382111561224a5761224a6121ef565b5060051b60200190565b600082601f83011261226557600080fd5b8135602061227282612231565b60405161227f8282612205565b83815260059390931b850182019282810191508684111561229f57600080fd5b8286015b848110156122ba57803583529183019183016122a3565b509695505050505050565b600082601f8301126122d657600080fd5b81356001600160401b038111156122ef576122ef6121ef565b604051612306601f8301601f191660200182612205565b81815284602083860101111561231b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561235057600080fd5b61235986611f92565b945061236760208701611f92565b935060408601356001600160401b038082111561238357600080fd5b61238f89838a01612254565b945060608801359150808211156123a557600080fd5b6123b189838a01612254565b935060808801359150808211156123c757600080fd5b506123d4888289016122c5565b9150509295509295909350565b60608101818360005b600381101561240b57815115158352602092830192909101906001016123ea565b50505092915050565b803560ff81168114611fa957600080fd5b60008060006060848603121561243a57600080fd5b61244384611f92565b9250602084013591506121e660408501612414565b6000806040838503121561246b57600080fd5b82356001600160401b038082111561248257600080fd5b818501915085601f83011261249657600080fd5b813560206124a382612231565b6040516124b08282612205565b83815260059390931b85018201928281019150898411156124d057600080fd5b948201945b838610156124f5576124e686611f92565b825294820194908201906124d5565b9650508601359250508082111561250b57600080fd5b5061251885828601612254565b9150509250929050565b600081518084526020808501945080840160005b8381101561255257815187529582019590820190600101612536565b509495945050505050565b602081526000611f6d6020830184612522565b60008060008060006060868803121561258857600080fd5b85356001600160401b038082111561259f57600080fd5b6125ab89838a0161200b565b909750955060208801359150808211156125c457600080fd5b506125d18882890161200b565b90945092506125e4905060408701611f92565b90509295509295909350565b6000806040838503121561260357600080fd5b61260c83611f92565b91506020830135801515811461262157600080fd5b809150509250929050565b6000806040838503121561263f57600080fd5b8235915061264f60208401611f92565b90509250929050565b60008060006060848603121561266d57600080fd5b83356001600160401b0381111561268357600080fd5b61268f868287016122c5565b9660208601359650604090950135949350505050565b6000806000606084860312156126ba57600080fd5b6126c384611f92565b92506020840135915060408401356001600160401b038111156126e557600080fd5b6126f1868287016122c5565b9150509250925092565b6000806040838503121561270e57600080fd5b61271783611f92565b915061264f60208401611f92565b600080600080600060a0868803121561273d57600080fd5b61274686611f92565b945061275460208701611f92565b9350604086013592506060860135915060808601356001600160401b0381111561277d57600080fd5b6123d4888289016122c5565b60006020828403121561279b57600080fd5b611f6d82611f92565b60008060008060008060a087890312156127bd57600080fd5b6127c687611f92565b9550602087013594506127db60408801611f92565b93506127e960608801612414565b925060808701356001600160401b0381111561280457600080fd5b61281089828a0161200b565b979a9699509497509295939492505050565b60208082526019908201527f417272617973206c656e67746873206d757374206d6174636800000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561288157600080fd5b611f6d82612414565b6000808335601e198436030181126128a157600080fd5b8301803591506001600160401b038211156128bb57600080fd5b6020019150600581901b360382131561204f57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016128fb576128fb6128d3565b5060010190565b600181811c9082168061291657607f821691505b60208210810361293657634e487b7160e01b600052602260045260246000fd5b50919050565b60609290921b6001600160601b0319168252601482015260340190565b60006020828403121561296b57600080fd5b5051919050565b600081600019048311821515161561298c5761298c6128d3565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826129b6576129b6612991565b500490565b600060ff821660ff81036129d1576129d16128d3565b60010192915050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b600060ff821660ff841680821015612a4357612a436128d3565b90039392505050565b606081526000612a5f6060830186612174565b60208301949094525060400152919050565b60008351612a83818460208801612148565b835190830190612a97818360208801612148565b01949350505050565b601f821115612ae657600081815260208120601f850160051c81016020861015612ac75750805b601f850160051c820191505b8181101561165457828155600101612ad3565b505050565b81516001600160401b03811115612b0457612b046121ef565b612b1881612b128454612902565b84612aa0565b602080601f831160018114612b4d5760008415612b355750858301515b600019600386901b1c1916600185901b178555611654565b600085815260208120601f198616915b82811015612b7c57888601518255948401946001909101908401612b5d565b5085821015612b9a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60008219821115612c4c57612c4c6128d3565b500190565b604081526000612c646040830185612522565b82810360208401526112298185612522565b600082821015612c8857612c886128d3565b500390565b600082612c9c57612c9c612991565b500690565b6001600160a01b0386811682528516602082015260a060408201819052600090612ccd90830186612522565b8281036060840152612cdf8186612522565b90508281036080840152612cf38185612174565b98975050505050505050565b600060208284031215612d1157600080fd5b8151611f6d81611fd8565b600060033d1115612d355760046000803e5060005160e01c5b90565b600060443d1015612d465790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715612d7557505050505090565b8285019150815181811115612d8d5750505050505090565b843d8701016020828501011115612da75750505050505090565b612db660208286010187612205565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612e4390830184612174565b97965050505050505056fea26469706673582212203cea1bc3789f130f009d61b7c575ed63bf1e3a9249c03602baa7351955470c9064736f6c634300080f0033000000000000000000000000000000000000000000000000000000000000006042420ab76dbe31436106a45363fcaee4adc7df5d45d3c58a437d3d346f5e8b3f00000000000000000000000000000000000000000000000000000000636cb64e000000000000000000000000000000000000000000000000000000000000002e516d5348445a4d5a354c715a36503536747064534d7138556761443752486a553542546e5a504a5332327a647856000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102055760003560e01c80636ed93dd01161011a578063d01f5932116100ad578063e985e9c51161007c578063e985e9c514610494578063ebf0c717146104d0578063f242432a146104d9578063f2fde38b146104ec578063f9beb740146104ff57600080fd5b8063d01f593214610448578063db833f001461045b578063df773e341461046e578063e591ed891461048157600080fd5b8063a22cb465116100e9578063a22cb465146103e1578063a943840a146103f4578063c9e7d50a14610407578063ceb120fa1461043557600080fd5b80636ed93dd0146103a2578063715018a6146103ab5780637c7cd785146103b35780638da5cb5b146103c657600080fd5b8063230ad5cc1161019d5780633917dac51161016c5780633917dac51461033457806339731d911461035457806339efae52146103675780634e1273f41461037a5780636e748f971461039a57600080fd5b8063230ad5cc146102d05780632335570b146102f357806329dcb0cf146103185780632eb2c2d61461032157600080fd5b80631253c546116101d95780631253c5461461028857806318160ddd1461029b57806319636585146102a3578063204a875a146102c657600080fd5b8062fdd58e1461020a57806301ffc9a71461023057806302524936146102535780630e89341c14610268575b600080fd5b61021d610218366004611fae565b610512565b6040519081526020015b60405180910390f35b61024361023e366004611fee565b6105a8565b6040519015158152602001610227565b610266610261366004612056565b6105fa565b005b61027b61027636600461212f565b610711565b60405161022791906121a0565b61027b61029636600461212f565b6107b3565b61021d61084d565b6102436102b136600461212f565b60076020526000908152604090205460ff1681565b60055461021d9081565b6102436102de36600461212f565b60086020526000908152604090205460ff1681565b6103066103013660046121b3565b61085d565b60405160ff9091168152602001610227565b61021d60065481565b61026661032f366004612338565b610a9b565b6103476103423660046121b3565b610ae7565b60405161022791906123e1565b61021d610362366004612425565b610bf0565b61021d610375366004611fae565b610c43565b61038d610388366004612458565b610c76565b604051610227919061255d565b61021d600381565b61021d61271081565b610266610d97565b6102666103c1366004612570565b610dab565b6003546040516001600160a01b039091168152602001610227565b6102666103ef3660046125f0565b610e3a565b610266610402366004611fae565b610e49565b61024361041536600461262c565b600960209081526000928352604080842090915290825290205460ff1681565b610266610443366004612658565b610ee0565b6102666104563660046126a5565b610fd3565b610266610469366004611fae565b6110ed565b61026661047c3660046121b3565b611184565b61024361048f3660046121b3565b6111a8565b6102436104a23660046126fb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b61021d60045481565b6102666104e7366004612725565b611232565b6102666104fa366004612789565b611277565b61026661050d3660046127a4565b6112f0565b60006001600160a01b0383166105825760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b14806105d957506001600160e01b031982166303a24d0760e21b145b806105f457506301ffc9a760e01b6001600160e01b03198316145b92915050565b8786811461061a5760405162461bcd60e51b815260040161057990612822565b8084146106395760405162461bcd60e51b815260040161057990612822565b8082146106585760405162461bcd60e51b815260040161057990612822565b60005b81811015610704576106f28b8b8381811061067857610678612859565b905060200201602081019061068d9190612789565b8a8a8481811061069f5761069f612859565b90506020020135898989868181106106b9576106b9612859565b90506020020160208101906106ce919061286f565b8888878181106106e0576106e0612859565b905060200281019061050d919061288a565b806106fc816128e9565b91505061065b565b5050505050505050505050565b6000818152600a6020526040902080546060919061072e90612902565b80601f016020809104026020016040519081016040528092919081815260200182805461075a90612902565b80156107a75780601f1061077c576101008083540402835291602001916107a7565b820191906000526020600020905b81548152906001019060200180831161078a57829003601f168201915b50505050509050919050565b600a60205260009081526040902080546107cc90612902565b80601f01602080910402602001604051908101604052809291908181526020018280546107f890612902565b80156108455780601f1061081a57610100808354040283529160200191610845565b820191906000526020600020905b81548152906001019060200180831161082857829003601f168201915b505050505081565b600061085860055490565b905090565b6000838360076000838360405160200161087892919061293c565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff16156108dd5760405162461bcd60e51b815260206004820152600c60248201526b15985d5b1d081c185d5cd95960a21b6044820152606401610579565b604051633ae05cff60e11b8152600481018690526001600160a01b038581166024830152600091908816906375c0b9fe90604401602060405180830381865afa15801561092e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109529190612959565b6040516310bfff0b60e31b8152600481018890529091506000906001600160a01b038916906385fff85890602401602060405180830381865afa15801561099d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c19190612959565b905080600003610a035760405162461bcd60e51b815260206004820152600d60248201526c506f6f6c20697320656d70747960981b6044820152606401610579565b60408051606081018252600a8152606460208201526105dc918101919091526000805b60038160ff161015610a8d57612710838260ff1660038110610a4a57610a4a612859565b6020020151610a5d9061ffff1686612972565b610a6791906129a7565b8510610a8d5781610a77816129bb565b9250508080610a85906129bb565b915050610a26565b509998505050505050505050565b6001600160a01b038516331480610ab75750610ab785336104a2565b610ad35760405162461bcd60e51b8152600401610579906129da565b610ae0858585858561147f565b5050505050565b610aef611f74565b60086000610afd8686610c43565b815260208101919091526040016000205460ff16610b545760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610579565b60015b610b6285858561085d565b60ff168160ff1611610be85760096000610b7d878785610bf0565b8152602080820192909252604090810160009081206001600160a01b038716825290925290205460ff16610bd657600182610bb88284612a29565b60ff1660038110610bcb57610bcb612859565b911515602090920201525b80610be0816129bb565b915050610b57565b509392505050565b6040805160609490941b6001600160601b031916602080860191909152603485019390935260f89190911b6001600160f81b03191660548401528051603581850301815260559093019052815191012090565b60008282604051602001610c5892919061293c565b60405160208183030381529060405280519060200120905092915050565b60608151835114610cdb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610579565b600083516001600160401b03811115610cf657610cf66121ef565b604051908082528060200260200182016040528015610d1f578160200160208202803683370190505b50905060005b8451811015610be857610d6a858281518110610d4357610d43612859565b6020026020010151858381518110610d5d57610d5d612859565b6020026020010151610512565b828281518110610d7c57610d7c612859565b6020908102919091010152610d90816128e9565b9050610d25565b610d9f61165c565b610da960006116b6565b565b83828114610dcb5760405162461bcd60e51b815260040161057990612822565b60005b81811015610e3157610e1f878783818110610deb57610deb612859565b9050602002016020810190610e009190612789565b868684818110610e1257610e12612859565b9050602002013585611184565b80610e29816128e9565b915050610dce565b50505050505050565b610e45338383611708565b5050565b610e5161165c565b6000600760008484604051602001610e6a92919061293c565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555080826001600160a01b03167f5e8526ee3954b37e3817ddd2a2af5028e0bd006511f190d1deeb43d15d0a18cd60405160405180910390a35050565b610ee861165c565b6006544211610f395760405162461bcd60e51b815260206004820181905260248201527f4d696e74696e6720646561646c696e6520776173206e6f7420726561636865646044820152606401610579565b804210610f885760405162461bcd60e51b815260206004820152601b60248201527f4e657720646561646c696e6520616c72656164792070617373656400000000006044820152606401610579565b600482905560068190556040517f0321d29aa78655def372c63c55cdf9813510b8e8f5263d109dc5554a405b4ed890610fc690859085908590612a4c565b60405180910390a1505050565b610fdb61165c565b60086000610fe98585610c43565b815260208101919091526040016000205460ff16156110415760405162461bcd60e51b81526020600482015260146024820152735661756c7420616c72656164792065786973747360601b6044820152606401610579565b6001600860006110518686610c43565b81526020810191909152604001600020805460ff191691151591909117905560015b60038160ff16116110e7578161108b8260ff166117e8565b60405160200161109c929190612a71565b604051602081830303815290604052600a60006110ba878786610bf0565b815260200190815260200160002090816110d49190612aeb565b50806110df816129bb565b915050611073565b50505050565b6110f561165c565b600160076000848460405160200161110e92919061293c565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555080826001600160a01b03167f57847ecb0caf57ab272aebf4d12c2e00b717d17e11280577d5302fd2f6a901ae60405160405180910390a35050565b600061119184848461085d565b905060ff8116156110e7576110e7848484846118f0565b6000806111b685858561085d565b905060ff8116158015906112295750600860006111d38787610c43565b815260208101919091526040016000205460ff1680156112295750600960006111fd878785610bf0565b8152602080820192909252604090810160009081206001600160a01b038716825290925290205460ff16155b95945050505050565b6001600160a01b03851633148061124e575061124e85336104a2565b61126a5760405162461bcd60e51b8152600401610579906129da565b610ae08585858585611a0e565b61127f61165c565b6001600160a01b0381166112e45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610579565b6112ed816116b6565b50565b858560076000838360405160200161130992919061293c565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161561136e5760405162461bcd60e51b815260206004820152600c60248201526b15985d5b1d081c185d5cd95960a21b6044820152606401610579565b60065442106113bf5760405162461bcd60e51b815260206004820152601760248201527f4d696e74696e6720646561646c696e65207061737365640000000000000000006044820152606401610579565b6040805160608a811b6001600160601b0319908116602080850191909152603484018c9052918a901b16605483015260f888901b6001600160f81b031916606883015282516049818403018152606990920190925280519101206114269085908590611b38565b6114695760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610579565b611475888888886118f0565b5050505050505050565b81518351146114e15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610579565b6001600160a01b0384166115075760405162461bcd60e51b815260040161057990612baa565b3360005b84518110156115ee57600085828151811061152857611528612859565b60200260200101519050600085838151811061154657611546612859565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156115965760405162461bcd60e51b815260040161057990612bef565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906115d3908490612c39565b92505081905550505050806115e7906128e9565b905061150b565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161163e929190612c51565b60405180910390a4611654818787878787611b48565b505050505050565b6003546001600160a01b03163314610da95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610579565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03160361177b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610579565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000361180f5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156118395780611823816128e9565b91506118329050600a836129a7565b9150611813565b6000816001600160401b03811115611853576118536121ef565b6040519080825280601f01601f19166020018201604052801561187d576020820181803683370190505b5090505b84156118e857611892600183612c76565b915061189f600a86612c8d565b6118aa906030612c39565b60f81b8183815181106118bf576118bf612859565b60200101906001600160f81b031916908160001a9053506118e1600a866129a7565b9450611881565b949350505050565b600860006118fe8686610c43565b815260208101919091526040016000205460ff166119555760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610579565b60015b8160ff168160ff1611610ae05760096000611974878785610bf0565b8152602080820192909252604090810160009081206001600160a01b038716825290925290205460ff166119fc576001600960006119b3888886610bf0565b8152602080820192909252604090810160009081206001600160a01b03881682529092529020805460ff19169115159190911790556119fc836119f7878785610bf0565b611ca3565b80611a06816129bb565b915050611958565b6001600160a01b038416611a345760405162461bcd60e51b815260040161057990612baa565b336000611a4085611ccd565b90506000611a4d85611ccd565b90506000868152602081815260408083206001600160a01b038c16845290915290205485811015611a905760405162461bcd60e51b815260040161057990612bef565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611acd908490612c39565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611b2d848a8a8a8a8a611d18565b505050505050505050565b60006118e8848460045485611dd3565b6001600160a01b0384163b156116545760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611b8c9089908990889088908890600401612ca1565b6020604051808303816000875af1925050508015611bc7575060408051601f3d908101601f19168201909252611bc491810190612cff565b60015b611c7357611bd3612d1c565b806308c379a003611c0c5750611be7612d38565b80611bf25750611c0e565b8060405162461bcd60e51b815260040161057991906121a0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610579565b6001600160e01b0319811663bc197c8160e01b14610e315760405162461bcd60e51b815260040161057990612dc1565b611cb1600580546001019055565b610e458282600160405180602001604052806000815250611deb565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611d0757611d07612859565b602090810291909101015292915050565b6001600160a01b0384163b156116545760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611d5c9089908990889088908890600401612e09565b6020604051808303816000875af1925050508015611d97575060408051601f3d908101601f19168201909252611d9491810190612cff565b60015b611da357611bd3612d1c565b6001600160e01b0319811663f23a6e6160e01b14610e315760405162461bcd60e51b815260040161057990612dc1565b600082611de1868685611ef6565b1495945050505050565b6001600160a01b038416611e4b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610579565b336000611e5785611ccd565b90506000611e6485611ccd565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290611e96908490612c39565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610e3183600089898989611d18565b600081815b84811015611f3957611f2582878784818110611f1957611f19612859565b90506020020135611f42565b915080611f31816128e9565b915050611efb565b50949350505050565b6000818310611f5e576000828152602084905260409020611f6d565b60008381526020839052604090205b9392505050565b60405180606001604052806003906020820280368337509192915050565b80356001600160a01b0381168114611fa957600080fd5b919050565b60008060408385031215611fc157600080fd5b611fca83611f92565b946020939093013593505050565b6001600160e01b0319811681146112ed57600080fd5b60006020828403121561200057600080fd5b8135611f6d81611fd8565b60008083601f84011261201d57600080fd5b5081356001600160401b0381111561203457600080fd5b6020830191508360208260051b850101111561204f57600080fd5b9250929050565b600080600080600080600080600060a08a8c03121561207457600080fd5b89356001600160401b038082111561208b57600080fd5b6120978d838e0161200b565b909b50995060208c01359150808211156120b057600080fd5b6120bc8d838e0161200b565b90995097508791506120d060408d01611f92565b965060608c01359150808211156120e657600080fd5b6120f28d838e0161200b565b909650945060808c013591508082111561210b57600080fd5b506121188c828d0161200b565b915080935050809150509295985092959850929598565b60006020828403121561214157600080fd5b5035919050565b60005b8381101561216357818101518382015260200161214b565b838111156110e75750506000910152565b6000815180845261218c816020860160208601612148565b601f01601f19169290920160200192915050565b602081526000611f6d6020830184612174565b6000806000606084860312156121c857600080fd5b6121d184611f92565b9250602084013591506121e660408501611f92565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561222a5761222a6121ef565b6040525050565b60006001600160401b0382111561224a5761224a6121ef565b5060051b60200190565b600082601f83011261226557600080fd5b8135602061227282612231565b60405161227f8282612205565b83815260059390931b850182019282810191508684111561229f57600080fd5b8286015b848110156122ba57803583529183019183016122a3565b509695505050505050565b600082601f8301126122d657600080fd5b81356001600160401b038111156122ef576122ef6121ef565b604051612306601f8301601f191660200182612205565b81815284602083860101111561231b57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561235057600080fd5b61235986611f92565b945061236760208701611f92565b935060408601356001600160401b038082111561238357600080fd5b61238f89838a01612254565b945060608801359150808211156123a557600080fd5b6123b189838a01612254565b935060808801359150808211156123c757600080fd5b506123d4888289016122c5565b9150509295509295909350565b60608101818360005b600381101561240b57815115158352602092830192909101906001016123ea565b50505092915050565b803560ff81168114611fa957600080fd5b60008060006060848603121561243a57600080fd5b61244384611f92565b9250602084013591506121e660408501612414565b6000806040838503121561246b57600080fd5b82356001600160401b038082111561248257600080fd5b818501915085601f83011261249657600080fd5b813560206124a382612231565b6040516124b08282612205565b83815260059390931b85018201928281019150898411156124d057600080fd5b948201945b838610156124f5576124e686611f92565b825294820194908201906124d5565b9650508601359250508082111561250b57600080fd5b5061251885828601612254565b9150509250929050565b600081518084526020808501945080840160005b8381101561255257815187529582019590820190600101612536565b509495945050505050565b602081526000611f6d6020830184612522565b60008060008060006060868803121561258857600080fd5b85356001600160401b038082111561259f57600080fd5b6125ab89838a0161200b565b909750955060208801359150808211156125c457600080fd5b506125d18882890161200b565b90945092506125e4905060408701611f92565b90509295509295909350565b6000806040838503121561260357600080fd5b61260c83611f92565b91506020830135801515811461262157600080fd5b809150509250929050565b6000806040838503121561263f57600080fd5b8235915061264f60208401611f92565b90509250929050565b60008060006060848603121561266d57600080fd5b83356001600160401b0381111561268357600080fd5b61268f868287016122c5565b9660208601359650604090950135949350505050565b6000806000606084860312156126ba57600080fd5b6126c384611f92565b92506020840135915060408401356001600160401b038111156126e557600080fd5b6126f1868287016122c5565b9150509250925092565b6000806040838503121561270e57600080fd5b61271783611f92565b915061264f60208401611f92565b600080600080600060a0868803121561273d57600080fd5b61274686611f92565b945061275460208701611f92565b9350604086013592506060860135915060808601356001600160401b0381111561277d57600080fd5b6123d4888289016122c5565b60006020828403121561279b57600080fd5b611f6d82611f92565b60008060008060008060a087890312156127bd57600080fd5b6127c687611f92565b9550602087013594506127db60408801611f92565b93506127e960608801612414565b925060808701356001600160401b0381111561280457600080fd5b61281089828a0161200b565b979a9699509497509295939492505050565b60208082526019908201527f417272617973206c656e67746873206d757374206d6174636800000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561288157600080fd5b611f6d82612414565b6000808335601e198436030181126128a157600080fd5b8301803591506001600160401b038211156128bb57600080fd5b6020019150600581901b360382131561204f57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016128fb576128fb6128d3565b5060010190565b600181811c9082168061291657607f821691505b60208210810361293657634e487b7160e01b600052602260045260246000fd5b50919050565b60609290921b6001600160601b0319168252601482015260340190565b60006020828403121561296b57600080fd5b5051919050565b600081600019048311821515161561298c5761298c6128d3565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826129b6576129b6612991565b500490565b600060ff821660ff81036129d1576129d16128d3565b60010192915050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b600060ff821660ff841680821015612a4357612a436128d3565b90039392505050565b606081526000612a5f6060830186612174565b60208301949094525060400152919050565b60008351612a83818460208801612148565b835190830190612a97818360208801612148565b01949350505050565b601f821115612ae657600081815260208120601f850160051c81016020861015612ac75750805b601f850160051c820191505b8181101561165457828155600101612ad3565b505050565b81516001600160401b03811115612b0457612b046121ef565b612b1881612b128454612902565b84612aa0565b602080601f831160018114612b4d5760008415612b355750858301515b600019600386901b1c1916600185901b178555611654565b600085815260208120601f198616915b82811015612b7c57888601518255948401946001909101908401612b5d565b5085821015612b9a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60008219821115612c4c57612c4c6128d3565b500190565b604081526000612c646040830185612522565b82810360208401526112298185612522565b600082821015612c8857612c886128d3565b500390565b600082612c9c57612c9c612991565b500690565b6001600160a01b0386811682528516602082015260a060408201819052600090612ccd90830186612522565b8281036060840152612cdf8186612522565b90508281036080840152612cf38185612174565b98975050505050505050565b600060208284031215612d1157600080fd5b8151611f6d81611fd8565b600060033d1115612d355760046000803e5060005160e01c5b90565b600060443d1015612d465790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715612d7557505050505090565b8285019150815181811115612d8d5750505050505090565b843d8701016020828501011115612da75750505050505090565b612db660208286010187612205565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612e4390830184612174565b97965050505050505056fea26469706673582212203cea1bc3789f130f009d61b7c575ed63bf1e3a9249c03602baa7351955470c9064736f6c634300080f0033

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

000000000000000000000000000000000000000000000000000000000000006042420ab76dbe31436106a45363fcaee4adc7df5d45d3c58a437d3d346f5e8b3f00000000000000000000000000000000000000000000000000000000636cb64e000000000000000000000000000000000000000000000000000000000000002e516d5348445a4d5a354c715a36503536747064534d7138556761443752486a553542546e5a504a5332327a647856000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _merkleTreeIPFSRef (string): QmSHDZMZ5LqZ6P56tpdSMq8UgaD7RHjU5BTnZPJS22zdxV
Arg [1] : _root (bytes32): 0x42420ab76dbe31436106a45363fcaee4adc7df5d45d3c58a437d3d346f5e8b3f
Arg [2] : _deadline (uint256): 1668068942

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 42420ab76dbe31436106a45363fcaee4adc7df5d45d3c58a437d3d346f5e8b3f
Arg [2] : 00000000000000000000000000000000000000000000000000000000636cb64e
Arg [3] : 000000000000000000000000000000000000000000000000000000000000002e
Arg [4] : 516d5348445a4d5a354c715a36503536747064534d7138556761443752486a55
Arg [5] : 3542546e5a504a5332327a647856000000000000000000000000000000000000


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

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