MATIC Price: $0.717344 (-1.81%)
Gas: 30 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60806040308894302022-07-19 7:23:17677 days ago1658215397IN
 Create: HFurucomboFunds
0 MATIC0.0382328833.72074833

Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
HFurucomboFunds

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2022-07-19
*/

// Sources flattened with hardhat v2.8.0 https://hardhat.org

// File @openzeppelin/contracts/token/ERC20/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// File @openzeppelin/contracts/utils/[email protected]

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File @openzeppelin/contracts/token/ERC20/utils/[email protected]

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// File @openzeppelin/contracts/utils/[email protected]

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length)
        internal
        pure
        returns (string memory)
    {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

// File contracts/interface/IERC20Usdt.sol

pragma solidity ^0.8.0;

interface IERC20Usdt {
    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external;

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 amount) external;

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external;

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
}

// File contracts/Config.sol

pragma solidity ^0.8.0;

contract Config {
    // function signature of "postProcess()"
    bytes4 public constant POSTPROCESS_SIG = 0xc2722916;

    // The base amount of percentage function
    uint256 public constant PERCENTAGE_BASE = 1 ether;

    // Handler post-process type. Others should not happen now.
    enum HandlerType {
        Token,
        Custom,
        Others
    }
}

// File contracts/lib/LibCache.sol

pragma solidity ^0.8.0;

library LibCache {
    function set(
        mapping(bytes32 => bytes32) storage _cache,
        bytes32 _key,
        bytes32 _value
    ) internal {
        _cache[_key] = _value;
    }

    function setAddress(
        mapping(bytes32 => bytes32) storage _cache,
        bytes32 _key,
        address _value
    ) internal {
        _cache[_key] = bytes32(uint256(uint160(_value)));
    }

    function setUint256(
        mapping(bytes32 => bytes32) storage _cache,
        bytes32 _key,
        uint256 _value
    ) internal {
        _cache[_key] = bytes32(_value);
    }

    function getAddress(
        mapping(bytes32 => bytes32) storage _cache,
        bytes32 _key
    ) internal view returns (address ret) {
        ret = address(uint160(uint256(_cache[_key])));
    }

    function getUint256(
        mapping(bytes32 => bytes32) storage _cache,
        bytes32 _key
    ) internal view returns (uint256 ret) {
        ret = uint256(_cache[_key]);
    }

    function get(mapping(bytes32 => bytes32) storage _cache, bytes32 _key)
        internal
        view
        returns (bytes32 ret)
    {
        ret = _cache[_key];
    }
}

// File contracts/lib/LibStack.sol

pragma solidity ^0.8.0;

library LibStack {
    function setAddress(bytes32[] storage _stack, address _input) internal {
        _stack.push(bytes32(uint256(uint160(_input))));
    }

    function set(bytes32[] storage _stack, bytes32 _input) internal {
        _stack.push(_input);
    }

    function setHandlerType(bytes32[] storage _stack, Config.HandlerType _input)
        internal
    {
        _stack.push(bytes12(uint96(_input)));
    }

    function getAddress(bytes32[] storage _stack)
        internal
        returns (address ret)
    {
        ret = address(uint160(uint256(peek(_stack))));
        _stack.pop();
    }

    function getSig(bytes32[] storage _stack) internal returns (bytes4 ret) {
        ret = bytes4(peek(_stack));
        _stack.pop();
    }

    function get(bytes32[] storage _stack) internal returns (bytes32 ret) {
        ret = peek(_stack);
        _stack.pop();
    }

    function peek(bytes32[] storage _stack)
        internal
        view
        returns (bytes32 ret)
    {
        uint256 length = _stack.length;
        require(length > 0, "stack empty");
        ret = _stack[length - 1];
    }

    function peek(bytes32[] storage _stack, uint256 _index)
        internal
        view
        returns (bytes32 ret)
    {
        uint256 length = _stack.length;
        require(length > 0, "stack empty");
        require(length > _index, "not enough elements in stack");
        ret = _stack[length - _index - 1];
    }
}

// File contracts/Storage.sol

pragma solidity ^0.8.0;

/// @notice A cache structure composed by a bytes32 array
contract Storage {
    using LibCache for mapping(bytes32 => bytes32);
    using LibStack for bytes32[];

    bytes32[] public stack;
    mapping(bytes32 => bytes32) public cache;

    // keccak256 hash of "msg.sender"
    // prettier-ignore
    bytes32 public constant MSG_SENDER_KEY = 0xb2f2618cecbbb6e7468cc0f2aa43858ad8d153e0280b22285e28e853bb9d453a;

    modifier isStackEmpty() {
        require(stack.length == 0, "Stack not empty");
        _;
    }

    modifier isInitialized() {
        require(_getSender() != address(0), "Sender is not initialized");
        _;
    }

    modifier isNotInitialized() {
        require(_getSender() == address(0), "Sender is initialized");
        _;
    }

    function _setSender() internal isNotInitialized {
        cache.setAddress(MSG_SENDER_KEY, msg.sender);
    }

    function _resetSender() internal {
        cache.setAddress(MSG_SENDER_KEY, address(0));
    }

    function _getSender() internal view returns (address) {
        return cache.getAddress(MSG_SENDER_KEY);
    }
}

// File contracts/handlers/HandlerBase.sol

pragma solidity ^0.8.0;

abstract contract HandlerBase is Storage, Config {
    using SafeERC20 for IERC20;
    using LibStack for bytes32[];

    address public constant NATIVE_TOKEN_ADDRESS =
        0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
    address private constant MATIC_TOKEN =
        0x0000000000000000000000000000000000001010;

    function postProcess() external payable virtual {
        revert("Invalid post process");
        /* Implementation template
        bytes4 sig = stack.getSig();
        if (sig == bytes4(keccak256(bytes("handlerFunction_1()")))) {
            // Do something
        } else if (sig == bytes4(keccak256(bytes("handlerFunction_2()")))) {
            bytes32 temp = stack.get();
            // Do something
        } else revert("Invalid post process");
        */
    }

    function _updateToken(address token) internal {
        _notMaticToken(token);
        stack.setAddress(token);
        // Ignore token type to fit old handlers
        // stack.setHandlerType(uint256(HandlerType.Token));
    }

    function _updatePostProcess(bytes32[] memory params) internal {
        for (uint256 i = params.length; i > 0; i--) {
            stack.set(params[i - 1]);
        }
        stack.set(msg.sig);
        stack.setHandlerType(HandlerType.Custom);
    }

    function getContractName() public pure virtual returns (string memory);

    function _revertMsg(string memory functionName, string memory reason)
        internal
        pure
    {
        revert(
            string(
                abi.encodePacked(
                    getContractName(),
                    "_",
                    functionName,
                    ": ",
                    reason
                )
            )
        );
    }

    function _revertMsg(string memory functionName) internal pure {
        _revertMsg(functionName, "Unspecified");
    }

    function _requireMsg(
        bool condition,
        string memory functionName,
        string memory reason
    ) internal pure {
        if (!condition) _revertMsg(functionName, reason);
    }

    function _uint2String(uint256 n) internal pure returns (string memory) {
        if (n == 0) {
            return "0";
        } else {
            uint256 len = 0;
            for (uint256 temp = n; temp > 0; temp /= 10) {
                len++;
            }
            bytes memory str = new bytes(len);
            for (uint256 i = len; i > 0; i--) {
                str[i - 1] = bytes1(uint8(48 + (n % 10)));
                n /= 10;
            }
            return string(str);
        }
    }

    function _getBalance(address token, uint256 amount)
        internal
        view
        returns (uint256)
    {
        if (amount != type(uint256).max) {
            return amount;
        }

        // ETH case
        if (token == address(0) || token == NATIVE_TOKEN_ADDRESS) {
            return address(this).balance;
        }
        // ERC20 token case
        return IERC20(token).balanceOf(address(this));
    }

    function _tokenApprove(
        address token,
        address spender,
        uint256 amount
    ) internal {
        try IERC20Usdt(token).approve(spender, amount) {} catch {
            IERC20(token).safeApprove(spender, 0);
            IERC20(token).safeApprove(spender, amount);
        }
    }

    function _tokenApproveZero(address token, address spender) internal {
        if (IERC20Usdt(token).allowance(address(this), spender) > 0) {
            try IERC20Usdt(token).approve(spender, 0) {} catch {
                IERC20Usdt(token).approve(spender, 1);
            }
        }
    }

    // Do not support matic token (0x0000...1010)
    function _notMaticToken(address token) internal pure {
        require(token != MATIC_TOKEN, "Not support matic token");
    }

    function _notMaticToken(address[] memory tokens) internal pure {
        for (uint256 i = 0; i < tokens.length; i++) {
            require(tokens[i] != MATIC_TOKEN, "Not support matic token");
        }
    }

    function _isNotNativeToken(address token) internal pure returns (bool) {
        return (token != address(0) && token != NATIVE_TOKEN_ADDRESS);
    }
}

// File contracts/handlers/furucombo/funds/IFunds.sol

pragma solidity ^0.8.0;

interface IFunds {
    function denomination() external view returns (address);

    function shareToken() external view returns (address);

    function calculateShare(uint256 balance_)
        external
        view
        returns (uint256 share);

    function calculateBalance(uint256 share_)
        external
        view
        returns (uint256 balance);

    function vault() external view returns (address);

    function purchase(uint256 balance_) external returns (uint256 share);

    function redeem(uint256 share_, bool acceptPending_)
        external
        returns (uint256 balance);
}

// File contracts/handlers/furucombo/funds/IFundProxyFactory.sol

pragma solidity ^0.8.0;

interface IFundProxyFactory {
    function isFundCreated(address fund) external view returns (bool);
}

// File contracts/handlers/furucombo/funds/HFurucomboFunds.sol

pragma solidity 0.8.10;

/// @title Furucombo funds operation handler.
/// @notice Deposit or withdraw to/from funds.
contract HFurucomboFunds is HandlerBase {
    using SafeERC20 for IERC20;
    using Strings for uint256;

    IFundProxyFactory public constant FUND_PROXY_FACTORY =
        IFundProxyFactory(0xFD1353baBf86387FcB6D009C7b74c1aB2178B304);

    function getContractName() public pure override returns (string memory) {
        return "HFurucomboFunds";
    }

    function purchase(address fundsAddr, uint256 amount)
        external
        payable
        returns (uint256)
    {
        require(FUND_PROXY_FACTORY.isFundCreated(fundsAddr), "invalid funds");

        IFunds funds = IFunds(fundsAddr);
        address denomination = funds.denomination();
        amount = _getBalance(denomination, amount);

        // Purchase
        _tokenApprove(denomination, fundsAddr, amount);

        uint256 shareAmount;
        try funds.purchase(amount) returns (uint256 share_) {
            shareAmount = share_;
        } catch Error(string memory reason) {
            _revertMsg("purchase", reason);
        } catch (bytes memory data) {
            // The last 32 bytes should be Funds RevertCode.
            // Ex: 0x64c41b44000000000000000000000000000000000000000000000000000000000000004a
            uint256 revertCode;
            assembly {
                revertCode := mload(add(data, add(0x20, 4)))
            }
            _revertMsg("purchase", revertCode.toString());
        }

        _tokenApproveZero(denomination, fundsAddr);

        address shareToken = funds.shareToken();
        _updateToken(shareToken);

        return shareAmount;
    }

    function redeem(address fundsAddr, uint256 share)
        external
        payable
        returns (uint256)
    {
        require(FUND_PROXY_FACTORY.isFundCreated(fundsAddr), "invalid funds");

        IFunds funds = IFunds(fundsAddr);
        address shareToken = funds.shareToken();
        share = _getBalance(shareToken, share);

        // Redeem, doesn't support redeem pending.
        _tokenApprove(shareToken, fundsAddr, share);

        uint256 amount;
        try funds.redeem(share, false) returns (uint256 balance) {
            amount = balance;
        } catch Error(string memory reason) {
            _revertMsg("redeem", reason);
        } catch (bytes memory data) {
            // The last 32 bytes should be Funds RevertCode.
            // Ex: 0x64c41b44000000000000000000000000000000000000000000000000000000000000004a
            uint256 revertCode;
            assembly {
                revertCode := mload(add(data, add(0x20, 4)))
            }
            _revertMsg("redeem", revertCode.toString());
        }

        _tokenApproveZero(shareToken, fundsAddr);

        address denomination = funds.denomination();
        _updateToken(denomination);

        return amount;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"FUND_PROXY_FACTORY","outputs":[{"internalType":"contract IFundProxyFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MSG_SENDER_KEY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENTAGE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POSTPROCESS_SIG","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"cache","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"postProcess","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"fundsAddr","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"purchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"fundsAddr","type":"address"},{"internalType":"uint256","name":"share","type":"uint256"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stack","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061138d806100206000396000f3fe60806040526004361061009c5760003560e01c8063b4ca72d611610064578063b4ca72d614610157578063c272291614610197578063dc9031c4146101a1578063df2ebdbb146101c1578063f5f5ba72146101e9578063fa2901a51461022757600080fd5b80630f532d18146100a15780631e9a6950146100e857806387c13943146100fb5780638de932221461011757806399eb59b91461012a575b600080fd5b3480156100ad57600080fd5b506100d57fb2f2618cecbbb6e7468cc0f2aa43858ad8d153e0280b22285e28e853bb9d453a81565b6040519081526020015b60405180910390f35b6100d56100f6366004611030565b61025b565b34801561010757600080fd5b506100d5670de0b6b3a764000081565b6100d5610125366004611030565b610559565b34801561013657600080fd5b506100d561014536600461105c565b60016020526000908152604090205481565b34801561016357600080fd5b5061017f73fd1353babf86387fcb6d009c7b74c1ab2178b30481565b6040516001600160a01b0390911681526020016100df565b61019f61080f565b005b3480156101ad57600080fd5b506100d56101bc36600461105c565b61084e565b3480156101cd57600080fd5b5061017f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156101f557600080fd5b50604080518082018252600f81526e4846757275636f6d626f46756e647360881b602082015290516100df91906110a5565b34801561023357600080fd5b50610242636139148b60e11b81565b6040516001600160e01b031990911681526020016100df565b60405163cd0ef24d60e01b81526001600160a01b038316600482015260009073fd1353babf86387fcb6d009c7b74c1ab2178b3049063cd0ef24d90602401602060405180830381865afa1580156102b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102da91906110d8565b61031b5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c69642066756e647360981b60448201526064015b60405180910390fd5b60008390506000816001600160a01b0316636c9fa59e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610360573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038491906110fa565b9050610390818561086f565b935061039d81868661092e565b604051630d65a06b60e41b815260048101859052600060248201819052906001600160a01b0384169063d65a06b0906044016020604051808303816000875af192505050801561040a575060408051601f3d908101601f1916820190925261040791810190611117565b60015b6104d157610416611130565b806308c379a01415610464575061042b61119d565b806104365750610466565b61045e6040518060400160405280600681526020016572656465656d60d01b815250826109bb565b506104d4565b505b3d808015610490576040519150601f19603f3d011682016040523d82523d6000602084013e610495565b606091505b50602481015160408051808201909152600681526572656465656d60d01b60208201526104ca906104c583610a1b565b6109bb565b50506104d4565b90505b6104de8287610b21565b6000836001600160a01b0316638bca6d166040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054291906110fa565b905061054d81610c61565b50925050505b92915050565b60405163cd0ef24d60e01b81526001600160a01b038316600482015260009073fd1353babf86387fcb6d009c7b74c1ab2178b3049063cd0ef24d90602401602060405180830381865afa1580156105b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d891906110d8565b6106145760405162461bcd60e51b815260206004820152600d60248201526c696e76616c69642066756e647360981b6044820152606401610312565b60008390506000816001600160a01b0316638bca6d166040518163ffffffff1660e01b8152600401602060405180830381865afa158015610659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067d91906110fa565b9050610689818561086f565b935061069681868661092e565b60405163efef39a160e01b8152600481018590526000906001600160a01b0384169063efef39a1906024016020604051808303816000875af19250505080156106fc575060408051601f3d908101601f191682019092526106f991810190611117565b60015b6107c257610708611130565b806308c379a01415610758575061071d61119d565b80610728575061075a565b61075260405180604001604052806008815260200167707572636861736560c01b815250826109bb565b506107c5565b505b3d808015610784576040519150601f19603f3d011682016040523d82523d6000602084013e610789565b606091505b506024810151604080518082019091526008815267707572636861736560c01b60208201526107bb906104c583610a1b565b50506107c5565b90505b6107cf8287610b21565b6000836001600160a01b0316636c9fa59e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051e573d6000803e3d6000fd5b60405162461bcd60e51b8152602060048201526014602482015273496e76616c696420706f73742070726f6365737360601b6044820152606401610312565b6000818154811061085e57600080fd5b600091825260209091200154905081565b60006000198214610881575080610553565b6001600160a01b03831615806108b357506001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b156108bf575047610553565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610903573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109279190611117565b9392505050565b60405163095ea7b360e01b81526001600160a01b0383811660048301526024820183905284169063095ea7b390604401600060405180830381600087803b15801561097857600080fd5b505af1925050508015610989575060015b6109b6576109a26001600160a01b038416836000610cac565b6109b66001600160a01b0384168383610cac565b505050565b60408051808201909152600f81526e4846757275636f6d626f46756e647360881b602082015282826040516020016109f593929190611227565b60408051601f198184030181529082905262461bcd60e51b8252610312916004016110a5565b606081610a3f5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610a695780610a538161129d565b9150610a629050600a836112ce565b9150610a43565b60008167ffffffffffffffff811115610a8457610a8461114c565b6040519080825280601f01601f191660200182016040528015610aae576020820181803683370190505b5090505b8415610b1957610ac36001836112e2565b9150610ad0600a866112f9565b610adb90603061130d565b60f81b818381518110610af057610af0611325565b60200101906001600160f81b031916908160001a905350610b12600a866112ce565b9450610ab2565b949350505050565b604051636eb1769f60e11b81523060048201526001600160a01b0382811660248301526000919084169063dd62ed3e90604401602060405180830381865afa158015610b71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b959190611117565b1115610c5d5760405163095ea7b360e01b81526001600160a01b0382811660048301526000602483015283169063095ea7b390604401600060405180830381600087803b158015610be557600080fd5b505af1925050508015610bf6575060015b610c5d5760405163095ea7b360e01b81526001600160a01b0382811660048301526001602483015283169063095ea7b390604401600060405180830381600087803b158015610c4457600080fd5b505af1158015610c58573d6000803e3d6000fd5b505050505b5050565b610c6a81610de3565b600080546001810182559080526001600160a01b0382167f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639091015550565b50565b801580610d265750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d249190611117565b155b610d915760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610312565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526109b6908490610e3e565b6001600160a01b0381166110101415610ca95760405162461bcd60e51b815260206004820152601760248201527f4e6f7420737570706f7274206d6174696320746f6b656e0000000000000000006044820152606401610312565b6000610e93826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f109092919063ffffffff16565b8051909150156109b65780806020019051810190610eb191906110d8565b6109b65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610312565b6060610b19848460008585843b610f695760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610312565b600080866001600160a01b03168587604051610f85919061133b565b60006040518083038185875af1925050503d8060008114610fc2576040519150601f19603f3d011682016040523d82523d6000602084013e610fc7565b606091505b5091509150610fd7828286610fe2565b979650505050505050565b60608315610ff1575081610927565b8251156110015782518084602001fd5b8160405162461bcd60e51b815260040161031291906110a5565b6001600160a01b0381168114610ca957600080fd5b6000806040838503121561104357600080fd5b823561104e8161101b565b946020939093013593505050565b60006020828403121561106e57600080fd5b5035919050565b60005b83811015611090578181015183820152602001611078565b8381111561109f576000848401525b50505050565b60208152600082518060208401526110c4816040850160208701611075565b601f01601f19169190910160400192915050565b6000602082840312156110ea57600080fd5b8151801515811461092757600080fd5b60006020828403121561110c57600080fd5b81516109278161101b565b60006020828403121561112957600080fd5b5051919050565b600060033d11156111495760046000803e5060005160e01c5b90565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff8111828210171561119657634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d10156111ab5790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156111db57505050505090565b82850191508151818111156111f35750505050505090565b843d870101602082850101111561120d5750505050505090565b61121c60208286010187611162565b509095945050505050565b60008451611239818460208901611075565b605f60f81b9083019081528451611257816001840160208901611075565b6101d160f51b60019290910191820152835161127a816003840160208801611075565b0160030195945050505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156112b1576112b1611287565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826112dd576112dd6112b8565b500490565b6000828210156112f4576112f4611287565b500390565b600082611308576113086112b8565b500690565b6000821982111561132057611320611287565b500190565b634e487b7160e01b600052603260045260246000fd5b6000825161134d818460208701611075565b919091019291505056fea2646970667358221220d3e6df9fbb68dab99fb796faa2204c4b1d39d69e04121e7c0520f145dcab0e0164736f6c634300080a0033

Deployed Bytecode

0x60806040526004361061009c5760003560e01c8063b4ca72d611610064578063b4ca72d614610157578063c272291614610197578063dc9031c4146101a1578063df2ebdbb146101c1578063f5f5ba72146101e9578063fa2901a51461022757600080fd5b80630f532d18146100a15780631e9a6950146100e857806387c13943146100fb5780638de932221461011757806399eb59b91461012a575b600080fd5b3480156100ad57600080fd5b506100d57fb2f2618cecbbb6e7468cc0f2aa43858ad8d153e0280b22285e28e853bb9d453a81565b6040519081526020015b60405180910390f35b6100d56100f6366004611030565b61025b565b34801561010757600080fd5b506100d5670de0b6b3a764000081565b6100d5610125366004611030565b610559565b34801561013657600080fd5b506100d561014536600461105c565b60016020526000908152604090205481565b34801561016357600080fd5b5061017f73fd1353babf86387fcb6d009c7b74c1ab2178b30481565b6040516001600160a01b0390911681526020016100df565b61019f61080f565b005b3480156101ad57600080fd5b506100d56101bc36600461105c565b61084e565b3480156101cd57600080fd5b5061017f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156101f557600080fd5b50604080518082018252600f81526e4846757275636f6d626f46756e647360881b602082015290516100df91906110a5565b34801561023357600080fd5b50610242636139148b60e11b81565b6040516001600160e01b031990911681526020016100df565b60405163cd0ef24d60e01b81526001600160a01b038316600482015260009073fd1353babf86387fcb6d009c7b74c1ab2178b3049063cd0ef24d90602401602060405180830381865afa1580156102b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102da91906110d8565b61031b5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c69642066756e647360981b60448201526064015b60405180910390fd5b60008390506000816001600160a01b0316636c9fa59e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610360573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038491906110fa565b9050610390818561086f565b935061039d81868661092e565b604051630d65a06b60e41b815260048101859052600060248201819052906001600160a01b0384169063d65a06b0906044016020604051808303816000875af192505050801561040a575060408051601f3d908101601f1916820190925261040791810190611117565b60015b6104d157610416611130565b806308c379a01415610464575061042b61119d565b806104365750610466565b61045e6040518060400160405280600681526020016572656465656d60d01b815250826109bb565b506104d4565b505b3d808015610490576040519150601f19603f3d011682016040523d82523d6000602084013e610495565b606091505b50602481015160408051808201909152600681526572656465656d60d01b60208201526104ca906104c583610a1b565b6109bb565b50506104d4565b90505b6104de8287610b21565b6000836001600160a01b0316638bca6d166040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054291906110fa565b905061054d81610c61565b50925050505b92915050565b60405163cd0ef24d60e01b81526001600160a01b038316600482015260009073fd1353babf86387fcb6d009c7b74c1ab2178b3049063cd0ef24d90602401602060405180830381865afa1580156105b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d891906110d8565b6106145760405162461bcd60e51b815260206004820152600d60248201526c696e76616c69642066756e647360981b6044820152606401610312565b60008390506000816001600160a01b0316638bca6d166040518163ffffffff1660e01b8152600401602060405180830381865afa158015610659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067d91906110fa565b9050610689818561086f565b935061069681868661092e565b60405163efef39a160e01b8152600481018590526000906001600160a01b0384169063efef39a1906024016020604051808303816000875af19250505080156106fc575060408051601f3d908101601f191682019092526106f991810190611117565b60015b6107c257610708611130565b806308c379a01415610758575061071d61119d565b80610728575061075a565b61075260405180604001604052806008815260200167707572636861736560c01b815250826109bb565b506107c5565b505b3d808015610784576040519150601f19603f3d011682016040523d82523d6000602084013e610789565b606091505b506024810151604080518082019091526008815267707572636861736560c01b60208201526107bb906104c583610a1b565b50506107c5565b90505b6107cf8287610b21565b6000836001600160a01b0316636c9fa59e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051e573d6000803e3d6000fd5b60405162461bcd60e51b8152602060048201526014602482015273496e76616c696420706f73742070726f6365737360601b6044820152606401610312565b6000818154811061085e57600080fd5b600091825260209091200154905081565b60006000198214610881575080610553565b6001600160a01b03831615806108b357506001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b156108bf575047610553565b6040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa158015610903573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109279190611117565b9392505050565b60405163095ea7b360e01b81526001600160a01b0383811660048301526024820183905284169063095ea7b390604401600060405180830381600087803b15801561097857600080fd5b505af1925050508015610989575060015b6109b6576109a26001600160a01b038416836000610cac565b6109b66001600160a01b0384168383610cac565b505050565b60408051808201909152600f81526e4846757275636f6d626f46756e647360881b602082015282826040516020016109f593929190611227565b60408051601f198184030181529082905262461bcd60e51b8252610312916004016110a5565b606081610a3f5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610a695780610a538161129d565b9150610a629050600a836112ce565b9150610a43565b60008167ffffffffffffffff811115610a8457610a8461114c565b6040519080825280601f01601f191660200182016040528015610aae576020820181803683370190505b5090505b8415610b1957610ac36001836112e2565b9150610ad0600a866112f9565b610adb90603061130d565b60f81b818381518110610af057610af0611325565b60200101906001600160f81b031916908160001a905350610b12600a866112ce565b9450610ab2565b949350505050565b604051636eb1769f60e11b81523060048201526001600160a01b0382811660248301526000919084169063dd62ed3e90604401602060405180830381865afa158015610b71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b959190611117565b1115610c5d5760405163095ea7b360e01b81526001600160a01b0382811660048301526000602483015283169063095ea7b390604401600060405180830381600087803b158015610be557600080fd5b505af1925050508015610bf6575060015b610c5d5760405163095ea7b360e01b81526001600160a01b0382811660048301526001602483015283169063095ea7b390604401600060405180830381600087803b158015610c4457600080fd5b505af1158015610c58573d6000803e3d6000fd5b505050505b5050565b610c6a81610de3565b600080546001810182559080526001600160a01b0382167f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639091015550565b50565b801580610d265750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d249190611117565b155b610d915760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610312565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526109b6908490610e3e565b6001600160a01b0381166110101415610ca95760405162461bcd60e51b815260206004820152601760248201527f4e6f7420737570706f7274206d6174696320746f6b656e0000000000000000006044820152606401610312565b6000610e93826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f109092919063ffffffff16565b8051909150156109b65780806020019051810190610eb191906110d8565b6109b65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610312565b6060610b19848460008585843b610f695760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610312565b600080866001600160a01b03168587604051610f85919061133b565b60006040518083038185875af1925050503d8060008114610fc2576040519150601f19603f3d011682016040523d82523d6000602084013e610fc7565b606091505b5091509150610fd7828286610fe2565b979650505050505050565b60608315610ff1575081610927565b8251156110015782518084602001fd5b8160405162461bcd60e51b815260040161031291906110a5565b6001600160a01b0381168114610ca957600080fd5b6000806040838503121561104357600080fd5b823561104e8161101b565b946020939093013593505050565b60006020828403121561106e57600080fd5b5035919050565b60005b83811015611090578181015183820152602001611078565b8381111561109f576000848401525b50505050565b60208152600082518060208401526110c4816040850160208701611075565b601f01601f19169190910160400192915050565b6000602082840312156110ea57600080fd5b8151801515811461092757600080fd5b60006020828403121561110c57600080fd5b81516109278161101b565b60006020828403121561112957600080fd5b5051919050565b600060033d11156111495760046000803e5060005160e01c5b90565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff8111828210171561119657634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d10156111ab5790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156111db57505050505090565b82850191508151818111156111f35750505050505090565b843d870101602082850101111561120d5750505050505090565b61121c60208286010187611162565b509095945050505050565b60008451611239818460208901611075565b605f60f81b9083019081528451611257816001840160208901611075565b6101d160f51b60019290910191820152835161127a816003840160208801611075565b0160030195945050505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156112b1576112b1611287565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826112dd576112dd6112b8565b500490565b6000828210156112f4576112f4611287565b500390565b600082611308576113086112b8565b500690565b6000821982111561132057611320611287565b500190565b634e487b7160e01b600052603260045260246000fd5b6000825161134d818460208701611075565b919091019291505056fea2646970667358221220d3e6df9fbb68dab99fb796faa2204c4b1d39d69e04121e7c0520f145dcab0e0164736f6c634300080a0033

Deployed Bytecode Sourcemap

28838:2862:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22549:107;;;;;;;;;;-1:-1:-1;22549:107:0;22590:66;22549:107;;;;;160:25:1;;;148:2;133:18;22549:107:0;;;;;;;;30453:1244;;;;;;:::i;:::-;;:::i;19143:49::-;;;;;;;;;;;;19185:7;19143:49;;29209:1236;;;;;;:::i;:::-;;:::i;22437:40::-;;;;;;;;;;-1:-1:-1;22437:40:0;;;;;:::i;:::-;;;;;;;;;;;;;;28952:125;;;;;;;;;;;;29034:42;28952:125;;;;;-1:-1:-1;;;;;1209:32:1;;;1191:51;;1179:2;1164:18;28952:125:0;1019:229:1;23773:479:0;;;:::i;:::-;;22408:22;;;;;;;;;;-1:-1:-1;22408:22:0;;;;;:::i;:::-;;:::i;23569:98::-;;;;;;;;;;;;23625:42;23569:98;;29086:115;;;;;;;;;;-1:-1:-1;29169:24:0;;;;;;;;;;;-1:-1:-1;;;29169:24:0;;;;29086:115;;;;29169:24;29086:115;:::i;19036:51::-;;;;;;;;;;-1:-1:-1;19036:51:0;-1:-1:-1;;;19036:51:0;;;;;-1:-1:-1;;;;;;2459:33:1;;;2441:52;;2429:2;2414:18;19036:51:0;2297:202:1;30453:1244:0;30589:43;;-1:-1:-1;;;30589:43:0;;-1:-1:-1;;;;;1209:32:1;;30589:43:0;;;1191:51:1;30556:7:0;;29034:42;;30589:32;;1164:18:1;;30589:43:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;30581:69;;;;-1:-1:-1;;;30581:69:0;;2988:2:1;30581:69:0;;;2970:21:1;3027:2;3007:18;;;3000:30;-1:-1:-1;;;3046:18:1;;;3039:43;3099:18;;30581:69:0;;;;;;;;;30663:12;30685:9;30663:32;;30706:18;30727:5;-1:-1:-1;;;;;30727:16:0;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;30706:39;;30764:30;30776:10;30788:5;30764:11;:30::i;:::-;30756:38;;30859:43;30873:10;30885:9;30896:5;30859:13;:43::i;:::-;30944:26;;-1:-1:-1;;;30944:26:0;;;;;3552:25:1;;;30915:14:0;3593:18:1;;;3586:50;;;30915:14:0;-1:-1:-1;;;;;30944:12:0;;;;;3525:18:1;;30944:26:0;;;;;;;;;;;;;;;;;;;-1:-1:-1;30944:26:0;;;;;;;;-1:-1:-1;;30944:26:0;;;;;;;;;;;;:::i;:::-;;;30940:578;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;31090:28;;;;;;;;;;;;;;-1:-1:-1;;;31090:28:0;;;31111:6;31090:10;:28::i;:::-;31041:89;30940:578;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31420:12:0;31410:23;;31404:30;31463:43;;;;;;;;;;;;-1:-1:-1;;;31424:4:0;31463:43;;;;;31484:21;31404:30;31484:19;:21::i;:::-;31463:10;:43::i;:::-;31157:361;31131:387;30940:578;;;31021:7;-1:-1:-1;30940:578:0;31530:40;31548:10;31560:9;31530:17;:40::i;:::-;31583:20;31606:5;-1:-1:-1;;;;;31606:18:0;;:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;31583:43;;31637:26;31650:12;31637;:26::i;:::-;-1:-1:-1;31683:6:0;-1:-1:-1;;;30453:1244:0;;;;;:::o;29209:1236::-;29348:43;;-1:-1:-1;;;29348:43:0;;-1:-1:-1;;;;;1209:32:1;;29348:43:0;;;1191:51:1;29315:7:0;;29034:42;;29348:32;;1164:18:1;;29348:43:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;29340:69;;;;-1:-1:-1;;;29340:69:0;;2988:2:1;29340:69:0;;;2970:21:1;3027:2;3007:18;;;3000:30;-1:-1:-1;;;3046:18:1;;;3039:43;3099:18;;29340:69:0;2786:337:1;29340:69:0;29422:12;29444:9;29422:32;;29465:20;29488:5;-1:-1:-1;;;;;29488:18:0;;:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;29465:43;;29528:33;29540:12;29554:6;29528:11;:33::i;:::-;29519:42;;29595:46;29609:12;29623:9;29634:6;29595:13;:46::i;:::-;29688:22;;-1:-1:-1;;;29688:22:0;;;;;160:25:1;;;29654:19:0;;-1:-1:-1;;;;;29688:14:0;;;;;133:18:1;;29688:22:0;;;;;;;;;;;;;;;;;;;-1:-1:-1;29688:22:0;;;;;;;;-1:-1:-1;;29688:22:0;;;;;;;;;;;;:::i;:::-;;;29684:581;;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;29833:30;;;;;;;;;;;;;;-1:-1:-1;;;29833:30:0;;;29856:6;29833:10;:30::i;:::-;29784:91;29684:581;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;30165:12:0;30155:23;;30149:30;30208:45;;;;;;;;;;;;-1:-1:-1;;;30169:4:0;30208:45;;;;;30231:21;30149:30;30231:19;:21::i;30208:45::-;29902:363;29876:389;29684:581;;;29765:6;-1:-1:-1;29684:581:0;30277:42;30295:12;30309:9;30277:17;:42::i;:::-;30332:18;30353:5;-1:-1:-1;;;;;30353:16:0;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23773:479;23832:30;;-1:-1:-1;;;23832:30:0;;5381:2:1;23832:30:0;;;5363:21:1;5420:2;5400:18;;;5393:30;-1:-1:-1;;;5439:18:1;;;5432:50;5499:18;;23832:30:0;5179:344:1;22408:22:0;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22408:22:0;:::o;26102:438::-;26204:7;-1:-1:-1;;26233:6:0;:27;26229:73;;-1:-1:-1;26284:6:0;26277:13;;26229:73;-1:-1:-1;;;;;26339:19:0;;;;:52;;-1:-1:-1;;;;;;26362:29:0;;23625:42;26362:29;26339:52;26335:113;;;-1:-1:-1;26415:21:0;26408:28;;26335:113;26494:38;;-1:-1:-1;;;26494:38:0;;26526:4;26494:38;;;1191:51:1;-1:-1:-1;;;;;26494:23:0;;;;;1164:18:1;;26494:38:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;26487:45;26102:438;-1:-1:-1;;;26102:438:0:o;26548:309::-;26677:42;;-1:-1:-1;;;26677:42:0;;-1:-1:-1;;;;;5720:32:1;;;26677:42:0;;;5702:51:1;5769:18;;;5762:34;;;26677:25:0;;;;;5675:18:1;;26677:42:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26673:177;;26744:37;-1:-1:-1;;;;;26744:25:0;;26770:7;26779:1;26744:25;:37::i;:::-;26796:42;-1:-1:-1;;;;;26796:25:0;;26822:7;26831:6;26796:25;:42::i;:::-;26548:309;;;:::o;24842:390::-;29169:24;;;;;;;;;;;;-1:-1:-1;;;29169:24:0;;;;25111:12;25173:6;25006:192;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;25006:192:0;;;;;;;;;;-1:-1:-1;;;24960:264:0;;;;;;;:::i;16299:723::-;16355:13;16576:10;16572:53;;-1:-1:-1;;16603:10:0;;;;;;;;;;;;-1:-1:-1;;;16603:10:0;;;;;16299:723::o;16572:53::-;16650:5;16635:12;16691:78;16698:9;;16691:78;;16724:8;;;;:::i;:::-;;-1:-1:-1;16747:10:0;;-1:-1:-1;16755:2:0;16747:10;;:::i;:::-;;;16691:78;;;16779:19;16811:6;16801:17;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16801:17:0;;16779:39;;16829:154;16836:10;;16829:154;;16863:11;16873:1;16863:11;;:::i;:::-;;-1:-1:-1;16932:10:0;16940:2;16932:5;:10;:::i;:::-;16919:24;;:2;:24;:::i;:::-;16906:39;;16889:6;16896;16889:14;;;;;;;;:::i;:::-;;;;:56;-1:-1:-1;;;;;16889:56:0;;;;;;;;-1:-1:-1;16960:11:0;16969:2;16960:11;;:::i;:::-;;;16829:154;;;17007:6;16299:723;-1:-1:-1;;;;16299:723:0:o;26865:296::-;26948:51;;-1:-1:-1;;;26948:51:0;;26984:4;26948:51;;;8006:34:1;-1:-1:-1;;;;;8076:15:1;;;8056:18;;;8049:43;27002:1:0;;26948:27;;;;;;7941:18:1;;26948:51:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:55;26944:210;;;27024:37;;-1:-1:-1;;;27024:37:0;;-1:-1:-1;;;;;5720:32:1;;;27024:37:0;;;5702:51:1;27059:1:0;5769:18:1;;;5762:34;27024:25:0;;;;;5675:18:1;;27024:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27020:123;;27090:37;;-1:-1:-1;;;27090:37:0;;-1:-1:-1;;;;;5720:32:1;;;27090:37:0;;;5702:51:1;27125:1:0;5769:18:1;;;5762:34;27090:25:0;;;;;5675:18:1;;27090:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27020:123;26865:296;;:::o;24260:232::-;24317:21;24332:5;24317:14;:21::i;:::-;24349:5;20778:46;;;;;;;;;;-1:-1:-1;;;;;20798:24:0;;20778:46;;;;;24260:232;:::o;24349:23::-;24260:232;:::o;13020:653::-;13384:10;;;13383:62;;-1:-1:-1;13400:39:0;;-1:-1:-1;;;13400:39:0;;13424:4;13400:39;;;8006:34:1;-1:-1:-1;;;;;8076:15:1;;;8056:18;;;8049:43;13400:15:0;;;;;7941:18:1;;13400:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:44;13383:62;13361:166;;;;-1:-1:-1;;;13361:166:0;;8879:2:1;13361:166:0;;;8861:21:1;8918:2;8898:18;;;8891:30;8957:34;8937:18;;;8930:62;-1:-1:-1;;;9008:18:1;;;9001:52;9070:19;;13361:166:0;8677:418:1;13361:166:0;13592:62;;;-1:-1:-1;;;;;5720:32:1;;13592:62:0;;;5702:51:1;5769:18;;;;5762:34;;;13592:62:0;;;;;;;;;;5675:18:1;;;;13592:62:0;;;;;;;;-1:-1:-1;;;;;13592:62:0;-1:-1:-1;;;13592:62:0;;;13538:127;;13572:5;;13538:19;:127::i;27220:128::-;-1:-1:-1;;;;;27292:20:0;;23722:42;27292:20;;27284:56;;;;-1:-1:-1;;;27284:56:0;;9302:2:1;27284:56:0;;;9284:21:1;9341:2;9321:18;;;9314:30;9380:25;9360:18;;;9353:53;9423:18;;27284:56:0;9100:347:1;15177:802:0;15601:23;15627:106;15669:4;15627:106;;;;;;;;;;;;;;;;;15635:5;-1:-1:-1;;;;;15627:27:0;;;:106;;;;;:::i;:::-;15748:17;;15601:132;;-1:-1:-1;15748:21:0;15744:228;;15863:10;15852:30;;;;;;;;;;;;:::i;:::-;15826:134;;;;-1:-1:-1;;;15826:134:0;;9654:2:1;15826:134:0;;;9636:21:1;9693:2;9673:18;;;9666:30;9732:34;9712:18;;;9705:62;-1:-1:-1;;;9783:18:1;;;9776:40;9833:19;;15826:134:0;9452:406:1;6688:229:0;6825:12;6857:52;6879:6;6887:4;6893:1;6896:12;6825;4108:20;;8228:60;;;;-1:-1:-1;;;8228:60:0;;10472:2:1;8228:60:0;;;10454:21:1;10511:2;10491:18;;;10484:30;10550:31;10530:18;;;10523:59;10599:18;;8228:60:0;10270:353:1;8228:60:0;8302:12;8316:23;8343:6;-1:-1:-1;;;;;8343:11:0;8362:5;8383:4;8343:55;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8301:97;;;;8416:51;8433:7;8442:10;8454:12;8416:16;:51::i;:::-;8409:58;7904:571;-1:-1:-1;;;;;;;7904:571:0:o;10864:712::-;11014:12;11043:7;11039:530;;;-1:-1:-1;11074:10:0;11067:17;;11039:530;11188:17;;:21;11184:374;;11386:10;11380:17;11447:15;11434:10;11430:2;11426:19;11419:44;11184:374;11529:12;11522:20;;-1:-1:-1;;;11522:20:0;;;;;;;;:::i;196:131:1:-;-1:-1:-1;;;;;271:31:1;;261:42;;251:70;;317:1;314;307:12;332:315;400:6;408;461:2;449:9;440:7;436:23;432:32;429:52;;;477:1;474;467:12;429:52;516:9;503:23;535:31;560:5;535:31;:::i;:::-;585:5;637:2;622:18;;;;609:32;;-1:-1:-1;;;332:315:1:o;834:180::-;893:6;946:2;934:9;925:7;921:23;917:32;914:52;;;962:1;959;952:12;914:52;-1:-1:-1;985:23:1;;834:180;-1:-1:-1;834:180:1:o;1646:258::-;1718:1;1728:113;1742:6;1739:1;1736:13;1728:113;;;1818:11;;;1812:18;1799:11;;;1792:39;1764:2;1757:10;1728:113;;;1859:6;1856:1;1853:13;1850:48;;;1894:1;1885:6;1880:3;1876:16;1869:27;1850:48;;1646:258;;;:::o;1909:383::-;2058:2;2047:9;2040:21;2021:4;2090:6;2084:13;2133:6;2128:2;2117:9;2113:18;2106:34;2149:66;2208:6;2203:2;2192:9;2188:18;2183:2;2175:6;2171:15;2149:66;:::i;:::-;2276:2;2255:15;-1:-1:-1;;2251:29:1;2236:45;;;;2283:2;2232:54;;1909:383;-1:-1:-1;;1909:383:1:o;2504:277::-;2571:6;2624:2;2612:9;2603:7;2599:23;2595:32;2592:52;;;2640:1;2637;2630:12;2592:52;2672:9;2666:16;2725:5;2718:13;2711:21;2704:5;2701:32;2691:60;;2747:1;2744;2737:12;3128:251;3198:6;3251:2;3239:9;3230:7;3226:23;3222:32;3219:52;;;3267:1;3264;3257:12;3219:52;3299:9;3293:16;3318:31;3343:5;3318:31;:::i;3647:184::-;3717:6;3770:2;3758:9;3749:7;3745:23;3741:32;3738:52;;;3786:1;3783;3776:12;3738:52;-1:-1:-1;3809:16:1;;3647:184;-1:-1:-1;3647:184:1:o;3836:179::-;3871:3;3913:1;3895:16;3892:23;3889:120;;;3959:1;3956;3953;3938:23;-1:-1:-1;3996:1:1;3990:8;3985:3;3981:18;3889:120;3836:179;:::o;4020:127::-;4081:10;4076:3;4072:20;4069:1;4062:31;4112:4;4109:1;4102:15;4136:4;4133:1;4126:15;4152:346;4262:2;4243:13;;-1:-1:-1;;4239:27:1;4227:40;;4297:18;4282:34;;4318:22;;;4279:62;4276:185;;;4383:10;4378:3;4374:20;4371:1;4364:31;4418:4;4415:1;4408:15;4446:4;4443:1;4436:15;4276:185;4477:2;4470:22;-1:-1:-1;;4152:346:1:o;4503:671::-;4542:3;4584:4;4566:16;4563:26;4560:39;;;4503:671;:::o;4560:39::-;4626:2;4620:9;-1:-1:-1;;4691:16:1;4687:25;;4684:1;4620:9;4663:50;4742:4;4736:11;4766:16;4801:18;4872:2;4865:4;4857:6;4853:17;4850:25;4845:2;4837:6;4834:14;4831:45;4828:58;;;4879:5;;;;;4503:671;:::o;4828:58::-;4916:6;4910:4;4906:17;4895:28;;4952:3;4946:10;4979:2;4971:6;4968:14;4965:27;;;4985:5;;;;;;4503:671;:::o;4965:27::-;5069:2;5050:16;5044:4;5040:27;5036:36;5029:4;5020:6;5015:3;5011:16;5007:27;5004:69;5001:82;;;5076:5;;;;;;4503:671;:::o;5001:82::-;5092:57;5143:4;5134:6;5126;5122:19;5118:30;5112:4;5092:57;:::i;:::-;-1:-1:-1;5165:3:1;;4503:671;-1:-1:-1;;;;;4503:671:1:o;5807:941::-;6236:3;6274:6;6268:13;6290:53;6336:6;6331:3;6324:4;6316:6;6312:17;6290:53;:::i;:::-;-1:-1:-1;;;6365:16:1;;;6390:18;;;6433:13;;6455:65;6433:13;6507:1;6496:13;;6489:4;6477:17;;6455:65;:::i;:::-;-1:-1:-1;;;6583:1:1;6539:20;;;;6575:10;;;6568:24;6617:13;;6639:62;6617:13;6688:1;6680:10;;6673:4;6661:17;;6639:62;:::i;:::-;6721:17;6740:1;6717:25;;5807:941;-1:-1:-1;;;;;5807:941:1:o;6753:127::-;6814:10;6809:3;6805:20;6802:1;6795:31;6845:4;6842:1;6835:15;6869:4;6866:1;6859:15;6885:135;6924:3;-1:-1:-1;;6945:17:1;;6942:43;;;6965:18;;:::i;:::-;-1:-1:-1;7012:1:1;7001:13;;6885:135::o;7025:127::-;7086:10;7081:3;7077:20;7074:1;7067:31;7117:4;7114:1;7107:15;7141:4;7138:1;7131:15;7157:120;7197:1;7223;7213:35;;7228:18;;:::i;:::-;-1:-1:-1;7262:9:1;;7157:120::o;7282:125::-;7322:4;7350:1;7347;7344:8;7341:34;;;7355:18;;:::i;:::-;-1:-1:-1;7392:9:1;;7282:125::o;7412:112::-;7444:1;7470;7460:35;;7475:18;;:::i;:::-;-1:-1:-1;7509:9:1;;7412:112::o;7529:128::-;7569:3;7600:1;7596:6;7593:1;7590:13;7587:39;;;7606:18;;:::i;:::-;-1:-1:-1;7642:9:1;;7529:128::o;7662:127::-;7723:10;7718:3;7714:20;7711:1;7704:31;7754:4;7751:1;7744:15;7778:4;7775:1;7768:15;10628:274;10757:3;10795:6;10789:13;10811:53;10857:6;10852:3;10845:4;10837:6;10833:17;10811:53;:::i;:::-;10880:16;;;;;10628:274;-1:-1:-1;;10628:274:1:o

Swarm Source

ipfs://d3e6df9fbb68dab99fb796faa2204c4b1d39d69e04121e7c0520f145dcab0e01

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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