Contract 0x5FCDfD5634c50CCcEf6275a239207B09Bd0379df

 
Txn Hash
Block
From
To
Value [Txn Fee]
0xcae634aff6744c2d6d6e2417dc28cafa9b4d4c2a5c97e0c0c8e580d5e1e65eed500522021-07-01 12:33:1078 days 6 hrs ago0x904b5993fc92979eeedc19ccc58bed6b7216667c IN  Contract Creation0 ETH0.012503821117 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ValueCapture

Compiler Version
v0.7.4+commit.3f05b770

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv2 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at arbiscan.io on 2021-08-31
*/

// SPDX-License-Identifier: GPL
pragma solidity 0.7.4;

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

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

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @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;
}

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

        uint256 size;
        // 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 funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // 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");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

/**
 * @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 SafeERC20Upgradeable {
    using SafeMathUpgradeable for uint256;
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(IERC20Upgradeable 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");
        }
    }
}

/**
 * @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.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSetUpgradeable {
    // 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];
    }

    // Bytes32Set

    struct Bytes32Set {
        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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, 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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

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

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set 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(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, 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(uint160(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(uint160(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(uint160(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(uint160(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));
    }
}

// solhint-disable-next-line compiler-version
/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract 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 protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(
            _initializing || _isConstructor() || !_initialized,
            "Initializable: contract is already 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) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuardUpgradeable 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 refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    function __ReentrancyGuard_init() internal initializer {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal initializer {
        _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 refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
    uint256[49] private __gap;
}

interface ICaptureNotifyRecipient {
    /**
     * @notice Value capture handler.
     */
    function onValueCaptured(uint256 totalCapturedUSD, uint256 lastCapturedBlock) external;
}

interface IUSDConvertor {
    function tokenIn() external view returns (address);

    function tokenOut() external view returns (address);

    function exchangeForUSD(uint256 amountIn) external returns (uint256 amountOut);
}

interface IAuthenticator {
    /**
     * @notice  Check if an account has the given role.
     * @param   role    A bytes32 value generated from keccak256("ROLE_NAME").
     * @param   account The account to be checked.
     * @return  True if the account has already granted permissions for the given role.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @notice  This should be called from external contract, to test if a account has specified role.

     * @param   role    A bytes32 value generated from keccak256("ROLE_NAME").
     * @param   account The account to be checked.
     * @return  True if the account has already granted permissions for the given role.
     */
    function hasRoleOrAdmin(bytes32 role, address account) external view returns (bool);
}

interface IValueCapture {
    function totalCapturedUSD() external view returns (uint256);

    function lastCapturedBlock() external view returns (uint256);

    function getCapturedValue()
        external
        view
        returns (uint256 totalCapturedUSD_, uint256 lastCapturedBlock_);

    /**
     * @notice Set receiver of value captured events.
     */
    function setCaptureNotifyRecipient(address newRecipient) external;

    /**
     * @notice  Return all addresses of USD tokens in whitelist as an array.
     */
    function listUSDTokens(uint256 begin, uint256 end)
        external
        view
        returns (address[] memory result);

    /**
     * @notice  Add a USD token to whitelist.
     *          Since not all the ERC20 has decimals interface, caller needs to specify the decimal of USD token.
     *          But the `decimals()` of token will be checked to match the parameter passed in if possible.
     *
     * @param   token       The address of usd token to be put into whitelist.
     * @param   decimals    The decimals of token.
     */
    function addUSDToken(address token, uint256 decimals) external;

    /**
     * @notice  Remove a USD token from whitelist.
     *
     * @param   token   The address of USD token to remove.
     */
    function removeUSDToken(address token) external;

    /**
     * @notice  Add a 'exchange' for some token.
     *          A exchange is known as a external contract who has an interface to accept some kind of token
     *          and return USD token in value capture's whitelist.
     *          That means the output token of exchange must be in th e whitelist.
     *          See contract/interfaces/IUSDConvertor.sol for interface spec of a exchange.
     *
     * @param   token               The address of any token accepted by exchange.
     * @param   exchange_          The address of exchange contract.
     */
    function setExternalExchange(address token, address exchange_) external;

    /**
     * @notice  Batch version of forwardAsset.
     *
     * @param   tokens      The array of address of token to forward to vault.
     * @param   amountsIn   The array of amounts to (exchange for USD and) forward to vault.
     */
    function forwardMultiAssets(address[] memory tokens, uint256[] memory amountsIn) external;

    /**
     * @notice  This method has the same usage as `forwardERC20Token`.
     *
     *          *Asset sent though this method to vault will not affect mintable amount of MCB.*
     */
    function forwardETH(uint256 amount) external;

    /**
     * @notice  This method is should not be called if there are any exchange available for given ERC20 token.
     *          But if there is really not, or the exchange is lack of enough liquidity,
     *          guardian will be able to send the asset to vault for other usage.
     *
     *          *Asset sent though this method to vault will not affect mintable amount of MCB.*
     */
    function forwardERC20Token(address token, uint256 amount) external;

    /**
     * @notice  This method has the same usage as `forwardERC20Token`.
     *
     *          *Asset sent though this method to vault will not affect mintable amount of MCB.*
     */
    function forwardERC721Token(address token, uint256 tokenID) external;
}

interface IDecimals {
    function decimals() external view returns (uint8);
}
contract ValueCapture is Initializable, ReentrancyGuardUpgradeable, IValueCapture {
    using SafeMathUpgradeable for uint256;
    using AddressUpgradeable for address;
    using SafeERC20Upgradeable for IERC20Upgradeable;
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;

    uint256 public constant SYSTEM_DECIMALS = 18;
    bytes32 public constant VALUE_CAPTURE_ADMIN_ROLE = keccak256("VALUE_CAPTURE_ADMIN_ROLE");

    IAuthenticator public authenticator;
    address public vault;
    address public captureNotifyRecipient;
    uint256 public override totalCapturedUSD;
    uint256 public override lastCapturedBlock;

    EnumerableSetUpgradeable.AddressSet internal _usdTokenList;
    mapping(address => uint256) public normalizers;
    mapping(address => IUSDConvertor) public externalExchanges;

    event AddUSDToken(address indexed usdToken);
    event RemoveUSDToken(address indexed usdToken);
    event SetConvertor(address indexed tokenAddress, address indexed exchange);
    event ExchangeToken(
        address indexed tokenIn,
        uint256 balanceIn,
        address indexed tokenOut,
        uint256 balanceOut
    );
    event ForwardAsset(address indexed tokenOut, uint256 amountOut, uint256 normalizeAmountOut);
    event ForwardETH(uint256 amount);
    event ForwardERC20Token(address indexed tokenOut, uint256 amount);
    event ForwardERC721Token(address indexed tokenOut, uint256 tokenID);
    event SetMiner(address indexed oldMinter, address indexed newMinter);
    event SendValueCaptureNotification(
        address indexed recipient,
        uint256 totalCapturedUSD,
        uint256 lastCapturedBlock
    );

    receive() external payable {}

    modifier onlyAuthorized() {
        require(
            authenticator.hasRoleOrAdmin(VALUE_CAPTURE_ADMIN_ROLE, msg.sender),
            "caller is not authorized"
        );
        _;
    }

    modifier onlyAdmin() {
        require(authenticator.hasRoleOrAdmin(0, msg.sender), "caller is not admin");
        _;
    }

    function getCapturedValue() external view override returns (uint256, uint256) {
        return (totalCapturedUSD, lastCapturedBlock);
    }

    /**
     * @notice  Initialize value capture contract.
     *
     * @param   authenticator_  The address of authenticator controller that can determine who is able to call
     *                          admin interfaces.
     * @param   vault_          The address of vault contract. All funds later will be collected to this address.
     */
    function initialize(address authenticator_, address vault_) external initializer {
        require(vault_ != address(0), "vault is the zero address");
        require(authenticator_.isContract(), "authenticator must be a contract");

        __ReentrancyGuard_init();

        authenticator = IAuthenticator(authenticator_);
        vault = vault_;
    }

    /**
     * @notice Set receiver of value captured events.
     */
    function setCaptureNotifyRecipient(address newRecipient) external override onlyAdmin {
        require(newRecipient != captureNotifyRecipient, "newRecipient is already set");
        emit SetMiner(captureNotifyRecipient, newRecipient);
        captureNotifyRecipient = newRecipient;
    }

    /**
     * @notice  Return all addresses of USD tokens in whitelist as an array.
     */
    function listUSDTokens(uint256 begin, uint256 end)
        external
        view
        override
        returns (address[] memory result)
    {
        require(end > begin, "begin should be lower than end");
        uint256 length = _usdTokenList.length();
        if (begin >= length) {
            return result;
        }
        uint256 safeEnd = (end <= length) ? end : length;
        result = new address[](safeEnd - begin);
        for (uint256 i = begin; i < safeEnd; i++) {
            result[i - begin] = _usdTokenList.at(i);
        }
        return result;
    }

    /**
     * @notice  Add a USD token to whitelist.
     *          Since not all the ERC20 has decimals interface, caller needs to specify the decimal of USD token.
     *          But the `decimals()` of token will be checked to match the parameter passed in if possible.
     *
     * @param   token       The address of usd token to be put into whitelist.
     * @param   decimals    The decimals of token.
     */
    function addUSDToken(address token, uint256 decimals) external override onlyAuthorized {
        require(!_usdTokenList.contains(token), "token already in usd list");
        require(token.isContract(), "token address must be contract");
        require(decimals <= 18, "decimals out of range");
        // verify decimals if possible
        try IDecimals(token).decimals() returns (uint8 actualDecimals) {
            require(actualDecimals == decimals, "decimals not match");
        } catch {}

        bool isAdded = _usdTokenList.add(token);
        require(isAdded, "fail to add token to list");
        normalizers[token] = 10**(SYSTEM_DECIMALS.sub(decimals));

        emit AddUSDToken(token);
    }

    /**
     * @notice  Remove a USD token from whitelist.
     *
     * @param   token   The address of USD token to remove.
     */
    function removeUSDToken(address token) external override onlyAuthorized {
        require(_usdTokenList.contains(token), "token not in usd list");

        bool isRemoved = _usdTokenList.remove(token);
        require(isRemoved, "fail to remove token from list");

        emit RemoveUSDToken(token);
    }

    /**
     * @notice  Add a 'exchange' for some token.
     *          A exchange is known as a external contract who has an interface to accept some kind of token
     *          and return USD token in value capture's whitelist.
     *          That means the output token of exchange must be in th e whitelist.
     *          See contract/interfaces/IUSDConvertor.sol for interface spec of a exchange.
     *
     * @param   token               The address of any token accepted by exchange.
     * @param   exchange_          The address of exchange contract.
     */
    function setExternalExchange(address token, address exchange_)
        external
        override
        onlyAuthorized
    {
        require(exchange_.isContract(), "exchange must be a contract");
        IUSDConvertor exchange = IUSDConvertor(exchange_);
        require(token == exchange.tokenIn(), "input token mismatch");
        require(_usdTokenList.contains(exchange.tokenOut()), "token out is not in usd list");

        externalExchanges[token] = exchange;
        emit SetConvertor(token, exchange_);
    }

    /**
     * @notice  Batch version of forwardAsset.
     *
     * @param   tokens      The array of address of token to forward to vault.
     * @param   amountsIn   The array of amounts to (exchange for USD and) forward to vault.
     */
    function forwardMultiAssets(address[] memory tokens, uint256[] memory amountsIn)
        external
        override
        nonReentrant
        onlyAuthorized
    {
        require(tokens.length == amountsIn.length, "length of parameters mismatch");
        for ((uint256 i, uint256 count) = (0, tokens.length); i < count; i++) {
            _forwardAsset(tokens[i], amountsIn[i]);
        }
        sendCaptureNotification();
    }

    /**
     * @notice  This method has the same usage as `forwardERC20Token`.
     *
     *          *Asset sent though this method to vault will not affect mintable amount of MCB.*
     */
    function forwardETH(uint256 amount) external override onlyAuthorized nonReentrant {
        require(vault != address(0), "vault is not set");
        AddressUpgradeable.sendValue(payable(vault), amount);
        emit ForwardETH(amount);
    }

    /**
     * @notice  This method is should not be called if there are any exchange available for given ERC20 token.
     *          But if there is really not, or the exchange is lack of enough liquidity,
     *          guardian will be able to send the asset to vault for other usage.
     *
     *          *Asset sent though this method to vault will not affect mintable amount of MCB.*
     */
    function forwardERC20Token(address token, uint256 amount)
        external
        override
        onlyAuthorized
        nonReentrant
    {
        require(vault != address(0), "vault is not set");
        IERC20Upgradeable(token).safeTransfer(vault, amount);
        emit ForwardERC20Token(token, amount);
    }

    /**
     * @notice  This method has the same usage as `forwardERC20Token`.
     *
     *          *Asset sent though this method to vault will not affect mintable amount of MCB.*
     */
    function forwardERC721Token(address token, uint256 tokenID)
        external
        override
        onlyAuthorized
        nonReentrant
    {
        require(vault != address(0), "vault is not set");
        IERC721Upgradeable(token).safeTransferFrom(address(this), vault, tokenID);
        emit ForwardERC721Token(token, tokenID);
    }

    /**
     * @notice Try send a notification to recipient.
     */
    function sendCaptureNotification() public onlyAuthorized {
        if (!captureNotifyRecipient.isContract()) {
            return;
        }
        ICaptureNotifyRecipient(captureNotifyRecipient).onValueCaptured(
            totalCapturedUSD,
            lastCapturedBlock
        );
        emit SendValueCaptureNotification(
            captureNotifyRecipient,
            totalCapturedUSD,
            lastCapturedBlock
        );
    }

    function _forwardAsset(address token, uint256 amountIn) internal {
        require(vault != address(0), "vault is not set");
        require(amountIn != 0, "amount in is zero");

        // prepare token to be transfer to vault
        (address tokenOut, uint256 amountOut) = _exchangeTokenForUSD(token, amountIn);
        require(_usdTokenList.contains(tokenOut), "unexpected out token");

        // transfer token to vault && add up the converted amount
        uint256 normalizer = normalizers[tokenOut];
        require(normalizer != 0, "unexpected normalizer");

        uint256 normalizeAmountOut = amountOut.mul(normalizer);
        totalCapturedUSD = totalCapturedUSD.add(normalizeAmountOut);
        lastCapturedBlock = _blockNumber();

        IERC20Upgradeable(tokenOut).safeTransfer(vault, amountOut);

        emit ForwardAsset(tokenOut, amountOut, normalizeAmountOut);
    }

    function _exchangeTokenForUSD(address tokenIn, uint256 amountIn)
        internal
        returns (address tokenOut, uint256 amountOut)
    {
        uint256 tokenInBalance = IERC20Upgradeable(tokenIn).balanceOf(address(this));
        require(amountIn <= tokenInBalance, "amount in exceeds convertable amount");
        if (amountIn == 0) {
            // early revert
            revert("no balance to convert");
        } else if (_usdTokenList.contains(tokenIn)) {
            // if the token to be converted is USD token in whitelist, return the balance
            tokenOut = tokenIn;
            amountOut = amountIn;
        } else {
            IUSDConvertor exchange = externalExchanges[tokenIn];
            require(address(exchange).isContract(), "token exchange is not available");
            require(tokenIn == exchange.tokenIn(), "input token mismatch");
            tokenOut = externalExchanges[tokenIn].tokenOut();

            IERC20Upgradeable(tokenIn).safeIncreaseAllowance(address(exchange), amountIn);
            amountOut = externalExchanges[tokenIn].exchangeForUSD(amountIn);
        }
        require(amountOut > 0, "balance out is 0");
        emit ExchangeToken(tokenIn, amountIn, tokenOut, amountOut);
    }

    function _blockNumber() internal view virtual returns (uint256) {
        return block.number;
    }

    bytes32[50] private __gap;
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usdToken","type":"address"}],"name":"AddUSDToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"balanceIn","type":"uint256"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"balanceOut","type":"uint256"}],"name":"ExchangeToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"normalizeAmountOut","type":"uint256"}],"name":"ForwardAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ForwardERC20Token","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"ForwardERC721Token","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ForwardETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usdToken","type":"address"}],"name":"RemoveUSDToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalCapturedUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastCapturedBlock","type":"uint256"}],"name":"SendValueCaptureNotification","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"}],"name":"SetConvertor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldMinter","type":"address"},{"indexed":true,"internalType":"address","name":"newMinter","type":"address"}],"name":"SetMiner","type":"event"},{"inputs":[],"name":"SYSTEM_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALUE_CAPTURE_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"decimals","type":"uint256"}],"name":"addUSDToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"authenticator","outputs":[{"internalType":"contract IAuthenticator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureNotifyRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"externalExchanges","outputs":[{"internalType":"contract IUSDConvertor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"forwardERC20Token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"forwardERC721Token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"forwardETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"name":"forwardMultiAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCapturedValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"authenticator_","type":"address"},{"internalType":"address","name":"vault_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastCapturedBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"begin","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"listUSDTokens","outputs":[{"internalType":"address[]","name":"result","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"normalizers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeUSDToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sendCaptureNotification","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRecipient","type":"address"}],"name":"setCaptureNotifyRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"exchange_","type":"address"}],"name":"setExternalExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalCapturedUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50612ce6806100206000396000f3fe60806040526004361061012e5760003560e01c8063525dc0c5116100ab578063c2019e911161006f578063c2019e91146104ec578063c9452c3014610525578063db8136ee1461055e578063e1dc22f114610591578063f8c7052f146105bb578063fbfa77cf146105f657610135565b8063525dc0c51461034b5780635eb5e2ae146103605780636d69c8b5146104945780638d26807d146104a9578063c055738c146104be57610135565b80634746368a116100f25780634746368a14610233578063485cc955146102b35780634d4fde8c146102ee5780634deac21d146103035780634e592c221461031857610135565b8063085ac7e51461013a578063191747dd1461017f5780631a63f13d146101ba5780632335c76b146101ed57806323d3a8fc1461021e57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061016d6004803603602081101561015d57600080fd5b50356001600160a01b031661060b565b60408051918252519081900360200190f35b34801561018b57600080fd5b506101b8600480360360408110156101a257600080fd5b506001600160a01b03813516906020013561061d565b005b3480156101c657600080fd5b506101b8600480360360208110156101dd57600080fd5b50356001600160a01b03166107e3565b3480156101f957600080fd5b50610202610967565b604080516001600160a01b039092168252519081900360200190f35b34801561022a57600080fd5b5061016d610976565b34801561023f57600080fd5b506102636004803603604081101561025657600080fd5b5080359060200135610988565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561029f578181015183820152602001610287565b505050509050019250505060405180910390f35b3480156102bf57600080fd5b506101b8600480360360408110156102d657600080fd5b506001600160a01b0381358116916020013516610aa0565b3480156102fa57600080fd5b5061016d610c3a565b34801561030f57600080fd5b5061016d610c3f565b34801561032457600080fd5b506102026004803603602081101561033b57600080fd5b50356001600160a01b0316610c45565b34801561035757600080fd5b506101b8610c60565b34801561036c57600080fd5b506101b86004803603604081101561038357600080fd5b81019060208101813564010000000081111561039e57600080fd5b8201836020820111156103b057600080fd5b803590602001918460208302840111640100000000831117156103d257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561042257600080fd5b82018360208201111561043457600080fd5b8035906020019184602083028401116401000000008311171561045657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610e0d945050505050565b3480156104a057600080fd5b5061016d610fd3565b3480156104b557600080fd5b50610202610fd9565b3480156104ca57600080fd5b506104d3610fe8565b6040805192835260208301919091528051918290030190f35b3480156104f857600080fd5b506101b86004803603604081101561050f57600080fd5b506001600160a01b038135169060200135610ff2565b34801561053157600080fd5b506101b86004803603604081101561054857600080fd5b506001600160a01b038135169060200135611211565b34801561056a57600080fd5b506101b86004803603602081101561058157600080fd5b50356001600160a01b0316611558565b34801561059d57600080fd5b506101b8600480360360208110156105b457600080fd5b503561170f565b3480156105c757600080fd5b506101b8600480360360408110156105de57600080fd5b506001600160a01b03813581169160200135166118c4565b34801561060257600080fd5b50610202611bcc565b603a6020526000908152604090205481565b60335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b15801561067c57600080fd5b505afa158015610690573d6000803e3d6000fd5b505050506040513d60208110156106a657600080fd5b50516106e7576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b6002600154141561072d576040805162461bcd60e51b815260206004820152601f6024820152600080516020612b54833981519152604482015290519081900360640190fd5b60026001556034546001600160a01b0316610782576040805162461bcd60e51b815260206004820152601060248201526f1d985d5b1d081a5cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b60345461079c906001600160a01b03848116911683611bdb565b6040805182815290516001600160a01b038416917ffb3d4c784a3d99ae773f0122092531b689b81ef1b07cd6cc33c8aed4951a1fa7919081900360200190a2505060018055565b60335460408051635db8200960e01b81526000600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b15801561083557600080fd5b505afa158015610849573d6000803e3d6000fd5b505050506040513d602081101561085f57600080fd5b50516108a8576040805162461bcd60e51b815260206004820152601360248201527231b0b63632b91034b9903737ba1030b236b4b760691b604482015290519081900360640190fd5b6035546001600160a01b038281169116141561090b576040805162461bcd60e51b815260206004820152601b60248201527f6e6577526563697069656e7420697320616c7265616479207365740000000000604482015290519081900360640190fd5b6035546040516001600160a01b038084169216907f857d613c213ac1a9d7cbf6e7da75394163ce32ea31d5a3fdcde052dc5e5d06bd90600090a3603580546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b031681565b600080516020612c0283398151915281565b60608282116109de576040805162461bcd60e51b815260206004820152601e60248201527f626567696e2073686f756c64206265206c6f776572207468616e20656e640000604482015290519081900360640190fd5b60006109ea6038611c2d565b90508084106109f95750610a9a565b600081841115610a095781610a0b565b835b905084810367ffffffffffffffff81118015610a2657600080fd5b50604051908082528060200260200182016040528015610a50578160200160208202803683370190505b509250845b81811015610a9657610a68603882611c38565b8487830381518110610a7657fe5b6001600160a01b0390921660209283029190910190910152600101610a55565b5050505b92915050565b600054610100900460ff1680610ab95750610ab9611c4b565b80610ac7575060005460ff16155b610b025760405162461bcd60e51b815260040180806020018281038252602e815260200180612bd4602e913960400191505060405180910390fd5b600054610100900460ff16158015610b2d576000805460ff1961ff0019909116610100171660011790555b6001600160a01b038216610b88576040805162461bcd60e51b815260206004820152601960248201527f7661756c7420697320746865207a65726f206164647265737300000000000000604482015290519081900360640190fd5b610b9a836001600160a01b0316611c5c565b610beb576040805162461bcd60e51b815260206004820181905260248201527f61757468656e74696361746f72206d757374206265206120636f6e7472616374604482015290519081900360640190fd5b610bf3611c62565b603380546001600160a01b038086166001600160a01b03199283161790925560348054928516929091169190911790558015610c35576000805461ff00191690555b505050565b601281565b60365481565b603b602052600090815260409020546001600160a01b031681565b60335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b158015610cbf57600080fd5b505afa158015610cd3573d6000803e3d6000fd5b505050506040513d6020811015610ce957600080fd5b5051610d2a576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b603554610d3f906001600160a01b0316611c5c565b610d4857610e0b565b60355460365460375460408051637b2c947b60e11b815260048101939093526024830191909152516001600160a01b039092169163f65928f69160448082019260009290919082900301818387803b158015610da357600080fd5b505af1158015610db7573d6000803e3d6000fd5b505060355460365460375460408051928352602083019190915280516001600160a01b0390931694507fc33237c014f6b559cb835dd68ae2f1acad1b95b21a8ab9abb5410306ba4dfffc9350908290030190a25b565b60026001541415610e53576040805162461bcd60e51b815260206004820152601f6024820152600080516020612b54833981519152604482015290519081900360640190fd5b600260015560335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b158015610eb757600080fd5b505afa158015610ecb573d6000803e3d6000fd5b505050506040513d6020811015610ee157600080fd5b5051610f22576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b8051825114610f78576040805162461bcd60e51b815260206004820152601d60248201527f6c656e677468206f6620706172616d6574657273206d69736d61746368000000604482015290519081900360640190fd5b81516000905b80821015610fc157610fb6848381518110610f9557fe5b6020026020010151848481518110610fa957fe5b6020026020010151611d0c565b600190910190610f7e565b5050610fcb610c60565b505060018055565b60375481565b6035546001600160a01b031681565b6036546037549091565b60335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b15801561105157600080fd5b505afa158015611065573d6000803e3d6000fd5b505050506040513d602081101561107b57600080fd5b50516110bc576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b60026001541415611102576040805162461bcd60e51b815260206004820152601f6024820152600080516020612b54833981519152604482015290519081900360640190fd5b60026001556034546001600160a01b0316611157576040805162461bcd60e51b815260206004820152601060248201526f1d985d5b1d081a5cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b60345460408051632142170760e11b81523060048201526001600160a01b039283166024820152604481018490529051918416916342842e0e9160648082019260009290919082900301818387803b1580156111b257600080fd5b505af11580156111c6573d6000803e3d6000fd5b50506040805184815290516001600160a01b03861693507f7de6ad2352ca335fed4a4b677706092b093c9ee9427b4e500b50954fc8a2a62892509081900360200190a2505060018055565b60335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b15801561127057600080fd5b505afa158015611284573d6000803e3d6000fd5b505050506040513d602081101561129a57600080fd5b50516112db576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b6112e6603883611ef9565b15611338576040805162461bcd60e51b815260206004820152601960248201527f746f6b656e20616c726561647920696e20757364206c69737400000000000000604482015290519081900360640190fd5b61134a826001600160a01b0316611c5c565b61139b576040805162461bcd60e51b815260206004820152601e60248201527f746f6b656e2061646472657373206d75737420626520636f6e74726163740000604482015290519081900360640190fd5b60128111156113e9576040805162461bcd60e51b8152602060048201526015602482015274646563696d616c73206f7574206f662072616e676560581b604482015290519081900360640190fd5b816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561142257600080fd5b505afa92505050801561144757506040513d602081101561144257600080fd5b505160015b6114505761149e565b818160ff161461149c576040805162461bcd60e51b81526020600482015260126024820152710c8cac6d2dac2d8e640dcdee840dac2e8c6d60731b604482015290519081900360640190fd5b505b60006114ab603884611f0e565b9050806114ff576040805162461bcd60e51b815260206004820152601960248201527f6661696c20746f2061646420746f6b656e20746f206c69737400000000000000604482015290519081900360640190fd5b61150a601283611f23565b6001600160a01b0384166000818152603a6020526040808220600a9490940a909355915190917fd591516fdbce1327516f54998d69bd669fbbc06af6b52993cc0170a34369a4e891a2505050565b60335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b1580156115b757600080fd5b505afa1580156115cb573d6000803e3d6000fd5b505050506040513d60208110156115e157600080fd5b5051611622576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b61162d603882611ef9565b611676576040805162461bcd60e51b81526020600482015260156024820152741d1bdad95b881b9bdd081a5b881d5cd9081b1a5cdd605a1b604482015290519081900360640190fd5b6000611683603883611f80565b9050806116d7576040805162461bcd60e51b815260206004820152601e60248201527f6661696c20746f2072656d6f766520746f6b656e2066726f6d206c6973740000604482015290519081900360640190fd5b6040516001600160a01b038316907fd507d28f738847ecf92d9fa83d9e1a54c41eea541e3f9e23907bd034d03c1f0890600090a25050565b60335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b15801561176e57600080fd5b505afa158015611782573d6000803e3d6000fd5b505050506040513d602081101561179857600080fd5b50516117d9576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b6002600154141561181f576040805162461bcd60e51b815260206004820152601f6024820152600080516020612b54833981519152604482015290519081900360640190fd5b60026001556034546001600160a01b0316611874576040805162461bcd60e51b815260206004820152601060248201526f1d985d5b1d081a5cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b60345461188a906001600160a01b031682611f95565b6040805182815290517fd1d4e1a0d420824f8d12a38a8ff32bf5f94c1237807fe3d4671b69c830251b059181900360200190a15060018055565b60335460408051635db8200960e01b8152600080516020612c02833981519152600482015233602482015290516001600160a01b0390921691635db8200991604480820192602092909190829003018186803b15801561192357600080fd5b505afa158015611937573d6000803e3d6000fd5b505050506040513d602081101561194d57600080fd5b505161198e576040805162461bcd60e51b81526020600482015260186024820152600080516020612c43833981519152604482015290519081900360640190fd5b6119a0816001600160a01b0316611c5c565b6119f1576040805162461bcd60e51b815260206004820152601b60248201527f65786368616e6765206d757374206265206120636f6e74726163740000000000604482015290519081900360640190fd5b6000819050806001600160a01b0316636daf390b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611a2f57600080fd5b505afa158015611a43573d6000803e3d6000fd5b505050506040513d6020811015611a5957600080fd5b50516001600160a01b03848116911614611ab1576040805162461bcd60e51b81526020600482015260146024820152730d2dce0eae840e8ded6cadc40dad2e6dac2e8c6d60631b604482015290519081900360640190fd5b611b21816001600160a01b031663d0202d3b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611aed57600080fd5b505afa158015611b01573d6000803e3d6000fd5b505050506040513d6020811015611b1757600080fd5b5051603890611ef9565b611b72576040805162461bcd60e51b815260206004820152601c60248201527f746f6b656e206f7574206973206e6f7420696e20757364206c69737400000000604482015290519081900360640190fd5b6001600160a01b038381166000818152603b602052604080822080546001600160a01b03191686861617905551928516927f24a2b479b91fec73d7cf3b4a1d572f4ca97c271bfc83b024040951a41d365a689190a3505050565b6034546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c3590849061207a565b6000610a9a8261212b565b6000611c44838361212f565b9392505050565b6000611c5630611c5c565b15905090565b3b151590565b600054610100900460ff1680611c7b5750611c7b611c4b565b80611c89575060005460ff16155b611cc45760405162461bcd60e51b815260040180806020018281038252602e815260200180612bd4602e913960400191505060405180910390fd5b600054610100900460ff16158015611cef576000805460ff1961ff0019909116610100171660011790555b611cf7612193565b8015611d09576000805461ff00191690555b50565b6034546001600160a01b0316611d5c576040805162461bcd60e51b815260206004820152601060248201526f1d985d5b1d081a5cc81b9bdd081cd95d60821b604482015290519081900360640190fd5b80611da2576040805162461bcd60e51b8152602060048201526011602482015270616d6f756e7420696e206973207a65726f60781b604482015290519081900360640190fd5b600080611daf8484612238565b9092509050611dbf603883611ef9565b611e07576040805162461bcd60e51b81526020600482015260146024820152733ab732bc3832b1ba32b21037baba103a37b5b2b760611b604482015290519081900360640190fd5b6001600160a01b0382166000908152603a602052604090205480611e6a576040805162461bcd60e51b81526020600482015260156024820152743ab732bc3832b1ba32b2103737b936b0b634bd32b960591b604482015290519081900360640190fd5b6000611e76838361264a565b603654909150611e8690826126a3565b603655611e916126fd565b603755603454611eae906001600160a01b03868116911685611bdb565b604080518481526020810183905281516001600160a01b038716927fea09527d95a6220839f62ba967ac4239b8a5a986eba9c4d84b6ffcbe4fcf7975928290030190a2505050505050565b6000611c44836001600160a01b038416612701565b6000611c44836001600160a01b038416612719565b600082821115611f7a576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000611c44836001600160a01b038416612763565b80471015611fea576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114612035576040519150601f19603f3d011682016040523d82523d6000602084013e61203a565b606091505b5050905080610c355760405162461bcd60e51b815260040180806020018281038252603a815260200180612b74603a913960400191505060405180910390fd5b60606120cf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128299092919063ffffffff16565b805190915015610c35578080602001905160208110156120ee57600080fd5b5051610c355760405162461bcd60e51b815260040180806020018281038252602a815260200180612c63602a913960400191505060405180910390fd5b5490565b815460009082106121715760405162461bcd60e51b8152600401808060200182810382526022815260200180612b326022913960400191505060405180910390fd5b82600001828154811061218057fe5b9060005260206000200154905092915050565b600054610100900460ff16806121ac57506121ac611c4b565b806121ba575060005460ff16155b6121f55760405162461bcd60e51b815260040180806020018281038252602e815260200180612bd4602e913960400191505060405180910390fd5b600054610100900460ff16158015612220576000805460ff1961ff0019909116610100171660011790555b600180558015611d09576000805461ff001916905550565b6000806000846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561228a57600080fd5b505afa15801561229e573d6000803e3d6000fd5b505050506040513d60208110156122b457600080fd5b50519050808411156122f75760405162461bcd60e51b8152600401808060200182810382526024815260200180612c8d6024913960400191505060405180910390fd5b83612341576040805162461bcd60e51b81526020600482015260156024820152741b9bc818985b185b98d9481d1bc818dbdb9d995c9d605a1b604482015290519081900360640190fd5b61234c603886611ef9565b1561235c578492508391506125a7565b6001600160a01b038086166000908152603b60205260409020541661238081611c5c565b6123d1576040805162461bcd60e51b815260206004820152601f60248201527f746f6b656e2065786368616e6765206973206e6f7420617661696c61626c6500604482015290519081900360640190fd5b806001600160a01b0316636daf390b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561240a57600080fd5b505afa15801561241e573d6000803e3d6000fd5b505050506040513d602081101561243457600080fd5b50516001600160a01b0387811691161461248c576040805162461bcd60e51b81526020600482015260146024820152730d2dce0eae840e8ded6cadc40dad2e6dac2e8c6d60631b604482015290519081900360640190fd5b6001600160a01b038087166000908152603b602090815260409182902054825163d0202d3b60e01b8152925193169263d0202d3b926004808201939291829003018186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d602081101561250757600080fd5b5051935061251f6001600160a01b0387168287612840565b6001600160a01b038087166000908152603b60209081526040808320548151632cdece5560e01b8152600481018b90529151941693632cdece5593602480840194938390030190829087803b15801561257757600080fd5b505af115801561258b573d6000803e3d6000fd5b505050506040513d60208110156125a157600080fd5b50519250505b600082116125ef576040805162461bcd60e51b815260206004820152601060248201526f062616c616e6365206f757420697320360841b604482015290519081900360640190fd5b826001600160a01b0316856001600160a01b03167fd6b8a36bb6b6b76fe095d4742edc970f9278f373ae9ab6f875f0c98a96c322b58685604051808381526020018281526020019250505060405180910390a3509250929050565b60008261265957506000610a9a565b8282028284828161266657fe5b0414611c445760405162461bcd60e51b8152600401808060200182810382526021815260200180612c226021913960400191505060405180910390fd5b600082820183811015611c44576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b4390565b60009081526001919091016020526040902054151590565b60006127258383612701565b61275b57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a9a565b506000610a9a565b6000818152600183016020526040812054801561281f578354600019808301919081019060009087908390811061279657fe5b90600052602060002001549050808760000184815481106127b357fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806127e357fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610a9a565b6000915050610a9a565b60606128388484600085612931565b949350505050565b60006128d682856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b1580156128a457600080fd5b505afa1580156128b8573d6000803e3d6000fd5b505050506040513d60208110156128ce57600080fd5b5051906126a3565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905290915061292b90859061207a565b50505050565b6060824710156129725760405162461bcd60e51b8152600401808060200182810382526026815260200180612bae6026913960400191505060405180910390fd5b61297b85611c5c565b6129cc576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612a0b5780518252601f1990920191602091820191016129ec565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612a6d576040519150601f19603f3d011682016040523d82523d6000602084013e612a72565b606091505b5091509150612a82828286612a8d565b979650505050505050565b60608315612a9c575081611c44565b825115612aac5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612af6578181015183820152602001612ade565b50505050905090810190601f168015612b235780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64735265656e7472616e637947756172643a207265656e7472616e742063616c6c00416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564e84d166bad4981073f1b4bdc5fecdb216902502bdfea5c01391b14df2724e4f7536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7763616c6c6572206973206e6f7420617574686f72697a656400000000000000005361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564616d6f756e7420696e206578636565647320636f6e7665727461626c6520616d6f756e74a264697066735822122087631390f1157389d11e9bf10bce5cc5f6d3278c8df07b1f4352f39c6435c78264736f6c63430007040033

Deployed ByteCode Sourcemap

46418:12073:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;47151:46;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;47151:46:0;-1:-1:-1;;;;;47151:46:0;;:::i;:::-;;;;;;;;;;;;;;;;54751:323;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;54751:323:0;;;;;;;;:::i;:::-;;49454:292;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;49454:292:0;-1:-1:-1;;;;;49454:292:0;;:::i;46876:35::-;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;46876:35:0;;;;;;;;;;;;;;46779:88;;;;;;;;;;;;;:::i;49850:594::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;49850:594:0;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49011:362;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;49011:362:0;;;;;;;;;;:::i;46728:44::-;;;;;;;;;;;;;:::i;46989:40::-;;;;;;;;;;;;;:::i;47204:58::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;47204:58:0;-1:-1:-1;;;;;47204:58:0;;:::i;55706:453::-;;;;;;;;;;;;;:::i;53441:443::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;53441:443:0;;;;;;;;-1:-1:-1;53441:443:0;;-1:-1:-1;;53441:443:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;53441:443:0;;-1:-1:-1;53441:443:0;;-1:-1:-1;;;;;53441:443:0:i;47036:41::-;;;;;;;;;;;;;:::i;46945:37::-;;;;;;;;;;;;;:::i;48506:141::-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;55278:348;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;55278:348:0;;;;;;;;:::i;50881:722::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;50881:722:0;;;;;;;;:::i;51750:313::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;51750:313:0;-1:-1:-1;;;;;51750:313:0;;:::i;54088:246::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;54088:246:0;;:::i;52656:529::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;52656:529:0;;;;;;;;;;:::i;46918:20::-;;;;;;;;;;;;;:::i;47151:46::-;;;;;;;;;;;;;:::o;54751:323::-;48225:13;;:66;;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0;;;;48280:10;48225:66;;;;;;-1:-1:-1;;;;;48225:13:0;;;;:28;;:66;;;;;;;;;;;;;;;:13;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48225:66:0;48203:140;;;;;-1:-1:-1;;;48203:140:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;;;40518:1:::1;41281:7;;:19;;41273:63;;;::::0;;-1:-1:-1;;;41273:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;41273:63:0;;;;;;;;;;;;;::::1;;40518:1;41414:7;:18:::0;54915:5:::2;::::0;-1:-1:-1;;;;;54915:5:0::2;54907:48;;;::::0;;-1:-1:-1;;;54907:48:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;54907:48:0;;;;;;;;;;;;;::::2;;55004:5;::::0;54966:52:::2;::::0;-1:-1:-1;;;;;54966:37:0;;::::2;::::0;55004:5:::2;55011:6:::0;54966:37:::2;:52::i;:::-;55034:32;::::0;;;;;;;-1:-1:-1;;;;;55034:32:0;::::2;::::0;::::2;::::0;;;;;::::2;::::0;;::::2;-1:-1:-1::0;;40474:1:0::1;41593:22:::0;;54751:323::o;49454:292::-;48411:13;;:43;;;-1:-1:-1;;;48411:43:0;;:13;:43;;;;48443:10;48411:43;;;;;;-1:-1:-1;;;;;48411:13:0;;;;:28;;:43;;;;;;;;;;;;;;;:13;:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48411:43:0;48403:75;;;;;-1:-1:-1;;;48403:75:0;;;;;;;;;;;;-1:-1:-1;;;48403:75:0;;;;;;;;;;;;;;;49574:22:::1;::::0;-1:-1:-1;;;;;49558:38:0;;::::1;49574:22:::0;::::1;49558:38;;49550:78;;;::::0;;-1:-1:-1;;;49550:78:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;49653:22;::::0;49644:46:::1;::::0;-1:-1:-1;;;;;49644:46:0;;::::1;::::0;49653:22:::1;::::0;49644:46:::1;::::0;49653:22:::1;::::0;49644:46:::1;49701:22;:37:::0;;-1:-1:-1;;;;;;49701:37:0::1;-1:-1:-1::0;;;;;49701:37:0;;;::::1;::::0;;;::::1;::::0;;49454:292::o;46876:35::-;;;-1:-1:-1;;;;;46876:35:0;;:::o;46779:88::-;-1:-1:-1;;;;;;;;;;;46779:88:0;:::o;49850:594::-;49969:23;50024:5;50018:3;:11;50010:54;;;;;-1:-1:-1;;;50010:54:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;50075:14;50092:22;:13;:20;:22::i;:::-;50075:39;;50138:6;50129:5;:15;50125:61;;50161:13;;;50125:61;50196:15;50222:6;50215:3;:13;;50214:30;;50238:6;50214:30;;;50232:3;50214:30;50196:48;;50288:5;50278:7;:15;50264:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;50264:30:0;-1:-1:-1;50255:39:0;-1:-1:-1;50322:5:0;50305:108;50333:7;50329:1;:11;50305:108;;;50382:19;:13;50399:1;50382:16;:19::i;:::-;50362:6;50373:5;50369:1;:9;50362:17;;;;;;;;-1:-1:-1;;;;;50362:39:0;;;:17;;;;;;;;;;;:39;50342:3;;50305:108;;;;50423:13;;49850:594;;;;;:::o;49011:362::-;38228:13;;;;;;;;:33;;;38245:16;:14;:16::i;:::-;38228:50;;;-1:-1:-1;38266:12:0;;;;38265:13;38228:50;38206:146;;;;-1:-1:-1;;;38206:146:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;38365:19;38388:13;;;;;;38387:14;38412:101;;;;38447:13;:20;;-1:-1:-1;;;;38447:20:0;;;;;38482:19;38463:4;38482:19;;;38412:101;-1:-1:-1;;;;;49111:20:0;::::1;49103:58;;;::::0;;-1:-1:-1;;;49103:58:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;49180:27;:14;-1:-1:-1::0;;;;;49180:25:0::1;;:27::i;:::-;49172:72;;;::::0;;-1:-1:-1;;;49172:72:0;;::::1;;::::0;::::1;::::0;;;;;;;::::1;::::0;;;;;;;;;;;;;::::1;;49257:24;:22;:24::i;:::-;49294:13;:46:::0;;-1:-1:-1;;;;;49294:46:0;;::::1;-1:-1:-1::0;;;;;;49294:46:0;;::::1;;::::0;;;49351:5:::1;:14:::0;;;;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;38539:68;;;;38590:5;38574:21;;-1:-1:-1;;38574:21:0;;;38539:68;49011:362;;;:::o;46728:44::-;46770:2;46728:44;:::o;46989:40::-;;;;:::o;47204:58::-;;;;;;;;;;;;-1:-1:-1;;;;;47204:58:0;;:::o;55706:453::-;48225:13;;:66;;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0;;;;48280:10;48225:66;;;;;;-1:-1:-1;;;;;48225:13:0;;;;:28;;:66;;;;;;;;;;;;;;;:13;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48225:66:0;48203:140;;;;;-1:-1:-1;;;48203:140:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;;;55779:22:::1;::::0;:35:::1;::::0;-1:-1:-1;;;;;55779:22:0::1;:33;:35::i;:::-;55774:75;;55831:7;;55774:75;55883:22;::::0;55937:16:::1;::::0;55968:17:::1;::::0;55859:137:::1;::::0;;-1:-1:-1;;;55859:137:0;;::::1;::::0;::::1;::::0;;;;;;;;;;;;-1:-1:-1;;;;;55883:22:0;;::::1;::::0;55859:63:::1;::::0;:137;;;;;55883:22:::1;::::0;55859:137;;;;;;;;55883:22;;55859:137;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;56055:22:0::1;::::0;56092:16:::1;::::0;56123:17:::1;::::0;56012:139:::1;::::0;;;;;::::1;::::0;::::1;::::0;;;;;;-1:-1:-1;;;;;56055:22:0;;::::1;::::0;-1:-1:-1;56012:139:0::1;::::0;-1:-1:-1;56012:139:0;;;;;;::::1;48354:1;55706:453::o:0;53441:443::-;40518:1;41281:7;;:19;;41273:63;;;;;-1:-1:-1;;;41273:63:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;41273:63:0;;;;;;;;;;;;;;;40518:1;41414:7;:18;48225:13:::1;::::0;:66:::1;::::0;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0::1;::::0;::::1;::::0;48280:10:::1;48225:66:::0;;;;;;-1:-1:-1;;;;;48225:13:0;;::::1;::::0;:28:::1;::::0;:66;;;;;::::1;::::0;;;;;;;;;:13;:66;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;48225:66:0;48203:140:::1;;;::::0;;-1:-1:-1;;;48203:140:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;::::1;;53645:9:::2;:16;53628:6;:13;:33;53620:75;;;::::0;;-1:-1:-1;;;53620:75:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;::::2;::::0;;;;;;;;;;;;;::::2;;53744:13:::0;;53712:9:::2;::::0;53706:135:::2;53764:5;53760:1;:9;53706:135;;;53791:38;53805:6;53812:1;53805:9;;;;;;;;;;;;;;53816;53826:1;53816:12;;;;;;;;;;;;;;53791:13;:38::i;:::-;53771:3;::::0;;::::2;::::0;53706:135:::2;;;;;53851:25;:23;:25::i;:::-;-1:-1:-1::0;;40474:1:0;41593:22;;53441:443::o;47036:41::-;;;;:::o;46945:37::-;;;-1:-1:-1;;;;;46945:37:0;;:::o;48506:141::-;48603:16;;48621:17;;48506:141;;:::o;55278:348::-;48225:13;;:66;;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0;;;;48280:10;48225:66;;;;;;-1:-1:-1;;;;;48225:13:0;;;;:28;;:66;;;;;;;;;;;;;;;:13;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48225:66:0;48203:140;;;;;-1:-1:-1;;;48203:140:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;;;40518:1:::1;41281:7;;:19;;41273:63;;;::::0;;-1:-1:-1;;;41273:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;41273:63:0;;;;;;;;;;;;;::::1;;40518:1;41414:7;:18:::0;55444:5:::2;::::0;-1:-1:-1;;;;;55444:5:0::2;55436:48;;;::::0;;-1:-1:-1;;;55436:48:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;55436:48:0;;;;;;;;;;;;;::::2;;55553:5;::::0;55495:73:::2;::::0;;-1:-1:-1;;;55495:73:0;;55546:4:::2;55495:73;::::0;::::2;::::0;-1:-1:-1;;;;;55553:5:0;;::::2;55495:73:::0;;;;;;;;;;;;:42;;::::2;::::0;::::2;::::0;:73;;;;;55553:5:::2;::::0;55495:73;;;;;;;;55553:5;55495:42;:73;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;-1:-1:-1::0;;55584:34:0::2;::::0;;;;;;;-1:-1:-1;;;;;55584:34:0;::::2;::::0;-1:-1:-1;55584:34:0::2;::::0;-1:-1:-1;55584:34:0;;;;::::2;::::0;;::::2;-1:-1:-1::0;;40474:1:0::1;41593:22:::0;;55278:348::o;50881:722::-;48225:13;;:66;;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0;;;;48280:10;48225:66;;;;;;-1:-1:-1;;;;;48225:13:0;;;;:28;;:66;;;;;;;;;;;;;;;:13;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48225:66:0;48203:140;;;;;-1:-1:-1;;;48203:140:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;;;50988:29:::1;:13;51011:5:::0;50988:22:::1;:29::i;:::-;50987:30;50979:68;;;::::0;;-1:-1:-1;;;50979:68:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;51066:18;:5;-1:-1:-1::0;;;;;51066:16:0::1;;:18::i;:::-;51058:61;;;::::0;;-1:-1:-1;;;51058:61:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;51150:2;51138:8;:14;;51130:48;;;::::0;;-1:-1:-1;;;51130:48:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;51130:48:0;;;;;;;;;;;;;::::1;;51243:5;-1:-1:-1::0;;;;;51233:25:0::1;;:27;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;51233:27:0;::::1;;51229:156;;;;;51333:8;51315:14;:26;;;51307:57;;;::::0;;-1:-1:-1;;;51307:57:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;51307:57:0;;;;;;;;;;;;;::::1;;51261:115;51229:156;51397:12;51412:24;:13;51430:5:::0;51412:17:::1;:24::i;:::-;51397:39;;51455:7;51447:45;;;::::0;;-1:-1:-1;;;51447:45:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;51529:29;46770:2;51549:8:::0;51529:19:::1;:29::i;:::-;-1:-1:-1::0;;;;;51503:18:0;::::1;;::::0;;;:11:::1;:18;::::0;;;;;51524:2:::1;:35:::0;;;::::1;51503:56:::0;;;51577:18;;51503;;51577::::1;::::0;::::1;48354:1;50881:722:::0;;:::o;51750:313::-;48225:13;;:66;;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0;;;;48280:10;48225:66;;;;;;-1:-1:-1;;;;;48225:13:0;;;;:28;;:66;;;;;;;;;;;;;;;:13;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48225:66:0;48203:140;;;;;-1:-1:-1;;;48203:140:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;;;51841:29:::1;:13;51864:5:::0;51841:22:::1;:29::i;:::-;51833:63;;;::::0;;-1:-1:-1;;;51833:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;51833:63:0;;;;;;;;;;;;;::::1;;51909:14;51926:27;:13;51947:5:::0;51926:20:::1;:27::i;:::-;51909:44;;51972:9;51964:52;;;::::0;;-1:-1:-1;;;51964:52:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;52034:21;::::0;-1:-1:-1;;;;;52034:21:0;::::1;::::0;::::1;::::0;;;::::1;48354:1;51750:313:::0;:::o;54088:246::-;48225:13;;:66;;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0;;;;48280:10;48225:66;;;;;;-1:-1:-1;;;;;48225:13:0;;;;:28;;:66;;;;;;;;;;;;;;;:13;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48225:66:0;48203:140;;;;;-1:-1:-1;;;48203:140:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;;;40518:1:::1;41281:7;;:19;;41273:63;;;::::0;;-1:-1:-1;;;41273:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;41273:63:0;;;;;;;;;;;;;::::1;;40518:1;41414:7;:18:::0;54189:5:::2;::::0;-1:-1:-1;;;;;54189:5:0::2;54181:48;;;::::0;;-1:-1:-1;;;54181:48:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;54181:48:0;;;;;;;;;;;;;::::2;;54277:5;::::0;54240:52:::2;::::0;-1:-1:-1;;;;;54277:5:0::2;54285:6:::0;54240:28:::2;:52::i;:::-;54308:18;::::0;;;;;;;::::2;::::0;;;;::::2;::::0;;::::2;-1:-1:-1::0;40474:1:0::1;41593:22:::0;;54088:246::o;52656:529::-;48225:13;;:66;;;-1:-1:-1;;;48225:66:0;;-1:-1:-1;;;;;;;;;;;48225:66:0;;;;48280:10;48225:66;;;;;;-1:-1:-1;;;;;48225:13:0;;;;:28;;:66;;;;;;;;;;;;;;;:13;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48225:66:0;48203:140;;;;;-1:-1:-1;;;48203:140:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;48203:140:0;;;;;;;;;;;;;;;52803:22:::1;:9;-1:-1:-1::0;;;;;52803:20:0::1;;:22::i;:::-;52795:62;;;::::0;;-1:-1:-1;;;52795:62:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;52868:22;52907:9;52868:49;;52945:8;-1:-1:-1::0;;;;;52945:16:0::1;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;52945:18:0;-1:-1:-1;;;;;52936:27:0;;::::1;::::0;::::1;;52928:60;;;::::0;;-1:-1:-1;;;52928:60:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;52928:60:0;;;;;;;;;;;;;::::1;;53007:43;53030:8;-1:-1:-1::0;;;;;53030:17:0::1;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;53030:19:0;53007:13:::1;::::0;:22:::1;:43::i;:::-;52999:84;;;::::0;;-1:-1:-1;;;52999:84:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;-1:-1:-1::0;;;;;53096:24:0;;::::1;;::::0;;;:17:::1;:24;::::0;;;;;:35;;-1:-1:-1;;;;;;53096:35:0::1;::::0;;::::1;;::::0;;53147:30;;;::::1;::::0;::::1;::::0;53096:24;53147:30:::1;48354:1;52656:529:::0;;:::o;46918:20::-;;;-1:-1:-1;;;;;46918:20:0;;:::o;23579:222::-;23734:58;;;-1:-1:-1;;;;;23734:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;23734:58:0;-1:-1:-1;;;23734:58:0;;;23707:86;;23727:5;;23707:19;:86::i;34534:117::-;34597:7;34624:19;34632:3;34624:7;:19::i;35005:158::-;35079:7;35130:22;35134:3;35146:5;35130:3;:22::i;:::-;35122:31;35005:158;-1:-1:-1;;;35005:158:0:o;38707:125::-;38755:4;38780:44;38818:4;38780:29;:44::i;:::-;38779:45;38772:52;;38707:125;:::o;16483:444::-;16863:20;16911:8;;;16483:444::o;40560:108::-;38228:13;;;;;;;;:33;;;38245:16;:14;:16::i;:::-;38228:50;;;-1:-1:-1;38266:12:0;;;;38265:13;38228:50;38206:146;;;;-1:-1:-1;;;38206:146:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;38365:19;38388:13;;;;;;38387:14;38412:101;;;;38447:13;:20;;-1:-1:-1;;;;38447:20:0;;;;;38482:19;38463:4;38482:19;;;38412:101;40626:34:::1;:32;:34::i;:::-;38543:14:::0;38539:68;;;38590:5;38574:21;;-1:-1:-1;;38574:21:0;;;38539:68;40560:108;:::o;56167:908::-;56251:5;;-1:-1:-1;;;;;56251:5:0;56243:48;;;;;-1:-1:-1;;;56243:48:0;;;;;;;;;;;;-1:-1:-1;;;56243:48:0;;;;;;;;;;;;;;;56310:13;56302:43;;;;;-1:-1:-1;;;56302:43:0;;;;;;;;;;;;-1:-1:-1;;;56302:43:0;;;;;;;;;;;;;;;56409:16;56427:17;56448:37;56469:5;56476:8;56448:20;:37::i;:::-;56408:77;;-1:-1:-1;56408:77:0;-1:-1:-1;56504:32:0;:13;56408:77;56504:22;:32::i;:::-;56496:65;;;;;-1:-1:-1;;;56496:65:0;;;;;;;;;;;;-1:-1:-1;;;56496:65:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;56662:21:0;;56641:18;56662:21;;;:11;:21;;;;;;56702:15;56694:49;;;;;-1:-1:-1;;;56694:49:0;;;;;;;;;;;;-1:-1:-1;;;56694:49:0;;;;;;;;;;;;;;;56756:26;56785:25;:9;56799:10;56785:13;:25::i;:::-;56840:16;;56756:54;;-1:-1:-1;56840:40:0;;56756:54;56840:20;:40::i;:::-;56821:16;:59;56911:14;:12;:14::i;:::-;56891:17;:34;56979:5;;56938:58;;-1:-1:-1;;;;;56938:40:0;;;;56979:5;56986:9;56938:40;:58::i;:::-;57014:53;;;;;;;;;;;;;;-1:-1:-1;;;;;57014:53:0;;;;;;;;;;;56167:908;;;;;;:::o;34281:167::-;34361:4;34385:55;34395:3;-1:-1:-1;;;;;34415:23:0;;34385:9;:55::i;33709:152::-;33779:4;33803:50;33808:3;-1:-1:-1;;;;;33828:23:0;;33803:4;:50::i;3236:158::-;3294:7;3327:1;3322;:6;;3314:49;;;;;-1:-1:-1;;;3314:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3381:5:0;;;3236:158::o;34037:::-;34110:4;34134:53;34142:3;-1:-1:-1;;;;;34162:23:0;;34134:7;:53::i;17862:397::-;17977:6;17952:21;:31;;17944:73;;;;;-1:-1:-1;;;17944:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;18127:35;;18109:12;;-1:-1:-1;;;;;18127:14:0;;;18150:6;;18109:12;18127:35;18109:12;18127:35;18150:6;18127:14;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18108:54;;;18181:7;18173:78;;;;-1:-1:-1;;;18173:78:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26280:822;26715:23;26741:106;26783:4;26741:106;;;;;;;;;;;;;;;;;26749:5;-1:-1:-1;;;;;26741:27:0;;;:106;;;;;:::i;:::-;26862:17;;26715:132;;-1:-1:-1;26862:21:0;26858:237;;27017:10;27006:30;;;;;;;;;;;;;;;-1:-1:-1;27006:30:0;26998:85;;;;-1:-1:-1;;;26998:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31188:109;31271:18;;31188:109::o;31651:204::-;31746:18;;31718:7;;31746:26;-1:-1:-1;31738:73:0;;;;-1:-1:-1;;;31738:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31829:3;:11;;31841:5;31829:18;;;;;;;;;;;;;;;;31822:25;;31651:204;;;;:::o;40676:106::-;38228:13;;;;;;;;:33;;;38245:16;:14;:16::i;:::-;38228:50;;;-1:-1:-1;38266:12:0;;;;38265:13;38228:50;38206:146;;;;-1:-1:-1;;;38206:146:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;38365:19;38388:13;;;;;;38387:14;38412:101;;;;38447:13;:20;;-1:-1:-1;;;;38447:20:0;;;;;38482:19;38463:4;38482:19;;;38412:101;40474:1:::1;40752:22:::0;;38539:68;;;;38590:5;38574:21;;-1:-1:-1;;38574:21:0;;;40676:106;:::o;57083:1261::-;57184:16;57202:17;57237:22;57280:7;-1:-1:-1;;;;;57262:36:0;;57307:4;57262:51;;;;;;;;;;;;;-1:-1:-1;;;;;57262:51:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;57262:51:0;;-1:-1:-1;57332:26:0;;;;57324:75;;;;-1:-1:-1;;;57324:75:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;57414:13;57410:805;;57473:31;;;-1:-1:-1;;;57473:31:0;;;;;;;;;;;;-1:-1:-1;;;57473:31:0;;;;;;;;;;;;;;57410:805;57526:31;:13;57549:7;57526:22;:31::i;:::-;57522:693;;;57676:7;57665:18;;57710:8;57698:20;;57522:693;;;-1:-1:-1;;;;;57776:26:0;;;57751:22;57776:26;;;:17;:26;;;;;;;57825:30;57776:26;57825:28;:30::i;:::-;57817:74;;;;;-1:-1:-1;;;57817:74:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;57925:8;-1:-1:-1;;;;;57925:16:0;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;57925:18:0;-1:-1:-1;;;;;57914:29:0;;;;;;57906:62;;;;;-1:-1:-1;;;57906:62:0;;;;;;;;;;;;-1:-1:-1;;;57906:62:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;57994:26:0;;;;;;;:17;:26;;;;;;;;;;:37;;-1:-1:-1;;;57994:37:0;;;;:26;;;:35;;:37;;;;;:26;:37;;;;;;:26;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;57994:37:0;;-1:-1:-1;58048:77:0;-1:-1:-1;;;;;58048:48:0;;58105:8;58116;58048:48;:77::i;:::-;-1:-1:-1;;;;;58152:26:0;;;;;;;:17;:26;;;;;;;;;:51;;-1:-1:-1;;;58152:51:0;;;;;;;;;;:26;;;:41;;:51;;;;;:26;:51;;;;;;;:26;:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;58152:51:0;;-1:-1:-1;;57522:693:0;58245:1;58233:9;:13;58225:42;;;;;-1:-1:-1;;;58225:42:0;;;;;;;;;;;;-1:-1:-1;;;58225:42:0;;;;;;;;;;;;;;;58316:8;-1:-1:-1;;;;;58283:53:0;58297:7;-1:-1:-1;;;;;58283:53:0;;58306:8;58326:9;58283:53;;;;;;;;;;;;;;;;;;;;;;;;57083:1261;;;;;;:::o;3653:220::-;3711:7;3735:6;3731:20;;-1:-1:-1;3750:1:0;3743:8;;3731:20;3774:5;;;3778:1;3774;:5;:1;3798:5;;;;;:10;3790:56;;;;-1:-1:-1;;;3790:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2774:179;2832:7;2864:5;;;2888:6;;;;2880:46;;;;;-1:-1:-1;;;2880:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;58352:102;58434:12;58352:102;:::o;30973:129::-;31046:4;31070:19;;;:12;;;;;:19;;;;;;:24;;;30973:129::o;28740:414::-;28803:4;28825:21;28835:3;28840:5;28825:9;:21::i;:::-;28820:327;;-1:-1:-1;28863:23:0;;;;;;;;:11;:23;;;;;;;;;;;;;29046:18;;29024:19;;;:12;;;:19;;;;;;:40;;;;29079:11;;28820:327;-1:-1:-1;29130:5:0;29123:12;;29330:1557;29396:4;29535:19;;;:12;;;:19;;;;;;29571:15;;29567:1313;;30019:18;;-1:-1:-1;;29970:14:0;;;;30019:22;;;;29946:21;;30019:3;;:22;;30306;;;;;;;;;;;;;;30286:42;;30452:9;30423:3;:11;;30435:13;30423:26;;;;;;;;;;;;;;;;;;;:38;;;;30529:23;;;30571:1;30529:12;;;:23;;;;;;30555:17;;;30529:43;;30681:17;;30529:3;;30681:17;;;;;;;;;;;;;;;;;;;;;;30776:3;:12;;:19;30789:5;30776:19;;;;;;;;;;;30769:26;;;30819:4;30812:11;;;;;;;;29567:1313;30863:5;30856:12;;;;;19425:229;19562:12;19594:52;19616:6;19624:4;19630:1;19633:12;19594:21;:52::i;:::-;19587:59;19425:229;-1:-1:-1;;;;19425:229:0:o;25063:368::-;25205:20;25228:50;25272:5;25228;-1:-1:-1;;;;;25228:15:0;;25252:4;25259:7;25228:39;;;;;;;;;;;;;-1:-1:-1;;;;;25228:39:0;;;;;;-1:-1:-1;;;;;25228:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;25228:39:0;;:43;:50::i;:::-;25343:69;;;-1:-1:-1;;;;;25343:69:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;25343:69:0;-1:-1:-1;;;25343:69:0;;;25205:73;;-1:-1:-1;25289:134:0;;25323:5;;25289:19;:134::i;:::-;25063:368;;;;:::o;20558:573::-;20728:12;20786:5;20761:21;:30;;20753:81;;;;-1:-1:-1;;;20753:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20853:18;20864:6;20853:10;:18::i;:::-;20845:60;;;;;-1:-1:-1;;;20845:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;20979:12;20993:23;21020:6;-1:-1:-1;;;;;21020:11:0;21040:5;21048:4;21020:33;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;21020:33:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20978:75;;;;21071:52;21089:7;21098:10;21110:12;21071:17;:52::i;:::-;21064:59;20558:573;-1:-1:-1;;;;;;;20558:573:0:o;22203:777::-;22353:12;22382:7;22378:595;;;-1:-1:-1;22413:10:0;22406:17;;22378:595;22527:17;;:21;22523:439;;22790:10;22784:17;22851:15;22838:10;22834:2;22830:19;22823:44;22738:148;22933:12;22926:20;;-1:-1:-1;;;22926:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Swarm Source

ipfs://87631390f1157389d11e9bf10bce5cc5f6d3278c8df07b1f4352f39c6435c782
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.