Contract 0x8af4BdFC4CfBe5388bd194B7e86D4CcF502121A5

Contract Overview

Balance:
0 Ether
Txn Hash
Method
Block
From
To
Value
0x9a2c44c02172146bc10cc32b02c14af438a88d23d61e88e2c851a6ae084a57dfFinalize Vault82615102021-03-19 12:11:47618 days 7 hrs ago0xfc4ceee77e4ef44305bd579355f53c711a89dba5 IN  0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether0.000023141
0xdba424e034f0e6a364dbd96746388560c3e5540c8e2865f4365e09140e7f118f0x6080604082521812021-03-17 21:18:45619 days 22 hrs ago0xb5191de5e9ed5ce94176b7917430a8512e5ad517 IN  Create: NFTXv7Rinkeby0 Ether0.005195071
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xca99b8b5e14ef07e63c6a5d6d443ea232c82042678df39e746bdf61f5afb956087004202021-06-03 17:44:17542 days 2 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x2625b017e21c8799ca90db2f27dcc5ea20b49f1d68e451469477f832acd1b4c285912192021-05-15 18:33:56561 days 1 hr ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x5994c5859093b0cd8e6735742a5f47715e6041298cd73ab07508011cb378ca8785911722021-05-15 18:22:10561 days 1 hr ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x710eef026cdbd186c14e8ea0b50ebfadc0fd753384d4be7ad01fc8f313491e1585832432021-05-14 9:18:21562 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0xb674e8886cb7d1a4b38aafed01629b9262d672e26610ae19adf3a4972f2a449485832372021-05-14 9:16:51562 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x1758c68eb01cb9fc88916553cac2da80023a06fb2e58f42536b58401af2569e885832362021-05-14 9:16:36562 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0xf2085297af9d0bb4c71abcb531207f1f2137e11d9e1f7b95886d30ad4b4c4fb485832042021-05-14 9:08:36562 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x609213fa0ff1dfd6d286a4fe6b4893bb8504f7524f83e8e778c42148cac9dc6d85832032021-05-14 9:08:21562 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x849c68f1cc763c09296ef6da2c9192160043ec58c4b8a4e1ee32a57cdcb4d04d85831902021-05-14 9:05:06562 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0xc1b8a7ca441caa6177e66cccbb32e76ae74a45323abbfb3de4913b8c8f63172585830662021-05-14 8:34:05562 days 11 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x1fdd814bcc2fede40cc002b37a1406ee0614f9df67f18d9c892db65f32b12b3785830532021-05-14 8:30:50562 days 11 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x513805ac9ea80e95c867ee9e3704f1e317e0cd01fa0cba0ac02458de938fdcc285829962021-05-14 8:16:35562 days 11 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x050fafc3f378c20a3278ad264c1e7ca3c98c760f8dd2d0c1d8b51561d318b64085607682021-05-10 11:36:20566 days 8 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x6b7007cf0fffe0dfe84dc1dabcc4e6ccc8f5f2c6a0b79b954bc546d26e96659385607442021-05-10 11:30:19566 days 8 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x8530558b1e23931c897d496aa47631ee33ac4e3e1948d8feb85104790136ba7185607222021-05-10 11:24:49566 days 8 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x8530558b1e23931c897d496aa47631ee33ac4e3e1948d8feb85104790136ba7185607222021-05-10 11:24:49566 days 8 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x2fe510e46c95d6c77538e18227fc2973162391404273f29755076e3e1ae762ee85607222021-05-10 11:24:49566 days 8 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x2fe510e46c95d6c77538e18227fc2973162391404273f29755076e3e1ae762ee85607222021-05-10 11:24:49566 days 8 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x6bbfb703bcf3bd227d8a2a01e3ccdaa8bc32145a60a77fa9c8408e51e6eb479785606272021-05-10 11:01:04566 days 9 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x6bbfb703bcf3bd227d8a2a01e3ccdaa8bc32145a60a77fa9c8408e51e6eb479785606272021-05-10 11:01:04566 days 9 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x645070224f895c12be12fb41925b86717890afa441c3c26ab799ecf60133935485605992021-05-10 10:54:04566 days 9 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x645070224f895c12be12fb41925b86717890afa441c3c26ab799ecf60133935485605992021-05-10 10:54:04566 days 9 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x8a2f014e37700b06611b9f6c050895a218089b0f16125b02b1eaada48430bce185604232021-05-10 10:10:04566 days 9 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x562bce2d9f0da459b64535da8187a040559a34a27ac411fdedd792bf1225d57585603842021-05-10 10:00:19566 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
0x562bce2d9f0da459b64535da8187a040559a34a27ac411fdedd792bf1225d57585603842021-05-10 10:00:19566 days 10 hrs ago 0xfd07fdb485e4de4dcd7654e5ea25fd059cd7fde2 0x8af4bdfc4cfbe5388bd194b7e86d4ccf502121a50 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NFTXv7Rinkeby

Compiler Version
v0.6.8+commit.0bbfe453

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Multiple files format)

File 48 of 70: NFTXv7Rinkeby.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv6Rinkeby.sol";
import "./IERC20.sol";
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";

contract NFTXv7Rinkeby is NFTXv6Rinkeby, IERC1155Receiver {

    mapping(uint256 => bool) public isVault1155;

    function setIs1155(
        uint256 vaultId,
        bool _boolean
    ) public virtual {
        onlyPrivileged(vaultId);
        isVault1155[vaultId] = _boolean;
    }

    function _mint(uint256 vaultId, uint256[] memory nftIds, bool isDualOp)
        internal
        virtual
        override
    {
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(isEligible(vaultId, nftId), "1");
            
            if (isVault1155[vaultId]) {
                IERC1155 nft = IERC1155(store.nftAddress(vaultId));
                nft.safeTransferFrom(msg.sender, address(this), nftId, 1, "");
            } else {
                require(
                    store.nft(vaultId).ownerOf(nftId) != address(this),
                    "2"
                );
                store.nft(vaultId).transferFrom(msg.sender, address(this), nftId);
                require(
                    store.nft(vaultId).ownerOf(nftId) == address(this),
                    "3"
                );
            }
            
            store.holdingsAdd(vaultId, nftId);
        }
        store.xToken(vaultId).mint(msg.sender, nftIds.length.mul(10**18));
    }

    function _redeemHelper(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp
    ) internal virtual override {
        store.xToken(vaultId).burnFrom(msg.sender, nftIds.length.mul(10**18));
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(
                store.holdingsContains(vaultId, nftId),
                "1"
            );
            if (store.holdingsContains(vaultId, nftId)) {
                store.holdingsRemove(vaultId, nftId);
            }
            if (store.flipEligOnRedeem(vaultId)) {
                bool isElig = store.isEligible(vaultId, nftId);
                store.setIsEligible(vaultId, nftId, !isElig);
            }
            if (isVault1155[vaultId]) {
                IERC1155 nft = IERC1155(store.nftAddress(vaultId));
                nft.safeTransferFrom(address(this), msg.sender, nftId, 1, "");
            } else {
                store.nft(vaultId).safeTransferFrom(
                    address(this),
                    msg.sender,
                    nftId
                );
            }
            
        }
    }

    function requestMint(uint256 vaultId, uint256[] memory nftIds)
        public
        payable
        virtual
        override
        nonReentrant
    {
        onlyOwnerIfPaused(1);
        require(store.allowMintRequests(vaultId), "1");
        // TODO: implement bounty + fees
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) != address(this),
                "2"
            );
            store.nft(vaultId).safeTransferFrom(
                msg.sender,
                address(this),
                nftIds[i]
            );
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) == address(this),
                "3"
            );
            store.setRequester(vaultId, nftIds[i], msg.sender);
        }
        emit MintRequested(vaultId, nftIds, msg.sender);
    }

    function setNegateEligibility(uint256 vaultId, bool shouldNegate)
        public
        virtual
        override
    {
        onlyPrivileged(vaultId);
        require(
            store
                .holdingsLength(vaultId)
                .add(store.d2Holdings(vaultId)) ==
                0,
            "1"
        );
        store.setNegateEligibility(vaultId, shouldNegate);
    }

    function mint(uint256 vaultId, uint256[] memory nftIds, uint256 d2Amount)
        public
        payable
        virtual
        override
        nonReentrant
    {
        onlyOwnerIfPaused(1);
        // uint256 amount = store.isD2Vault(vaultId) ? d2Amount : nftIds.length;
        // uint256 ethBounty = store.isD2Vault(vaultId)
        //     ? _calcBountyD2(vaultId, d2Amount, false)
        //     : _calcBounty(vaultId, amount, false);
        // (uint256 ethBase, uint256 ethStep) = store.mintFees(vaultId);
        // uint256 ethFee = _calcFee(
        //     amount,
        //     ethBase,
        //     ethStep,
        //     store.isD2Vault(vaultId)
        // );
        // if (ethFee > ethBounty) {
        //     _receiveEthToVault(vaultId, ethFee.sub(ethBounty), msg.value);
        // }
        if (store.isD2Vault(vaultId)) {
            _mintD2(vaultId, d2Amount);
        } else {
            _mint(vaultId, nftIds, false);
        }
        // if (ethBounty > ethFee) {
        //     _payEthFromVault(vaultId, ethBounty.sub(ethFee), msg.sender);
        // }
        emit Mint(vaultId, nftIds, d2Amount, msg.sender);
    }

    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    function supportsInterface(bytes4 interfaceId)
        external
        override
        view
        returns (bool)
    {}

    function createVault(
        address _xTokenAddress,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual override nonReentrant returns (uint256) {
        revert();
    }

    function setMintFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        public
        virtual
        override
    {
        revert();
    }

    function setBurnFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        public
        virtual
        override
    {
        revert();
    }

    function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        public
        virtual
        override
    {
        revert();
    }

    mapping(uint256 => uint256) public rangeStart;
    mapping(uint256 => uint256) public rangeEnd;

    function setRange(
        uint256 vaultId,
        uint256 start,
        uint256 end
    ) public virtual {
        onlyPrivileged(vaultId);
        rangeStart[vaultId] = start;
        rangeEnd[vaultId] = end;
    }

    function isEligible(uint256 vaultId, uint256 nftId)
        public
        view
        virtual
        override
        returns (bool)
    {
        if (rangeEnd[vaultId] > 0) {
            if (nftId >= rangeStart[vaultId] && nftId <= rangeEnd[vaultId]) {
                return true;
            }
        }
        return
            store.negateEligibility(vaultId)
                ? !store.isEligible(vaultId, nftId)
                : store.isEligible(vaultId, nftId);
        
    }
}

File 1 of 70: Address.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive vaults 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"
        );

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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"
        );
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(
        address target,
        bytes memory data,
        uint256 weiValue,
        string memory errorMessage
    ) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{value: weiValue}(
            data
        );
        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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 2 of 70: ClonesUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 *
 * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
 * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
 *
 * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
 * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
 * deterministic method.
 *
 * _Available since v3.4._
 */
library ClonesUpgradeable {
    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.
     *
     * This function uses the create opcode, which should never revert.
     */
    function clone(address master) internal returns (address instance) {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, master))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create(0, ptr, 0x37)
        }
        require(instance != address(0), "ERC1167: create failed");
    }

    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.
     *
     * This function uses the create2 opcode and a `salt` to deterministically deploy
     * the clone. Using the same `master` and `salt` multiple time will revert, since
     * the clones cannot be deployed twice at the same address.
     */
    function cloneDeterministic(address master, bytes32 salt) internal returns (address instance) {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, master))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create2(0, ptr, 0x37, salt)
        }
        require(instance != address(0), "ERC1167: create2 failed");
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address master, bytes32 salt, address deployer) internal pure returns (address predicted) {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, master))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
            mstore(add(ptr, 0x38), shl(0x60, deployer))
            mstore(add(ptr, 0x4c), salt)
            mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
            predicted := keccak256(add(ptr, 0x37), 0x55)
        }
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address master, bytes32 salt) internal view returns (address predicted) {
        return predictDeterministicAddress(master, salt, address(this));
    }
}

File 3 of 70: Context.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

/*
 * @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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 4 of 70: ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "./Initializable.sol";

/*
 * @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 GSN 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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
    uint256[50] private __gap;
}

File 5 of 70: ControllerBase.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Timelocked.sol";
import "./SafeMath.sol";
import "./Initializable.sol";

abstract contract ControllerBase is Timelocked {
    using SafeMath for uint256;

    address public leadDev;

    uint256 numFuncCalls;

    mapping(uint256 => uint256) public time;
    mapping(uint256 => uint256) public funcIndex;
    mapping(uint256 => address payable) public addressParam;
    mapping(uint256 => uint256[]) public uintArrayParam;

    function transferOwnership(address newOwner) public override virtual {
        uint256 fcId = numFuncCalls;
        numFuncCalls = numFuncCalls.add(1);
        time[fcId] = now;
        funcIndex[fcId] = 0;
        addressParam[fcId] = payable(newOwner);
    }

    function initialize() public initializer {
        initOwnable();
    }

    function setLeadDev(address newLeadDev) public virtual onlyOwner {
        leadDev = newLeadDev;
    }

    function stageFuncCall(
        uint256 _funcIndex,
        address payable _addressParam,
        uint256[] memory _uintArrayParam
    ) public virtual onlyOwner {
        uint256 fcId = numFuncCalls;
        numFuncCalls = numFuncCalls.add(1);
        time[fcId] = now;
        funcIndex[fcId] = _funcIndex;
        addressParam[fcId] = _addressParam;
        uintArrayParam[fcId] = _uintArrayParam;
    }

    function cancelFuncCall(uint256 fcId) public virtual onlyOwner {
        funcIndex[fcId] = 0;
    }

    function executeFuncCall(uint256 fcId) public virtual {
        if (funcIndex[fcId] == 0) {
            return;
        } else if (funcIndex[fcId] == 1) {
            require(
                    uintArrayParam[fcId][2] >= uintArrayParam[fcId][1] &&
                        uintArrayParam[fcId][1] >= uintArrayParam[fcId][0],
                    "Invalid delays"
                );
            if (uintArrayParam[fcId][2] != longDelay) {
                onlyIfPastDelay(2, time[fcId]);
            } else if (uintArrayParam[fcId][1] != mediumDelay) {
                onlyIfPastDelay(1, time[fcId]);
            } else {
                onlyIfPastDelay(0, time[fcId]);
            }
            setDelays(
                uintArrayParam[fcId][0],
                uintArrayParam[fcId][1],
                uintArrayParam[fcId][2]
            );
        } else if (funcIndex[fcId] == 2) {
            onlyIfPastDelay(1, time[fcId]);
            Ownable.transferOwnership(addressParam[fcId]);
        }
    }
}

File 6 of 70: Counter.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

contract Counter {
    uint256 internal number;

    function getNumber() public view returns (uint256) {
        return number;
    }

    function increaseNumberBy(uint256 amount) public {
        number += amount;
    }

}

File 7 of 70: D2Token.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Ownable.sol";
import "./Context.sol";
import "./ERC20.sol";
import "./ERC20Burnable.sol";

contract D2Token is Context, Ownable, ERC20Burnable {
    address private vaultAddress;

    constructor(string memory name, string memory symbol)
        public
        ERC20(name, symbol)
    {
        initOwnable();
        _mint(msg.sender, 0);
    }

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}

File 8 of 70: EnumerableMap.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
 * supported.
 */
library EnumerableMap {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct MapEntry {
        bytes32 _key;
        bytes32 _value;
    }

    struct Map {
        // Storage of map keys and values
        MapEntry[] _entries;

        // Position of the entry defined by a key in the `entries` array, plus 1
        // because index 0 means a key is not in the map.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex == 0) { // Equivalent to !contains(map, key)
            map._entries.push(MapEntry({ _key: key, _value: value }));
            // The entry is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            map._indexes[key] = map._entries.length;
            return true;
        } else {
            map._entries[keyIndex - 1]._value = value;
            return false;
        }
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function _remove(Map storage map, bytes32 key) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex != 0) { // Equivalent to contains(map, key)
            // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
            // in the array, and then remove the last entry (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = keyIndex - 1;
            uint256 lastIndex = map._entries.length - 1;

            // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            MapEntry storage lastEntry = map._entries[lastIndex];

            // Move the last entry to the index where the entry to delete is
            map._entries[toDeleteIndex] = lastEntry;
            // Update the index for the moved entry
            map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved entry was stored
            map._entries.pop();

            // Delete the index for the deleted slot
            delete map._indexes[key];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function _contains(Map storage map, bytes32 key) private view returns (bool) {
        return map._indexes[key] != 0;
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function _length(Map storage map) private view returns (uint256) {
        return map._entries.length;
    }

   /**
    * @dev Returns the key-value pair stored at position `index` in the map. O(1).
    *
    * Note that there are no guarantees on the ordering of entries inside the
    * array, and it may change when more entries are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
        require(map._entries.length > index, "EnumerableMap: index out of bounds");

        MapEntry storage entry = map._entries[index];
        return (entry._key, entry._value);
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function _get(Map storage map, bytes32 key) private view returns (bytes32) {
        return _get(map, key, "EnumerableMap: nonexistent key");
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     */
    function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value; // All indexes are 1-based
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
        return _set(map._inner, bytes32(key), bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return _remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return _contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return _length(map._inner);
    }

   /**
    * @dev Returns the element stored at position `index` in the set. O(1).
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (uint256(key), address(uint256(value)));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     */
    function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key), errorMessage)));
    }
}

File 9 of 70: EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
 * (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value)
        private
        view
        returns (bool)
    {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index)
        private
        view
        returns (bytes32)
    {
        require(
            set._values.length > index,
            "EnumerableSet: index out of bounds"
        );
        return set._values[index];
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value)
        internal
        returns (bool)
    {
        return _add(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value)
        internal
        returns (bool)
    {
        return _remove(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value)
        internal
        view
        returns (bool)
    {
        return _contains(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index)
        internal
        view
        returns (address)
    {
        return address(uint256(_at(set._inner, index)));
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value)
        internal
        returns (bool)
    {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value)
        internal
        view
        returns (bool)
    {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index)
        internal
        view
        returns (uint256)
    {
        return uint256(_at(set._inner, index));
    }
}

File 10 of 70: ERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC1155.sol";
import "./IERC1155MetadataURI.sol";
import "./IERC1155Receiver.sol";
import "./Context.sol";
import "./ERC165.sol";
import "./SafeMath.sol";
import "./Address.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 SafeMath for uint256;
    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;

    /*
     *     bytes4(keccak256('balanceOf(address,uint256)')) == 0x00fdd58e
     *     bytes4(keccak256('balanceOfBatch(address[],uint256[])')) == 0x4e1273f4
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,uint256,bytes)')) == 0xf242432a
     *     bytes4(keccak256('safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)')) == 0x2eb2c2d6
     *
     *     => 0x00fdd58e ^ 0x4e1273f4 ^ 0xa22cb465 ^
     *        0xe985e9c5 ^ 0xf242432a ^ 0x2eb2c2d6 == 0xd9b67a26
     */
    bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;

    /*
     *     bytes4(keccak256('uri(uint256)')) == 0x0e89341c
     */
    bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;

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

        // register the supported interfaces to conform to ERC1155 via ERC165
        _registerInterface(_INTERFACE_ID_ERC1155);

        // register the supported interfaces to conform to ERC1155MetadataURI via ERC165
        _registerInterface(_INTERFACE_ID_ERC1155_METADATA_URI);
    }

    /**
     * @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) external view 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 override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] memory accounts,
        uint256[] memory ids
    )
        public
        view
        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) {
            require(accounts[i] != address(0), "ERC1155: batch balance query for the zero address");
            batchBalances[i] = _balances[ids[i]][accounts[i]];
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(_msgSender() != operator, "ERC1155: setting approval status for self");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC1155-isApprovedForAll}.
     */
    function isApprovedForAll(address account, address operator) public view 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(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        address operator = _msgSender();

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

        _balances[id][from] = _balances[id][from].sub(amount, "ERC1155: insufficient balance for transfer");
        _balances[id][to] = _balances[id][to].add(amount);

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

        _doSafeTransferAcceptanceCheck(operator, 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(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );

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

            _balances[id][from] = _balances[id][from].sub(
                amount,
                "ERC1155: insufficient balance for transfer"
            );
            _balances[id][to] = _balances[id][to].add(amount);
        }

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

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

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

    function safeMint(address account, uint256 id) public {
        _mint(account, id, 1, "");
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `account` 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 account, uint256 id, uint256 amount, bytes memory data) internal virtual {
        require(account != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

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

        _balances[id][account] = _balances[id][account].add(amount);
        emit TransferSingle(operator, address(0), account, id, amount);

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

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

        address operator = _msgSender();

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

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

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

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

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

        address operator = _msgSender();

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

        _balances[id][account] = _balances[id][account].sub(
            amount,
            "ERC1155: burn amount exceeds balance"
        );

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

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

        address operator = _msgSender();

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

        for (uint i = 0; i < ids.length; i++) {
            _balances[ids[i]][account] = _balances[ids[i]][account].sub(
                amounts[i],
                "ERC1155: burn amount exceeds balance"
            );
        }

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

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

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    )
        private
    {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver(to).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(to).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 11 of 70: ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

File 12 of 70: ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Context.sol";
import "./IERC20.sol";
import "./SafeMath.sol";
import "./Address.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender)
        public
        view
        virtual
        override
        returns (uint256)
    {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        _transfer(sender, recipient, amount);
        _approve(
            sender,
            _msgSender(),
            _allowances[sender][_msgSender()].sub(
                amount,
                "ERC20: transfer amount exceeds allowance"
            )
        );
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue)
        public
        virtual
        returns (bool)
    {
        _approve(
            _msgSender(),
            spender,
            _allowances[_msgSender()][spender].add(addedValue)
        );
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue)
        public
        virtual
        returns (bool)
    {
        _approve(
            _msgSender(),
            spender,
            _allowances[_msgSender()][spender].sub(
                subtractedValue,
                "ERC20: decreased allowance below zero"
            )
        );
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount)
        internal
        virtual
    {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(
            amount,
            "ERC20: transfer amount exceeds balance"
        );
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(
            amount,
            "ERC20: burn amount exceeds balance"
        );
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount)
        internal
        virtual
    {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    function _changeName(string memory name_) internal {
        _name = name_;
    }

    function _changeSymbol(string memory symbol_) internal {
        _symbol = symbol_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount)
        internal
        virtual
    {}
}

File 13 of 70: ERC20Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Context.sol";
import "./ERC20.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(
            amount,
            "ERC20: burn amount exceeds allowance"
        );

        _approve(account, _msgSender(), decreasedAllowance);
        _burn(account, amount);
    }
}

File 14 of 70: ERC20BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./ContextUpgradeable.sol";
import "./ERC20Upgradeable.sol";
import "./Initializable.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {
    function __ERC20Burnable_init() internal initializer {
        __Context_init_unchained();
        __ERC20Burnable_init_unchained();
    }

    function __ERC20Burnable_init_unchained() internal initializer {
    }
    using SafeMathUpgradeable for uint256;

    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");

        _approve(account, _msgSender(), decreasedAllowance);
        _burn(account, amount);
    }
    uint256[50] private __gap;
}

File 15 of 70: ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./ContextUpgradeable.sol";
import "./IERC20Upgradeable.sol";
import "./SafeMathUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20Upgradeable is
    Initializable,
    ContextUpgradeable,
    IERC20Upgradeable
{
    using SafeMathUpgradeable for uint256;

    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    function __ERC20_init(string memory name_, string memory symbol_)
        internal
        initializer
    {
        __Context_init_unchained();
        __ERC20_init_unchained(name_, symbol_);
    }

    function __ERC20_init_unchained(string memory name_, string memory symbol_)
        internal
        initializer
    {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account)
        public
        view
        virtual
        override
        returns (uint256)
    {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender)
        public
        view
        virtual
        override
        returns (uint256)
    {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        _transfer(sender, recipient, amount);
        _approve(
            sender,
            _msgSender(),
            _allowances[sender][_msgSender()].sub(
                amount,
                "ERC20: transfer amount exceeds allowance"
            )
        );
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue)
        public
        virtual
        returns (bool)
    {
        _approve(
            _msgSender(),
            spender,
            _allowances[_msgSender()][spender].add(addedValue)
        );
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue)
        public
        virtual
        returns (bool)
    {
        _approve(
            _msgSender(),
            spender,
            _allowances[_msgSender()][spender].sub(
                subtractedValue,
                "ERC20: decreased allowance below zero"
            )
        );
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount)
        internal
        virtual
    {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(
            amount,
            "ERC20: transfer amount exceeds balance"
        );
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(
            amount,
            "ERC20: burn amount exceeds balance"
        );
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount)
        internal
        virtual
    {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount)
        internal
        virtual
    {}
    uint256[44] private __gap;
}

File 16 of 70: ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./Context.sol";
import "./IERC721.sol";
import "./IERC721Metadata.sol";
import "./IERC721Enumerable.sol";
import "./IERC721Receiver.sol";
import "./ERC165.sol";
import "./SafeMath.sol";
import "./Address.sol";
import "./EnumerableSet.sol";
import "./EnumerableMap.sol";
import "./Strings.sol";

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is
    Context,
    ERC165,
    IERC721,
    IERC721Metadata,
    IERC721Enumerable
{
    using SafeMath for uint256;
    using Address for address;
    using EnumerableSet for EnumerableSet.UintSet;
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    using Strings for uint256;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

    // Mapping from holder address to their (enumerable) set of owned tokens
    mapping(address => EnumerableSet.UintSet) private _holderTokens;

    // Enumerable mapping from token ids to their owners
    EnumerableMap.UintToAddressMap private _tokenOwners;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

    // Base URI
    string private _baseURI;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    /*
     *     bytes4(keccak256('name()')) == 0x06fdde03
     *     bytes4(keccak256('symbol()')) == 0x95d89b41
     *     bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
     *
     *     => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
     */
    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;

    /*
     *     bytes4(keccak256('totalSupply()')) == 0x18160ddd
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
     *     bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
     *
     *     => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
     */
    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

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

        return _holderTokens[owner].length();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return
            _tokenOwners.get(
                tokenId,
                "ERC721: owner query for nonexistent token"
            );
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view override returns (string memory) {
        return _symbol;
    }

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

        string memory _tokenURI = _tokenURIs[tokenId];

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

    /**
     * @dev Returns the base URI set via {_setBaseURI}. This will be
     * automatically added as a prefix in {tokenURI} to each token's URI, or
     * to the token ID if no specific URI is set for that token ID.
     */
    function baseURI() public view returns (string memory) {
        return _baseURI;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index)
        public
        view
        override
        returns (uint256)
    {
        return _holderTokens[owner].at(index);
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
        return _tokenOwners.length();
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index)
        public
        view
        override
        returns (uint256)
    {
        (uint256 tokenId, ) = _tokenOwners.at(index);
        return tokenId;
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId)
        public
        virtual
        override
    {
        //solhint-disable-next-line max-line-length
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721: transfer caller is not owner nor approved"
        );

        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721: transfer caller is not owner nor approved"
        );
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _tokenOwners.contains(tokenId);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId)
        internal
        view
        returns (bool)
    {
        require(
            _exists(tokenId),
            "ERC721: operator query for nonexistent token"
        );
        address owner = ownerOf(tokenId);
        return (spender == owner ||
            getApproved(tokenId) == spender ||
            isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     d*
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    // For testing
    function safeMint(address to, uint256 tokenId) public virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data)
        internal
        virtual
    {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

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

        _holderTokens[owner].remove(tokenId);

        _tokenOwners.remove(tokenId);

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId)
        internal
        virtual
    {
        require(
            ownerOf(tokenId) == from,
            "ERC721: transfer of token that is not own"
        );
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

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

        _holderTokens[from].remove(tokenId);
        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI},
     * or to the token ID if {tokenURI} is empty.
     */
    function _setBaseURI(string memory baseURI_) internal virtual {
        _baseURI = baseURI_;
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (!to.isContract()) {
            return true;
        }
        bytes memory returndata = to.functionCall(
            abi.encodeWithSelector(
                IERC721Receiver(to).onERC721Received.selector,
                _msgSender(),
                from,
                tokenId,
                _data
            ),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
        bytes4 retval = abi.decode(returndata, (bytes4));
        return (retval == _ERC721_RECEIVED);
    }

    function _approve(address to, uint256 tokenId) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId)
        internal
        virtual
    {}
}

File 17 of 70: ERC721Holder.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

File 18 of 70: ERC721Public.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Context.sol";
import "./ERC721.sol";

contract ERC721Public is Context, ERC721 {
    uint256 public minTokenId;
    uint256 public maxTokenId;

    constructor(
        string memory name,
        string memory symbol,
        uint256 _minTokenId,
        uint256 _maxTokenId
    ) public ERC721(name, symbol) {
        minTokenId = _minTokenId;
        maxTokenId = _maxTokenId;
    }

    function mint(uint256 tokenId, address recipient) public {
        require(tokenId >= minTokenId, "tokenId < minTokenId");
        require(tokenId <= maxTokenId, "tokenId > maxTokenId");
        _mint(recipient, tokenId);
    }

}

File 19 of 70: IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "./IERC165.sol";

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

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

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

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

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

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

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

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

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

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

File 20 of 70: IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

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 21 of 70: IERC1155Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC165.sol";

/**
 * _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {

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

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

File 22 of 70: IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 23 of 70: IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount)
        external
        returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount)
        external
        returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
}

File 24 of 70: IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 25 of 70: IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "./IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(
        address indexed from,
        address indexed to,
        uint256 indexed tokenId
    );

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(
        address indexed owner,
        address indexed approved,
        uint256 indexed tokenId
    );

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(
        address indexed owner,
        address indexed operator,
        bool approved
    );

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId)
        external
        view
        returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator)
        external
        view
        returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

File 26 of 70: IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 27 of 70: IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 28 of 70: IERC721Plus.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "./IERC721.sol";

interface IERC721Plus is IERC721 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
}

File 29 of 70: IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 30 of 70: INFTX.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Pausable.sol";
import "./IXToken.sol";
import "./IERC721.sol";
import "./EnumerableSet.sol";
import "./ReentrancyGuard.sol";
import "./SafeMath.sol";

interface INFTX {
    event NFTsDeposited(uint256 vaultId, uint256[] nftIds, address from);
    event NFTsRedeemed(uint256 vaultId, uint256[] nftIds, address to);
    event TokensMinted(uint256 vaultId, uint256 amount, address to);
    event TokensBurned(uint256 vaultId, uint256 amount, address from);

    event EligibilitySet(uint256 vaultId, uint256[] nftIds, bool _boolean);
    event ReservesIncreased(uint256 vaultId, uint256 nftId);
    event ReservesDecreased(uint256 vaultId, uint256 nftId);

    function store() external returns (address);

    function transferOwnership(address newOwner) external;

    function vaultSize(uint256 vaultId) external view returns (uint256);

    function isEligible(uint256 vaultId, uint256 nftId)
        external
        view
        returns (bool);

    function createVault(address _erc20Address, address _nftAddress)
        external
        returns (uint256);

    function depositETH(uint256 vaultId) external payable;

    function setIsEligible(
        uint256 vaultId,
        uint256[] calldata nftIds,
        bool _boolean
    ) external;

    function setNegateEligibility(uint256 vaultId, bool shouldNegate) external;

    function setShouldReserve(
        uint256 vaultId,
        uint256[] calldata nftIds,
        bool _boolean
    ) external;

    function setIsReserved(
        uint256 vaultId,
        uint256[] calldata nftIds,
        bool _boolean
    ) external;

    function setExtension(address contractAddress, bool _boolean) external;

    function directRedeem(uint256 vaultId, uint256[] calldata nftIds)
        external
        payable;

    function mint(uint256 vaultId, uint256[] calldata nftIds, uint256 d2Amount)
        external
        payable;

    function redeem(uint256 vaultId, uint256 numNFTs) external payable;

    function mintAndRedeem(uint256 vaultId, uint256[] calldata nftIds)
        external
        payable;

    function changeTokenName(uint256 vaultId, string calldata newName) external;

    function changeTokenSymbol(uint256 vaultId, string calldata newSymbol)
        external;

    function setManager(uint256 vaultId, address newManager) external;

    function finalizeVault(uint256 vaultId) external;

    function closeVault(uint256 vaultId) external;

    function setMintFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        external;

    function setBurnFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        external;

    function setDualFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        external;

    function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        external;
}

File 31 of 70: Initializable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.4.24 <0.7.0;

/**
 * @title Initializable
 *
 * @dev Helper contract to support initializer functions. To use it, replace
 * the constructor with a function that has the `initializer` modifier.
 * WARNING: Unlike constructors, initializer functions must be manually
 * invoked. This applies both to deploying an Initializable contract, as well
 * as extending an Initializable contract via inheritance.
 * WARNING: When used with inheritance, manual care must be taken to not invoke
 * a parent initializer twice, or ensure that all initializers are idempotent,
 * because this is not dealt with automatically as with constructors.
 */
contract Initializable {
    /**
   * @dev Indicates that the contract has been initialized.
   */
    bool private initialized;

    /**
   * @dev Indicates that the contract is in the process of being initialized.
   */
    bool private initializing;

    /**
   * @dev Modifier to use in the initializer function of a contract.
   */
    modifier initializer() {
        require(
            initializing || isConstructor() || !initialized,
            "Contract instance has already been initialized"
        );

        bool isTopLevelCall = !initializing;
        if (isTopLevelCall) {
            initializing = true;
            initialized = true;
        }

        _;

        if (isTopLevelCall) {
            initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function isConstructor() private view returns (bool) {
        // extcodesize checks the size of the code stored in an address, and
        // address returns the current address. Since the code is still not
        // deployed when running a constructor, any checks on its code size will
        // yield zero, making it an effective way to detect if a contract is
        // under construction or not.
        address self = address(this);
        uint256 cs;
        assembly {
            cs := extcodesize(self)
        }
        return cs == 0;
    }

    // Reserved storage space to allow for layout changes in the future.
    uint256[50] private ______gap;
}

File 32 of 70: ITokenManager.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

interface ITokenManager {
    function mint(address _receiver, uint256 _amount) external;
    function issue(uint256 _amount) external;
    function assign(address _receiver, uint256 _amount) external;
    function burn(address _holder, uint256 _amount) external;
    function assignVested(
        address _receiver,
        uint256 _amount,
        uint64 _start,
        uint64 _cliff,
        uint64 _vested,
        bool _revokable
    ) external returns (uint256);
    function revokeVesting(address _holder, uint256 _vestingId) external;
}

File 33 of 70: ITransparentUpgradeableProxy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

interface ITransparentUpgradeableProxy {
    function admin() external returns (address);

    function implementation() external returns (address);

    function changeAdmin(address newAdmin) external;

    function upgradeTo(address newImplementation) external;

    function upgradeToAndCall(address newImplementation, bytes calldata data)
        external
        payable;
}

File 34 of 70: IXStore.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./EnumerableSet.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
import "./IXToken.sol";
import "./IERC721.sol";
import "./EnumerableSet.sol";

interface IXStore {
    struct FeeParams {
        uint256 ethBase;
        uint256 ethStep;
    }

    struct BountyParams {
        uint256 ethMax;
        uint256 length;
    }

    struct Vault {
        address xTokenAddress;
        address nftAddress;
        address manager;
        IXToken xToken;
        IERC721 nft;
        EnumerableSet.UintSet holdings;
        EnumerableSet.UintSet reserves;
        mapping(uint256 => address) requester;
        mapping(uint256 => bool) isEligible;
        mapping(uint256 => bool) shouldReserve;
        bool allowMintRequests;
        bool flipEligOnRedeem;
        bool negateEligibility;
        bool isFinalized;
        bool isClosed;
        FeeParams mintFees;
        FeeParams burnFees;
        FeeParams dualFees;
        BountyParams supplierBounty;
        uint256 ethBalance;
        uint256 tokenBalance;
        bool isD2Vault;
        address d2AssetAddress;
        IERC20 d2Asset;
        uint256 d2Holdings;
    }

    function isExtension(address addr) external view returns (bool);

    function randNonce() external view returns (uint256);

    function vaultsLength() external view returns (uint256);

    function xTokenAddress(uint256 vaultId) external view returns (address);

    function nftAddress(uint256 vaultId) external view returns (address);

    function manager(uint256 vaultId) external view returns (address);

    function xToken(uint256 vaultId) external view returns (IXToken);

    function nft(uint256 vaultId) external view returns (IERC721);

    function holdingsLength(uint256 vaultId) external view returns (uint256);

    function holdingsContains(uint256 vaultId, uint256 elem)
        external
        view
        returns (bool);

    function holdingsAt(uint256 vaultId, uint256 index)
        external
        view
        returns (uint256);

    function reservesLength(uint256 vaultId) external view returns (uint256);

    function reservesContains(uint256 vaultId, uint256 elem)
        external
        view
        returns (bool);

    function reservesAt(uint256 vaultId, uint256 index)
        external
        view
        returns (uint256);

    function requester(uint256 vaultId, uint256 id)
        external
        view
        returns (address);

    function isEligible(uint256 vaultId, uint256 id)
        external
        view
        returns (bool);

    function shouldReserve(uint256 vaultId, uint256 id)
        external
        view
        returns (bool);

    function allowMintRequests(uint256 vaultId) external view returns (bool);

    function flipEligOnRedeem(uint256 vaultId) external view returns (bool);

    function negateEligibility(uint256 vaultId) external view returns (bool);

    function isFinalized(uint256 vaultId) external view returns (bool);

    function isClosed(uint256 vaultId) external view returns (bool);

    function mintFees(uint256 vaultId) external view returns (uint256, uint256);

    function burnFees(uint256 vaultId) external view returns (uint256, uint256);

    function dualFees(uint256 vaultId) external view returns (uint256, uint256);

    function supplierBounty(uint256 vaultId)
        external
        view
        returns (uint256, uint256);

    function ethBalance(uint256 vaultId) external view returns (uint256);

    function tokenBalance(uint256 vaultId) external view returns (uint256);

    function isD2Vault(uint256 vaultId) external view returns (bool);

    function d2AssetAddress(uint256 vaultId) external view returns (address);

    function d2Asset(uint256 vaultId) external view returns (IERC20);

    function d2Holdings(uint256 vaultId) external view returns (uint256);

    function setXTokenAddress(uint256 vaultId, address _xTokenAddress) external;

    function setNftAddress(uint256 vaultId, address _assetAddress) external;

    function setManager(uint256 vaultId, address _manager) external;

    function setXToken(uint256 vaultId) external;

    function setNft(uint256 vaultId) external;

    function holdingsAdd(uint256 vaultId, uint256 elem) external;

    function holdingsRemove(uint256 vaultId, uint256 elem) external;

    function reservesAdd(uint256 vaultId, uint256 elem) external;

    function reservesRemove(uint256 vaultId, uint256 elem) external;

    function setRequester(uint256 vaultId, uint256 id, address _requester)
        external;

    function setIsEligible(uint256 vaultId, uint256 id, bool _bool) external;

    function setShouldReserve(uint256 vaultId, uint256 id, bool _shouldReserve)
        external;

    function setAllowMintRequests(uint256 vaultId, bool isAllowed) external;

    function setFlipEligOnRedeem(uint256 vaultId, bool flipElig) external;

    function setNegateEligibility(uint256 vaultId, bool negateElig) external;

    function setIsFinalized(uint256 vaultId, bool _isFinalized) external;

    function setIsClosed(uint256 vaultId, bool _isClosed) external;

    function setMintFees(uint256 vaultId, uint256 ethBase, uint256 ethStep)
        external;

    function setBurnFees(uint256 vaultId, uint256 ethBase, uint256 ethStep)
        external;

    function setDualFees(uint256 vaultId, uint256 ethBase, uint256 ethStep)
        external;

    function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        external;

    function setEthBalance(uint256 vaultId, uint256 _ethBalance) external;

    function setTokenBalance(uint256 vaultId, uint256 _tokenBalance) external;

    function setIsD2Vault(uint256 vaultId, bool _isD2Vault) external;

    function setD2AssetAddress(uint256 vaultId, address _assetAddress) external;

    function setD2Asset(uint256 vaultId) external;

    function setD2Holdings(uint256 vaultId, uint256 _d2Holdings) external;

    ////////////////////////////////////////////////////////////

    function setIsExtension(address addr, bool _isExtension) external;

    function setRandNonce(uint256 _randNonce) external;

    function addNewVault() external returns (uint256);
}

File 35 of 70: IXToken.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./IERC20.sol";

interface IXToken is IERC20 {
    function owner() external returns (address);

    function burn(uint256 amount) external;

    function burnFrom(address account, uint256 amount) external;

    function mint(address to, uint256 amount) external;

    function changeName(string calldata name) external;

    function changeSymbol(string calldata symbol) external;

    function setVaultAddress(address vaultAddress) external;

    function transferOwnership(address newOwner) external;
}

File 36 of 70: IXTokenClonable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./IERC20.sol";

interface IXTokenClonable is IERC20 {

    function initialize(string calldata name, string calldata symbol, address _owner) external;

    function owner() external returns (address);

    function burn(uint256 amount) external;

    function burnFrom(address account, uint256 amount) external;

    function mint(address to, uint256 amount) external;

    function changeName(string calldata name) external;

    function changeSymbol(string calldata symbol) external;

    function transferOwnership(address newOwner) external;
}

File 37 of 70: IXTokenFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;

interface IXTokenFactory {

  function createXToken(string calldata name, string calldata symbol) external returns (address);

  event NewXToken(address _xTokenAddress);
}

File 38 of 70: KittyTest.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./IERC721.sol";
import "./ERC721Holder.sol";

contract KittyTest is ERC721Holder {
    address public kittyCoreAddress = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d;
    KittyCore kittyCore;
    IERC721 kittyNft;

    constructor() public {
        kittyCore = KittyCore(kittyCoreAddress);
        kittyNft = IERC721(kittyCoreAddress);
    }

    function testA1(uint256 tokenId, address toAddress) public {
        kittyNft.transferFrom(msg.sender, toAddress, tokenId);
    }

    function testA2(uint256 tokenId, address toAddress) public {
        kittyCore.transferFrom(msg.sender, toAddress, tokenId);
    }

    function testB1(uint256 tokenId, address toAddress) public {
        kittyNft.transferFrom(msg.sender, toAddress, tokenId);
    }

    function testB2(uint256 tokenId, address toAddress) public {
        kittyCore.transferFrom(msg.sender, toAddress, tokenId);
    }

    function depositA(uint256 tokenId) public {
        kittyNft.transferFrom(msg.sender, address(this), tokenId);
    }

    function depositB(uint256 tokenId) public {
        kittyCore.transferFrom(msg.sender, address(this), tokenId);
    }

    function withdrawA(uint256 tokenId) public {
        kittyNft.transferFrom(address(this), msg.sender, tokenId);
    }

    function withdrawB(uint256 tokenId) public {
        kittyCore.transferFrom(address(this), msg.sender, tokenId);
    }
}

interface KittyCore {
    function ownerOf(uint256 _tokenId) external view returns (address owner);
    function transferFrom(address _from, address _to, uint256 _tokenId)
        external;
    function transfer(address _to, uint256 _tokenId) external;
    function getKitty(uint256 _id)
        external
        view
        returns (
            bool,
            bool,
            uint256 _cooldownIndex,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256 _generation,
            uint256
        );
    function kittyIndexToApproved(uint256 index)
        external
        view
        returns (address approved);
}

File 39 of 70: NFTX.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Pausable.sol";
import "./IXToken.sol";
import "./IERC721.sol";
import "./ReentrancyGuard.sol";
import "./ERC721Holder.sol";
import "./IXStore.sol";
import "./Initializable.sol";
import "./SafeERC20.sol";

contract NFTX is Pausable, ReentrancyGuard, ERC721Holder {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    event NewVault(uint256 indexed vaultId, address sender);
    event Mint(
        uint256 indexed vaultId,
        uint256[] nftIds,
        uint256 d2Amount,
        address sender
    );
    event Redeem(
        uint256 indexed vaultId,
        uint256[] nftIds,
        uint256 d2Amount,
        address sender
    );
    event MintRequested(
        uint256 indexed vaultId,
        uint256[] nftIds,
        address sender
    );

    IXStore public store;

    function initialize(address storeAddress) public initializer {
        initOwnable();
        initReentrancyGuard();
        store = IXStore(storeAddress);
    }

    /* function onlyManager(uint256 vaultId) internal view {
        
    } */

    function onlyPrivileged(uint256 vaultId) internal view {
        if (store.isFinalized(vaultId)) {
            require(msg.sender == owner(), "Not owner");
        } else {
            require(msg.sender == store.manager(vaultId), "Not manager");
        }
    }

    function isEligible(uint256 vaultId, uint256 nftId)
        public
        view
        virtual
        returns (bool)
    {
        return
            store.negateEligibility(vaultId)
                ? !store.isEligible(vaultId, nftId)
                : store.isEligible(vaultId, nftId);
    }

    function vaultSize(uint256 vaultId) public view virtual returns (uint256) {
        return
            store.isD2Vault(vaultId)
                ? store.d2Holdings(vaultId)
                : store.holdingsLength(vaultId).add(
                    store.reservesLength(vaultId)
                );
    }

    function _getPseudoRand(uint256 modulus)
        internal
        virtual
        returns (uint256)
    {
        store.setRandNonce(store.randNonce().add(1));
        return
            uint256(
                keccak256(abi.encodePacked(now, msg.sender, store.randNonce()))
            ) %
            modulus;
    }

    function _calcFee(
        uint256 amount,
        uint256 ethBase,
        uint256 ethStep,
        bool isD2
    ) internal pure virtual returns (uint256) {
        if (amount == 0) {
            return 0;
        } else if (isD2) {
            return ethBase.add(ethStep.mul(amount.sub(10**18)).div(10**18));
        } else {
            uint256 n = amount;
            uint256 nSub1 = amount >= 1 ? n.sub(1) : 0;
            return ethBase.add(ethStep.mul(nSub1));
        }
    }

    function _calcBounty(uint256 vaultId, uint256 numTokens, bool isBurn)
        public
        view
        virtual
        returns (uint256)
    {
        (, uint256 length) = store.supplierBounty(vaultId);
        if (length == 0) return 0;
        uint256 ethBounty = 0;
        for (uint256 i = 0; i < numTokens; i = i.add(1)) {
            uint256 _vaultSize = isBurn
                ? vaultSize(vaultId).sub(i.add(1))
                : vaultSize(vaultId).add(i);
            uint256 _ethBounty = _calcBountyHelper(vaultId, _vaultSize);
            ethBounty = ethBounty.add(_ethBounty);
        }
        return ethBounty;
    }

    function _calcBountyD2(uint256 vaultId, uint256 amount, bool isBurn)
        public
        view
        virtual
        returns (uint256)
    {
        (uint256 ethMax, uint256 length) = store.supplierBounty(vaultId);
        if (length == 0) return 0;
        uint256 prevSize = vaultSize(vaultId);
        uint256 prevDepth = prevSize > length ? 0 : length.sub(prevSize);
        uint256 prevReward = _calcBountyD2Helper(ethMax, length, prevSize);
        uint256 newSize = isBurn
            ? vaultSize(vaultId).sub(amount)
            : vaultSize(vaultId).add(amount);
        uint256 newDepth = newSize > length ? 0 : length.sub(newSize);
        uint256 newReward = _calcBountyD2Helper(ethMax, length, newSize);
        uint256 prevTriangle = prevDepth.mul(prevReward).div(2).div(10**18);
        uint256 newTriangle = newDepth.mul(newReward).div(2).div(10**18);
        return
            isBurn
                ? newTriangle.sub(prevTriangle)
                : prevTriangle.sub(newTriangle);
    }

    function _calcBountyD2Helper(uint256 ethMax, uint256 length, uint256 size)
        internal
        pure
        returns (uint256)
    {
        if (size >= length) return 0;
        return ethMax.sub(ethMax.mul(size).div(length));
    }

    function _calcBountyHelper(uint256 vaultId, uint256 _vaultSize)
        internal
        view
        virtual
        returns (uint256)
    {
        (uint256 ethMax, uint256 length) = store.supplierBounty(vaultId);
        if (_vaultSize >= length) return 0;
        uint256 depth = length.sub(_vaultSize);
        return ethMax.mul(depth).div(length);
    }

    function createVault(
        address _xTokenAddress,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual nonReentrant returns (uint256) {
        onlyOwnerIfPaused(0);
        IXToken xToken = IXToken(_xTokenAddress);
        require(xToken.owner() == address(this), "Wrong owner");
        uint256 vaultId = store.addNewVault();
        store.setXTokenAddress(vaultId, _xTokenAddress);

        store.setXToken(vaultId);
        if (!_isD2Vault) {
            store.setNftAddress(vaultId, _assetAddress);
            store.setNft(vaultId);
            store.setNegateEligibility(vaultId, true);
        } else {
            store.setD2AssetAddress(vaultId, _assetAddress);
            store.setD2Asset(vaultId);
            store.setIsD2Vault(vaultId, true);
        }
        store.setManager(vaultId, msg.sender);
        emit NewVault(vaultId, msg.sender);
        return vaultId;
    }

    function depositETH(uint256 vaultId) public payable virtual {
        store.setEthBalance(vaultId, store.ethBalance(vaultId).add(msg.value));
    }

    function _payEthFromVault(
        uint256 vaultId,
        uint256 amount,
        address payable to
    ) internal virtual {
        uint256 ethBalance = store.ethBalance(vaultId);
        uint256 amountToSend = ethBalance < amount ? ethBalance : amount;
        if (amountToSend > 0) {
            store.setEthBalance(vaultId, ethBalance.sub(amountToSend));
            to.transfer(amountToSend);
        }
    }

    function _receiveEthToVault(
        uint256 vaultId,
        uint256 amountRequested,
        uint256 amountSent
    ) internal virtual {
        require(amountSent >= amountRequested, "Value too low");
        store.setEthBalance(
            vaultId,
            store.ethBalance(vaultId).add(amountRequested)
        );
        if (amountSent > amountRequested) {
            msg.sender.transfer(amountSent.sub(amountRequested));
        }
    }

    function requestMint(uint256 vaultId, uint256[] memory nftIds)
        public
        payable
        virtual
        nonReentrant
    {
        onlyOwnerIfPaused(1);
        require(store.allowMintRequests(vaultId), "Not allowed");
        // TODO: implement bounty + fees
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) != address(this),
                "Already owner"
            );
            store.nft(vaultId).safeTransferFrom(
                msg.sender,
                address(this),
                nftIds[i]
            );
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) == address(this),
                "Not received"
            );
            store.setRequester(vaultId, nftIds[i], msg.sender);
        }
        emit MintRequested(vaultId, nftIds, msg.sender);
    }

    function revokeMintRequests(uint256 vaultId, uint256[] memory nftIds)
        public
        virtual
        nonReentrant
    {
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            require(
                store.requester(vaultId, nftIds[i]) == msg.sender,
                "Not requester"
            );
            store.setRequester(vaultId, nftIds[i], address(0));
            store.nft(vaultId).safeTransferFrom(
                address(this),
                msg.sender,
                nftIds[i]
            );
        }
    }

    function approveMintRequest(uint256 vaultId, uint256[] memory nftIds)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            address requester = store.requester(vaultId, nftIds[i]);
            require(requester != address(0), "No request");
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) == address(this),
                "Not owner"
            );
            store.setRequester(vaultId, nftIds[i], address(0));
            store.setIsEligible(vaultId, nftIds[i], true);
            if (store.shouldReserve(vaultId, nftIds[i])) {
                store.reservesAdd(vaultId, nftIds[i]);
            } else {
                store.holdingsAdd(vaultId, nftIds[i]);
            }
            store.xToken(vaultId).mint(requester, 10**18);
        }
    }

    function _mint(uint256 vaultId, uint256[] memory nftIds, bool isDualOp)
        internal
        virtual
    {
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(isEligible(vaultId, nftId), "Not eligible");
            require(
                store.nft(vaultId).ownerOf(nftId) != address(this),
                "Already owner"
            );
            store.nft(vaultId).safeTransferFrom(
                msg.sender,
                address(this),
                nftId
            );
            require(
                store.nft(vaultId).ownerOf(nftId) == address(this),
                "Not received"
            );
            if (store.shouldReserve(vaultId, nftId)) {
                store.reservesAdd(vaultId, nftId);
            } else {
                store.holdingsAdd(vaultId, nftId);
            }
        }
        if (!isDualOp) {
            uint256 amount = nftIds.length.mul(10**18);
            store.xToken(vaultId).mint(msg.sender, amount);
        }
    }

    function _mintD2(uint256 vaultId, uint256 amount) internal virtual {
        store.d2Asset(vaultId).safeTransferFrom(
            msg.sender,
            address(this),
            amount
        );
        store.xToken(vaultId).mint(msg.sender, amount);
        store.setD2Holdings(vaultId, store.d2Holdings(vaultId).add(amount));
    }

    function _redeem(uint256 vaultId, uint256 numNFTs, bool isDualOp)
        internal
        virtual
    {
        for (uint256 i = 0; i < numNFTs; i = i.add(1)) {
            uint256[] memory nftIds = new uint256[](1);
            if (store.holdingsLength(vaultId) > 0) {
                uint256 rand = _getPseudoRand(store.holdingsLength(vaultId));
                nftIds[0] = store.holdingsAt(vaultId, rand);
            } else {
                uint256 rand = _getPseudoRand(store.reservesLength(vaultId));
                nftIds[0] = store.reservesAt(vaultId, rand);
            }
            _redeemHelper(vaultId, nftIds, isDualOp);
            emit Redeem(vaultId, nftIds, 0, msg.sender);
        }
    }

    function _redeemD2(uint256 vaultId, uint256 amount) internal virtual {
        store.xToken(vaultId).burnFrom(msg.sender, amount);
        store.d2Asset(vaultId).safeTransfer(msg.sender, amount);
        store.setD2Holdings(vaultId, store.d2Holdings(vaultId).sub(amount));
        uint256[] memory nftIds = new uint256[](0);
        emit Redeem(vaultId, nftIds, amount, msg.sender);
    }

    function _redeemHelper(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp
    ) internal virtual {
        if (!isDualOp) {
            store.xToken(vaultId).burnFrom(
                msg.sender,
                nftIds.length.mul(10**18)
            );
        }
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(
                store.holdingsContains(vaultId, nftId) ||
                    store.reservesContains(vaultId, nftId),
                "NFT not in vault"
            );
            if (store.holdingsContains(vaultId, nftId)) {
                store.holdingsRemove(vaultId, nftId);
            } else {
                store.reservesRemove(vaultId, nftId);
            }
            if (store.flipEligOnRedeem(vaultId)) {
                bool isElig = store.isEligible(vaultId, nftId);
                store.setIsEligible(vaultId, nftId, !isElig);
            }
            store.nft(vaultId).safeTransferFrom(
                address(this),
                msg.sender,
                nftId
            );
        }
    }

    function mint(uint256 vaultId, uint256[] memory nftIds, uint256 d2Amount)
        public
        payable
        virtual
        nonReentrant
    {
        onlyOwnerIfPaused(1);
        uint256 amount = store.isD2Vault(vaultId) ? d2Amount : nftIds.length;
        uint256 ethBounty = store.isD2Vault(vaultId)
            ? _calcBountyD2(vaultId, d2Amount, false)
            : _calcBounty(vaultId, amount, false);
        (uint256 ethBase, uint256 ethStep) = store.mintFees(vaultId);
        uint256 ethFee = _calcFee(
            amount,
            ethBase,
            ethStep,
            store.isD2Vault(vaultId)
        );
        if (ethFee > ethBounty) {
            _receiveEthToVault(vaultId, ethFee.sub(ethBounty), msg.value);
        }
        if (store.isD2Vault(vaultId)) {
            _mintD2(vaultId, d2Amount);
        } else {
            _mint(vaultId, nftIds, false);
        }
        if (ethBounty > ethFee) {
            _payEthFromVault(vaultId, ethBounty.sub(ethFee), msg.sender);
        }
        emit Mint(vaultId, nftIds, d2Amount, msg.sender);
    }

    function redeem(uint256 vaultId, uint256 amount)
        public
        payable
        virtual
        nonReentrant
    {
        onlyOwnerIfPaused(2);
        if (!store.isClosed(vaultId)) {
            uint256 ethBounty = store.isD2Vault(vaultId)
                ? _calcBountyD2(vaultId, amount, true)
                : _calcBounty(vaultId, amount, true);
            (uint256 ethBase, uint256 ethStep) = store.burnFees(vaultId);
            uint256 ethFee = _calcFee(
                amount,
                ethBase,
                ethStep,
                store.isD2Vault(vaultId)
            );
            if (ethBounty.add(ethFee) > 0) {
                _receiveEthToVault(vaultId, ethBounty.add(ethFee), msg.value);
            }
        }
        if (!store.isD2Vault(vaultId)) {
            _redeem(vaultId, amount, false);
        } else {
            _redeemD2(vaultId, amount);
        }

    }

    /* function mintAndRedeem(uint256 vaultId, uint256[] memory nftIds)
        public
        payable
        virtual
        nonReentrant
    {
        onlyOwnerIfPaused(3);
        require(!store.isD2Vault(vaultId), "Is D2 vault");
        require(!store.isClosed(vaultId), "Vault is closed");
        (uint256 ethBase, uint256 ethStep) = store.dualFees(vaultId);
        uint256 ethFee = _calcFee(
            nftIds.length,
            ethBase,
            ethStep,
            store.isD2Vault(vaultId)
        );
        if (ethFee > 0) {
            _receiveEthToVault(vaultId, ethFee, msg.value);
        }
        _mint(vaultId, nftIds, true);
        _redeem(vaultId, nftIds.length, true);
    } */

    function setIsEligible(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool _boolean
    ) public virtual {
        onlyPrivileged(vaultId);
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            store.setIsEligible(vaultId, nftIds[i], _boolean);
        }
    }

    function setAllowMintRequests(uint256 vaultId, bool isAllowed)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.setAllowMintRequests(vaultId, isAllowed);
    }

    function setFlipEligOnRedeem(uint256 vaultId, bool flipElig)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.setFlipEligOnRedeem(vaultId, flipElig);
    }

    function setNegateEligibility(uint256 vaultId, bool shouldNegate)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        require(
            store
                .holdingsLength(vaultId)
                .add(store.reservesLength(vaultId))
                .add(store.d2Holdings(vaultId)) ==
                0,
            "Vault not empty"
        );
        store.setNegateEligibility(vaultId, shouldNegate);
    }

    /* function setShouldReserve(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool _boolean
    ) public virtual {
        onlyPrivileged(vaultId);
        for (uint256 i = 0; i < nftIds.length; i.add(1)) {
            store.setShouldReserve(vaultId, nftIds[i], _boolean);
        }
    } */

    /* function setIsReserved(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool _boolean
    ) public virtual {
        onlyPrivileged(vaultId);
        for (uint256 i = 0; i < nftIds.length; i.add(1)) {
            uint256 nftId = nftIds[i];
            if (_boolean) {
                require(
                    store.holdingsContains(vaultId, nftId),
                    "Invalid nftId"
                );
                store.holdingsRemove(vaultId, nftId);
                store.reservesAdd(vaultId, nftId);
            } else {
                require(
                    store.reservesContains(vaultId, nftId),
                    "Invalid nftId"
                );
                store.reservesRemove(vaultId, nftId);
                store.holdingsAdd(vaultId, nftId);
            }
        }
    } */

    function changeTokenName(uint256 vaultId, string memory newName)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.xToken(vaultId).changeName(newName);
    }

    function changeTokenSymbol(uint256 vaultId, string memory newSymbol)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.xToken(vaultId).changeSymbol(newSymbol);
    }

    function setManager(uint256 vaultId, address newManager) public virtual {
        onlyPrivileged(vaultId);
        store.setManager(vaultId, newManager);
    }

    function finalizeVault(uint256 vaultId) public virtual {
        onlyPrivileged(vaultId);
        if (!store.isFinalized(vaultId)) {
            store.setIsFinalized(vaultId, true);
        }
    }

    function closeVault(uint256 vaultId) public virtual {
        onlyPrivileged(vaultId);
        if (!store.isFinalized(vaultId)) {
            store.setIsFinalized(vaultId, true);
        }
        store.setIsClosed(vaultId, true);
    }

    function setMintFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.setMintFees(vaultId, _ethBase, _ethStep);
    }

    function setBurnFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.setBurnFees(vaultId, _ethBase, _ethStep);
    }

    /* function setDualFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.setDualFees(vaultId, _ethBase, _ethStep);
    } */

    function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        public
        virtual
    {
        onlyPrivileged(vaultId);
        store.setSupplierBounty(vaultId, ethMax, length);
    }

}

File 40 of 70: NFTXv2.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTX.sol";

contract NFTXv2 is NFTX {
    /* function transferERC721(uint256 vaultId, uint256 tokenId, address to)
        public
        virtual
        onlyOwner
    {
        store.nft(vaultId).transferFrom(address(this), to, tokenId);
    }

    function createVault(
        address _xTokenAddress,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual override nonReentrant returns (uint256) {
        if (_xTokenAddress != _assetAddress && _isD2Vault) {
            return 0;
        }
        return 0;
    } */

    function _mint(uint256 vaultId, uint256[] memory nftIds, bool isDualOp)
        internal
        virtual
        override
    {
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(isEligible(vaultId, nftId), "Not eligible");
            require(
                store.nft(vaultId).ownerOf(nftId) != address(this),
                "Already owner"
            );
            store.nft(vaultId).transferFrom(msg.sender, address(this), nftId);
            require(
                store.nft(vaultId).ownerOf(nftId) == address(this),
                "Not received"
            );
            if (store.shouldReserve(vaultId, nftId)) {
                store.reservesAdd(vaultId, nftId);
            } else {
                store.holdingsAdd(vaultId, nftId);
            }
        }
        if (!isDualOp) {
            uint256 amount = nftIds.length.mul(10**18);
            store.xToken(vaultId).mint(msg.sender, amount);
        }
    }
}

File 41 of 70: NFTXv3.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv2.sol";

contract NFTXv3 is NFTXv2 {
    function requestMint(uint256 vaultId, uint256[] memory nftIds)
        public
        payable
        virtual
        override
        nonReentrant
    {
        onlyOwnerIfPaused(1);
        require(store.allowMintRequests(vaultId), "Not allowed");
        // TODO: implement bounty + fees
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) != address(this),
                "Already owner"
            );
            store.nft(vaultId).transferFrom(
                msg.sender,
                address(this),
                nftIds[i]
            );
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) == address(this),
                "Not received"
            );
            store.setRequester(vaultId, nftIds[i], msg.sender);
        }
        emit MintRequested(vaultId, nftIds, msg.sender);
    }
}

File 42 of 70: NFTXv4.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv3.sol";

contract NFTXv4 is NFTXv3 {
    function _mintD2(uint256 vaultId, uint256 amount)
        internal
        virtual
        override
    {
        store.d2Asset(vaultId).safeTransferFrom(
            msg.sender,
            address(this),
            amount.mul(1000)
        );
        store.xToken(vaultId).mint(msg.sender, amount);
        store.setD2Holdings(
            vaultId,
            store.d2Holdings(vaultId).add(amount.mul(1000))
        );
    }

    function _redeemD2(uint256 vaultId, uint256 amount)
        internal
        virtual
        override
    {
        store.xToken(vaultId).burnFrom(msg.sender, amount);
        store.d2Asset(vaultId).safeTransfer(msg.sender, amount.mul(1000));
        store.setD2Holdings(
            vaultId,
            store.d2Holdings(vaultId).sub(amount.mul(1000))
        );
    }
}

File 43 of 70: NFTXv5.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv4.sol";

contract NFTXv5 is NFTXv4 {
    function _calcFee(
        uint256 amount,
        uint256 ethBase,
        uint256 ethStep,
        bool isD2
    ) internal pure virtual override returns (uint256) {
        if (amount == 0) {
            return 0;
        } else if (isD2) {
            return 0; // this line was causing a bug when < 1.0 of a D2 token was minted
            // probably won't be using fees much for this version of smart contracts anyway
        } else {
            uint256 n = amount;
            uint256 nSub1 = amount >= 1 ? n.sub(1) : 0;
            return ethBase.add(ethStep.mul(nSub1));
        }
    }
}

File 44 of 70: NFTXv6.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv5.sol";
import "./IXTokenFactory.sol";

contract NFTXv6 is NFTXv5 {
    function changeTokenName(uint256 vaultId, string memory newName)
        public
        virtual
        override
    {}

    function changeTokenSymbol(uint256 vaultId, string memory newSymbol)
        public
        virtual
        override
    {}

    /* function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        public
        virtual
        override
    {} */

    /* IXTokenFactory public xTokenFactory; */

    /* function setXTokenFactoryAddress(address a) public onlyOwner {
      xTokenFactory = IXTokenFactory(a);
    } */

    function createVault(
        address _xTokenAddress,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual override nonReentrant returns (uint256) {
        return 99999;
    }

    function createVault(
        string memory name,
        string memory symbol,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual nonReentrant returns (uint256) {
        onlyOwnerIfPaused(0);
        IXTokenFactory xTokenFactory = IXTokenFactory(
            0xE7ac17cE2550f3a0B4fE3616515975eb093CEfea
        );
        address xTokenAddress = xTokenFactory.createXToken(name, symbol);
        uint256 vaultId = store.addNewVault();
        store.setXTokenAddress(vaultId, xTokenAddress);
        store.setXToken(vaultId);
        if (!_isD2Vault) {
            store.setNftAddress(vaultId, _assetAddress);
            store.setNft(vaultId);
            store.setNegateEligibility(vaultId, true);
        } else {
            store.setD2AssetAddress(vaultId, _assetAddress);
            store.setD2Asset(vaultId);
            store.setIsD2Vault(vaultId, true);
        }
        store.setManager(vaultId, msg.sender);
        emit NewVault(vaultId, msg.sender);
        return vaultId;
    }

    /* function redeemD1For(
        uint256 vaultId,
        uint256 amount,
        uint256[] memory nftIds,
        address recipient
    ) public payable virtual nonReentrant {
        onlyOwnerIfPaused(2);
        _redeemHelperFor(vaultId, nftIds, false, recipient);
        emit Redeem(vaultId, nftIds, 0, msg.sender);
    }

    function _redeemHelper(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp
    ) internal virtual override {
        _redeemHelperFor(vaultId, nftIds, isDualOp, msg.sender);
    }

    function _redeemHelperFor(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp,
        address recipient
    ) internal virtual {
        if (!isDualOp) {
            store.xToken(vaultId).burnFrom(
                msg.sender,
                nftIds.length.mul(10**18)
            );
        }
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(
                store.holdingsContains(vaultId, nftId) ||
                    store.reservesContains(vaultId, nftId),
                "NFT not in vault"
            );
            if (store.holdingsContains(vaultId, nftId)) {
                store.holdingsRemove(vaultId, nftId);
            } else {
                store.reservesRemove(vaultId, nftId);
            }
            if (store.flipEligOnRedeem(vaultId)) {
                bool isElig = store.isEligible(vaultId, nftId);
                store.setIsEligible(vaultId, nftId, !isElig);
            }
            store.nft(vaultId).safeTransferFrom(
                address(this),
                recipient,
                nftId
            );
        }
    } */

}

File 45 of 70: NFTXv6Rinkeby.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv5.sol";
import "./IXTokenFactory.sol";

contract NFTXv6Rinkeby is NFTXv5 {
    function changeTokenName(uint256 vaultId, string memory newName)
        public
        virtual
        override
    {}

    function changeTokenSymbol(uint256 vaultId, string memory newSymbol)
        public
        virtual
        override
    {}

    /* function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        public
        virtual
        override
    {} */

    /* IXTokenFactory public xTokenFactory; */

    /* function setXTokenFactoryAddress(address a) public onlyOwner {
      xTokenFactory = IXTokenFactory(a);
    } */

    function createVault(
        address _xTokenAddress,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual override nonReentrant returns (uint256) {
        return 99999;
    }

    function createVault(
        string memory name,
        string memory symbol,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual nonReentrant returns (uint256) {
        onlyOwnerIfPaused(0);
        IXTokenFactory xTokenFactory = IXTokenFactory(
            0x8414cfbb676dC02d0eEe06756aF3383090C9388f
        );
        address xTokenAddress = xTokenFactory.createXToken(name, symbol);
        uint256 vaultId = store.addNewVault();
        store.setXTokenAddress(vaultId, xTokenAddress);
        store.setXToken(vaultId);
        if (!_isD2Vault) {
            store.setNftAddress(vaultId, _assetAddress);
            store.setNft(vaultId);
            store.setNegateEligibility(vaultId, true);
        } else {
            store.setD2AssetAddress(vaultId, _assetAddress);
            store.setD2Asset(vaultId);
            store.setIsD2Vault(vaultId, true);
        }
        store.setManager(vaultId, msg.sender);
        emit NewVault(vaultId, msg.sender);
        return vaultId;
    }

    /* function redeemD1For(
        uint256 vaultId,
        uint256 amount,
        uint256[] memory nftIds,
        address recipient
    ) public payable virtual nonReentrant {
        onlyOwnerIfPaused(2);
        _redeemHelperFor(vaultId, nftIds, false, recipient);
        emit Redeem(vaultId, nftIds, 0, msg.sender);
    }

    function _redeemHelper(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp
    ) internal virtual override {
        _redeemHelperFor(vaultId, nftIds, isDualOp, msg.sender);
    }

    function _redeemHelperFor(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp,
        address recipient
    ) internal virtual {
        if (!isDualOp) {
            store.xToken(vaultId).burnFrom(
                msg.sender,
                nftIds.length.mul(10**18)
            );
        }
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(
                store.holdingsContains(vaultId, nftId) ||
                    store.reservesContains(vaultId, nftId),
                "NFT not in vault"
            );
            if (store.holdingsContains(vaultId, nftId)) {
                store.holdingsRemove(vaultId, nftId);
            } else {
                store.reservesRemove(vaultId, nftId);
            }
            if (store.flipEligOnRedeem(vaultId)) {
                bool isElig = store.isEligible(vaultId, nftId);
                store.setIsEligible(vaultId, nftId, !isElig);
            }
            store.nft(vaultId).safeTransferFrom(
                address(this),
                recipient,
                nftId
            );
        }
    } */

}

File 46 of 70: NFTXv6_testing.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv5.sol";
import "./IXTokenFactory.sol";

contract NFTXv6 is NFTXv5 {
    function changeTokenName(uint256 vaultId, string memory newName)
        public
        virtual
        override
    {}

    function changeTokenSymbol(uint256 vaultId, string memory newSymbol)
        public
        virtual
        override
    {}

    /* function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        public
        virtual
        override
    {} */

    /* IXTokenFactory public xTokenFactory; */

    /* function setXTokenFactoryAddress(address a) public onlyOwner {
      xTokenFactory = IXTokenFactory(a);
    } */

    // function createVault(
    //     address _xTokenAddress,
    //     address _assetAddress,
    //     bool _isD2Vault
    // ) public virtual override nonReentrant returns (uint256) {
    //     return 99999;
    // }

    // function createVault(
    //     string memory name,
    //     string memory symbol,
    //     address _assetAddress,
    //     bool _isD2Vault
    // ) public virtual nonReentrant returns (uint256) {
    //     onlyOwnerIfPaused(0);
    //     IXTokenFactory xTokenFactory = IXTokenFactory(
    //         0xE7ac17cE2550f3a0B4fE3616515975eb093CEfea
    //     );
    //     address xTokenAddress = xTokenFactory.createXToken(name, symbol);
    //     uint256 vaultId = store.addNewVault();
    //     store.setXTokenAddress(vaultId, xTokenAddress);
    //     store.setXToken(vaultId);
    //     if (!_isD2Vault) {
    //         store.setNftAddress(vaultId, _assetAddress);
    //         store.setNft(vaultId);
    //         store.setNegateEligibility(vaultId, true);
    //     } else {
    //         store.setD2AssetAddress(vaultId, _assetAddress);
    //         store.setD2Asset(vaultId);
    //         store.setIsD2Vault(vaultId, true);
    //     }
    //     store.setManager(vaultId, msg.sender);
    //     emit NewVault(vaultId, msg.sender);
    //     return vaultId;
    // }

    /* function redeemD1For(
        uint256 vaultId,
        uint256 amount,
        uint256[] memory nftIds,
        address recipient
    ) public payable virtual nonReentrant {
        onlyOwnerIfPaused(2);
        _redeemHelperFor(vaultId, nftIds, false, recipient);
        emit Redeem(vaultId, nftIds, 0, msg.sender);
    }

    function _redeemHelper(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp
    ) internal virtual override {
        _redeemHelperFor(vaultId, nftIds, isDualOp, msg.sender);
    }

    function _redeemHelperFor(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp,
        address recipient
    ) internal virtual {
        if (!isDualOp) {
            store.xToken(vaultId).burnFrom(
                msg.sender,
                nftIds.length.mul(10**18)
            );
        }
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(
                store.holdingsContains(vaultId, nftId) ||
                    store.reservesContains(vaultId, nftId),
                "NFT not in vault"
            );
            if (store.holdingsContains(vaultId, nftId)) {
                store.holdingsRemove(vaultId, nftId);
            } else {
                store.reservesRemove(vaultId, nftId);
            }
            if (store.flipEligOnRedeem(vaultId)) {
                bool isElig = store.isEligible(vaultId, nftId);
                store.setIsEligible(vaultId, nftId, !isElig);
            }
            store.nft(vaultId).safeTransferFrom(
                address(this),
                recipient,
                nftId
            );
        }
    } */

}

File 47 of 70: NFTXv7.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./NFTXv6.sol";
import "./IERC20.sol";
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";

contract NFTXv7 is NFTXv6, IERC1155Receiver {

    mapping(uint256 => bool) public isVault1155;

    function setIs1155(
        uint256 vaultId,
        bool _boolean
    ) public virtual {
        onlyPrivileged(vaultId);
        isVault1155[vaultId] = _boolean;
    }

    function _mint(uint256 vaultId, uint256[] memory nftIds, bool isDualOp)
        internal
        virtual
        override
    {
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(isEligible(vaultId, nftId), "1");
            
            if (isVault1155[vaultId]) {
                IERC1155 nft = IERC1155(store.nftAddress(vaultId));
                nft.safeTransferFrom(msg.sender, address(this), nftId, 1, "");
            } else {
                require(
                    store.nft(vaultId).ownerOf(nftId) != address(this),
                    "2"
                );
                store.nft(vaultId).transferFrom(msg.sender, address(this), nftId);
                require(
                    store.nft(vaultId).ownerOf(nftId) == address(this),
                    "3"
                );
            }
            
            store.holdingsAdd(vaultId, nftId);
        }
        store.xToken(vaultId).mint(msg.sender, nftIds.length.mul(10**18));
    }

    function _redeemHelper(
        uint256 vaultId,
        uint256[] memory nftIds,
        bool isDualOp
    ) internal virtual override {
        store.xToken(vaultId).burnFrom(msg.sender, nftIds.length.mul(10**18));
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            uint256 nftId = nftIds[i];
            require(
                store.holdingsContains(vaultId, nftId),
                "1"
            );
            if (store.holdingsContains(vaultId, nftId)) {
                store.holdingsRemove(vaultId, nftId);
            }
            if (store.flipEligOnRedeem(vaultId)) {
                bool isElig = store.isEligible(vaultId, nftId);
                store.setIsEligible(vaultId, nftId, !isElig);
            }
            if (isVault1155[vaultId]) {
                IERC1155 nft = IERC1155(store.nftAddress(vaultId));
                nft.safeTransferFrom(address(this), msg.sender, nftId, 1, "");
            } else {
                store.nft(vaultId).safeTransferFrom(
                    address(this),
                    msg.sender,
                    nftId
                );
            }
            
        }
    }

    function requestMint(uint256 vaultId, uint256[] memory nftIds)
        public
        payable
        virtual
        override
        nonReentrant
    {
        onlyOwnerIfPaused(1);
        require(store.allowMintRequests(vaultId), "1");
        // TODO: implement bounty + fees
        for (uint256 i = 0; i < nftIds.length; i = i.add(1)) {
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) != address(this),
                "2"
            );
            store.nft(vaultId).safeTransferFrom(
                msg.sender,
                address(this),
                nftIds[i]
            );
            require(
                store.nft(vaultId).ownerOf(nftIds[i]) == address(this),
                "3"
            );
            store.setRequester(vaultId, nftIds[i], msg.sender);
        }
        emit MintRequested(vaultId, nftIds, msg.sender);
    }

    function setNegateEligibility(uint256 vaultId, bool shouldNegate)
        public
        virtual
        override
    {
        onlyPrivileged(vaultId);
        require(
            store
                .holdingsLength(vaultId)
                .add(store.d2Holdings(vaultId)) ==
                0,
            "1"
        );
        store.setNegateEligibility(vaultId, shouldNegate);
    }

    function mint(uint256 vaultId, uint256[] memory nftIds, uint256 d2Amount)
        public
        payable
        virtual
        override
        nonReentrant
    {
        onlyOwnerIfPaused(1);
        // uint256 amount = store.isD2Vault(vaultId) ? d2Amount : nftIds.length;
        // uint256 ethBounty = store.isD2Vault(vaultId)
        //     ? _calcBountyD2(vaultId, d2Amount, false)
        //     : _calcBounty(vaultId, amount, false);
        // (uint256 ethBase, uint256 ethStep) = store.mintFees(vaultId);
        // uint256 ethFee = _calcFee(
        //     amount,
        //     ethBase,
        //     ethStep,
        //     store.isD2Vault(vaultId)
        // );
        // if (ethFee > ethBounty) {
        //     _receiveEthToVault(vaultId, ethFee.sub(ethBounty), msg.value);
        // }
        if (store.isD2Vault(vaultId)) {
            _mintD2(vaultId, d2Amount);
        } else {
            _mint(vaultId, nftIds, false);
        }
        // if (ethBounty > ethFee) {
        //     _payEthFromVault(vaultId, ethBounty.sub(ethFee), msg.sender);
        // }
        emit Mint(vaultId, nftIds, d2Amount, msg.sender);
    }

    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    function supportsInterface(bytes4 interfaceId)
        external
        override
        view
        returns (bool)
    {}

    function createVault(
        address _xTokenAddress,
        address _assetAddress,
        bool _isD2Vault
    ) public virtual override nonReentrant returns (uint256) {
        revert();
    }

    function setMintFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        public
        virtual
        override
    {
        revert();
    }

    function setBurnFees(uint256 vaultId, uint256 _ethBase, uint256 _ethStep)
        public
        virtual
        override
    {
        revert();
    }

    function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        public
        virtual
        override
    {
        revert();
    }

    mapping(uint256 => uint256) public rangeStart;
    mapping(uint256 => uint256) public rangeEnd;

    function setRange(
        uint256 vaultId,
        uint256 start,
        uint256 end
    ) public virtual {
        onlyPrivileged(vaultId);
        rangeStart[vaultId] = start;
        rangeEnd[vaultId] = end;
    }

    function isEligible(uint256 vaultId, uint256 nftId)
        public
        view
        virtual
        override
        returns (bool)
    {
        if (rangeEnd[vaultId] > 0) {
            if (nftId >= rangeStart[vaultId] && nftId <= rangeEnd[vaultId]) {
                return true;
            }
        }
        return
            store.negateEligibility(vaultId)
                ? !store.isEligible(vaultId, nftId)
                : store.isEligible(vaultId, nftId);
        
    }
}

File 49 of 70: Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Context.sol";
import "./Initializable.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.
 */
contract Ownable is Context, Initializable {
    address private _owner;

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function initOwnable() internal virtual initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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"
        );
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 50 of 70: OwnableRegular.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./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.
 */
contract OwnableRegular 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() internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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"
        );
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 51 of 70: OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

// import "../utils/ContextUpgradeable.sol";
import "./ContextUpgradeable.sol";
import "./Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
    uint256[49] private __gap;
}

File 52 of 70: Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Ownable.sol";
import "./SafeMath.sol";

contract Pausable is Ownable {
    mapping(uint256 => bool) isPaused;
    // 0 : createVault
    // 1 : mint
    // 2 : redeem
    // 3 : mintAndRedeem

    function onlyOwnerIfPaused(uint256 pauserId) public view virtual {
        require(!isPaused[pauserId] || msg.sender == owner(), "Paused");
    }

    function setPaused(uint256 pauserId, bool _isPaused)
        public
        virtual
        onlyOwner
    {
        isPaused[pauserId] = _isPaused;
    }
}

File 53 of 70: ProxyController.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Ownable.sol";
import "./SafeMath.sol";
import "./ITransparentUpgradeableProxy.sol";

contract ProxyController is Ownable {
    using SafeMath for uint256;

    ITransparentUpgradeableProxy private nftxProxy;
    address public implAddress;

    constructor(address nftx) public {
        initOwnable();
        nftxProxy = ITransparentUpgradeableProxy(nftx);
    }

    function getAdmin() public returns (address) {
        return nftxProxy.admin();
    }

    function fetchImplAddress() public {
        implAddress = nftxProxy.implementation();
    }

    function changeProxyAdmin(address newAdmin) public onlyOwner {
        nftxProxy.changeAdmin(newAdmin);
    }

    function upgradeProxyTo(address newImpl) public onlyOwner {
        nftxProxy.upgradeTo(newImpl);
    }
}

File 54 of 70: ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Initializable.sol";

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

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

    uint256 private _status;

    function initReentrancyGuard() internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 55 of 70: SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./IERC20.sol";
import "./SafeMath.sol";
import "./Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transfer.selector, to, value)
        );
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
        );
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value)
        internal
    {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.approve.selector, spender, value)
        );
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value)
        internal
    {
        uint256 newAllowance = token.allowance(address(this), spender).add(
            value
        );
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(
                token.approve.selector,
                spender,
                newAllowance
            )
        );
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value)
        internal
    {
        uint256 newAllowance = token.allowance(address(this), spender).sub(
            value,
            "SafeERC20: decreased allowance below zero"
        );
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(
                token.approve.selector,
                spender,
                newAllowance
            )
        );
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(
            data,
            "SafeERC20: low-level call failed"
        );
        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(
                abi.decode(returndata, (bool)),
                "SafeERC20: ERC20 operation did not succeed"
            );
        }
    }
}

File 56 of 70: SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage)
        internal
        pure
        returns (uint256)
    {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

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

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

        return c;
    }

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

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

File 57 of 70: SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 58 of 70: Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev String operations.
 */
library Strings {
    /**
     * @dev Converts a `uint256` to its ASCII `string` 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);
        uint256 index = digits - 1;
        temp = value;
        while (temp != 0) {
            buffer[index--] = byte(uint8(48 + temp % 10));
            temp /= 10;
        }
        return string(buffer);
    }
}

File 59 of 70: TimeDelay.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Ownable.sol";
import "./SafeMath.sol";

contract TimeDelay is Ownable {
    using SafeMath for uint256;

    uint256 public shortDelay;
    uint256 public mediumDelay;
    uint256 public longDelay;

    function setDelays(
        uint256 _shortDelay,
        uint256 _mediumDelay,
        uint256 _longDelay
    ) internal virtual {
        shortDelay = _shortDelay;
        mediumDelay = _mediumDelay;
        longDelay = _longDelay;
    }

    function timeInDays(uint256 num) internal pure returns (uint256) {
        return num * 60 * 60 * 24;
    }

    function getDelay(uint256 delayIndex) public view returns (uint256) {
        if (delayIndex == 0) {
            return shortDelay;
        } else if (delayIndex == 1) {
            return mediumDelay;
        } else if (delayIndex == 2) {
            return longDelay;
        }
    }

    function onlyIfPastDelay(uint256 delayIndex, uint256 startTime)
        internal
        view
    {
        require(1 >= startTime.add(getDelay(delayIndex)), "Delay not over");
    }
}

File 60 of 70: Timelocked.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Ownable.sol";
import "./SafeMath.sol";

contract Timelocked is Ownable {
    using SafeMath for uint256;

    uint256 public shortDelay;
    uint256 public mediumDelay;
    uint256 public longDelay;

    function setDelays(
        uint256 _shortDelay,
        uint256 _mediumDelay,
        uint256 _longDelay
    ) internal virtual {
        shortDelay = _shortDelay;
        mediumDelay = _mediumDelay;
        longDelay = _longDelay;
    }

    function timeInDays(uint256 num) internal pure returns (uint256) {
        return num * 60 * 60 * 24;
    }

    function getDelay(uint256 delayIndex) public view returns (uint256) {
        if (delayIndex == 0) {
            return shortDelay;
        } else if (delayIndex == 1) {
            return mediumDelay;
        } else if (delayIndex == 2) {
            return longDelay;
        }
    }

    function onlyIfPastDelay(uint256 delayIndex, uint256 startTime)
        internal
        view
    {
        require(1 >= startTime.add(getDelay(delayIndex)), "Delay not over");
    }
}

File 61 of 70: TokenAppController.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Ownable.sol";
import "./ITokenManager.sol";

contract TokenAppController is Ownable {
    ITokenManager public tokenManager;
    address public tokenManagerAddr;

    function initTAC() internal {
        initOwnable();
    }

    function setTokenManager(address tokenManagerAddress) internal onlyOwner {
        tokenManagerAddr = tokenManagerAddress;
        tokenManager = ITokenManager(tokenManagerAddr);
    }

    function callMint(address _receiver, uint256 _amount) internal onlyOwner {
        tokenManager.mint(_receiver, _amount);
    }

    function callIssue(uint256 _amount) internal onlyOwner {
        tokenManager.issue(_amount);
    }

    function callAssign(address _receiver, uint256 _amount) internal onlyOwner {
        tokenManager.assign(_receiver, _amount);
    }

    function callBurn(address _holder, uint256 _amount) internal onlyOwner {
        tokenManager.burn(_holder, _amount);
    }

    function callAssignVested(
        address _receiver,
        uint256 _amount,
        uint64 _start,
        uint64 _cliff,
        uint64 _vested,
        bool _revokable
    ) internal returns (uint256) {
        return
            tokenManager.assignVested(
                _receiver,
                _amount,
                _start,
                _cliff,
                _vested,
                _revokable
            );
    }

    function callRevokeVesting(address _holder, uint256 _vestingId)
        internal
        onlyOwner
    {
        tokenManager.revokeVesting(_holder, _vestingId);
    }

}

File 62 of 70: TokenMultiCall.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./ERC20.sol";
import "./ERC721.sol";

contract TokenMultiCall {
    function getErc20Data(address addr)
        public
        view
        returns (string memory name, string memory symbol, uint256 totalSupply)
    {
        ERC20 erc20 = ERC20(addr);
        string memory _name = erc20.name();
        string memory _symbol = erc20.symbol();
        uint256 _totalSupply = erc20.totalSupply();

        return (_name, _symbol, _totalSupply);
    }

    function getErc721Data(address addr)
        public
        view
        returns (string memory name, string memory symbol)
    {
        ERC721 erc721 = ERC721(addr);
        string memory _name = erc721.name();
        string memory _symbol = erc721.symbol();

        return (_name, _symbol);
    }

    function getErc20And721Data(address erc20Addr, address erc721Addr)
        public
        view
        returns (
            string memory erc20Name,
            string memory erc20Symbol,
            uint256 erc20TotalSupply,
            string memory erc721name,
            string memory erc721symbol
        )
    {
        (string memory _erc20Name, string memory _erc20Symbol, uint256 _erc20TotalSupply) = getErc20Data(
            erc20Addr
        );
        (string memory _erc721Name, string memory _erc721Symbol) = getErc721Data(
            erc721Addr
        );

        return (
            _erc20Name,
            _erc20Symbol,
            _erc20TotalSupply,
            _erc721Name,
            _erc721Symbol
        );
    }

    function getDoubleErc20Data(address addr1, address addr2)
        public
        view
        returns (
            string memory name1,
            string memory symbol1,
            uint256 totalSupply1,
            string memory name2,
            string memory symbol2,
            uint256 totalSupply2
        )
    {
        (string memory _name1, string memory _symbol1, uint256 _totalSupply1) = getErc20Data(
            addr1
        );
        (string memory _name2, string memory _symbol2, uint256 _totalSupply2) = getErc20Data(
            addr2
        );

        return (
            _name1,
            _symbol1,
            _totalSupply1,
            _name2,
            _symbol2,
            _totalSupply2
        );
    }

}

File 63 of 70: UpgradeController.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./ITransparentUpgradeableProxy.sol";
import "./ControllerBase.sol";

contract UpgradeController is ControllerBase {
    using SafeMath for uint256;

    
    ITransparentUpgradeableProxy private nftxProxy;
    ITransparentUpgradeableProxy private xControllerProxy;

    constructor(address nftx, address xController) public {
        ControllerBase.initialize();
        nftxProxy = ITransparentUpgradeableProxy(nftx);
        xControllerProxy = ITransparentUpgradeableProxy(xController);
    }

    function executeFuncCall(uint256 fcId) public override onlyOwner {
        super.executeFuncCall(fcId);
        if (funcIndex[fcId] == 3) {
            nftxProxy.changeAdmin(addressParam[fcId]);
        } else if (funcIndex[fcId] == 4) {
            nftxProxy.upgradeTo(addressParam[fcId]);
        } else if (funcIndex[fcId] == 5) {
            xControllerProxy.changeAdmin(addressParam[fcId]);
        } else if (funcIndex[fcId] == 6) {
            xControllerProxy.upgradeTo(addressParam[fcId]);
        }
    }

}

File 64 of 70: XBouties.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./TokenAppController.sol";
import "./IERC20.sol";
import "./IERC721.sol";
import "./IXStore.sol";
import "./SafeMath.sol";
import "./SafeERC20.sol";
import "./ReentrancyGuard.sol";

contract XBounties is TokenAppController, ReentrancyGuard {
    using SafeMath for uint256;

    using SafeERC20 for IERC20;

    uint256 public constant BASE = 10**18;
    uint256 public interval = 15 * 60; // 15 minutes
    uint256 public start = 1608580800; // Mon, Dec 21 2020, 12pm PST
    uint64 public vestedUntil = 1609876800; // Tue, Jan 5 2021, 12pm PST

    IERC20 public nftxToken;
    address payable public daoMultiSig;

    struct Bounty {
        address tokenContract;
        uint256 nftxPrice;
        uint256 paidOut;
        uint256 payoutCap;
    }

    event NewBountyAdded(uint256 bountyId);
    event BountyFilled(
        uint256 bountyId,
        uint256 nftxAmount,
        uint256 assetAmount,
        address sender,
        uint64 start,
        uint64 cliff,
        uint64 vested
    );
    event NftxPriceSet(uint256 bountyId, uint256 newNftxPrice);
    event PayoutCapSet(uint256 bountyId, uint256 newCap);
    event BountyClosed(uint256 bountyId);
    event EthWithdrawn(uint256 amount);
    event Erc20Withdrawn(address tokenContract, uint256 amount);
    event Erc721Withdrawn(address nftContract, uint256 tokenId);

    Bounty[] internal bounties;

    constructor(
        address _tokenManager,
        address payable _daoMultiSig,
        address _nftxToken,
        address _xStore
    ) public {
        initTAC();
        setTokenManager(_tokenManager);
        daoMultiSig = _daoMultiSig;
        nftxToken = IERC20(_nftxToken);

        IXStore xStore = IXStore(_xStore);

        createEthBounty(130 * BASE, 65000 * BASE);
        createEthBounty(65 * BASE, 65000 * BASE);
        createEthBounty(BASE.mul(130).div(3), 65000 * BASE);
        createBounty(
            xStore.xTokenAddress(0), // PUNK-BASIC
            390 * BASE,
            31200 * BASE
        );
        createBounty(
            xStore.xTokenAddress(1), // PUNK-ATTR-4
            585 * BASE,
            14625 * BASE
        );
        createBounty(
            xStore.xTokenAddress(2), // PUNK-ATTR-5
            1950 * BASE,
            15600 * BASE
        );
        createBounty(
            xStore.xTokenAddress(3), // PUNK-ZOMBIE
            8450 * BASE,
            16900 * BASE
        );
        createBounty(
            xStore.xTokenAddress(4), // AXIE-ORIGIN
            130 * BASE,
            7800 * BASE
        );
        createBounty(
            xStore.xTokenAddress(5), // AXIE-MYSTIC-1
            780 * BASE,
            7800 * BASE
        );
        createBounty(
            xStore.xTokenAddress(6), // AXIE-MYSTIC-2
            3900 * BASE,
            7800 * BASE
        );
        createBounty(
            xStore.xTokenAddress(7), // KITTY-GEN-0
            26 * BASE,
            5850 * BASE
        );
        createBounty(
            xStore.xTokenAddress(8), // KITTY-GEN-0-F
            39 * BASE,
            5850 * BASE
        );
        createBounty(
            xStore.xTokenAddress(9), // KITTY-FOUNDER
            6175 * BASE,
            6175 * BASE
        );
        createBounty(
            xStore.xTokenAddress(10), // AVASTR-BASIC
            20 * BASE,
            6175 * BASE
        );
        createBounty(
            xStore.xTokenAddress(11), // AVASTR-RANK-30
            26 * BASE,
            6175 * BASE
        );
        createBounty(
            xStore.xTokenAddress(12), // AVASTR-RANK-60
            195 * BASE,
            6175 * BASE
        );
        createBounty(
            xStore.xTokenAddress(13), // GLYPH
            1300 * BASE,
            26000 * BASE
        );
        createBounty(
            xStore.xTokenAddress(14), // JOY
            455 * BASE,
            10010 * BASE
        );
    }

    function setStart(uint256 newStart) public onlyOwner {
        start = newStart;
    }

    function setInterval(uint256 newInterval) public onlyOwner {
        interval = newInterval;
    }

    function setVestedUntil(uint64 newTime) public onlyOwner {
        vestedUntil = newTime;
    }

    function getBountyInfo(uint256 bountyId)
        public
        view
        returns (address, uint256, uint256, uint256)
    {
        require(bountyId < bounties.length, "Invalid bountyId");
        return (
            bounties[bountyId].tokenContract,
            bounties[bountyId].nftxPrice,
            bounties[bountyId].paidOut,
            bounties[bountyId].payoutCap
        );
    }

    function getMaxPayout() public view returns (uint256) {
        uint256 tMinus4 = start.sub(interval.mul(4));
        uint256 tMinus3 = start.sub(interval.mul(3));
        uint256 tMinus2 = start.sub(interval.mul(2));
        uint256 tMinus1 = start.sub(interval.mul(1));
        uint256 tm4Max = 0;
        uint256 tm3Max = 50 * BASE;
        uint256 tm2Max = 500 * BASE;
        uint256 tm1Max = 5000 * BASE;
        uint256 tm0Max = 50000 * BASE;
        if (now < tMinus4) {
            return 0;
        } else if (now < tMinus3) {
            uint256 progressBigNum = now.sub(tMinus4).mul(BASE).div(interval);
            uint256 addedPayout = tm3Max.sub(tm4Max).mul(progressBigNum).div(
                BASE
            );
            return tm4Max.add(addedPayout);
        } else if (now < tMinus2) {
            uint256 progressBigNum = now.sub(tMinus3).mul(BASE).div(interval);
            uint256 addedPayout = tm2Max.sub(tm3Max).mul(progressBigNum).div(
                BASE
            );
            return tm3Max.add(addedPayout);
        } else if (now < tMinus1) {
            uint256 progressBigNum = now.sub(tMinus2).mul(BASE).div(interval);
            uint256 addedPayout = tm1Max.sub(tm2Max).mul(progressBigNum).div(
                BASE
            );
            return tm2Max.add(addedPayout);
        } else if (now < start) {
            uint256 progressBigNum = now.sub(tMinus1).mul(BASE).div(interval);
            uint256 addedPayout = tm0Max.sub(tm1Max).mul(progressBigNum).div(
                BASE
            );
            return tm1Max.add(addedPayout);
        } else {
            return tm0Max;
        }
    }

    function getBountiesLength() public view returns (uint256) {
        return bounties.length;
    }

    function getIsEth(uint256 bountyId) public view returns (bool) {
        require(bountyId < bounties.length, "Invalid bountyId");
        return bounties[bountyId].tokenContract == address(0);
    }

    function getTokenContract(uint256 bountyId) public view returns (address) {
        require(bountyId < bounties.length, "Invalid bountyId");
        return bounties[bountyId].tokenContract;
    }

    function getNftxPrice(uint256 bountyId) public view returns (uint256) {
        require(bountyId < bounties.length, "Invalid bountyId");
        return bounties[bountyId].nftxPrice;
    }

    function getPayoutCap(uint256 bountyId) public view returns (uint256) {
        require(bountyId < bounties.length, "Invalid bountyId");
        return bounties[bountyId].payoutCap;
    }

    function getPaidOut(uint256 bountyId) public view returns (uint256) {
        require(bountyId < bounties.length, "Invalid bountyId");
        return bounties[bountyId].paidOut;
    }

    function setNftxPrice(uint256 bountyId, uint256 newPrice) public onlyOwner {
        require(bountyId < bounties.length, "Invalid bountyId");
        bounties[bountyId].nftxPrice = newPrice;
        emit NftxPriceSet(bountyId, newPrice);
    }

    function setPayoutCap(uint256 bountyId, uint256 newCap) public onlyOwner {
        require(bountyId < bounties.length, "Invalid bountyId");
        bounties[bountyId].payoutCap = newCap;
        emit PayoutCapSet(bountyId, newCap);
    }

    function createEthBounty(uint256 nftxPricePerEth, uint256 amountOfEth)
        public
        onlyOwner
    {
        createBounty(address(0), nftxPricePerEth, amountOfEth);
    }

    function createBounty(address token, uint256 nftxPrice, uint256 payoutCap)
        public
        onlyOwner
    {
        Bounty memory newBounty;
        newBounty.tokenContract = token;
        newBounty.nftxPrice = nftxPrice;
        newBounty.payoutCap = payoutCap;
        bounties.push(newBounty);
        uint256 bountyId = bounties.length.sub(1);
        emit NewBountyAdded(bountyId);
    }

    function closeBounty(uint256 bountyId) public onlyOwner {
        require(bountyId < bounties.length, "Invalid bountyId");
        bounties[bountyId].payoutCap = bounties[bountyId].paidOut;
        emit BountyClosed(bountyId);
    }

    function fillBounty(uint256 bountyId, uint256 amountBeingSent)
        public
        payable
        nonReentrant
    {
        _fillBountyCustom(
            bountyId,
            amountBeingSent,
            vestedUntil - 2,
            vestedUntil - 1,
            vestedUntil
        );
    }

    /* function fillBountyCustom(
        uint256 bountyId,
        uint256 donationSize,
        uint64 _start,
        uint64 cliff,
        uint64 vested
    ) public payable nonReentrant {
        _fillBountyCustom(bountyId, donationSize, _start, cliff, vested);
    } */

    function _fillBountyCustom(
        uint256 bountyId,
        uint256 donationSize,
        uint64 _start,
        uint64 cliff,
        uint64 vested
    ) internal {
        require(cliff >= vestedUntil - 1 && vested >= vestedUntil, "Not valid");
        require(bountyId < bounties.length, "Invalid bountyId");
        Bounty storage bounty = bounties[bountyId];
        uint256 rewardCap = getMaxPayout();
        require(rewardCap > 0, "Must wait for cap to be lifted");
        uint256 remainingNftx = bounty.payoutCap.sub(bounty.paidOut);
        require(remainingNftx > 0, "Bounty is already finished");
        uint256 requestedNftx = donationSize.mul(bounty.nftxPrice).div(BASE);
        uint256 willGive = remainingNftx < requestedNftx
            ? remainingNftx
            : rewardCap < requestedNftx
            ? rewardCap
            : requestedNftx;
        uint256 willTake = donationSize.mul(willGive).div(requestedNftx);
        if (getIsEth(bountyId)) {
            require(msg.value >= willTake, "Value sent is insufficient");
            if (msg.value > willTake) {
                address payable _sender = msg.sender;
                _sender.transfer(msg.value.sub(willTake));
            }
            daoMultiSig.transfer(willTake);
        } else {
            IERC20 fundToken = IERC20(bounty.tokenContract);
            fundToken.safeTransferFrom(msg.sender, daoMultiSig, willTake);
        }
        if (now > vested) {
            nftxToken.safeTransfer(msg.sender, willGive);
        } else {
            nftxToken.safeTransfer(tokenManagerAddr, willGive);
            callAssignVested(
                msg.sender,
                willGive,
                _start,
                cliff,
                vested,
                false
            );
        }
        bounty.paidOut = bounty.paidOut.add(willGive);
        emit BountyFilled(
            bountyId,
            willGive,
            willTake,
            msg.sender,
            _start,
            cliff,
            vested
        );
    }

    function withdrawEth(uint256 amount) public onlyOwner {
        address payable sender = msg.sender;
        sender.transfer(amount);
        emit EthWithdrawn(amount);
    }

    function withdrawErc20(address tokenContract, uint256 amount)
        public
        onlyOwner
    {
        IERC20 token = IERC20(tokenContract);
        token.safeTransfer(msg.sender, amount);
        emit Erc20Withdrawn(tokenContract, amount);
    }

    function withdrawErc721(address nftContract, uint256 tokenId)
        public
        onlyOwner
    {
        IERC721 nft = IERC721(nftContract);
        nft.safeTransferFrom(address(this), msg.sender, tokenId);
        emit Erc721Withdrawn(nftContract, tokenId);
    }
}

File 65 of 70: XController.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./ControllerBase.sol";
import "./INFTX.sol";
import "./IXStore.sol";
import "./Initializable.sol";

contract XController is ControllerBase {
    INFTX private nftx;
    IXStore store;

    /* uint256 numFuncCalls;

    mapping(uint256 => uint256) public time;
    mapping(uint256 => uint256) public funcIndex;
    mapping(uint256 => address payable) public addressParam;
    mapping(uint256 => uint256[]) public uintArrayParam; */
    mapping(uint256 => uint256) public uintParam;
    mapping(uint256 => string) public stringParam;
    mapping(uint256 => bool) public boolParam;

    mapping(uint256 => uint256) public pendingEligAdditions;

    function initXController(address nftxAddress) public initializer {
        initOwnable();
        nftx = INFTX(nftxAddress);
    }

    function onlyOwnerOrLeadDev(uint256 funcIndex) public view virtual {
        if (funcIndex > 3) {
            require(
                _msgSender() == leadDev || _msgSender() == owner(),
                "Not owner or leadDev"
            );
        } else {
            require(_msgSender() == owner(), "Not owner");
        }
    }

    function stageFuncCall(
        uint256 _funcIndex,
        address payable _addressParam,
        uint256 _uintParam,
        string memory _stringParam,
        uint256[] memory _uintArrayParam,
        bool _boolParam
    ) public virtual {
        onlyOwnerOrLeadDev(_funcIndex);
        uint256 fcId = numFuncCalls;
        numFuncCalls = numFuncCalls.add(1);
        time[fcId] = 1;
        funcIndex[fcId] = _funcIndex;
        addressParam[fcId] = _addressParam;
        uintParam[fcId] = _uintParam;
        stringParam[fcId] = _stringParam;
        uintArrayParam[fcId] = _uintArrayParam;
        boolParam[fcId] = _boolParam;
        if (
            funcIndex[fcId] == 4 &&
            store.negateEligibility(uintParam[fcId]) != !boolParam[fcId]
        ) {
            pendingEligAdditions[uintParam[fcId]] = pendingEligAdditions[uintParam[fcId]]
                .add(uintArrayParam[fcId].length);
        }
    }

    function cancelFuncCall(uint256 fcId) public override virtual {
        onlyOwnerOrLeadDev(funcIndex[fcId]);
        require(funcIndex[fcId] != 0, "Already cancelled");
        funcIndex[fcId] = 0;
        if (
            funcIndex[fcId] == 3 &&
            store.negateEligibility(uintParam[fcId]) != !boolParam[fcId]
        ) {
            pendingEligAdditions[uintParam[fcId]] = pendingEligAdditions[uintParam[fcId]]
                .sub(uintArrayParam[fcId].length);
        }
    }

    function executeFuncCall(uint256 fcId) public override virtual {
        super.executeFuncCall(fcId);
        if (funcIndex[fcId] == 3) {
            onlyIfPastDelay(2, time[fcId]);
            nftx.transferOwnership(addressParam[fcId]);
        } else if (funcIndex[fcId] == 4) {
            uint256 percentInc = pendingEligAdditions[uintParam[fcId]]
                .mul(100)
                .div(nftx.vaultSize(uintParam[fcId]));
            if (percentInc > 10) {
                onlyIfPastDelay(2, time[fcId]);
            } else if (percentInc > 1) {
                onlyIfPastDelay(1, time[fcId]);
            } else {
                onlyIfPastDelay(0, time[fcId]);
            }
            nftx.setIsEligible(
                uintParam[fcId],
                uintArrayParam[fcId],
                boolParam[fcId]
            );
            pendingEligAdditions[uintParam[fcId]] = pendingEligAdditions[uintParam[fcId]]
                .sub(uintArrayParam[fcId].length);
        } else if (funcIndex[fcId] == 5) {
            onlyIfPastDelay(0, time[fcId]); // vault must be empty
            nftx.setNegateEligibility(funcIndex[fcId], boolParam[fcId]);
        } else if (funcIndex[fcId] == 6) {
            onlyIfPastDelay(0, time[fcId]);
            nftx.setShouldReserve(
                uintParam[fcId],
                uintArrayParam[fcId],
                boolParam[fcId]
            );
        } else if (funcIndex[fcId] == 7) {
            onlyIfPastDelay(0, time[fcId]);
            nftx.setIsReserved(
                uintParam[fcId],
                uintArrayParam[fcId],
                boolParam[fcId]
            );
        } else if (funcIndex[fcId] == 8) {
            onlyIfPastDelay(1, time[fcId]);
            nftx.changeTokenName(uintParam[fcId], stringParam[fcId]);
        } else if (funcIndex[fcId] == 9) {
            onlyIfPastDelay(1, time[fcId]);
            nftx.changeTokenSymbol(uintParam[fcId], stringParam[fcId]);
        } else if (funcIndex[fcId] == 10) {
            onlyIfPastDelay(0, time[fcId]);
            nftx.closeVault(uintParam[fcId]);
        } else if (funcIndex[fcId] == 11) {
            onlyIfPastDelay(0, time[fcId]);
            nftx.setMintFees(
                uintArrayParam[fcId][0],
                uintArrayParam[fcId][1],
                uintArrayParam[fcId][2]
            );
        } else if (funcIndex[fcId] == 12) {
            (uint256 ethBase, uint256 ethStep) = store.burnFees(
                uintArrayParam[fcId][0]
            );
            uint256 ethBasePercentInc = uintArrayParam[fcId][1].mul(100).div(
                ethBase
            );
            uint256 ethStepPercentInc = uintArrayParam[fcId][2].mul(100).div(
                ethStep
            );
            if (ethBasePercentInc.add(ethStepPercentInc) > 15) {
                onlyIfPastDelay(2, time[fcId]);
            } else if (ethBasePercentInc.add(ethStepPercentInc) > 5) {
                onlyIfPastDelay(1, time[fcId]);
            } else {
                onlyIfPastDelay(0, time[fcId]);
            }
            nftx.setBurnFees(
                uintArrayParam[fcId][0],
                uintArrayParam[fcId][1],
                uintArrayParam[fcId][2]
            );
        } else if (funcIndex[fcId] == 13) {
            onlyIfPastDelay(0, time[fcId]);
            nftx.setDualFees(
                uintArrayParam[fcId][0],
                uintArrayParam[fcId][1],
                uintArrayParam[fcId][2]
            );
        } else if (funcIndex[fcId] == 14) {
            (uint256 ethMax, uint256 length) = store.supplierBounty(
                uintArrayParam[fcId][0]
            );
            uint256 ethMaxPercentInc = uintArrayParam[fcId][1].mul(100).div(
                ethMax
            );
            uint256 lengthPercentInc = uintArrayParam[fcId][2].mul(100).div(
                length
            );
            if (ethMaxPercentInc.add(lengthPercentInc) > 20) {
                onlyIfPastDelay(2, time[fcId]);
            } else if (ethMaxPercentInc.add(lengthPercentInc) > 5) {
                onlyIfPastDelay(1, time[fcId]);
            } else {
                onlyIfPastDelay(0, time[fcId]);
            }
            nftx.setSupplierBounty(
                uintArrayParam[fcId][0],
                uintArrayParam[fcId][1],
                uintArrayParam[fcId][2]
            );
        }
    }

}

File 66 of 70: XSale.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./SafeMath.sol";
import "./Pausable.sol";
import "./INFTX.sol";
import "./IXStore.sol";
import "./IERC721.sol";
import "./ITokenManager.sol";
import "./Context.sol";
import "./ReentrancyGuard.sol";

contract XSale is Pausable, ReentrancyGuard {
    using SafeMath for uint256;
    using EnumerableSet for EnumerableSet.UintSet;

    INFTX public nftx;
    IXStore public xStore;
    IERC20 public nftxToken;
    ITokenManager public tokenManager;

    uint64 public constant vestedUntil = 1610697600000; // Fri Jan 15 2021 00:00:00 GMT-0800

    // Bounty[] public ethBounties;
    mapping(uint256 => Bounty[]) public xBounties;

    struct Bounty {
        uint256 reward;
        uint256 request;
    }

    constructor(address _nftx, address _nftxToken, address _tokenManager)
        public
    {
        initOwnable();
        nftx = INFTX(_nftx);
        xStore = IXStore(nftx.store());
        nftxToken = IERC20(_nftxToken);
        tokenManager = ITokenManager(_tokenManager);
    }

    function addXBounty(uint256 vaultId, uint256 reward, uint256 request)
        public
        onlyOwner
    {
        Bounty memory newXBounty;
        newXBounty.reward = reward;
        newXBounty.request = request;
        xBounties[vaultId].push(newXBounty);
    }

    function setXBounty(
        uint256 vaultId,
        uint256 xBountyIndex,
        uint256 newReward,
        uint256 newRequest
    ) public onlyOwner {
        Bounty storage xBounty = xBounties[vaultId][xBountyIndex];
        xBounty.reward = newReward;
        xBounty.request = newRequest;
    }

    function withdrawNFTX(address to, uint256 amount) public onlyOwner {
        nftxToken.transfer(to, amount);
    }

    function withdrawXToken(uint256 vaultId, address to, uint256 amount)
        public
        onlyOwner
    {
        xStore.xToken(vaultId).transfer(to, amount);
    }

    function withdrawETH(address payable to, uint256 amount) public onlyOwner {
        to.transfer(amount);
    }

    function fillXBounty(uint256 vaultId, uint256 xBountyIndex, uint256 amount)
        public
        nonReentrant
    {
        Bounty storage xBounty = xBounties[vaultId][xBountyIndex];
        require(amount <= xBounty.request, "Amount > bounty");
        require(
            amount <= nftxToken.balanceOf(address(nftx)),
            "Amount > balance"
        );
        xStore.xToken(vaultId).transferFrom(
            _msgSender(),
            address(nftx),
            amount
        );
        uint256 reward = xBounty.reward.mul(amount).div(xBounty.request);
        xBounty.request = xBounty.request.sub(amount);
        xBounty.reward = xBounty.reward.sub(reward);
        nftxToken.transfer(address(tokenManager), reward);
        tokenManager.assignVested(
            _msgSender(),
            reward,
            vestedUntil,
            vestedUntil,
            vestedUntil,
            false
        );
    }
}

File 67 of 70: XStore.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./EnumerableSet.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
import "./IXToken.sol";
import "./IERC721.sol";
import "./SafeERC20.sol";

contract XStore is Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.UintSet;

    struct FeeParams {
        uint256 ethBase;
        uint256 ethStep;
    }

    struct BountyParams {
        uint256 ethMax;
        uint256 length;
    }

    struct Vault {
        address xTokenAddress;
        address nftAddress;
        address manager;
        IXToken xToken;
        IERC721 nft;
        EnumerableSet.UintSet holdings;
        EnumerableSet.UintSet reserves;
        mapping(uint256 => address) requester;
        mapping(uint256 => bool) isEligible;
        mapping(uint256 => bool) shouldReserve;
        bool allowMintRequests;
        bool flipEligOnRedeem;
        bool negateEligibility;
        bool isFinalized;
        bool isClosed;
        FeeParams mintFees;
        FeeParams burnFees;
        FeeParams dualFees;
        BountyParams supplierBounty;
        uint256 ethBalance;
        uint256 tokenBalance;
        bool isD2Vault;
        address d2AssetAddress;
        IERC20 d2Asset;
        uint256 d2Holdings;
    }

    event XTokenAddressSet(uint256 indexed vaultId, address token);
    event NftAddressSet(uint256 indexed vaultId, address asset);
    event ManagerSet(uint256 indexed vaultId, address manager);
    event XTokenSet(uint256 indexed vaultId);
    event NftSet(uint256 indexed vaultId);
    event HoldingsAdded(uint256 indexed vaultId, uint256 id);
    event HoldingsRemoved(uint256 indexed vaultId, uint256 id);
    event ReservesAdded(uint256 indexed vaultId, uint256 id);
    event ReservesRemoved(uint256 indexed vaultId, uint256 id);
    event RequesterSet(uint256 indexed vaultId, uint256 id, address requester);
    event IsEligibleSet(uint256 indexed vaultId, uint256 id, bool _bool);
    event ShouldReserveSet(uint256 indexed vaultId, uint256 id, bool _bool);
    event AllowMintRequestsSet(uint256 indexed vaultId, bool isAllowed);
    event FlipEligOnRedeemSet(uint256 indexed vaultId, bool _bool);
    event NegateEligibilitySet(uint256 indexed vaultId, bool _bool);
    event IsFinalizedSet(uint256 indexed vaultId, bool _isFinalized);
    event IsClosedSet(uint256 indexed vaultId, bool _isClosed);
    event MintFeesSet(
        uint256 indexed vaultId,
        uint256 ethBase,
        uint256 ethStep
    );
    event BurnFeesSet(
        uint256 indexed vaultId,
        uint256 ethBase,
        uint256 ethStep
    );
    event DualFeesSet(
        uint256 indexed vaultId,
        uint256 ethBase,
        uint256 ethStep
    );
    event SupplierBountySet(
        uint256 indexed vaultId,
        uint256 ethMax,
        uint256 length
    );
    event EthBalanceSet(uint256 indexed vaultId, uint256 _ethBalance);
    event TokenBalanceSet(uint256 indexed vaultId, uint256 _tokenBalance);
    event IsD2VaultSet(uint256 indexed vaultId, bool _isD2Vault);
    event D2AssetAddressSet(uint256 indexed vaultId, address _d2Asset);
    event D2AssetSet(uint256 indexed vaultId);
    event D2HoldingsSet(uint256 indexed vaultId, uint256 _d2Holdings);
    event NewVaultAdded(uint256 indexed vaultId);
    event IsExtensionSet(address addr, bool _isExtension);
    event RandNonceSet(uint256 _randNonce);

    Vault[] internal vaults;

    mapping(address => bool) public isExtension;
    uint256 public randNonce;

    constructor() public {
        initOwnable();
    }

    function _getVault(uint256 vaultId) internal view returns (Vault storage) {
        require(vaultId < vaults.length, "Invalid vaultId");
        return vaults[vaultId];
    }

    function vaultsLength() public view returns (uint256) {
        return vaults.length;
    }

    function xTokenAddress(uint256 vaultId) public view returns (address) {
        Vault storage vault = _getVault(vaultId);
        return vault.xTokenAddress;
    }

    function nftAddress(uint256 vaultId) public view returns (address) {
        Vault storage vault = _getVault(vaultId);
        return vault.nftAddress;
    }

    function manager(uint256 vaultId) public view returns (address) {
        Vault storage vault = _getVault(vaultId);
        return vault.manager;
    }

    function xToken(uint256 vaultId) public view returns (IXToken) {
        Vault storage vault = _getVault(vaultId);
        return vault.xToken;
    }

    function nft(uint256 vaultId) public view returns (IERC721) {
        Vault storage vault = _getVault(vaultId);
        return vault.nft;
    }

    function holdingsLength(uint256 vaultId) public view returns (uint256) {
        Vault storage vault = _getVault(vaultId);
        return vault.holdings.length();
    }

    function holdingsContains(uint256 vaultId, uint256 elem)
        public
        view
        returns (bool)
    {
        Vault storage vault = _getVault(vaultId);
        return vault.holdings.contains(elem);
    }

    function holdingsAt(uint256 vaultId, uint256 index)
        public
        view
        returns (uint256)
    {
        Vault storage vault = _getVault(vaultId);
        return vault.holdings.at(index);
    }

    function reservesLength(uint256 vaultId) public view returns (uint256) {
        Vault storage vault = _getVault(vaultId);
        return vault.holdings.length();
    }

    function reservesContains(uint256 vaultId, uint256 elem)
        public
        view
        returns (bool)
    {
        Vault storage vault = _getVault(vaultId);
        return vault.holdings.contains(elem);
    }

    function reservesAt(uint256 vaultId, uint256 index)
        public
        view
        returns (uint256)
    {
        Vault storage vault = _getVault(vaultId);
        return vault.holdings.at(index);
    }

    function requester(uint256 vaultId, uint256 id)
        public
        view
        returns (address)
    {
        Vault storage vault = _getVault(vaultId);
        return vault.requester[id];
    }

    function isEligible(uint256 vaultId, uint256 id)
        public
        view
        returns (bool)
    {
        Vault storage vault = _getVault(vaultId);
        return vault.isEligible[id];
    }

    function shouldReserve(uint256 vaultId, uint256 id)
        public
        view
        returns (bool)
    {
        Vault storage vault = _getVault(vaultId);
        return vault.shouldReserve[id];
    }

    function allowMintRequests(uint256 vaultId) public view returns (bool) {
        Vault storage vault = _getVault(vaultId);
        return vault.allowMintRequests;
    }

    function flipEligOnRedeem(uint256 vaultId) public view returns (bool) {
        Vault storage vault = _getVault(vaultId);
        return vault.flipEligOnRedeem;
    }

    function negateEligibility(uint256 vaultId) public view returns (bool) {
        Vault storage vault = _getVault(vaultId);
        return vault.negateEligibility;
    }

    function isFinalized(uint256 vaultId) public view returns (bool) {
        Vault storage vault = _getVault(vaultId);
        return vault.isFinalized;
    }

    function isClosed(uint256 vaultId) public view returns (bool) {
        Vault storage vault = _getVault(vaultId);
        return vault.isClosed;
    }

    function mintFees(uint256 vaultId) public view returns (uint256, uint256) {
        Vault storage vault = _getVault(vaultId);
        return (vault.mintFees.ethBase, vault.mintFees.ethStep);
    }

    function burnFees(uint256 vaultId) public view returns (uint256, uint256) {
        Vault storage vault = _getVault(vaultId);
        return (vault.burnFees.ethBase, vault.burnFees.ethStep);
    }

    function dualFees(uint256 vaultId) public view returns (uint256, uint256) {
        Vault storage vault = _getVault(vaultId);
        return (vault.dualFees.ethBase, vault.dualFees.ethStep);
    }

    function supplierBounty(uint256 vaultId)
        public
        view
        returns (uint256, uint256)
    {
        Vault storage vault = _getVault(vaultId);
        return (vault.supplierBounty.ethMax, vault.supplierBounty.length);
    }

    function ethBalance(uint256 vaultId) public view returns (uint256) {
        Vault storage vault = _getVault(vaultId);
        return vault.ethBalance;
    }

    function tokenBalance(uint256 vaultId) public view returns (uint256) {
        Vault storage vault = _getVault(vaultId);
        return vault.tokenBalance;
    }

    function isD2Vault(uint256 vaultId) public view returns (bool) {
        Vault storage vault = _getVault(vaultId);
        return vault.isD2Vault;
    }

    function d2AssetAddress(uint256 vaultId) public view returns (address) {
        Vault storage vault = _getVault(vaultId);
        return vault.d2AssetAddress;
    }

    function d2Asset(uint256 vaultId) public view returns (IERC20) {
        Vault storage vault = _getVault(vaultId);
        return vault.d2Asset;
    }

    function d2Holdings(uint256 vaultId) public view returns (uint256) {
        Vault storage vault = _getVault(vaultId);
        return vault.d2Holdings;
    }

    function setXTokenAddress(uint256 vaultId, address _xTokenAddress)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.xTokenAddress = _xTokenAddress;
        emit XTokenAddressSet(vaultId, _xTokenAddress);
    }

    function setNftAddress(uint256 vaultId, address _nft) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.nftAddress = _nft;
        emit NftAddressSet(vaultId, _nft);
    }

    function setManager(uint256 vaultId, address _manager) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.manager = _manager;
        emit ManagerSet(vaultId, _manager);
    }

    function setXToken(uint256 vaultId) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.xToken = IXToken(vault.xTokenAddress);
        emit XTokenSet(vaultId);
    }

    function setNft(uint256 vaultId) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.nft = IERC721(vault.nftAddress);
        emit NftSet(vaultId);
    }

    function holdingsAdd(uint256 vaultId, uint256 elem) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.holdings.add(elem);
        emit HoldingsAdded(vaultId, elem);
    }

    function holdingsRemove(uint256 vaultId, uint256 elem) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.holdings.remove(elem);
        emit HoldingsRemoved(vaultId, elem);
    }

    function reservesAdd(uint256 vaultId, uint256 elem) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.reserves.add(elem);
        emit ReservesAdded(vaultId, elem);
    }

    function reservesRemove(uint256 vaultId, uint256 elem) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.reserves.remove(elem);
        emit ReservesRemoved(vaultId, elem);
    }

    function setRequester(uint256 vaultId, uint256 id, address _requester)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.requester[id] = _requester;
        emit RequesterSet(vaultId, id, _requester);
    }

    function setIsEligible(uint256 vaultId, uint256 id, bool _bool)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.isEligible[id] = _bool;
        emit IsEligibleSet(vaultId, id, _bool);
    }

    function setShouldReserve(uint256 vaultId, uint256 id, bool _shouldReserve)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.shouldReserve[id] = _shouldReserve;
        emit ShouldReserveSet(vaultId, id, _shouldReserve);
    }

    function setAllowMintRequests(uint256 vaultId, bool isAllowed)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.allowMintRequests = isAllowed;
        emit AllowMintRequestsSet(vaultId, isAllowed);
    }

    function setFlipEligOnRedeem(uint256 vaultId, bool flipElig)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.flipEligOnRedeem = flipElig;
        emit FlipEligOnRedeemSet(vaultId, flipElig);
    }

    function setNegateEligibility(uint256 vaultId, bool negateElig)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.negateEligibility = negateElig;
        emit NegateEligibilitySet(vaultId, negateElig);
    }

    function setIsFinalized(uint256 vaultId, bool _isFinalized)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.isFinalized = _isFinalized;
        emit IsFinalizedSet(vaultId, _isFinalized);
    }

    function setIsClosed(uint256 vaultId, bool _isClosed) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.isClosed = _isClosed;
        emit IsClosedSet(vaultId, _isClosed);
    }

    function setMintFees(uint256 vaultId, uint256 ethBase, uint256 ethStep)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.mintFees = FeeParams(ethBase, ethStep);
        emit MintFeesSet(vaultId, ethBase, ethStep);
    }

    function setBurnFees(uint256 vaultId, uint256 ethBase, uint256 ethStep)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.burnFees = FeeParams(ethBase, ethStep);
        emit BurnFeesSet(vaultId, ethBase, ethStep);
    }

    function setDualFees(uint256 vaultId, uint256 ethBase, uint256 ethStep)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.dualFees = FeeParams(ethBase, ethStep);
        emit DualFeesSet(vaultId, ethBase, ethStep);
    }

    function setSupplierBounty(uint256 vaultId, uint256 ethMax, uint256 length)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.supplierBounty = BountyParams(ethMax, length);
        emit SupplierBountySet(vaultId, ethMax, length);
    }

    function setEthBalance(uint256 vaultId, uint256 _ethBalance)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.ethBalance = _ethBalance;
        emit EthBalanceSet(vaultId, _ethBalance);
    }

    function setTokenBalance(uint256 vaultId, uint256 _tokenBalance)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.tokenBalance = _tokenBalance;
        emit TokenBalanceSet(vaultId, _tokenBalance);
    }

    function setIsD2Vault(uint256 vaultId, bool _isD2Vault) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.isD2Vault = _isD2Vault;
        emit IsD2VaultSet(vaultId, _isD2Vault);
    }

    function setD2AssetAddress(uint256 vaultId, address _d2Asset)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.d2AssetAddress = _d2Asset;
        emit D2AssetAddressSet(vaultId, _d2Asset);
    }

    function setD2Asset(uint256 vaultId) public onlyOwner {
        Vault storage vault = _getVault(vaultId);
        vault.d2Asset = IERC20(vault.d2AssetAddress);
        emit D2AssetSet(vaultId);
    }

    function setD2Holdings(uint256 vaultId, uint256 _d2Holdings)
        public
        onlyOwner
    {
        Vault storage vault = _getVault(vaultId);
        vault.d2Holdings = _d2Holdings;
        emit D2HoldingsSet(vaultId, _d2Holdings);
    }

    ////////////////////////////////////////////////////////////

    function addNewVault() public onlyOwner returns (uint256) {
        Vault memory newVault;
        vaults.push(newVault);
        uint256 vaultId = vaults.length.sub(1);
        emit NewVaultAdded(vaultId);
        return vaultId;
    }

    function setIsExtension(address addr, bool _isExtension) public onlyOwner {
        isExtension[addr] = _isExtension;
        emit IsExtensionSet(addr, _isExtension);
    }

    function setRandNonce(uint256 _randNonce) public onlyOwner {
        randNonce = _randNonce;
        emit RandNonceSet(_randNonce);
    }
}

File 68 of 70: XStoreMultiCall.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./IXStore.sol";

contract XStoreMultiCall {
    IXStore public xStore;

    constructor() public {
        xStore = IXStore(0xBe54738723cea167a76ad5421b50cAa49692E7B7);
    }

    function getVaultDataA(uint256 vaultId)
        public
        view
        returns (
            address xTokenAddress,
            address nftAddress,
            address manager,
            bool isClosed,
            bool isD2Vault,
            address d2AssetAddress
        )
    {
        address _xTokenAddress = xStore.xTokenAddress(vaultId);
        address _nftAddress = xStore.nftAddress(vaultId);
        address _manager = xStore.manager(vaultId);
        bool _isClosed = xStore.isClosed(vaultId);
        bool _isD2Vault = xStore.isD2Vault(vaultId);
        address _d2AssetAddress = xStore.d2AssetAddress(vaultId);

        return (
            _xTokenAddress,
            _nftAddress,
            _manager,
            _isClosed,
            _isD2Vault,
            _d2AssetAddress
        );
    }

    function getVaultDataB(uint256 vaultId)
        public
        view
        returns (
            bool allowMintRequests,
            bool flipEligOnRedeem,
            bool negateEligibility,
            bool isFinalized
        )
    {
        bool _allowMintRequests = xStore.allowMintRequests(vaultId);
        bool _flipEligOnRedeem = xStore.flipEligOnRedeem(vaultId);
        bool _negateEligibility = xStore.negateEligibility(vaultId);
        bool _isFinalized = xStore.isFinalized(vaultId);

        return (
            _allowMintRequests,
            _flipEligOnRedeem,
            _negateEligibility,
            _isFinalized
        );
    }
}

File 69 of 70: XToken.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.8;

import "./Ownable.sol";
import "./Context.sol";
import "./ERC20.sol";
import "./ERC20Burnable.sol";

contract XToken is Context, Ownable, ERC20Burnable {
    constructor(string memory name, string memory symbol, address _owner)
        public
        ERC20(name, symbol)
    {
        initOwnable();
        transferOwnership(_owner);
        _mint(msg.sender, 0);
    }

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }

    function changeName(string memory name) public onlyOwner {
        _changeName(name);
    }

    function changeSymbol(string memory symbol) public onlyOwner {
        _changeSymbol(symbol);
    }
}

File 70 of 70: XTokenClonable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;

// import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./OwnableUpgradeable.sol";
// import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20BurnableUpgradeable.sol";
import "./ERC20BurnableUpgradeable.sol";

contract XTokenClonable is OwnableUpgradeable, ERC20BurnableUpgradeable {
    function initialize(string memory name, string memory symbol)
        public
        initializer
    {
        __Ownable_init();
        __ERC20_init(name, symbol);
        __ERC20Burnable_init_unchained();
    }

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }

    function changeName(string memory name) public onlyOwner {}

    function changeSymbol(string memory symbol) public onlyOwner {}
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"d2Amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"MintRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"NewVault","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":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"d2Amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"Redeem","type":"event"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"numTokens","type":"uint256"},{"internalType":"bool","name":"isBurn","type":"bool"}],"name":"_calcBounty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isBurn","type":"bool"}],"name":"_calcBountyD2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"}],"name":"approveMintRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"string","name":"newName","type":"string"}],"name":"changeTokenName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"string","name":"newSymbol","type":"string"}],"name":"changeTokenSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"closeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xTokenAddress","type":"address"},{"internalType":"address","name":"_assetAddress","type":"address"},{"internalType":"bool","name":"_isD2Vault","type":"bool"}],"name":"createVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"_assetAddress","type":"address"},{"internalType":"bool","name":"_isD2Vault","type":"bool"}],"name":"createVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"finalizeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"storeAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"isEligible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isVault1155","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"internalType":"uint256","name":"d2Amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pauserId","type":"uint256"}],"name":"onlyOwnerIfPaused","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rangeEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rangeStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"}],"name":"requestMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"}],"name":"revokeMintRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"bool","name":"isAllowed","type":"bool"}],"name":"setAllowMintRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"_ethBase","type":"uint256"},{"internalType":"uint256","name":"_ethStep","type":"uint256"}],"name":"setBurnFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"bool","name":"flipElig","type":"bool"}],"name":"setFlipEligOnRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"bool","name":"_boolean","type":"bool"}],"name":"setIs1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"internalType":"bool","name":"_boolean","type":"bool"}],"name":"setIsEligible","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"address","name":"newManager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"_ethBase","type":"uint256"},{"internalType":"uint256","name":"_ethStep","type":"uint256"}],"name":"setMintFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"bool","name":"shouldNegate","type":"bool"}],"name":"setNegateEligibility","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pauserId","type":"uint256"},{"internalType":"bool","name":"_isPaused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"setRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"ethMax","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"setSupplierBounty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"store","outputs":[{"internalType":"contract IXStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"vaultSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50615d0980620000216000396000f3fe60806040526004361061023b5760003560e01c806377b2521f1161012e578063a4ebfede116100ab578063f09e82e21161006f578063f09e82e214610e5c578063f23a6e6114610e8c578063f2fde38b14610f62578063f84b40dc14610617578063fabeaafd14610f955761023b565b8063a4ebfede14610a2c578063bc197c8114610ae3578063c4d66de814610cb1578063d2fc990714610ce4578063daff97b514610e2a5761023b565b806383e8d7e3116100f257806383e8d7e3146108da5780638d584bb11461090c5780638da5cb5b1461093e578063975057e71461096f5780639fa9ef73146109845761023b565b806377b2521f1461077057806378079411146107a65780637c77b616146107d85780637cbc23731461080257806383e4c539146108255761023b565b8063360c3288116101bc5780635358fbda116101805780635358fbda146106cf57806353e1cb27146106ec57806364d715a314610731578063685c6d81146102f0578063715018a61461075b5761023b565b8063360c32881461057d5780633a43a54e146105a75780633c08a615146105df57806341263725146102f057806341c11666146106175761023b565b8063150b7a0211610203578063150b7a02146103d05780632911c27d146104be5780632ad5f0a1146104f75780632e644db11461052957806331f669d5146105535761023b565b806301ffc9a714610240578063065e8c06146102885780630daa2a4b146102b45780630e4e411c146102f057806313b0cc3914610326575b600080fd5b34801561024c57600080fd5b506102746004803603602081101561026357600080fd5b50356001600160e01b03191661104a565b604080519115158252519081900360200190f35b34801561029457600080fd5b506102b2600480360360208110156102ab57600080fd5b5035611050565b005b3480156102c057600080fd5b506102de600480360360208110156102d757600080fd5b5035611145565b60408051918252519081900360200190f35b3480156102fc57600080fd5b506102b26004803603606081101561031357600080fd5b508035906020810135906040013561023b565b6102b26004803603606081101561033c57600080fd5b81359190810190604081016020820135600160201b81111561035d57600080fd5b82018360208201111561036f57600080fd5b803590602001918460208302840111600160201b8311171561039057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250611157915050565b3480156103dc57600080fd5b506104a1600480360360808110156103f357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561042d57600080fd5b82018360208201111561043f57600080fd5b803590602001918460018302840111600160201b8311171561046057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506112e6945050505050565b604080516001600160e01b03199092168252519081900360200190f35b3480156104ca57600080fd5b506102b2600480360360408110156104e157600080fd5b50803590602001356001600160a01b03166112f7565b34801561050357600080fd5b506102b26004803603604081101561051a57600080fd5b50803590602001351515611371565b34801561053557600080fd5b506102de6004803603602081101561054c57600080fd5b5035611502565b34801561055f57600080fd5b506102de6004803603602081101561057657600080fd5b5035611514565b34801561058957600080fd5b506102b2600480360360208110156105a057600080fd5b5035611661565b3480156105b357600080fd5b506102de600480360360608110156105ca57600080fd5b508035906020810135906040013515156117a7565b3480156105eb57600080fd5b506102de6004803603606081101561060257600080fd5b5080359060208101359060400135151561197f565b34801561062357600080fd5b506102b26004803603604081101561063a57600080fd5b81359190810190604081016020820135600160201b81111561065b57600080fd5b82018360208201111561066d57600080fd5b803590602001918460018302840111600160201b8311171561068e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611a95945050505050565b6102b2600480360360208110156106e557600080fd5b5035611a99565b3480156106f857600080fd5b506102de6004803603606081101561070f57600080fd5b506001600160a01b038135811691602081013590911690604001351515611b31565b34801561073d57600080fd5b506102746004803603602081101561075457600080fd5b5035611b83565b34801561076757600080fd5b506102b2611b98565b34801561077c57600080fd5b506102b26004803603606081101561079357600080fd5b5080359060208101359060400135611c4c565b3480156107b257600080fd5b506102b2600480360360408110156107c957600080fd5b50803590602001351515611c73565b3480156107e457600080fd5b506102b2600480360360208110156107fb57600080fd5b5035611c9c565b6102b26004803603604081101561081857600080fd5b5080359060200135611d0c565b34801561083157600080fd5b506102b26004803603604081101561084857600080fd5b81359190810190604081016020820135600160201b81111561086957600080fd5b82018360208201111561087b57600080fd5b803590602001918460208302840111600160201b8311171561089c57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061205c945050505050565b3480156108e657600080fd5b506102b2600480360360408110156108fd57600080fd5b50803590602001351515612378565b34801561091857600080fd5b506102b26004803603604081101561092f57600080fd5b508035906020013515156123d6565b34801561094a57600080fd5b50610953612434565b604080516001600160a01b039092168252519081900360200190f35b34801561097b57600080fd5b50610953612443565b6102b26004803603604081101561099a57600080fd5b81359190810190604081016020820135600160201b8111156109bb57600080fd5b8201836020820111156109cd57600080fd5b803590602001918460208302840111600160201b831117156109ee57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550612452945050505050565b348015610a3857600080fd5b506102b260048036036060811015610a4f57600080fd5b81359190810190604081016020820135600160201b811115610a7057600080fd5b820183602082011115610a8257600080fd5b803590602001918460208302840111600160201b83111715610aa357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050503515159050612a54565b348015610aef57600080fd5b506104a1600480360360a0811015610b0657600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b811115610b3957600080fd5b820183602082011115610b4b57600080fd5b803590602001918460208302840111600160201b83111715610b6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610bbb57600080fd5b820183602082011115610bcd57600080fd5b803590602001918460208302840111600160201b83111715610bee57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610c3d57600080fd5b820183602082011115610c4f57600080fd5b803590602001918460018302840111600160201b83111715610c7057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612b18945050505050565b348015610cbd57600080fd5b506102b260048036036020811015610cd457600080fd5b50356001600160a01b0316612b29565b348015610cf057600080fd5b506102de60048036036080811015610d0757600080fd5b810190602081018135600160201b811115610d2157600080fd5b820183602082011115610d3357600080fd5b803590602001918460018302840111600160201b83111715610d5457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b811115610da657600080fd5b820183602082011115610db857600080fd5b803590602001918460018302840111600160201b83111715610dd957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160a01b0383351693505050602001351515612bf6565b348015610e3657600080fd5b506102b260048036036040811015610e4d57600080fd5b5080359060200135151561321d565b348015610e6857600080fd5b5061027460048036036040811015610e7f57600080fd5b50803590602001356132a7565b348015610e9857600080fd5b506104a1600480360360a0811015610eaf57600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b811115610eee57600080fd5b820183602082011115610f0057600080fd5b803590602001918460018302840111600160201b83111715610f2157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061347b945050505050565b348015610f6e57600080fd5b506102b260048036036020811015610f8557600080fd5b50356001600160a01b031661348c565b348015610fa157600080fd5b506102b260048036036040811015610fb857600080fd5b81359190810190604081016020820135600160201b811115610fd957600080fd5b820183602082011115610feb57600080fd5b803590602001918460208302840111600160201b8311171561100c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613597945050505050565b50600090565b61105981613baa565b603654604080516333727c4d60e01b81526004810184905290516001600160a01b03909216916333727c4d91602480820192602092909190829003018186803b1580156110a557600080fd5b505afa1580156110b9573d6000803e3d6000fd5b505050506040513d60208110156110cf57600080fd5b50516111425760365460408051638991342b60e01b8152600481018490526001602482015290516001600160a01b0390921691638991342b9160448082019260009290919082900301818387803b15801561112957600080fd5b505af115801561113d573d6000803e3d6000fd5b505050505b50565b60396020526000908152604090205481565b6002603554141561119d576040805162461bcd60e51b815260206004820152601f6024820152600080516020615c15833981519152604482015290519081900360640190fd5b60026035556111ac6001611c9c565b60365460408051632650a9bb60e11b81526004810186905290516001600160a01b0390921691634ca1537691602480820192602092909190829003018186803b1580156111f857600080fd5b505afa15801561120c573d6000803e3d6000fd5b505050506040513d602081101561122257600080fd5b505115611238576112338382613d47565b611244565b61124483836000613f7f565b827f1870fef12063ecb25738cfa99e018fc7ed7c3073cf1e6d58554470cac39ecf448383336040518080602001848152602001836001600160a01b03166001600160a01b03168152602001828103825285818151815260200191508051906020019060200280838360005b838110156112c75781810151838201526020016112af565b5050505090500194505050505060405180910390a25050600160355550565b630a85bd0160e11b5b949350505050565b61130082613baa565b60365460408051632911c27d60e01b8152600481018590526001600160a01b03848116602483015291519190921691632911c27d91604480830192600092919082900301818387803b15801561135557600080fd5b505af1158015611369573d6000803e3d6000fd5b505050505050565b61137a82613baa565b60365460408051632de8d14760e11b8152600481018590529051611477926001600160a01b031691635bd1a28e916024808301926020929190829003018186803b1580156113c757600080fd5b505afa1580156113db573d6000803e3d6000fd5b505050506040513d60208110156113f157600080fd5b50516036546040805163e94dbf8960e01b81526004810187905290516001600160a01b039092169163e94dbf8991602480820192602092909190829003018186803b15801561143f57600080fd5b505afa158015611453573d6000803e3d6000fd5b505050506040513d602081101561146957600080fd5b50519063ffffffff6145d516565b156114ad576040805162461bcd60e51b81526020600482015260016024820152603160f81b604482015290519081900360640190fd5b60365460408051632ad5f0a160e01b815260048101859052831515602482015290516001600160a01b0390921691632ad5f0a19160448082019260009290919082900301818387803b15801561135557600080fd5b60386020526000908152604090205481565b60365460408051632650a9bb60e11b81526004810184905290516000926001600160a01b031691634ca15376916024808301926020929190829003018186803b15801561156057600080fd5b505afa158015611574573d6000803e3d6000fd5b505050506040513d602081101561158a57600080fd5b50516115e2576036546040805163cc82447360e01b81526004810185905290516115dd926001600160a01b03169163cc824473916024808301926020929190829003018186803b1580156113c757600080fd5b61165b565b60365460408051632de8d14760e11b81526004810185905290516001600160a01b0390921691635bd1a28e91602480820192602092909190829003018186803b15801561162e57600080fd5b505afa158015611642573d6000803e3d6000fd5b505050506040513d602081101561165857600080fd5b50515b92915050565b61166a81613baa565b603654604080516333727c4d60e01b81526004810184905290516001600160a01b03909216916333727c4d91602480820192602092909190829003018186803b1580156116b657600080fd5b505afa1580156116ca573d6000803e3d6000fd5b505050506040513d60208110156116e057600080fd5b50516117535760365460408051638991342b60e01b8152600481018490526001602482015290516001600160a01b0390921691638991342b9160448082019260009290919082900301818387803b15801561173a57600080fd5b505af115801561174e573d6000803e3d6000fd5b505050505b6036546040805163be2cbc4f60e01b8152600481018490526001602482015290516001600160a01b039092169163be2cbc4f9160448082019260009290919082900301818387803b15801561112957600080fd5b60365460408051630331c8f160e31b8152600481018690528151600093849384936001600160a01b039092169263198e4788926024808201939291829003018186803b1580156117f657600080fd5b505afa15801561180a573d6000803e3d6000fd5b505050506040513d604081101561182057600080fd5b50805160209091015190925090508061183e57600092505050611978565b600061184987611514565b9050600082821161186957611864838363ffffffff61462f16565b61186c565b60005b9050600061187b858585614671565b90506000876118a25761189d896118918c611514565b9063ffffffff6145d516565b6118bb565b6118bb896118af8c611514565b9063ffffffff61462f16565b905060008582116118db576118d6868363ffffffff61462f16565b6118de565b60005b905060006118ed888885614671565b9050600061191c670de0b6b3a76400006119106002818a8a63ffffffff6146a616565b9063ffffffff6146ff16565b9050600061193f670de0b6b3a7640000611910600281888863ffffffff6146a616565b90508b61195b57611956828263ffffffff61462f16565b61196b565b61196b818363ffffffff61462f16565b9a50505050505050505050505b9392505050565b60365460408051630331c8f160e31b815260048101869052815160009384936001600160a01b039091169263198e47889260248083019392829003018186803b1580156119cb57600080fd5b505afa1580156119df573d6000803e3d6000fd5b505050506040513d60408110156119f557600080fd5b5060200151905080611a0b576000915050611978565b6000805b85811015611a8b57600085611a3057611a2b826118918a611514565b611a4d565b611a4d611a4483600163ffffffff6145d516565b6118af8a611514565b90506000611a5b8983614741565b9050611a6d848263ffffffff6145d516565b9350611a849150829050600163ffffffff6145d516565b9050611a0f565b5095945050505050565b5050565b60365460408051635f8bf97960e11b81526004810184905290516001600160a01b03909216916329984915918491611af4913491869163bf17f2f2916024808301926020929190829003018186803b15801561143f57600080fd5b6040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561112957600080fd5b600060026035541415611b79576040805162461bcd60e51b815260206004820152601f6024820152600080516020615c15833981519152604482015290519081900360640190fd5b6002603555600080fd5b60376020526000908152604090205460ff1681565b611ba061480c565b6033546001600160a01b03908116911614611c02576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b611c5583613baa565b60009283526038602090815260408085209390935560399052912055565b611c7c82613baa565b600091825260376020526040909120805460ff1916911515919091179055565b60008181526034602052604090205460ff161580611cd25750611cbd612434565b6001600160a01b0316336001600160a01b0316145b611142576040805162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015290519081900360640190fd5b60026035541415611d52576040805162461bcd60e51b815260206004820152601f6024820152600080516020615c15833981519152604482015290519081900360640190fd5b60026035819055611d6290611c9c565b60365460408051631ab8f14560e31b81526004810185905290516001600160a01b039092169163d5c78a2891602480820192602092909190829003018186803b158015611dae57600080fd5b505afa158015611dc2573d6000803e3d6000fd5b505050506040513d6020811015611dd857600080fd5b5051611fbc5760365460408051632650a9bb60e11b81526004810185905290516000926001600160a01b031691634ca15376916024808301926020929190829003018186803b158015611e2a57600080fd5b505afa158015611e3e573d6000803e3d6000fd5b505050506040513d6020811015611e5457600080fd5b5051611e6b57611e668383600161197f565b611e77565b611e77838360016117a7565b603654604080516301a1535d60e11b815260048101879052815193945060009384936001600160a01b031692630342a6ba9260248082019391829003018186803b158015611ec457600080fd5b505afa158015611ed8573d6000803e3d6000fd5b505050506040513d6040811015611eee57600080fd5b50805160209182015160365460408051632650a9bb60e11b8152600481018b90529051939650919450600093611f83938993889388936001600160a01b0390911692634ca15376926024808201939291829003018186803b158015611f5257600080fd5b505afa158015611f66573d6000803e3d6000fd5b505050506040513d6020811015611f7c57600080fd5b5051614810565b90506000611f97858363ffffffff6145d516565b1115611fb757611fb786611fb1868463ffffffff6145d516565b3461487c565b505050505b60365460408051632650a9bb60e11b81526004810185905290516001600160a01b0390921691634ca1537691602480820192602092909190829003018186803b15801561200857600080fd5b505afa15801561201c573d6000803e3d6000fd5b505050506040513d602081101561203257600080fd5b505161204957612044828260006149b5565b612053565b6120538282614d34565b50506001603555565b600260355414156120a2576040805162461bcd60e51b815260206004820152601f6024820152600080516020615c15833981519152604482015290519081900360640190fd5b600260355560005b815181101561236e57603654825133916001600160a01b031690635770f6409086908690869081106120d857fe5b60200260200101516040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561211b57600080fd5b505afa15801561212f573d6000803e3d6000fd5b505050506040513d602081101561214557600080fd5b50516001600160a01b031614612192576040805162461bcd60e51b815260206004820152600d60248201526c2737ba103932b8bab2b9ba32b960991b604482015290519081900360640190fd5b60365482516001600160a01b0390911690637f10d3149085908590859081106121b757fe5b602002602001015160006040518463ffffffff1660e01b815260040180848152602001838152602001826001600160a01b03166001600160a01b031681526020019350505050600060405180830381600087803b15801561221757600080fd5b505af115801561222b573d6000803e3d6000fd5b505060365460408051639d0214cb60e01b81526004810188905290516001600160a01b039092169350639d0214cb9250602480820192602092909190829003018186803b15801561227b57600080fd5b505afa15801561228f573d6000803e3d6000fd5b505050506040513d60208110156122a557600080fd5b505182516001600160a01b03909116906342842e0e90309033908690869081106122cb57fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561233b57600080fd5b505af115801561234f573d6000803e3d6000fd5b505050506123676001826145d590919063ffffffff16565b90506120aa565b5050600160355550565b61238182613baa565b603654604080516383e8d7e360e01b815260048101859052831515602482015290516001600160a01b03909216916383e8d7e39160448082019260009290919082900301818387803b15801561135557600080fd5b6123df82613baa565b60365460408051638d584bb160e01b815260048101859052831515602482015290516001600160a01b0390921691638d584bb19160448082019260009290919082900301818387803b15801561135557600080fd5b6033546001600160a01b031690565b6036546001600160a01b031681565b60026035541415612498576040805162461bcd60e51b815260206004820152601f6024820152600080516020615c15833981519152604482015290519081900360640190fd5b60026035556124a76001611c9c565b60365460408051637e82b64160e11b81526004810185905290516001600160a01b039092169163fd056c8291602480820192602092909190829003018186803b1580156124f357600080fd5b505afa158015612507573d6000803e3d6000fd5b505050506040513d602081101561251d57600080fd5b5051612554576040805162461bcd60e51b81526020600482015260016024820152603160f81b604482015290519081900360640190fd5b60005b81518110156129ba5760365460408051639d0214cb60e01b815260048101869052905130926001600160a01b031691639d0214cb916024808301926020929190829003018186803b1580156125ab57600080fd5b505afa1580156125bf573d6000803e3d6000fd5b505050506040513d60208110156125d557600080fd5b505183516001600160a01b0390911690636352211e908590859081106125f757fe5b60200260200101516040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561263357600080fd5b505afa158015612647573d6000803e3d6000fd5b505050506040513d602081101561265d57600080fd5b50516001600160a01b0316141561269f576040805162461bcd60e51b81526020600482015260016024820152601960f91b604482015290519081900360640190fd5b60365460408051639d0214cb60e01b81526004810186905290516001600160a01b0390921691639d0214cb91602480820192602092909190829003018186803b1580156126eb57600080fd5b505afa1580156126ff573d6000803e3d6000fd5b505050506040513d602081101561271557600080fd5b505182516001600160a01b03909116906342842e0e903390309086908690811061273b57fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050600060405180830381600087803b1580156127ab57600080fd5b505af11580156127bf573d6000803e3d6000fd5b505060365460408051639d0214cb60e01b81526004810188905290513094506001600160a01b039092169250639d0214cb916024808301926020929190829003018186803b15801561281057600080fd5b505afa158015612824573d6000803e3d6000fd5b505050506040513d602081101561283a57600080fd5b505183516001600160a01b0390911690636352211e9085908590811061285c57fe5b60200260200101516040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561289857600080fd5b505afa1580156128ac573d6000803e3d6000fd5b505050506040513d60208110156128c257600080fd5b50516001600160a01b031614612903576040805162461bcd60e51b81526020600482015260016024820152603360f81b604482015290519081900360640190fd5b60365482516001600160a01b0390911690637f10d31490859085908590811061292857fe5b6020026020010151336040518463ffffffff1660e01b815260040180848152602001838152602001826001600160a01b03166001600160a01b031681526020019350505050600060405180830381600087803b15801561298757600080fd5b505af115801561299b573d6000803e3d6000fd5b505050506129b36001826145d590919063ffffffff16565b9050612557565b50817f7fb9f848633daec03e24ca1fc96c532829a9873a4962860b54b5d7fdb8fd001282336040518080602001836001600160a01b03166001600160a01b03168152602001828103825284818151815260200191508051906020019060200280838360005b83811015612a37578181015183820152602001612a1f565b50505050905001935050505060405180910390a250506001603555565b612a5d83613baa565b60005b8251811015612b125760365483516001600160a01b0390911690639989f93a908690869085908110612a8e57fe5b6020026020010151856040518463ffffffff1660e01b815260040180848152602001838152602001821515151581526020019350505050600060405180830381600087803b158015612adf57600080fd5b505af1158015612af3573d6000803e3d6000fd5b50505050612b0b6001826145d590919063ffffffff16565b9050612a60565b50505050565b63bc197c8160e01b95945050505050565b600054610100900460ff1680612b425750612b42614f66565b80612b50575060005460ff16155b612b8b5760405162461bcd60e51b815260040180806020018281038252602e815260200180615c7c602e913960400191505060405180910390fd5b600054610100900460ff16158015612bb6576000805460ff1961ff0019909116610100171660011790555b612bbe614f6c565b612bc6615065565b603680546001600160a01b0319166001600160a01b0384161790558015611a95576000805461ff00191690555050565b600060026035541415612c3e576040805162461bcd60e51b815260206004820152601f6024820152600080516020615c15833981519152604482015290519081900360640190fd5b6002603555612c4d6000611c9c565b60408051633734cd1760e21b815260048101918252865160448201528651738414cfbb676dc02d0eee06756af3383090c9388f92600092849263dcd3345c928b928b928291602481019160649091019060208701908083838d5b83811015612cbf578181015183820152602001612ca7565b50505050905090810190601f168015612cec5780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b83811015612d1f578181015183820152602001612d07565b50505050905090810190601f168015612d4c5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015612d6d57600080fd5b505af1158015612d81573d6000803e3d6000fd5b505050506040513d6020811015612d9757600080fd5b50516036546040805163d80ce5e960e01b815290519293506000926001600160a01b039092169163d80ce5e99160048082019260209290919082900301818787803b158015612de557600080fd5b505af1158015612df9573d6000803e3d6000fd5b505050506040513d6020811015612e0f57600080fd5b505160365460408051631567925f60e01b8152600481018490526001600160a01b0386811660248301529151939450911691631567925f9160448082019260009290919082900301818387803b158015612e6857600080fd5b505af1158015612e7c573d6000803e3d6000fd5b5050603654604080516301f6bbdf60e31b81526004810186905290516001600160a01b039092169350630fb5def8925060248082019260009290919082900301818387803b158015612ecd57600080fd5b505af1158015612ee1573d6000803e3d6000fd5b505050508461302d5760365460408051632250a27360e21b8152600481018490526001600160a01b0389811660248301529151919092169163894289cc91604480830192600092919082900301818387803b158015612f3f57600080fd5b505af1158015612f53573d6000803e3d6000fd5b505060365460408051630116c32b60e31b81526004810186905290516001600160a01b0390921693506308b61958925060248082019260009290919082900301818387803b158015612fa457600080fd5b505af1158015612fb8573d6000803e3d6000fd5b505060365460408051632ad5f0a160e01b8152600481018690526001602482015290516001600160a01b039092169350632ad5f0a1925060448082019260009290919082900301818387803b15801561301057600080fd5b505af1158015613024573d6000803e3d6000fd5b5050505061316c565b60365460408051636102815d60e01b8152600481018490526001600160a01b03898116602483015291519190921691636102815d91604480830192600092919082900301818387803b15801561308257600080fd5b505af1158015613096573d6000803e3d6000fd5b505060365460408051638e3f545f60e01b81526004810186905290516001600160a01b039092169350638e3f545f925060248082019260009290919082900301818387803b1580156130e757600080fd5b505af11580156130fb573d6000803e3d6000fd5b5050603654604080516388779e5d60e01b8152600481018690526001602482015290516001600160a01b0390921693506388779e5d925060448082019260009290919082900301818387803b15801561315357600080fd5b505af1158015613167573d6000803e3d6000fd5b505050505b60365460408051632911c27d60e01b81526004810184905233602482015290516001600160a01b0390921691632911c27d9160448082019260009290919082900301818387803b1580156131bf57600080fd5b505af11580156131d3573d6000803e3d6000fd5b50506040805133815290518493507fc117b81c381b8c8066e461527733c2f11b87ebf36631b006cb5a74e3c0388b1392509081900360200190a26001603555979650505050505050565b61322561480c565b6033546001600160a01b03908116911614613287576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600091825260346020526040909120805460ff1916911515919091179055565b600082815260396020526040812054156132f45760008381526038602052604090205482108015906132e757506000838152603960205260409020548211155b156132f45750600161165b565b6036546040805163ec475a1f60e01b81526004810186905290516001600160a01b039092169163ec475a1f91602480820192602092909190829003018186803b15801561334057600080fd5b505afa158015613354573d6000803e3d6000fd5b505050506040513d602081101561336a57600080fd5b50516133f4576036546040805163784f417160e11b8152600481018690526024810185905290516001600160a01b039092169163f09e82e291604480820192602092909190829003018186803b1580156133c357600080fd5b505afa1580156133d7573d6000803e3d6000fd5b505050506040513d60208110156133ed57600080fd5b5051611978565b6036546040805163784f417160e11b8152600481018690526024810185905290516001600160a01b039092169163f09e82e291604480820192602092909190829003018186803b15801561344757600080fd5b505afa15801561345b573d6000803e3d6000fd5b505050506040513d602081101561347157600080fd5b5051159392505050565b63f23a6e6160e01b95945050505050565b61349461480c565b6033546001600160a01b039081169116146134f6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661353b5760405162461bcd60e51b8152600401808060200182810382526026815260200180615c356026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b6135a082613baa565b60005b8151811015613ba55760365482516000916001600160a01b031690635770f6409086908690869081106135d257fe5b60200260200101516040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561361557600080fd5b505afa158015613629573d6000803e3d6000fd5b505050506040513d602081101561363f57600080fd5b505190506001600160a01b03811661368b576040805162461bcd60e51b815260206004820152600a602482015269139bc81c995c5d595cdd60b21b604482015290519081900360640190fd5b60365460408051639d0214cb60e01b815260048101879052905130926001600160a01b031691639d0214cb916024808301926020929190829003018186803b1580156136d657600080fd5b505afa1580156136ea573d6000803e3d6000fd5b505050506040513d602081101561370057600080fd5b505184516001600160a01b0390911690636352211e9086908690811061372257fe5b60200260200101516040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561375e57600080fd5b505afa158015613772573d6000803e3d6000fd5b505050506040513d602081101561378857600080fd5b50516001600160a01b0316146137d1576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b60365483516001600160a01b0390911690637f10d3149086908690869081106137f657fe5b602002602001015160006040518463ffffffff1660e01b815260040180848152602001838152602001826001600160a01b03166001600160a01b031681526020019350505050600060405180830381600087803b15801561385657600080fd5b505af115801561386a573d6000803e3d6000fd5b505060365485516001600160a01b039091169250639989f93a9150869086908690811061389357fe5b602002602001015160016040518463ffffffff1660e01b815260040180848152602001838152602001821515151581526020019350505050600060405180830381600087803b1580156138e557600080fd5b505af11580156138f9573d6000803e3d6000fd5b505060365485516001600160a01b039091169250634d0cb0989150869086908690811061392257fe5b60200260200101516040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561396557600080fd5b505afa158015613979573d6000803e3d6000fd5b505050506040513d602081101561398f57600080fd5b505115613a1d5760365483516001600160a01b0390911690631ca1e4929086908690869081106139bb57fe5b60200260200101516040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015613a0057600080fd5b505af1158015613a14573d6000803e3d6000fd5b50505050613aa0565b60365483516001600160a01b0390911690634cef6465908690869086908110613a4257fe5b60200260200101516040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015613a8757600080fd5b505af1158015613a9b573d6000803e3d6000fd5b505050505b60365460408051631d1cae2360e31b81526004810187905290516001600160a01b039092169163e8e5711891602480820192602092909190829003018186803b158015613aec57600080fd5b505afa158015613b00573d6000803e3d6000fd5b505050506040513d6020811015613b1657600080fd5b5051604080516340c10f1960e01b81526001600160a01b038481166004830152670de0b6b3a76400006024830152915191909216916340c10f1991604480830192600092919082900301818387803b158015613b7157600080fd5b505af1158015613b85573d6000803e3d6000fd5b5050505050613b9e6001826145d590919063ffffffff16565b90506135a3565b505050565b603654604080516333727c4d60e01b81526004810184905290516001600160a01b03909216916333727c4d91602480820192602092909190829003018186803b158015613bf657600080fd5b505afa158015613c0a573d6000803e3d6000fd5b505050506040513d6020811015613c2057600080fd5b505115613c8557613c2f612434565b6001600160a01b0316336001600160a01b031614613c80576040805162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b604482015290519081900360640190fd5b611142565b60365460408051635298145760e01b81526004810184905290516001600160a01b0390921691635298145791602480820192602092909190829003018186803b158015613cd157600080fd5b505afa158015613ce5573d6000803e3d6000fd5b505050506040513d6020811015613cfb57600080fd5b50516001600160a01b03163314611142576040805162461bcd60e51b815260206004820152600b60248201526a2737ba1036b0b730b3b2b960a91b604482015290519081900360640190fd5b613ded3330613d5e846103e863ffffffff6146a616565b603654604080516305bb848560e01b81526004810189905290516001600160a01b03909216916305bb848591602480820192602092909190829003018186803b158015613daa57600080fd5b505afa158015613dbe573d6000803e3d6000fd5b505050506040513d6020811015613dd457600080fd5b50516001600160a01b031692919063ffffffff61506c16565b60365460408051631d1cae2360e31b81526004810185905290516001600160a01b039092169163e8e5711891602480820192602092909190829003018186803b158015613e3957600080fd5b505afa158015613e4d573d6000803e3d6000fd5b505050506040513d6020811015613e6357600080fd5b5051604080516340c10f1960e01b81523360048201526024810184905290516001600160a01b03909216916340c10f199160448082019260009290919082900301818387803b158015613eb557600080fd5b505af1158015613ec9573d6000803e3d6000fd5b50506036546001600160a01b03169150632ef30ad0905083613f42613ef6856103e863ffffffff6146a616565b60365460408051632de8d14760e11b8152600481018a905290516001600160a01b0390921691635bd1a28e91602480820192602092909190829003018186803b15801561143f57600080fd5b6040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561135557600080fd5b60005b82518110156144c2576000838281518110613f9957fe5b60200260200101519050613fad85826132a7565b613fe2576040805162461bcd60e51b81526020600482015260016024820152603160f81b604482015290519081900360640190fd5b60008581526037602052604090205460ff16156140fb5760365460408051633e23eea360e21b81526004810188905290516000926001600160a01b03169163f88fba8c916024808301926020929190829003018186803b15801561404557600080fd5b505afa158015614059573d6000803e3d6000fd5b505050506040513d602081101561406f57600080fd5b505160408051637921219560e11b8152336004820152306024820152604481018590526001606482015260a06084820152600060a4820181905291519293506001600160a01b0384169263f242432a9260e48084019391929182900301818387803b1580156140dd57600080fd5b505af11580156140f1573d6000803e3d6000fd5b505050505061443a565b60365460408051639d0214cb60e01b815260048101889052905130926001600160a01b031691639d0214cb916024808301926020929190829003018186803b15801561414657600080fd5b505afa15801561415a573d6000803e3d6000fd5b505050506040513d602081101561417057600080fd5b5051604080516331a9108f60e11b81526004810185905290516001600160a01b0390921691636352211e91602480820192602092909190829003018186803b1580156141bb57600080fd5b505afa1580156141cf573d6000803e3d6000fd5b505050506040513d60208110156141e557600080fd5b50516001600160a01b03161415614227576040805162461bcd60e51b81526020600482015260016024820152601960f91b604482015290519081900360640190fd5b60365460408051639d0214cb60e01b81526004810188905290516001600160a01b0390921691639d0214cb91602480820192602092909190829003018186803b15801561427357600080fd5b505afa158015614287573d6000803e3d6000fd5b505050506040513d602081101561429d57600080fd5b5051604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd9160648082019260009290919082900301818387803b1580156142f557600080fd5b505af1158015614309573d6000803e3d6000fd5b505060365460408051639d0214cb60e01b8152600481018a905290513094506001600160a01b039092169250639d0214cb916024808301926020929190829003018186803b15801561435a57600080fd5b505afa15801561436e573d6000803e3d6000fd5b505050506040513d602081101561438457600080fd5b5051604080516331a9108f60e11b81526004810185905290516001600160a01b0390921691636352211e91602480820192602092909190829003018186803b1580156143cf57600080fd5b505afa1580156143e3573d6000803e3d6000fd5b505050506040513d60208110156143f957600080fd5b50516001600160a01b03161461443a576040805162461bcd60e51b81526020600482015260016024820152603360f81b604482015290519081900360640190fd5b60365460408051634cef646560e01b8152600481018890526024810184905290516001600160a01b0390921691634cef64659160448082019260009290919082900301818387803b15801561448e57600080fd5b505af11580156144a2573d6000803e3d6000fd5b50505050506144bb6001826145d590919063ffffffff16565b9050613f82565b5060365460408051631d1cae2360e31b81526004810186905290516001600160a01b039092169163e8e5711891602480820192602092909190829003018186803b15801561450f57600080fd5b505afa158015614523573d6000803e3d6000fd5b505050506040513d602081101561453957600080fd5b505182516001600160a01b03909116906340c10f1990339061456990670de0b6b3a764000063ffffffff6146a616565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156145b857600080fd5b505af11580156145cc573d6000803e3d6000fd5b50505050505050565b600082820183811015611978576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061197883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506150c6565b600082821061468257506000611978565b6112ef61469984611910878663ffffffff6146a616565b859063ffffffff61462f16565b6000826146b55750600061165b565b828202828482816146c257fe5b04146119785760405162461bcd60e51b8152600401808060200182810382526021815260200180615c5b6021913960400191505060405180910390fd5b600061197883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061515d565b60365460408051630331c8f160e31b8152600481018590528151600093849384936001600160a01b039092169263198e4788926024808201939291829003018186803b15801561479057600080fd5b505afa1580156147a4573d6000803e3d6000fd5b505050506040513d60408110156147ba57600080fd5b50805160209091015190925090508084106147da5760009250505061165b565b60006147ec828663ffffffff61462f16565b905061480282611910858463ffffffff6146a616565b9695505050505050565b3390565b60008461481f575060006112ef565b811561482d575060006112ef565b8460006001821015614840576000614851565b61485182600163ffffffff61462f16565b9050614873614866868363ffffffff6146a616565b879063ffffffff6145d516565b925050506112ef565b818110156148c1576040805162461bcd60e51b815260206004820152600d60248201526c56616c756520746f6f206c6f7760981b604482015290519081900360640190fd5b60365460408051635f8bf97960e11b81526004810186905290516001600160a01b0390921691632998491591869161491c918791869163bf17f2f2916024808301926020929190829003018186803b15801561143f57600080fd5b6040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561495957600080fd5b505af115801561496d573d6000803e3d6000fd5b5050505081811115613ba557336108fc61498d838563ffffffff61462f16565b6040518115909202916000818181858888f19350505050158015612b12573d6000803e3d6000fd5b60005b82811015612b12576040805160018082528183019092526060916020808301908036833750506036546040805163e94dbf8960e01b8152600481018a905290519394506000936001600160a01b03909216925063e94dbf89916024808301926020929190829003018186803b158015614a3057600080fd5b505afa158015614a44573d6000803e3d6000fd5b505050506040513d6020811015614a5a57600080fd5b50511115614b87576036546040805163e94dbf8960e01b8152600481018890529051600092614ae6926001600160a01b039091169163e94dbf8991602480820192602092909190829003018186803b158015614ab557600080fd5b505afa158015614ac9573d6000803e3d6000fd5b505050506040513d6020811015614adf57600080fd5b50516151c2565b6036546040805163645058b360e01b8152600481018a90526024810184905290519293506001600160a01b039091169163645058b391604480820192602092909190829003018186803b158015614b3c57600080fd5b505afa158015614b50573d6000803e3d6000fd5b505050506040513d6020811015614b6657600080fd5b505182518390600090614b7557fe5b60200260200101818152505050614c77565b6036546040805163cc82447360e01b8152600481018890529051600092614bda926001600160a01b039091169163cc82447391602480820192602092909190829003018186803b158015614ab557600080fd5b60365460408051637618032560e11b8152600481018a90526024810184905290519293506001600160a01b039091169163ec30064a91604480820192602092909190829003018186803b158015614c3057600080fd5b505afa158015614c44573d6000803e3d6000fd5b505050506040513d6020811015614c5a57600080fd5b505182518390600090614c6957fe5b602002602001018181525050505b614c82858285615335565b847f8dd603fb9fd7fdd0be7a7c282962e1ac7c6d82e51fc34bd602ec1b83cf2dc93c826000336040518080602001848152602001836001600160a01b03166001600160a01b03168152602001828103825285818151815260200191508051906020019060200280838360005b83811015614d06578181015183820152602001614cee565b5050505090500194505050505060405180910390a250614d2d81600163ffffffff6145d516565b90506149b8565b60365460408051631d1cae2360e31b81526004810185905290516001600160a01b039092169163e8e5711891602480820192602092909190829003018186803b158015614d8057600080fd5b505afa158015614d94573d6000803e3d6000fd5b505050506040513d6020811015614daa57600080fd5b50516040805163079cc67960e41b81523360048201526024810184905290516001600160a01b03909216916379cc67909160448082019260009290919082900301818387803b158015614dfc57600080fd5b505af1158015614e10573d6000803e3d6000fd5b50505050614ebb33614e2d6103e8846146a690919063ffffffff16565b603654604080516305bb848560e01b81526004810188905290516001600160a01b03909216916305bb848591602480820192602092909190829003018186803b158015614e7957600080fd5b505afa158015614e8d573d6000803e3d6000fd5b505050506040513d6020811015614ea357600080fd5b50516001600160a01b0316919063ffffffff61599816565b6036546001600160a01b0316632ef30ad083613f42614ee2856103e863ffffffff6146a616565b60365460408051632de8d14760e11b8152600481018a905290516001600160a01b0390921691635bd1a28e91602480820192602092909190829003018186803b158015614f2e57600080fd5b505afa158015614f42573d6000803e3d6000fd5b505050506040513d6020811015614f5857600080fd5b50519063ffffffff61462f16565b303b1590565b600054610100900460ff1680614f855750614f85614f66565b80614f93575060005460ff16155b614fce5760405162461bcd60e51b815260040180806020018281038252602e815260200180615c7c602e913960400191505060405180910390fd5b600054610100900460ff16158015614ff9576000805460ff1961ff0019909116610100171660011790555b600061500361480c565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015611142576000805461ff001916905550565b6001603555565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612b129085906159e6565b600081848411156151555760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561511a578181015183820152602001615102565b50505050905090810190601f1680156151475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836151ac5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561511a578181015183820152602001615102565b5060008385816151b857fe5b0495945050505050565b603654604080516330f009ab60e11b815290516000926001600160a01b03169163b7d04423916152169160019185916361e01356916004808301926020929190829003018186803b15801561143f57600080fd5b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561524c57600080fd5b505af1158015615260573d6000803e3d6000fd5b50505050814233603660009054906101000a90046001600160a01b03166001600160a01b03166361e013566040518163ffffffff1660e01b815260040160206040518083038186803b1580156152b557600080fd5b505afa1580156152c9573d6000803e3d6000fd5b505050506040513d60208110156152df57600080fd5b50516040805160208082019590955260609390931b6bffffffffffffffffffffffff19168382015260548084019290925280518084039092018252607490920190915280519101208161532e57fe5b0692915050565b60365460408051631d1cae2360e31b81526004810186905290516001600160a01b039092169163e8e5711891602480820192602092909190829003018186803b15801561538157600080fd5b505afa158015615395573d6000803e3d6000fd5b505050506040513d60208110156153ab57600080fd5b505182516001600160a01b03909116906379cc67909033906153db90670de0b6b3a764000063ffffffff6146a616565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561542a57600080fd5b505af115801561543e573d6000803e3d6000fd5b506000925050505b8251811015612b1257600083828151811061545d57fe5b60209081029190910181015160365460408051637cb251d560e01b8152600481018a90526024810184905290519294506001600160a01b0390911692637cb251d592604480840193829003018186803b1580156154b957600080fd5b505afa1580156154cd573d6000803e3d6000fd5b505050506040513d60208110156154e357600080fd5b505161551a576040805162461bcd60e51b81526020600482015260016024820152603160f81b604482015290519081900360640190fd5b60365460408051637cb251d560e01b8152600481018890526024810184905290516001600160a01b0390921691637cb251d591604480820192602092909190829003018186803b15801561556d57600080fd5b505afa158015615581573d6000803e3d6000fd5b505050506040513d602081101561559757600080fd5b50511561560b5760365460408051630f3e56c960e01b8152600481018890526024810184905290516001600160a01b0390921691630f3e56c99160448082019260009290919082900301818387803b1580156155f257600080fd5b505af1158015615606573d6000803e3d6000fd5b505050505b603654604080516348e1181560e11b81526004810188905290516001600160a01b03909216916391c2302a91602480820192602092909190829003018186803b15801561565757600080fd5b505afa15801561566b573d6000803e3d6000fd5b505050506040513d602081101561568157600080fd5b50511561577f576036546040805163784f417160e11b8152600481018890526024810184905290516000926001600160a01b03169163f09e82e2916044808301926020929190829003018186803b1580156156db57600080fd5b505afa1580156156ef573d6000803e3d6000fd5b505050506040513d602081101561570557600080fd5b505160365460408051634cc4fc9d60e11b8152600481018a9052602481018690528315604482015290519293506001600160a01b0390911691639989f93a9160648082019260009290919082900301818387803b15801561576557600080fd5b505af1158015615779573d6000803e3d6000fd5b50505050505b60008581526037602052604090205460ff16156158985760365460408051633e23eea360e21b81526004810188905290516000926001600160a01b03169163f88fba8c916024808301926020929190829003018186803b1580156157e257600080fd5b505afa1580156157f6573d6000803e3d6000fd5b505050506040513d602081101561580c57600080fd5b505160408051637921219560e11b8152306004820152336024820152604481018590526001606482015260a06084820152600060a4820181905291519293506001600160a01b0384169263f242432a9260e48084019391929182900301818387803b15801561587a57600080fd5b505af115801561588e573d6000803e3d6000fd5b505050505061597f565b60365460408051639d0214cb60e01b81526004810188905290516001600160a01b0390921691639d0214cb91602480820192602092909190829003018186803b1580156158e457600080fd5b505afa1580156158f8573d6000803e3d6000fd5b505050506040513d602081101561590e57600080fd5b505160408051632142170760e11b81523060048201523360248201526044810184905290516001600160a01b03909216916342842e0e9160648082019260009290919082900301818387803b15801561596657600080fd5b505af115801561597a573d6000803e3d6000fd5b505050505b5061599181600163ffffffff6145d516565b9050615446565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052613ba59084905b6060615a3b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316615a979092919063ffffffff16565b805190915015613ba557808060200190516020811015615a5a57600080fd5b5051613ba55760405162461bcd60e51b815260040180806020018281038252602a815260200180615caa602a913960400191505060405180910390fd5b60606112ef84846000856060615aac85615c0e565b615afd576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310615b3c5780518252601f199092019160209182019101615b1d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615b9e576040519150601f19603f3d011682016040523d82523d6000602084013e615ba3565b606091505b50915091508115615bb75791506112ef9050565b805115615bc75780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561511a578181015183820152602001615102565b3b15159056fe5265656e7472616e637947756172643a207265656e7472616e742063616c6c004f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212208dcf91c880e40f62913fc8561c18f6f4286929bb58c2976d9d58bf222386f58464736f6c63430006080033

Deployed ByteCode Sourcemap

169:7033:47:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;5584:123:47;;5:9:-1;2:2;;;27:1;24;17:12;2:2;5584:123:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;5584:123:47;-1:-1:-1;;;;;;5584:123:47;;:::i;:::-;;;;;;;;;;;;;;;;;;18584:197:38;;5:9:-1;2:2;;;27:1;24;17:12;2:2;18584:197:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;18584:197:38;;:::i;:::-;;6438:43:47;;5:9:-1;2:2;;;27:1;24;17:12;2:2;6438:43:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;6438:43:47;;:::i;:::-;;;;;;;;;;;;;;;;6071:151;;5:9:-1;2:2;;;27:1;24;17:12;2:2;6071:151:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;6071:151:47;;;;;;;;;;;;:::i;3953:1147::-;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;3953:1147:47;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;3953:1147:47;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;3953:1147:47;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;3953:1147:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;3953:1147:47;;-1:-1:-1;;3953:1147:47;;;-1:-1:-1;3953:1147:47;;-1:-1:-1;;3953:1147:47:i;516:200:14:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;516:200:14;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;-1:-1;;;;;516:200:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;516:200:14;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;516:200:14;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;516:200:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;516:200:14;;-1:-1:-1;516:200:14;;-1:-1:-1;;;;;516:200:14:i;:::-;;;;-1:-1:-1;;;;;;516:200:14;;;;;;;;;;;;;;18419:159:38;;5:9:-1;2:2;;;27:1;24;17:12;2:2;18419:159:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;18419:159:38;;;;;;-1:-1:-1;;;;;18419:159:38;;:::i;3557:390:47:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;3557:390:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;3557:390:47;;;;;;;;;:::i;6387:45::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;6387:45:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;6387:45:47;;:::i;1682:299:38:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1682:299:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1682:299:38;;:::i;18787:236::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;18787:236:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;18787:236:38;;:::i;3439:1007::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;3439:1007:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;3439:1007:38;;;;;;;;;;;;;;:::i;2801:632::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;2801:632:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2801:632:38;;;;;;;;;;;;;;:::i;276:123:44:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;276:123:44;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;276:123:44;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;276:123:44;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;276:123:44;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;276:123:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;276:123:44;;-1:-1:-1;276:123:44;;-1:-1:-1;;;;;276:123:44:i;5981:147:38:-;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;5981:147:38;;:::i;5713:195:47:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;5713:195:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;;;;;;5713:195:47;;;;;;;;;;;;;;;;;;;:::i;234:43::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;234:43:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;234:43:47;;:::i;1779:145:48:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1779:145:48;;;:::i;6488:218:47:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;6488:218:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;6488:218:47;;;;;;;;;;;;:::i;284:169::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;284:169:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;284:169:47;;;;;;;;;:::i;264:145:51:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;264:145:51;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;264:145:51;;:::i;14091:909:38:-;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;14091:909:38;;;;;;;:::i;7918:554::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;7918:554:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;7918:554:38;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;7918:554:38;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;7918:554:38;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;7918:554:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;7918:554:38;;-1:-1:-1;7918:554:38;;-1:-1:-1;;;;;7918:554:38:i;16223:190::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;16223:190:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;16223:190:38;;;;;;;;;:::i;16023:194::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;16023:194:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;16023:194:38;;;;;;;;;:::i;1156:77:48:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1156:77:48;;;:::i;:::-;;;;-1:-1:-1;;;;;1156:77:48;;;;;;;;;;;;;;840:20:38;;5:9:-1;2:2;;;27:1;24;17:12;2:2;840:20:38;;;:::i;2666:885:47:-;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;2666:885:47;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;2666:885:47;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;2666:885:47;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;2666:885:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;2666:885:47;;-1:-1:-1;2666:885:47;;-1:-1:-1;;;;;2666:885:47:i;15716:301:38:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;15716:301:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;15716:301:38;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;15716:301:38;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;15716:301:38;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;15716:301:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;15716:301:38;;-1:-1:-1;;;;15716:301:38;;;;-1:-1:-1;15716:301:38;:::i;5331:247:47:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;5331:247:47;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;-1:-1;;;;;5331:247:47;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;5331:247:47;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;5331:247:47;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;5331:247:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;5331:247:47;;;;;;;;-1:-1:-1;5331:247:47;;-1:-1:-1;;;;;11:28;;8:2;;;52:1;49;42:12;8:2;5331:247:47;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;5331:247:47;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;5331:247:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;5331:247:47;;;;;;;;-1:-1:-1;5331:247:47;;-1:-1:-1;;;;;11:28;;8:2;;;52:1;49;42:12;8:2;5331:247:47;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;5331:247:47;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;5331:247:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;5331:247:47;;-1:-1:-1;5331:247:47;;-1:-1:-1;;;;;5331:247:47:i;867:161:38:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;867:161:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;867:161:38;-1:-1:-1;;;;;867:161:38;;:::i;921:1019:44:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;921:1019:44;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;921:1019:44;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;921:1019:44;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;921:1019:44;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;921:1019:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;921:1019:44;;;;;;;;-1:-1:-1;921:1019:44;;-1:-1:-1;;;;;11:28;;8:2;;;52:1;49;42:12;8:2;921:1019:44;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;921:1019:44;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;921:1019:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;921:1019:44;;-1:-1:-1;;;;;;;921:1019:44;;;;-1:-1:-1;;;921:1019:44;;;;;;:::i;415:153:51:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;415:153:51;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;415:153:51;;;;;;;;;:::i;6712:488:47:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;6712:488:47;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;6712:488:47;;;;;;;:::i;5106:219::-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;5106:219:47;;;;;;15:3:-1;10;7:12;4:2;;;32:1;29;22:12;4:2;-1:-1;;;;;5106:219:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;5106:219:47;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;5106:219:47;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;5106:219:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;5106:219:47;;-1:-1:-1;5106:219:47;;-1:-1:-1;;;;;5106:219:47:i;2073:274:48:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;2073:274:48;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2073:274:48;-1:-1:-1;;;;;2073:274:48;;:::i;8478:869:38:-;;5:9:-1;2:2;;;27:1;24;17:12;2:2;8478:869:38;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;8478:869:38;;;;;;;;;;;;;;-1:-1:-1;;;11:28;;8:2;;;52:1;49;42:12;8:2;8478:869:38;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;8478:869:38;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;8478:869:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;8478:869:38;;-1:-1:-1;8478:869:38;;-1:-1:-1;;;;;8478:869:38:i;5584:123:47:-;-1:-1:-1;5695:4:47;;5584:123::o;18584:197:38:-;18649:23;18664:7;18649:14;:23::i;:::-;18687:5;;:26;;;-1:-1:-1;;;18687:26:38;;;;;;;;;;-1:-1:-1;;;;;18687:5:38;;;;:17;;:26;;;;;;;;;;;;;;;:5;:26;;;2:2:-1;;;;27:1;24;17:12;2:2;18687:26:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;18687:26:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;18687:26:38;18682:93;;18729:5;;:35;;;-1:-1:-1;;;18729:35:38;;;;;;;;:5;:35;;;;;;-1:-1:-1;;;;;18729:5:38;;;;:20;;:35;;;;;:5;;:35;;;;;;;;:5;;:35;;;2:2:-1;;;;27:1;24;17:12;2:2;18729:35:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;18729:35:38;;;;18682:93;18584:197;:::o;6438:43:47:-;;;;;;;;;;;;;:::o;3953:1147::-;1721:1:53;2326:7;;:19;;2318:63;;;;;-1:-1:-1;;;2318:63:53;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2318:63:53;;;;;;;;;;;;;;;1721:1;2456:7;:18;4126:20:47::1;4144:1;4126:17;:20::i;:::-;4772:5;::::0;:24:::1;::::0;;-1:-1:-1;;;4772:24:47;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;4772:5:47;;::::1;::::0;:15:::1;::::0;:24;;;;;::::1;::::0;;;;;;;;;:5;:24;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;4772:24:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;4772:24:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;4772:24:47;4768:141:::1;;;4812:26;4820:7;4829:8;4812:7;:26::i;:::-;4768:141;;;4869:29;4875:7;4884:6;4892:5;4869;:29::i;:::-;5055:7;5050:43;5064:6;5072:8;5082:10;5050:43;;;;;;;;;;;;-1:-1:-1::0;;;;;5050:43:47::1;-1:-1:-1::0;;;;;5050:43:47::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11:::0;;::::1;84:18:::0;71:11;;::::1;64:39:::0;52:2:::1;45:10;8:100;;;12:14;5050:43:47;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;1678:1:53;2630:7;:22;-1:-1:-1;3953:1147:47:o;516:200:14:-;-1:-1:-1;;;516:200:14;;;;;;;:::o;18419:159:38:-;18501:23;18516:7;18501:14;:23::i;:::-;18534:5;;:37;;;-1:-1:-1;;;18534:37:38;;;;;;;;-1:-1:-1;;;;;18534:37:38;;;;;;;;;:5;;;;;:16;;:37;;;;;:5;;:37;;;;;;;:5;;:37;;;2:2:-1;;;;27:1;24;17:12;2:2;18534:37:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;18534:37:38;;;;18419:159;;:::o;3557:390:47:-;3685:23;3700:7;3685:14;:23::i;:::-;3807:5;;:25;;;-1:-1:-1;;;3807:25:47;;;;;;;;;;3739:94;;-1:-1:-1;;;;;3807:5:47;;:16;;:25;;;;;;;;;;;;;;:5;:25;;;2:2:-1;;;;27:1;24;17:12;2:2;3807:25:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3807:25:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;3807:25:47;3739:5;;:46;;;-1:-1:-1;;;3739:46:47;;;;;;;;;;-1:-1:-1;;;;;3739:5:47;;;;:37;;:46;;;;;3807:25;;3739:46;;;;;;;;:5;:46;;;2:2:-1;;;;27:1;24;17:12;2:2;3739:46:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3739:46:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;3739:46:47;;:94;:67;:94;:::i;:::-;:115;3718:163;;;;;-1:-1:-1;;;3718:163:47;;;;;;;;;;;;-1:-1:-1;;;3718:163:47;;;;;;;;;;;;;;;3891:5;;:49;;;-1:-1:-1;;;3891:49:47;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3891:5:47;;;;:26;;:49;;;;;:5;;:49;;;;;;;;:5;;:49;;;2:2:-1;;;;27:1;24;17:12;6387:45:47;;;;;;;;;;;;;:::o;1682:299:38:-;1785:5;;:24;;;-1:-1:-1;;;1785:24:38;;;;;;;;;;1747:7;;-1:-1:-1;;;;;1785:5:38;;:15;;:24;;;;;;;;;;;;;;:5;:24;;;2:2:-1;;;;27:1;24;17:12;2:2;1785:24:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1785:24:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1785:24:38;:189;;1927:5;;:29;;;-1:-1:-1;;;1927:29:38;;;;;;;;;;1872:102;;-1:-1:-1;;;;;1927:5:38;;:20;;:29;;;;;;;;;;;;;;:5;:29;;;2:2:-1;;;;27:1;24;17:12;1872:102:38;1785:189;;;1828:5;;:25;;;-1:-1:-1;;;1828:25:38;;;;;;;;;;-1:-1:-1;;;;;1828:5:38;;;;:16;;:25;;;;;;;;;;;;;;;:5;:25;;;2:2:-1;;;;27:1;24;17:12;2:2;1828:25:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1828:25:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1828:25:38;1785:189;1766:208;1682:299;-1:-1:-1;;1682:299:38:o;18787:236::-;18849:23;18864:7;18849:14;:23::i;:::-;18887:5;;:26;;;-1:-1:-1;;;18887:26:38;;;;;;;;;;-1:-1:-1;;;;;18887:5:38;;;;:17;;:26;;;;;;;;;;;;;;;:5;:26;;;2:2:-1;;;;27:1;24;17:12;2:2;18887:26:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;18887:26:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;18887:26:38;18882:93;;18929:5;;:35;;;-1:-1:-1;;;18929:35:38;;;;;;;;:5;:35;;;;;;-1:-1:-1;;;;;18929:5:38;;;;:20;;:35;;;;;:5;;:35;;;;;;;;:5;;:35;;;2:2:-1;;;;27:1;24;17:12;2:2;18929:35:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;18929:35:38;;;;18882:93;18984:5;;:32;;;-1:-1:-1;;;18984:32:38;;;;;;;;:5;:32;;;;;;-1:-1:-1;;;;;18984:5:38;;;;:17;;:32;;;;;:5;;:32;;;;;;;;:5;;:32;;;2:2:-1;;;;27:1;24;17:12;3439:1007:38;3627:5;;:29;;;-1:-1:-1;;;3627:29:38;;;;;;;;;;3569:7;;;;;;-1:-1:-1;;;;;3627:5:38;;;;:20;;:29;;;;;;;;;;;;:5;:29;;;2:2:-1;;;;27:1;24;17:12;2:2;3627:29:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3627:29:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;3627:29:38;;;;;;;;;-1:-1:-1;3627:29:38;-1:-1:-1;3670:11:38;3666:25;;3690:1;3683:8;;;;;;3666:25;3701:16;3720:18;3730:7;3720:9;:18::i;:::-;3701:37;;3748:17;3779:6;3768:8;:17;:44;;3792:20;:6;3803:8;3792:20;:10;:20;:::i;:::-;3768:44;;;3788:1;3768:44;3748:64;;3822:18;3843:45;3863:6;3871;3879:8;3843:19;:45::i;:::-;3822:66;;3898:15;3916:6;:96;;3982:30;4005:6;3982:18;3992:7;3982:9;:18::i;:::-;:22;:30;:22;:30;:::i;:::-;3916:96;;;3937:30;3960:6;3937:18;3947:7;3937:9;:18::i;:::-;:22;:30;:22;:30;:::i;:::-;3898:114;;4022:16;4051:6;4041:7;:16;:42;;4064:19;:6;4075:7;4064:19;:10;:19;:::i;:::-;4041:42;;;4060:1;4041:42;4022:61;;4093:17;4113:44;4133:6;4141;4149:7;4113:19;:44::i;:::-;4093:64;-1:-1:-1;4167:20:38;4190:44;4227:6;4190:32;4220:1;4190:32;:9;4204:10;4190:25;:13;:25;:::i;:::-;:29;:32;:29;:32;:::i;:44::-;4167:67;-1:-1:-1;4244:19:38;4266:42;4301:6;4266:30;4294:1;4266:30;:8;4279:9;4266:23;:12;:23;:::i;:42::-;4244:64;;4337:6;:102;;4410:29;:12;4427:11;4410:29;:16;:29;:::i;:::-;4337:102;;;4362:29;:11;4378:12;4362:29;:15;:29;:::i;:::-;4318:121;;;;;;;;;;;;3439:1007;;;;;;:::o;2801:632::-;2976:5;;:29;;;-1:-1:-1;;;2976:29:38;;;;;;;;;;2932:7;;;;-1:-1:-1;;;;;2976:5:38;;;;:20;;:29;;;;;;;;;;;:5;:29;;;2:2:-1;;;;27:1;24;17:12;2:2;2976:29:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2976:29:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2976:29:38;;;;-1:-1:-1;3019:11:38;3015:25;;3039:1;3032:8;;;;;3015:25;3050:17;;3081:320;3105:9;3101:1;:13;3081:320;;;3144:18;3165:6;:101;;3241:25;3264:1;3241:18;3251:7;3241:9;:18::i;:25::-;3165:101;;;3190:32;3213:8;:1;3219;3213:8;:5;:8;:::i;:::-;3190:18;3200:7;3190:9;:18::i;:32::-;3144:122;;3280:18;3301:38;3319:7;3328:10;3301:17;:38::i;:::-;3280:59;-1:-1:-1;3365:25:38;:9;3280:59;3365:25;:13;:25;:::i;:::-;3353:37;-1:-1:-1;3120:8:38;;-1:-1:-1;3120:1:38;;-1:-1:-1;3126:1:38;3120:8;:5;:8;:::i;:::-;3116:12;;3081:320;;;-1:-1:-1;3417:9:38;2801:632;-1:-1:-1;;;;;2801:632:38:o;276:123:44:-;;;:::o;5981:147:38:-;6051:5;;6080:25;;;-1:-1:-1;;;6080:25:38;;;;;;;;;;-1:-1:-1;;;;;6051:5:38;;;;:19;;6071:7;;6080:40;;6110:9;;6051:5;;6080:16;;:25;;;;;;;;;;;;;;6051:5;6080:25;;;2:2:-1;;;;27:1;24;17:12;6080:40:38;6051:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;5713:195:47;5874:7;1721:1:53;2326:7;;:19;;2318:63;;;;;-1:-1:-1;;;2318:63:53;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2318:63:53;;;;;;;;;;;;;;;1721:1;2456:7;:18;12:1:-1::1;::::0;2:12:::1;234:43:47::0;;;;;;;;;;;;;;;:::o;1779:145:48:-;1370:12;:10;:12::i;:::-;1360:6;;-1:-1:-1;;;;;1360:6:48;;;:22;;;1352:67;;;;;-1:-1:-1;;;1352:67:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1869:6:::1;::::0;1848:40:::1;::::0;1885:1:::1;::::0;-1:-1:-1;;;;;1869:6:48::1;::::0;1848:40:::1;::::0;1885:1;;1848:40:::1;1898:6;:19:::0;;-1:-1:-1;;;;;;1898:19:48::1;::::0;;1779:145::o;6488:218:47:-;6606:23;6621:7;6606:14;:23::i;:::-;6639:19;;;;:10;:19;;;;;;;;:27;;;;6676:8;:17;;;;:23;6488:218::o;284:169::-;382:23;397:7;382:14;:23::i;:::-;415:20;;;;:11;:20;;;;;;:31;;-1:-1:-1;;415:31:47;;;;;;;;;;284:169::o;264:145:51:-;348:18;;;;:8;:18;;;;;;;;347:19;;:44;;;384:7;:5;:7::i;:::-;-1:-1:-1;;;;;370:21:51;:10;-1:-1:-1;;;;;370:21:51;;347:44;339:63;;;;;-1:-1:-1;;;339:63:51;;;;;;;;;;;;-1:-1:-1;;;339:63:51;;;;;;;;;;;;;;14091:909:38;1721:1:53;2326:7;;:19;;2318:63;;;;;-1:-1:-1;;;2318:63:53;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2318:63:53;;;;;;;;;;;;;;;1721:1;2456:7;:18;;;14222:20:38::1;::::0;:17:::1;:20::i;:::-;14257:5;::::0;:23:::1;::::0;;-1:-1:-1;;;14257:23:38;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;14257:5:38;;::::1;::::0;:14:::1;::::0;:23;;;;;::::1;::::0;;;;;;;;;:5;:23;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;14257:23:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;14257:23:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;14257:23:38;14252:588:::1;;14316:5;::::0;:24:::1;::::0;;-1:-1:-1;;;14316:24:38;;::::1;::::0;::::1;::::0;;;;;14296:17:::1;::::0;-1:-1:-1;;;;;14316:5:38::1;::::0;:15:::1;::::0;:24;;;;;::::1;::::0;;;;;;;;:5;:24;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;14316:24:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;14316:24:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;14316:24:38;:132:::1;;14414:34;14426:7;14435:6;14443:4;14414:11;:34::i;:::-;14316:132;;;14359:36;14373:7;14382:6;14390:4;14359:13;:36::i;:::-;14499:5;::::0;:23:::1;::::0;;-1:-1:-1;;;14499:23:38;;::::1;::::0;::::1;::::0;;;;;14296:152;;-1:-1:-1;14463:15:38::1;::::0;;;-1:-1:-1;;;;;14499:5:38::1;::::0;:14:::1;::::0;:23;;;;;;;;;;;:5;:23;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;14499:23:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;14499:23:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;14499:23:38;;::::1;::::0;;::::1;::::0;14653:5:::1;::::0;14499:23;14653:24;;-1:-1:-1;;;14653:24:38;;::::1;::::0;::::1;::::0;;;;;14499:23;;-1:-1:-1;14499:23:38;;-1:-1:-1;14536:14:38::1;::::0;14553:138:::1;::::0;14579:6;;14499:23;;;;-1:-1:-1;;;;;14653:5:38;;::::1;::::0;:15:::1;::::0;:24;;;;;14499:23;14653:24;;;;;;:5;:24;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;14653:24:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;14653:24:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;14653:24:38;14553:8:::1;:138::i;:::-;14536:155:::0;-1:-1:-1;14733:1:38::1;14709:21;:9:::0;14536:155;14709:21:::1;:13;:21;:::i;:::-;:25;14705:125;;;14754:61;14773:7:::0;14782:21:::1;:9:::0;14796:6;14782:21:::1;:13;:21;:::i;:::-;14805:9;14754:18;:61::i;:::-;14252:588;;;;;14854:5;::::0;:24:::1;::::0;;-1:-1:-1;;;14854:24:38;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;14854:5:38;;::::1;::::0;:15:::1;::::0;:24;;;;;::::1;::::0;;;;;;;;;:5;:24;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;14854:24:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;14854:24:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;14854:24:38;14849:144:::1;;14894:31;14902:7;14911:6;14919:5;14894:7;:31::i;:::-;14849:144;;;14956:26;14966:7;14975:6;14956:9;:26::i;:::-;-1:-1:-1::0;;1678:1:53;2630:7;:22;14091:909:38:o;7918:554::-;1721:1:53;2326:7;;:19;;2318:63;;;;;-1:-1:-1;;;2318:63:53;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2318:63:53;;;;;;;;;;;;;;;1721:1;2456:7;:18;8059:9:38::1;8054:412;8078:6;:13;8074:1;:17;8054:412;;;8146:5;::::0;8171:9;;8185:10:::1;::::0;-1:-1:-1;;;;;8146:5:38::1;::::0;:15:::1;::::0;8162:7;;8171:6;;8178:1;;8171:9;::::1;;;;;;;;;;;8146:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;8146:35:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;8146:35:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;8146:35:38;-1:-1:-1;;;;;8146:49:38::1;;8121:121;;;::::0;;-1:-1:-1;;;8121:121:38;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;8121:121:38;;;;;;;;;;;;;::::1;;8256:5;::::0;8284:9;;-1:-1:-1;;;;;8256:5:38;;::::1;::::0;:18:::1;::::0;8275:7;;8284:6;;8291:1;;8284:9;::::1;;;;;;;;;;;8303:1;8256:50;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;;;8256:50:38::1;-1:-1:-1::0;;;;;8256:50:38::1;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;8256:50:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;8320:5:38::1;::::0;:18:::1;::::0;;-1:-1:-1;;;8320:18:38;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;8320:5:38;;::::1;::::0;-1:-1:-1;8320:9:38::1;::::0;-1:-1:-1;8320:18:38;;;;;::::1;::::0;;;;;;;;;:5;:18;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;8320:18:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;8320:18:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;8320:18:38;8432:9;;-1:-1:-1;;;;;8320:35:38;;::::1;::::0;::::1;::::0;8381:4:::1;::::0;8404:10:::1;::::0;8432:6;;8439:1;;8432:9;::::1;;;;;;;;;;;8320:135;;;;;;;;;;;;;-1:-1:-1::0;;;;;8320:135:38::1;-1:-1:-1::0;;;;;8320:135:38::1;;;;;;-1:-1:-1::0;;;;;8320:135:38::1;-1:-1:-1::0;;;;;8320:135:38::1;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;8320:135:38;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;8320:135:38;;;;8097:8;8103:1;8097;:5;;:8;;;;:::i;:::-;8093:12;;8054:412;;;-1:-1:-1::0;;1678:1:53;2630:7;:22;-1:-1:-1;7918:554:38:o;16223:190::-;16329:23;16344:7;16329:14;:23::i;:::-;16362:5;;:44;;;-1:-1:-1;;;16362:44:38;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;16362:5:38;;;;:25;;:44;;;;;:5;;:44;;;;;;;;:5;;:44;;;2:2:-1;;;;27:1;24;17:12;16023:194:38;16131:23;16146:7;16131:14;:23::i;:::-;16164:5;;:46;;;-1:-1:-1;;;16164:46:38;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;16164:5:38;;;;:26;;:46;;;;;:5;;:46;;;;;;;;:5;;:46;;;2:2:-1;;;;27:1;24;17:12;1156:77:48;1220:6;;-1:-1:-1;;;;;1220:6:48;1156:77;:::o;840:20:38:-;;;-1:-1:-1;;;;;840:20:38;;:::o;2666:885:47:-;1721:1:53;2326:7;;:19;;2318:63;;;;;-1:-1:-1;;;2318:63:53;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2318:63:53;;;;;;;;;;;;;;;1721:1;2456:7;:18;2828:20:47::1;2846:1;2828:17;:20::i;:::-;2866:5;::::0;:32:::1;::::0;;-1:-1:-1;;;2866:32:47;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;2866:5:47;;::::1;::::0;:23:::1;::::0;:32;;;;;::::1;::::0;;;;;;;;;:5;:32;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;2866:32:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;2866:32:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;2866:32:47;2858:46:::1;;;::::0;;-1:-1:-1;;;2858:46:47;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;2858:46:47;;;;;;;;;;;;;::::1;;2960:9;2955:533;2979:6;:13;2975:1;:17;2955:533;;;3047:5;::::0;:18:::1;::::0;;-1:-1:-1;;;3047:18:47;;::::1;::::0;::::1;::::0;;;;;3096:4:::1;::::0;-1:-1:-1;;;;;3047:5:47::1;::::0;:9:::1;::::0;:18;;;;;::::1;::::0;;;;;;;;:5;:18;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;3047:18:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;3047:18:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;3047:18:47;3074:9;;-1:-1:-1;;;;;3047:26:47;;::::1;::::0;::::1;::::0;3074:6;;3081:1;;3074:9;::::1;;;;;;;;;;;3047:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;3047:37:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;3047:37:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;3047:37:47;-1:-1:-1;;;;;3047:54:47::1;;;3022:114;;;::::0;;-1:-1:-1;;;3022:114:47;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;3022:114:47;;;;;;;;;;;;;::::1;;3150:5;::::0;:18:::1;::::0;;-1:-1:-1;;;3150:18:47;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;3150:5:47;;::::1;::::0;:9:::1;::::0;:18;;;;;::::1;::::0;;;;;;;;;:5;:18;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;3150:18:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;3150:18:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;3150:18:47;3262:9;;-1:-1:-1;;;;;3150:35:47;;::::1;::::0;::::1;::::0;3203:10:::1;::::0;3239:4:::1;::::0;3262:6;;3269:1;;3262:9;::::1;;;;;;;;;;;3150:135;;;;;;;;;;;;;-1:-1:-1::0;;;;;3150:135:47::1;-1:-1:-1::0;;;;;3150:135:47::1;;;;;;-1:-1:-1::0;;;;;3150:135:47::1;-1:-1:-1::0;;;;;3150:135:47::1;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;3150:135:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;3324:5:47::1;::::0;:18:::1;::::0;;-1:-1:-1;;;3324:18:47;;::::1;::::0;::::1;::::0;;;;;3373:4:::1;::::0;-1:-1:-1;;;;;;3324:5:47;;::::1;::::0;-1:-1:-1;3324:9:47::1;::::0;:18;;;;;::::1;::::0;;;;;;;;:5;:18;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;3324:18:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;3324:18:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;3324:18:47;3351:9;;-1:-1:-1;;;;;3324:26:47;;::::1;::::0;::::1;::::0;3351:6;;3358:1;;3351:9;::::1;;;;;;;;;;;3324:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;3324:37:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;3324:37:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;3324:37:47;-1:-1:-1;;;;;3324:54:47::1;;3299:114;;;::::0;;-1:-1:-1;;;3299:114:47;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;3299:114:47;;;;;;;;;;;;;::::1;;3427:5;::::0;3455:9;;-1:-1:-1;;;;;3427:5:47;;::::1;::::0;:18:::1;::::0;3446:7;;3455:6;;3462:1;;3455:9;::::1;;;;;;;;;;;3466:10;3427:50;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;;;3427:50:47::1;-1:-1:-1::0;;;;;3427:50:47::1;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;3427:50:47;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;3427:50:47;;;;2998:8;3004:1;2998;:5;;:8;;;;:::i;:::-;2994:12;;2955:533;;;;3516:7;3502:42;3525:6;3533:10;3502:42;;;;;;;-1:-1:-1::0;;;;;3502:42:47::1;-1:-1:-1::0;;;;;3502:42:47::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11:::0;;::::1;84:18:::0;71:11;;::::1;64:39:::0;52:2:::1;45:10;8:100;;;12:14;3502:42:47;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;1678:1:53;2630:7;:22;2666:885:47:o;15716:301:38:-;15851:23;15866:7;15851:14;:23::i;:::-;15889:9;15884:127;15908:6;:13;15904:1;:17;15884:127;;;15951:5;;15980:9;;-1:-1:-1;;;;;15951:5:38;;;;:19;;15971:7;;15980:6;;15987:1;;15980:9;;;;;;;;;;;;15991:8;15951:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;15951:49:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;15951:49:38;;;;15927:8;15933:1;15927;:5;;:8;;;;:::i;:::-;15923:12;;15884:127;;;;15716:301;;;:::o;5331:247:47:-;-1:-1:-1;;;5331:247:47;;;;;;;:::o;867:161:38:-;1084:12:36;;;;;;;;:31;;;1100:15;:13;:15::i;:::-;1084:47;;;-1:-1:-1;1120:11:36;;;;1119:12;1084:47;1063:140;;;;-1:-1:-1;;;1063:140:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1214:19;1237:12;;;;;;1236:13;1259:96;;;;1293:12;:19;;-1:-1:-1;;;;1293:19:36;;;;;1326:18;1308:4;1326:18;;;1259:96;938:13:38::1;:11;:13::i;:::-;961:21;:19;:21::i;:::-;992:5;:29:::0;;-1:-1:-1;;;;;;992:29:38::1;-1:-1:-1::0;;;;;992:29:38;::::1;;::::0;;1377:65:36;;;;1426:5;1411:20;;-1:-1:-1;;1411:20:36;;;867:161:38;;:::o;921:1019:44:-;1099:7;1721:1:53;2326:7;;:19;;2318:63;;;;;-1:-1:-1;;;2318:63:53;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2318:63:53;;;;;;;;;;;;;;;1721:1;2456:7;:18;1118:20:44::1;1136:1;1118:17;:20::i;:::-;1293:40;::::0;;-1:-1:-1;;;1293:40:44;;::::1;::::0;::::1;::::0;;;;;;;;;;;1207:42:::1;::::0;1148:28:::1;::::0;1207:42;;1293:26:::1;::::0;1320:4;;1326:6;;1293:40;;;;;;;;;;;::::1;::::0;::::1;::::0;;;;1148:28;8:100:-1::1;33:3;30:1;27:10;8:100;;;90:11:::0;;::::1;84:18:::0;71:11;;::::1;64:39:::0;52:2:::1;45:10;8:100;;;12:14;1293:40:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;1293:40:44;;::::1;::::0;;;;;;;;::::1;::::0;;::::1;::::0;;::::1;::::0;;;;23:1:-1::1;8:100;33:3;30:1;27:10;8:100;;;90:11:::0;;::::1;84:18:::0;71:11;;::::1;64:39:::0;52:2:::1;45:10;8:100;;;12:14;1293:40:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24::::0;17:12:::1;2:2;1293:40:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;1293:40:44;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;1293:40:44;1361:5:::1;::::0;:19:::1;::::0;;-1:-1:-1;;;1361:19:44;;;;1293:40;;-1:-1:-1;1343:15:44::1;::::0;-1:-1:-1;;;;;1361:5:44;;::::1;::::0;:17:::1;::::0;:19:::1;::::0;;::::1;::::0;1293:40:::1;::::0;1361:19;;;;;;;;1343:15;1361:5;:19;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1361:19:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;1361:19:44;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28::::0;21:12:::1;4:2;-1:-1:::0;1361:19:44;1390:5:::1;::::0;:46:::1;::::0;;-1:-1:-1;;;1390:46:44;;::::1;::::0;::::1;::::0;;;-1:-1:-1;;;;;1390:46:44;;::::1;::::0;;;;;;1361:19;;-1:-1:-1;1390:5:44;::::1;::::0;:22:::1;::::0;:46;;;;;:5:::1;::::0;:46;;;;;;;;:5;;:46;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1390:46:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;1446:5:44::1;::::0;:24:::1;::::0;;-1:-1:-1;;;1446:24:44;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;1446:5:44;;::::1;::::0;-1:-1:-1;1446:15:44::1;::::0;-1:-1:-1;1446:24:44;;;;;:5:::1;::::0;:24;;;;;;;;:5;;:24;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1446:24:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;1446:24:44;;;;1485:10;1480:339;;1511:5;::::0;:43:::1;::::0;;-1:-1:-1;;;1511:43:44;;::::1;::::0;::::1;::::0;;;-1:-1:-1;;;;;1511:43:44;;::::1;::::0;;;;;;:5;;;::::1;::::0;:19:::1;::::0;:43;;;;;:5:::1;::::0;:43;;;;;;;:5;;:43;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1511:43:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;1568:5:44::1;::::0;:21:::1;::::0;;-1:-1:-1;;;1568:21:44;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;1568:5:44;;::::1;::::0;-1:-1:-1;1568:12:44::1;::::0;-1:-1:-1;1568:21:44;;;;;:5:::1;::::0;:21;;;;;;;;:5;;:21;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1568:21:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;1603:5:44::1;::::0;:41:::1;::::0;;-1:-1:-1;;;1603:41:44;;::::1;::::0;::::1;::::0;;;:5;:41;;;;;;-1:-1:-1;;;;;1603:5:44;;::::1;::::0;-1:-1:-1;1603:26:44::1;::::0;-1:-1:-1;1603:41:44;;;;;:5:::1;::::0;:41;;;;;;;;:5;;:41;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1603:41:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;1603:41:44;;;;1480:339;;;1675:5;::::0;:47:::1;::::0;;-1:-1:-1;;;1675:47:44;;::::1;::::0;::::1;::::0;;;-1:-1:-1;;;;;1675:47:44;;::::1;::::0;;;;;;:5;;;::::1;::::0;:23:::1;::::0;:47;;;;;:5:::1;::::0;:47;;;;;;;:5;;:47;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1675:47:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;1736:5:44::1;::::0;:25:::1;::::0;;-1:-1:-1;;;1736:25:44;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;1736:5:44;;::::1;::::0;-1:-1:-1;1736:16:44::1;::::0;-1:-1:-1;1736:25:44;;;;;:5:::1;::::0;:25;;;;;;;;:5;;:25;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1736:25:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;1775:5:44::1;::::0;:33:::1;::::0;;-1:-1:-1;;;1775:33:44;;::::1;::::0;::::1;::::0;;;:5;:33;;;;;;-1:-1:-1;;;;;1775:5:44;;::::1;::::0;-1:-1:-1;1775:18:44::1;::::0;-1:-1:-1;1775:33:44;;;;;:5:::1;::::0;:33;;;;;;;;:5;;:33;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1775:33:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;1775:33:44;;;;1480:339;1828:5;::::0;:37:::1;::::0;;-1:-1:-1;;;1828:37:44;;::::1;::::0;::::1;::::0;;;1854:10:::1;1828:37:::0;;;;;;-1:-1:-1;;;;;1828:5:44;;::::1;::::0;:16:::1;::::0;:37;;;;;:5:::1;::::0;:37;;;;;;;;:5;;:37;::::1;;2:2:-1::0;::::1;;;27:1;24::::0;17:12:::1;2:2;1828:37:44;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;-1:-1:::0;;1880:29:44::1;::::0;;1898:10:::1;1880:29:::0;;;;1889:7;;-1:-1:-1;1880:29:44::1;::::0;-1:-1:-1;1880:29:44;;;;::::1;::::0;;::::1;1678:1:53::0;2630:7;:22;1926:7:44;921:1019;-1:-1:-1;;;;;;;921:1019:44:o;415:153:51:-;1370:12:48;:10;:12::i;:::-;1360:6;;-1:-1:-1;;;;;1360:6:48;;;:22;;;1352:67;;;;;-1:-1:-1;;;1352:67:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;531:18:51::1;::::0;;;:8:::1;:18;::::0;;;;;:30;;-1:-1:-1;;531:30:51::1;::::0;::::1;;::::0;;;::::1;::::0;;415:153::o;6712:488:47:-;6842:4;6866:17;;;:8;:17;;;;;;:21;6862:159;;6916:19;;;;:10;:19;;;;;;6907:28;;;;;:58;;-1:-1:-1;6948:17:47;;;;:8;:17;;;;;;6939:26;;;6907:58;6903:108;;;-1:-1:-1;6992:4:47;6985:11;;6903:108;7049:5;;:32;;;-1:-1:-1;;;7049:32:47;;;;;;;;;;-1:-1:-1;;;;;7049:5:47;;;;:23;;:32;;;;;;;;;;;;;;;:5;:32;;;2:2:-1;;;;27:1;24;17:12;2:2;7049:32:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7049:32:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;7049:32:47;:135;;7152:5;;:32;;;-1:-1:-1;;;7152:32:47;;;;;;;;;;;;;;;;-1:-1:-1;;;;;7152:5:47;;;;:16;;:32;;;;;;;;;;;;;;;:5;:32;;;2:2:-1;;;;27:1;24;17:12;2:2;7152:32:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7152:32:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;7152:32:47;7049:135;;;7101:5;;:32;;;-1:-1:-1;;;7101:32:47;;;;;;;;;;;;;;;;-1:-1:-1;;;;;7101:5:47;;;;:16;;:32;;;;;;;;;;;;;;;:5;:32;;;2:2:-1;;;;27:1;24;17:12;2:2;7101:32:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7101:32:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;7101:32:47;7100:33;7030:154;6712:488;-1:-1:-1;;;6712:488:47:o;5106:219::-;-1:-1:-1;;;5106:219:47;;;;;;;:::o;2073:274:48:-;1370:12;:10;:12::i;:::-;1360:6;;-1:-1:-1;;;;;1360:6:48;;;:22;;;1352:67;;;;;-1:-1:-1;;;1352:67:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2174:22:48;::::1;2153:107;;;;-1:-1:-1::0;;;2153:107:48::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2296:6;::::0;2275:38:::1;::::0;-1:-1:-1;;;;;2275:38:48;;::::1;::::0;2296:6:::1;::::0;2275:38:::1;::::0;2296:6:::1;::::0;2275:38:::1;2323:6;:17:::0;;-1:-1:-1;;;;;;2323:17:48::1;-1:-1:-1::0;;;;;2323:17:48;;;::::1;::::0;;;::::1;::::0;;2073:274::o;8478:869:38:-;8593:23;8608:7;8593:14;:23::i;:::-;8631:9;8626:715;8650:6;:13;8646:1;:17;8626:715;;;8713:5;;8738:9;;8693:17;;-1:-1:-1;;;;;8713:5:38;;:15;;8729:7;;8738:6;;8745:1;;8738:9;;;;;;;;;;;;8713:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;8713:35:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8713:35:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;8713:35:38;;-1:-1:-1;;;;;;8770:23:38;;8762:46;;;;;-1:-1:-1;;;8762:46:38;;;;;;;;;;;;-1:-1:-1;;;8762:46:38;;;;;;;;;;;;;;;8847:5;;:18;;;-1:-1:-1;;;8847:18:38;;;;;;;;;;8896:4;;-1:-1:-1;;;;;8847:5:38;;:9;;:18;;;;;;;;;;;;;;:5;:18;;;2:2:-1;;;;27:1;24;17:12;2:2;8847:18:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8847:18:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;8847:18:38;8874:9;;-1:-1:-1;;;;;8847:26:38;;;;;;8874:6;;8881:1;;8874:9;;;;;;;;;;;;8847:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;8847:37:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8847:37:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;8847:37:38;-1:-1:-1;;;;;8847:54:38;;8822:122;;;;;-1:-1:-1;;;8822:122:38;;;;;;;;;;;;-1:-1:-1;;;8822:122:38;;;;;;;;;;;;;;;8958:5;;8986:9;;-1:-1:-1;;;;;8958:5:38;;;;:18;;8977:7;;8986:6;;8993:1;;8986:9;;;;;;;;;;;;9005:1;8958:50;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8958:50:38;-1:-1:-1;;;;;8958:50:38;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;8958:50:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;9022:5:38;;9051:9;;-1:-1:-1;;;;;9022:5:38;;;;-1:-1:-1;9022:19:38;;-1:-1:-1;9042:7:38;;9051:6;;9058:1;;9051:9;;;;;;;;;;;;9062:4;9022:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;9022:45:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;9085:5:38;;9114:9;;-1:-1:-1;;;;;9085:5:38;;;;-1:-1:-1;9085:19:38;;-1:-1:-1;9105:7:38;;9114:6;;9121:1;;9114:9;;;;;;;;;;;;9085:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;9085:39:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9085:39:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;9085:39:38;9081:191;;;9144:5;;9171:9;;-1:-1:-1;;;;;9144:5:38;;;;:17;;9162:7;;9171:6;;9178:1;;9171:9;;;;;;;;;;;;9144:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;9144:37:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9144:37:38;;;;9081:191;;;9220:5;;9247:9;;-1:-1:-1;;;;;9220:5:38;;;;:17;;9238:7;;9247:6;;9254:1;;9247:9;;;;;;;;;;;;9220:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;9220:37:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9220:37:38;;;;9081:191;9285:5;;:21;;;-1:-1:-1;;;9285:21:38;;;;;;;;;;-1:-1:-1;;;;;9285:5:38;;;;:12;;:21;;;;;;;;;;;;;;;:5;:21;;;2:2:-1;;;;27:1;24;17:12;2:2;9285:21:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9285:21:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;9285:21:38;:45;;;-1:-1:-1;;;9285:45:38;;-1:-1:-1;;;;;9285:45:38;;;;;;;9323:6;9285:45;;;;;;:26;;;;;;;:45;;;;;-1:-1:-1;;9285:45:38;;;;;;;-1:-1:-1;9285:26:38;:45;;;2:2:-1;;;;27:1;24;17:12;2:2;9285:45:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9285:45:38;;;;8626:715;8669:8;8675:1;8669;:5;;:8;;;;:::i;:::-;8665:12;;8626:715;;;;8478:869;;:::o;1114:262::-;1183:5;;:26;;;-1:-1:-1;;;1183:26:38;;;;;;;;;;-1:-1:-1;;;;;1183:5:38;;;;:17;;:26;;;;;;;;;;;;;;;:5;:26;;;2:2:-1;;;;27:1;24;17:12;2:2;1183:26:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1183:26:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1183:26:38;1179:191;;;1247:7;:5;:7::i;:::-;-1:-1:-1;;;;;1233:21:38;:10;-1:-1:-1;;;;;1233:21:38;;1225:43;;;;;-1:-1:-1;;;1225:43:38;;;;;;;;;;;;-1:-1:-1;;;1225:43:38;;;;;;;;;;;;;;;1179:191;;;1321:5;;:22;;;-1:-1:-1;;;1321:22:38;;;;;;;;;;-1:-1:-1;;;;;1321:5:38;;;;:13;;:22;;;;;;;;;;;;;;;:5;:22;;;2:2:-1;;;;27:1;24;17:12;2:2;1321:22:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1321:22:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1321:22:38;-1:-1:-1;;;;;1307:36:38;:10;:36;1299:60;;;;;-1:-1:-1;;;1299:60:38;;;;;;;;;;;;-1:-1:-1;;;1299:60:38;;;;;;;;;;;;;;113:428:41;227:130;280:10;312:4;331:16;:6;342:4;331:16;:10;:16;:::i;:::-;227:5;;:22;;;-1:-1:-1;;;227:22:41;;;;;;;;;;-1:-1:-1;;;;;227:5:41;;;;:13;;:22;;;;;;;;;;;;;;;:5;:22;;;2:2:-1;;;;27:1;24;17:12;2:2;227:22:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;227:22:41;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;227:22:41;-1:-1:-1;;;;;227:39:41;;:130;;;:39;:130;:::i;:::-;367:5;;:21;;;-1:-1:-1;;;367:21:41;;;;;;;;;;-1:-1:-1;;;;;367:5:41;;;;:12;;:21;;;;;;;;;;;;;;;:5;:21;;;2:2:-1;;;;27:1;24;17:12;2:2;367:21:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;367:21:41;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;367:21:41;:46;;;-1:-1:-1;;;367:46:41;;394:10;367:46;;;;;;;;;;;;-1:-1:-1;;;;;367:26:41;;;;;;:46;;;;;-1:-1:-1;;367:46:41;;;;;;;;-1:-1:-1;367:26:41;:46;;;2:2:-1;;;;27:1;24;17:12;2:2;367:46:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;423:5:41;;-1:-1:-1;;;;;423:5:41;;-1:-1:-1;423:19:41;;-1:-1:-1;456:7:41;477:47;507:16;:6;518:4;507:16;:10;:16;:::i;:::-;477:5;;:25;;;-1:-1:-1;;;477:25:41;;;;;;;;;;-1:-1:-1;;;;;477:5:41;;;;:16;;:25;;;;;;;;;;;;;;;:5;:25;;;2:2:-1;;;;27:1;24;17:12;477:47:41;423:111;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;459:1032:47;600:9;595:815;619:6;:13;615:1;:17;595:815;;;662:13;678:6;685:1;678:9;;;;;;;;;;;;;;662:25;;709:26;720:7;729:5;709:10;:26::i;:::-;701:40;;;;;-1:-1:-1;;;701:40:47;;;;;;;;;;;;-1:-1:-1;;;701:40:47;;;;;;;;;;;;;;;772:20;;;;:11;:20;;;;;;;;768:572;;;836:5;;:25;;;-1:-1:-1;;;836:25:47;;;;;;;;;;812:12;;-1:-1:-1;;;;;836:5:47;;:16;;:25;;;;;;;;;;;;;;:5;:25;;;2:2:-1;;;;27:1;24;17:12;2:2;836:25:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;836:25:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;836:25:47;880:61;;;-1:-1:-1;;;880:61:47;;901:10;880:61;;;;921:4;880:61;;;;;;;;;;935:1;880:61;;;;;;;;;-1:-1:-1;880:61:47;;;;;;;;836:25;;-1:-1:-1;;;;;;880:20:47;;;;;:61;;;;;-1:-1:-1;;880:61:47;;;;;;-1:-1:-1;880:20:47;:61;;;2:2:-1;;;;27:1;24;17:12;2:2;880:61:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;880:61:47;;;;768:572;;;;1009:5;;:18;;;-1:-1:-1;;;1009:18:47;;;;;;;;;;1054:4;;-1:-1:-1;;;;;1009:5:47;;:9;;:18;;;;;;;;;;;;;;:5;:18;;;2:2:-1;;;;27:1;24;17:12;2:2;1009:18:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1009:18:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1009:18:47;:33;;;-1:-1:-1;;;1009:33:47;;;;;;;;;;-1:-1:-1;;;;;1009:26:47;;;;;;:33;;;;;:18;;:33;;;;;;;;:26;:33;;;2:2:-1;;;;27:1;24;17:12;2:2;1009:33:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1009:33:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1009:33:47;-1:-1:-1;;;;;1009:50:47;;;980:122;;;;;-1:-1:-1;;;980:122:47;;;;;;;;;;;;-1:-1:-1;;;980:122:47;;;;;;;;;;;;;;;1120:5;;:18;;;-1:-1:-1;;;1120:18:47;;;;;;;;;;-1:-1:-1;;;;;1120:5:47;;;;:9;;:18;;;;;;;;;;;;;;;:5;:18;;;2:2:-1;;;;27:1;24;17:12;2:2;1120:18:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1120:18:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1120:18:47;:65;;;-1:-1:-1;;;1120:65:47;;1152:10;1120:65;;;;1172:4;1120:65;;;;;;;;;;;;-1:-1:-1;;;;;1120:31:47;;;;;;:65;;;;;-1:-1:-1;;1120:65:47;;;;;;;;-1:-1:-1;1120:31:47;:65;;;2:2:-1;;;;27:1;24;17:12;2:2;1120:65:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;1232:5:47;;:18;;;-1:-1:-1;;;1232:18:47;;;;;;;;;;1277:4;;-1:-1:-1;;;;;;1232:5:47;;;;-1:-1:-1;1232:9:47;;:18;;;;;;;;;;;;;;:5;:18;;;2:2:-1;;;;27:1;24;17:12;2:2;1232:18:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1232:18:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1232:18:47;:33;;;-1:-1:-1;;;1232:33:47;;;;;;;;;;-1:-1:-1;;;;;1232:26:47;;;;;;:33;;;;;:18;;:33;;;;;;;;:26;:33;;;2:2:-1;;;;27:1;24;17:12;2:2;1232:33:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1232:33:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1232:33:47;-1:-1:-1;;;;;1232:50:47;;1203:122;;;;;-1:-1:-1;;;1203:122:47;;;;;;;;;;;;-1:-1:-1;;;1203:122:47;;;;;;;;;;;;;;;1366:5;;:33;;;-1:-1:-1;;;1366:33:47;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1366:5:47;;;;:17;;:33;;;;;:5;;:33;;;;;;;;:5;;:33;;;2:2:-1;;;;27:1;24;17:12;2:2;1366:33:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1366:33:47;;;;595:815;638:8;644:1;638;:5;;:8;;;;:::i;:::-;634:12;;595:815;;;-1:-1:-1;1419:5:47;;:21;;;-1:-1:-1;;;1419:21:47;;;;;;;;;;-1:-1:-1;;;;;1419:5:47;;;;:12;;:21;;;;;;;;;;;;;;;:5;:21;;;2:2:-1;;;;27:1;24;17:12;2:2;1419:21:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1419:21:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1419:21:47;1458:13;;-1:-1:-1;;;;;1419:26:47;;;;;;1446:10;;1458:25;;1476:6;1458:25;:17;:25;:::i;:::-;1419:65;;;;;;;;;;;;;-1:-1:-1;;;;;1419:65:47;-1:-1:-1;;;;;1419:65:47;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1419:65:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1419:65:47;;;;459:1032;;;:::o;873:176:55:-;931:7;962:5;;;985:6;;;;977:46;;;;;-1:-1:-1;;;977:46:55;;;;;;;;;;;;;;;;;;;;;;;;;;;1320:134;1378:7;1404:43;1408:1;1411;1404:43;;;;;;;;;;;;;;;;;:3;:43::i;4452:237:38:-;4574:7;4609:6;4601:4;:14;4597:28;;-1:-1:-1;4624:1:38;4617:8;;4597:28;4642:40;4653:28;4674:6;4653:16;:6;4664:4;4653:16;:10;:16;:::i;:28::-;4642:6;;:40;:10;:40;:::i;2207:459:55:-;2265:7;2506:6;2502:45;;-1:-1:-1;2535:1:55;2528:8;;2502:45;2569:5;;;2573:1;2569;:5;:1;2592:5;;;;;:10;2584:56;;;;-1:-1:-1;;;2584:56:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3128:130;3186:7;3212:39;3216:1;3219;3212:39;;;;;;;;;;;;;;;;;:3;:39::i;4695:359:38:-;4880:5;;:29;;;-1:-1:-1;;;4880:29:38;;;;;;;;;;4822:7;;;;;;-1:-1:-1;;;;;4880:5:38;;;;:20;;:29;;;;;;;;;;;;:5;:29;;;2:2:-1;;;;27:1;24;17:12;2:2;4880:29:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4880:29:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;4880:29:38;;;;;;;;;-1:-1:-1;4880:29:38;-1:-1:-1;4923:20:38;;;4919:34;;4952:1;4945:8;;;;;;4919:34;4963:13;4979:22;:6;4990:10;4979:22;:10;:22;:::i;:::-;4963:38;-1:-1:-1;5018:29:38;5040:6;5018:17;:6;4963:38;5018:17;:10;:17;:::i;:29::-;5011:36;4695:359;-1:-1:-1;;;;;;4695:359:38:o;589:104:2:-;676:10;589:104;:::o;113:597:42:-;270:7;293:11;289:415;;-1:-1:-1;327:1:42;320:8;;289:415;349:4;345:359;;;-1:-1:-1;376:1:42;369:8;;345:359;579:6;567:9;625:1;615:11;;;:26;;640:1;615:26;;;629:8;:1;635;629:8;:5;:8;:::i;:::-;599:42;-1:-1:-1;662:31:42;674:18;:7;599:42;674:18;:11;:18;:::i;:::-;662:7;;:31;:11;:31;:::i;:::-;655:38;;;;;;6556:449:38;6725:15;6711:10;:29;;6703:55;;;;;-1:-1:-1;;;6703:55:38;;;;;;;;;;;;-1:-1:-1;;;6703:55:38;;;;;;;;;;;;;;;6768:5;;6822:25;;;-1:-1:-1;;;6822:25:38;;;;;;;;;;-1:-1:-1;;;;;6768:5:38;;;;:19;;6801:7;;6822:46;;6852:15;;6768:5;;6822:16;;:25;;;;;;;;;;;;;;6768:5;6822:25;;;2:2:-1;;;;27:1;24;17:12;6822:46:38;6768:110;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;6768:110:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6768:110:38;;;;6905:15;6892:10;:28;6888:111;;;6936:10;:52;6956:31;:10;6971:15;6956:31;:14;:31;:::i;:::-;6936:52;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;10754:710:38;10872:9;10867:591;10891:7;10887:1;:11;10867:591;;;10954:16;;;10968:1;10954:16;;;;;;;;;10928:23;;10954:16;;;;;;109:14:-1;10954:16:38;88:42:-1;-1:-1;;10988:5:38;;:29;;;-1:-1:-1;;;10988:29:38;;;;;;;;;;10928:42;;-1:-1:-1;;;;;;;;10988:5:38;;;;-1:-1:-1;10988:20:38;;:29;;;;;;;;;;;;;;:5;:29;;;2:2:-1;;;;27:1;24;17:12;2:2;10988:29:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10988:29:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;10988:29:38;:33;10984:353;;;11071:5;;:29;;;-1:-1:-1;;;11071:29:38;;;;;;;;;;11041:12;;11056:45;;-1:-1:-1;;;;;11071:5:38;;;;:20;;:29;;;;;;;;;;;;;;;:5;:29;;;2:2:-1;;;;27:1;24;17:12;2:2;11071:29:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11071:29:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;11071:29:38;11056:14;:45::i;:::-;11131:5;;:31;;;-1:-1:-1;;;11131:31:38;;;;;;;;;;;;;;;;11041:60;;-1:-1:-1;;;;;;11131:5:38;;;;:16;;:31;;;;;;;;;;;;;;;:5;:31;;;2:2:-1;;;;27:1;24;17:12;2:2;11131:31:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11131:31:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;11131:31:38;11119:9;;:6;;11126:1;;11119:9;;;;;;;;;:43;;;;;10984:353;;;;11231:5;;:29;;;-1:-1:-1;;;11231:29:38;;;;;;;;;;11201:12;;11216:45;;-1:-1:-1;;;;;11231:5:38;;;;:20;;:29;;;;;;;;;;;;;;;:5;:29;;;2:2:-1;;;;27:1;24;17:12;11216:45:38;11291:5;;:31;;;-1:-1:-1;;;11291:31:38;;;;;;;;;;;;;;;;11201:60;;-1:-1:-1;;;;;;11291:5:38;;;;:16;;:31;;;;;;;;;;;;;;;:5;:31;;;2:2:-1;;;;27:1;24;17:12;2:2;11291:31:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11291:31:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;11291:31:38;11279:9;;:6;;11286:1;;11279:9;;;;;;;;;:43;;;;;10984:353;;11350:40;11364:7;11373:6;11381:8;11350:13;:40::i;:::-;11416:7;11409:38;11425:6;11433:1;11436:10;11409:38;;;;;;;;;;;;-1:-1:-1;;;;;11409:38:38;-1:-1:-1;;;;;11409:38:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;11409:38:38;;;;;;;;;;;;;;;;;;;-1:-1:-1;10904:8:38;:1;10910;10904:8;:5;:8;:::i;:::-;10900:12;;10867:591;;547:369:41;663:5;;:21;;;-1:-1:-1;;;663:21:41;;;;;;;;;;-1:-1:-1;;;;;663:5:41;;;;:12;;:21;;;;;;;;;;;;;;;:5;:21;;;2:2:-1;;;;27:1;24;17:12;2:2;663:21:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;663:21:41;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;663:21:41;:50;;;-1:-1:-1;;;663:50:41;;694:10;663:50;;;;;;;;;;;;-1:-1:-1;;;;;663:30:41;;;;;;:50;;;;;-1:-1:-1;;663:50:41;;;;;;;;-1:-1:-1;663:30:41;:50;;;2:2:-1;;;;27:1;24;17:12;2:2;663:50:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;663:50:41;;;;723:65;759:10;771:16;782:4;771:6;:10;;:16;;;;:::i;:::-;723:5;;:22;;;-1:-1:-1;;;723:22:41;;;;;;;;;;-1:-1:-1;;;;;723:5:41;;;;:13;;:22;;;;;;;;;;;;;;;:5;:22;;;2:2:-1;;;;27:1;24;17:12;2:2;723:22:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;723:22:41;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;723:22:41;-1:-1:-1;;;;;723:35:41;;:65;;:35;:65;:::i;:::-;798:5;;-1:-1:-1;;;;;798:5:41;:19;831:7;852:47;882:16;:6;893:4;882:16;:10;:16;:::i;:::-;852:5;;:25;;;-1:-1:-1;;;852:25:41;;;;;;;;;;-1:-1:-1;;;;;852:5:41;;;;:16;;:25;;;;;;;;;;;;;;;:5;:25;;;2:2:-1;;;;27:1;24;17:12;2:2;852:25:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;852:25:41;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;852:25:41;;:47;:29;:47;:::i;1538:556:36:-;1973:4;2037:17;2080:7;1538:556;:::o;893:187:48:-;1084:12:36;;;;;;;;:31;;;1100:15;:13;:15::i;:::-;1084:47;;;-1:-1:-1;1120:11:36;;;;1119:12;1084:47;1063:140;;;;-1:-1:-1;;;1063:140:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1214:19;1237:12;;;;;;1236:13;1259:96;;;;1293:12;:19;;-1:-1:-1;;;;1293:19:36;;;;;1326:18;1308:4;1326:18;;;1259:96;955:17:48::1;975:12;:10;:12::i;:::-;997:6;:18:::0;;-1:-1:-1;;;;;;997:18:48::1;-1:-1:-1::0;;;;;997:18:48;::::1;::::0;;::::1;::::0;;;1030:43:::1;::::0;997:18;;-1:-1:-1;997:18:48;-1:-1:-1;;1030:43:48::1;::::0;-1:-1:-1;;1030:43:48::1;1365:1:36;1381:14:::0;1377:65;;;1426:5;1411:20;;-1:-1:-1;;1411:20:36;;;893:187:48;:::o;1759:79:53:-;1678:1;1809:7;:22;1759:79::o;891:275:54:-;1081:68;;;-1:-1:-1;;;;;1081:68:54;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1081:68:54;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;1029:130:54;;1062:5;;1029:19;:130::i;1745:215:55:-;1855:7;1894:12;1886:6;;;;1878:29;;;;-1:-1:-1;;;1878:29:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1878:29:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1929:5:55;;;1745:215::o;3740:300::-;3850:7;3888:12;3881:5;3873:28;;;;-1:-1:-1;;;3873:28:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;3873:28:55;;3911:9;3927:1;3923;:5;;;;;;;3740:300;-1:-1:-1;;;;;3740:300:55:o;1987:318:38:-;2101:5;;2120:17;;;-1:-1:-1;;;2120:17:38;;;;2078:7;;-1:-1:-1;;;;;2101:5:38;;:18;;2120:24;;2101:5;;;;2120:15;;:17;;;;;;;;;;;;;;2101:5;2120:17;;;2:2:-1;;;;27:1;24;17:12;2120:24:38;2101:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;2101:44:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2101:44:38;;;;2291:7;2226:3;2231:10;2243:5;;;;;;;;;-1:-1:-1;;;;;2243:5:38;-1:-1:-1;;;;;2243:15:38;;:17;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;2243:17:38;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2243:17:38;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2243:17:38;2209:52;;;2243:17;2209:52;;;;;;;;;;;;-1:-1:-1;;2209:52:38;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;2209:52:38;;;;;;;2199:63;;;;;2174:124;;;;;;;1987:318;-1:-1:-1;;1987:318:38:o;1497:1163:47:-;1643:5;;:21;;;-1:-1:-1;;;1643:21:47;;;;;;;;;;-1:-1:-1;;;;;1643:5:47;;;;:12;;:21;;;;;;;;;;;;;;;:5;:21;;;2:2:-1;;;;27:1;24;17:12;2:2;1643:21:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1643:21:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1643:21:47;1686:13;;-1:-1:-1;;;;;1643:30:47;;;;;;1674:10;;1686:25;;1704:6;1686:25;:17;:25;:::i;:::-;1643:69;;;;;;;;;;;;;-1:-1:-1;;;;;1643:69:47;-1:-1:-1;;;;;1643:69:47;;;;;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1643:69:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;1727:9:47;;-1:-1:-1;;;1722:932:47;1746:6;:13;1742:1;:17;1722:932;;;1789:13;1805:6;1812:1;1805:9;;;;;;;;;;;;;;;;;;;1853:5;;:38;;;-1:-1:-1;;;1853:38:47;;;;;;;;;;;;;;;;1805:9;;-1:-1:-1;;;;;;1853:5:47;;;;:22;;:38;;;;;;;;;;:5;:38;;;2:2:-1;;;;27:1;24;17:12;2:2;1853:38:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1853:38:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1853:38:47;1828:98;;;;;-1:-1:-1;;;1828:98:47;;;;;;;;;;;;-1:-1:-1;;;1828:98:47;;;;;;;;;;;;;;;1944:5;;:38;;;-1:-1:-1;;;1944:38:47;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1944:5:47;;;;:22;;:38;;;;;;;;;;;;;;;:5;:38;;;2:2:-1;;;;27:1;24;17:12;2:2;1944:38:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1944:38:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1944:38:47;1940:113;;;2002:5;;:36;;;-1:-1:-1;;;2002:36:47;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2002:5:47;;;;:20;;:36;;;;;:5;;:36;;;;;;;;:5;;:36;;;2:2:-1;;;;27:1;24;17:12;2:2;2002:36:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2002:36:47;;;;1940:113;2070:5;;:31;;;-1:-1:-1;;;2070:31:47;;;;;;;;;;-1:-1:-1;;;;;2070:5:47;;;;:22;;:31;;;;;;;;;;;;;;;:5;:31;;;2:2:-1;;;;27:1;24;17:12;2:2;2070:31:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2070:31:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2070:31:47;2066:178;;;2135:5;;:32;;;-1:-1:-1;;;2135:32:47;;;;;;;;;;;;;;;;2121:11;;-1:-1:-1;;;;;2135:5:47;;:16;;:32;;;;;;;;;;;;;;:5;:32;;;2:2:-1;;;;27:1;24;17:12;2:2;2135:32:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2135:32:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2135:32:47;2185:5;;:44;;;-1:-1:-1;;;2185:44:47;;;;;;;;;;;;;;2221:7;;2185:44;;;;;;2135:32;;-1:-1:-1;;;;;;2185:5:47;;;;:19;;:44;;;;;:5;;:44;;;;;;;;:5;;:44;;;2:2:-1;;;;27:1;24;17:12;2:2;2185:44:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2185:44:47;;;;2066:178;;2261:20;;;;:11;:20;;;;;;;;2257:374;;;2325:5;;:25;;;-1:-1:-1;;;2325:25:47;;;;;;;;;;2301:12;;-1:-1:-1;;;;;2325:5:47;;:16;;:25;;;;;;;;;;;;;;:5;:25;;;2:2:-1;;;;27:1;24;17:12;2:2;2325:25:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2325:25:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2325:25:47;2369:61;;;-1:-1:-1;;;2369:61:47;;2398:4;2369:61;;;;2405:10;2369:61;;;;;;;;;;2424:1;2369:61;;;;;;;;;-1:-1:-1;2369:61:47;;;;;;;;2325:25;;-1:-1:-1;;;;;;2369:20:47;;;;;:61;;;;;-1:-1:-1;;2369:61:47;;;;;;-1:-1:-1;2369:20:47;:61;;;2:2:-1;;;;27:1;24;17:12;2:2;2369:61:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2369:61:47;;;;2257:374;;;;2469:5;;:18;;;-1:-1:-1;;;2469:18:47;;;;;;;;;;-1:-1:-1;;;;;2469:5:47;;;;:9;;:18;;;;;;;;;;;;;;;:5;:18;;;2:2:-1;;;;27:1;24;17:12;2:2;2469:18:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2469:18:47;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2469:18:47;:147;;;-1:-1:-1;;;2469:147:47;;2534:4;2469:147;;;;2561:10;2469:147;;;;;;;;;;;;-1:-1:-1;;;;;2469:35:47;;;;;;:147;;;;;-1:-1:-1;;2469:147:47;;;;;;;;-1:-1:-1;2469:35:47;:147;;;2:2:-1;;;;27:1;24;17:12;2:2;2469:147:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2469:147:47;;;;2257:374;-1:-1:-1;1765:8:47;:1;1771;1765:8;:5;:8;:::i;:::-;1761:12;;1722:932;;676:209:54;810:58;;;-1:-1:-1;;;;;810:58:54;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;810:58:54;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;758:120:54;;791:5;;3376:843;3795:23;3821:103;3862:4;3821:103;;;;;;;;;;;;;;;;;3829:5;-1:-1:-1;;;;;3821:27:54;;;:103;;;;;:::i;:::-;3938:17;;3795:129;;-1:-1:-1;3938:21:54;3934:279;;4107:10;4096:30;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;4096:30:54;4071:131;;;;-1:-1:-1;;;4071:131:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3681:224:0;3814:12;3845:53;3868:6;3876:4;3882:1;3885:12;5418;5450:18;5461:6;5450:10;:18::i;:::-;5442:60;;;;;-1:-1:-1;;;5442:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5573:12;5587:23;5614:6;-1:-1:-1;;;;;5614:11:0;5633:8;5656:4;5614:56;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;5614:56:0;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;19;14:27;;;;67:4;61:11;56:16;;134:4;130:9;123:4;105:16;101:27;97:43;94:1;90:51;84:4;77:65;157:16;154:1;147:27;211:16;208:1;201:4;198:1;194:12;179:49;5:228;;14:27;32:4;27:9;;5:228;;5572:98:0;;;;5684:7;5680:580;;;5714:10;-1:-1:-1;5707:17:0;;-1:-1:-1;5707:17:0;5680:580;5825:17;;:21;5821:429;;6083:10;6077:17;6143:15;6130:10;6126:2;6122:19;6115:44;6032:145;6215:20;;-1:-1:-1;;;6215:20:0;;;;;;;;;;;;;;;;;6222:12;;6215:20;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;717:433:0;1089:20;1135:8;;;717:433::o

Swarm Source

ipfs://8dcf91c880e40f62913fc8561c18f6f4286929bb58c2976d9d58bf222386f584
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

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