ETH Price: $1,975.94 (+0.10%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0xd03f55df38c641cfd81f02a331ba517e897e6766ee19c31cb22a2c80438357f1 Batch Exec(pending)2026-02-22 9:38:0233 mins ago1771753082IN
Furucombo: Proxy V2.0.0
0 ETH(Pending)(Pending)
Batch Exec237091872025-11-02 4:15:23112 days ago1762056923IN
Furucombo: Proxy V2.0.0
0.0000001 ETH0.000001850.05175465
Batch Exec234145442025-09-21 22:57:23153 days ago1758495443IN
Furucombo: Proxy V2.0.0
0 ETH0.000005280.1
Transfer233646062025-09-14 23:28:35160 days ago1757892515IN
Furucombo: Proxy V2.0.0
0.00000016 ETH0.000004190.19963086
Batch Exec233646062025-09-14 23:28:35160 days ago1757892515IN
Furucombo: Proxy V2.0.0
0 ETH0.000008290.1
Batch Exec206510582024-08-31 20:52:11539 days ago1725137531IN
Furucombo: Proxy V2.0.0
0 ETH0.000022830.55
Batch Exec206510582024-08-31 20:52:11539 days ago1725137531IN
Furucombo: Proxy V2.0.0
0 ETH0.000022610.55
Batch Exec204534682024-08-04 6:42:59567 days ago1722753779IN
Furucombo: Proxy V2.0.0
0 ETH0.000042741
Batch Exec204534272024-08-04 6:34:47567 days ago1722753287IN
Furucombo: Proxy V2.0.0
0 ETH0.000053881
Batch Exec204534272024-08-04 6:34:47567 days ago1722753287IN
Furucombo: Proxy V2.0.0
0 ETH0.000041571
Batch Exec204533972024-08-04 6:28:47567 days ago1722752927IN
Furucombo: Proxy V2.0.0
0 ETH0.000043041.00071368
Batch Exec204533972024-08-04 6:28:47567 days ago1722752927IN
Furucombo: Proxy V2.0.0
0 ETH0.000042610.99081368
Batch Exec204025122024-07-28 3:59:11574 days ago1722139151IN
Furucombo: Proxy V2.0.0
0.0008016 ETH0.000037731
Batch Exec203958762024-07-27 5:45:23575 days ago1722059123IN
Furucombo: Proxy V2.0.0
0 ETH0.000041371
Batch Exec202005672024-06-29 23:16:59602 days ago1719703019IN
Furucombo: Proxy V2.0.0
0 ETH0.000063691.21
Batch Exec201010682024-06-16 1:28:35616 days ago1718501315IN
Furucombo: Proxy V2.0.0
0 ETH0.000106582.2
Batch Exec198997822024-05-18 22:22:47644 days ago1716070967IN
Furucombo: Proxy V2.0.0
0 ETH0.003200673.12868438
Batch Exec198997652024-05-18 22:19:23644 days ago1716070763IN
Furucombo: Proxy V2.0.0
0 ETH0.003933562.81276392
Batch Exec198816222024-05-16 9:24:23647 days ago1715851463IN
Furucombo: Proxy V2.0.0
0 ETH0.00798054.66584894
Batch Exec198661352024-05-14 5:22:23649 days ago1715664143IN
Furucombo: Proxy V2.0.0
0 ETH0.006291885.84676968
Batch Exec198494222024-05-11 21:17:47651 days ago1715462267IN
Furucombo: Proxy V2.0.0
0 ETH0.00033
Batch Exec198467052024-05-11 12:11:35651 days ago1715429495IN
Furucombo: Proxy V2.0.0
0 ETH0.013622395.5259354
Batch Exec198441162024-05-11 3:30:11652 days ago1715398211IN
Furucombo: Proxy V2.0.0
0 ETH0.000276944
Batch Exec198414832024-05-10 18:39:35652 days ago1715366375IN
Furucombo: Proxy V2.0.0
0 ETH0.00735799.87175581
Batch Exec198375902024-05-10 5:36:47653 days ago1715319407IN
Furucombo: Proxy V2.0.0
0 ETH0.005642634.91679382
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer198467052024-05-11 12:11:35651 days ago1715429495
Furucombo: Proxy V2.0.0
0.00000222 ETH
Submit198467052024-05-11 12:11:35651 days ago1715429495
Furucombo: Proxy V2.0.0
0.14266 ETH
Transfer198467052024-05-11 12:11:35651 days ago1715429495
Furucombo: Proxy V2.0.0
0.0478544 ETH
Transfer198467052024-05-11 12:11:35651 days ago1715429495
Furucombo: Proxy V2.0.0
0.09480781 ETH
Transfer198303662024-05-09 5:21:47654 days ago1715232107
Furucombo: Proxy V2.0.0
0.03518332 ETH
Transfer198303662024-05-09 5:21:47654 days ago1715232107
Furucombo: Proxy V2.0.0
0.03518332 ETH
Transfer198253862024-05-08 12:37:11654 days ago1715171831
Furucombo: Proxy V2.0.0
0.04938256 ETH
Transfer198253862024-05-08 12:37:11654 days ago1715171831
Furucombo: Proxy V2.0.0
0.01226772 ETH
Transfer198253862024-05-08 12:37:11654 days ago1715171831
Furucombo: Proxy V2.0.0
0.01107615 ETH
Transfer198253862024-05-08 12:37:11654 days ago1715171831
Furucombo: Proxy V2.0.0
0.02603869 ETH
Transfer198018722024-05-05 5:41:23658 days ago1714887683
Furucombo: Proxy V2.0.0
1 wei
Transfer198018722024-05-05 5:41:23658 days ago1714887683
Furucombo: Proxy V2.0.0
0.00010032 ETH
Transfer198018722024-05-05 5:41:23658 days ago1714887683
Furucombo: Proxy V2.0.0
0.0000002 ETH
Transfer197740072024-05-01 8:12:11662 days ago1714551131
Furucombo: Proxy V2.0.0
0.33589873 ETH
Transfer197740072024-05-01 8:12:11662 days ago1714551131
Furucombo: Proxy V2.0.0
0.33589873 ETH
Transfer197661742024-04-30 5:55:47663 days ago1714456547
Furucombo: Proxy V2.0.0
0.15251024 ETH
Transfer197661742024-04-30 5:55:47663 days ago1714456547
Furucombo: Proxy V2.0.0
0.11498288 ETH
Transfer197661742024-04-30 5:55:47663 days ago1714456547
Furucombo: Proxy V2.0.0
0.03752735 ETH
Transfer197616222024-04-29 14:40:35663 days ago1714401635
Furucombo: Proxy V2.0.0
0.101293 ETH
Transfer197616222024-04-29 14:40:35663 days ago1714401635
Furucombo: Proxy V2.0.0
0.101293 ETH
Exact Input Sing...197616222024-04-29 14:40:35663 days ago1714401635
Furucombo: Proxy V2.0.0
0.1 ETH
Transfer197616222024-04-29 14:40:35663 days ago1714401635
Furucombo: Proxy V2.0.0
0.0002004 ETH
Transfer197573662024-04-29 0:23:35664 days ago1714350215
Furucombo: Proxy V2.0.0
0.025 ETH
Transfer197573662024-04-29 0:23:35664 days ago1714350215
Furucombo: Proxy V2.0.0
0.0000501 ETH
Transfer197172732024-04-23 9:43:35670 days ago1713865415
Furucombo: Proxy V2.0.0
0.01811772 ETH
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Proxy

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./interface/IProxy.sol";
import "./interface/IRegistry.sol";
import "./interface/IFeeRuleRegistry.sol";
import "./Config.sol";
import "./Storage.sol";
import "./lib/LibParam.sol";
import "./lib/LibFeeStorage.sol";

/**
 * @title The entrance of Furucombo
 * @author Ben Huang
 */
contract Proxy is IProxy, Storage, Config {
    using Address for address;
    using SafeERC20 for IERC20;
    using LibParam for bytes32;
    using LibStack for bytes32[];
    using Strings for uint256;
    using LibFeeStorage for mapping(bytes32 => bytes32);

    event LogBegin(
        address indexed handler,
        bytes4 indexed selector,
        bytes payload
    );
    event LogEnd(
        address indexed handler,
        bytes4 indexed selector,
        bytes result
    );
    event ChargeFee(address indexed tokenIn, uint256 feeAmount);

    modifier isNotBanned() {
        require(registry.bannedAgents(address(this)) == 0, "Banned");
        _;
    }

    modifier isNotHalted() {
        require(registry.fHalt() == false, "Halted");
        _;
    }

    address private constant NATIVE_TOKEN =
        0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
    IRegistry public immutable registry;
    IFeeRuleRegistry public immutable feeRuleRegistry;

    constructor(address registry_, address feeRuleRegistry_) {
        registry = IRegistry(registry_);
        feeRuleRegistry = IFeeRuleRegistry(feeRuleRegistry_);
    }

    /**
     * @notice Direct transfer from EOA should be reverted.
     * @dev Callback function will be handled here.
     */
    fallback() external payable isNotHalted isNotBanned isInitialized {
        // If triggered by a function call, caller should be registered in
        // registry.
        // The function call will then be forwarded to the location registered
        // in registry.
        require(_isValidCaller(msg.sender), "Invalid caller");

        address target = address(bytes20(registry.callers(msg.sender)));
        bytes memory result = _exec(target, msg.data, type(uint256).max);

        // return result for aave v2 flashloan()
        uint256 size = result.length;
        assembly {
            let loc := add(result, 0x20)
            return(loc, size)
        }
    }

    /**
     * @notice Direct transfer from EOA should be reverted.
     */
    receive() external payable {
        require(Address.isContract(msg.sender), "Not allowed from EOA");
    }

    /**
     * @notice Combo execution function. Including three phases: pre-process,
     * exection and post-process.
     * @param tos The handlers of combo.
     * @param configs The configurations of executing cubes.
     * @param datas The combo datas.
     * @param ruleIndexes The indexes of rules.
     */
    function batchExec(
        address[] calldata tos,
        bytes32[] calldata configs,
        bytes[] memory datas,
        uint256[] calldata ruleIndexes
    ) external payable override isNotHalted isNotBanned {
        _preProcess(ruleIndexes);
        _execs(tos, configs, datas);
        _postProcess();
    }

    /**
     * @notice The execution interface for callback function to be executed.
     * @dev This function can only be called through the handler, which makes
     * the caller become proxy itself.
     */
    function execs(
        address[] calldata tos,
        bytes32[] calldata configs,
        bytes[] memory datas
    ) external payable override isNotHalted isNotBanned isInitialized {
        require(msg.sender == address(this), "Does not allow external calls");
        _execs(tos, configs, datas);
    }

    /**
     * @notice The execution phase.
     * @param tos The handlers of combo.
     * @param configs The configurations of executing cubes.
     * @param datas The combo datas.
     */
    function _execs(
        address[] memory tos,
        bytes32[] memory configs,
        bytes[] memory datas
    ) internal {
        bytes32[256] memory localStack;
        uint256 index;
        uint256 counter;

        require(
            tos.length == datas.length,
            "Tos and datas length inconsistent"
        );
        require(
            tos.length == configs.length,
            "Tos and configs length inconsistent"
        );
        for (uint256 i = 0; i < tos.length; i++) {
            address to = tos[i];
            bytes32 config = configs[i];
            bytes memory data = datas[i];
            // Check if the data contains dynamic parameter
            if (!config.isStatic()) {
                // If so, trim the exectution data base on the configuration and stack content
                _trim(data, config, localStack, index);
            }
            // Emit the execution log before call
            bytes4 selector = _getSelector(data);
            emit LogBegin(to, selector, data);

            // Check if the output will be referenced afterwards
            bytes memory result = _exec(to, data, counter);
            counter++;

            // Emit the execution log after call
            emit LogEnd(to, selector, result);

            if (config.isReferenced()) {
                // If so, parse the output and place it into local stack
                uint256 num = config.getReturnNum();
                uint256 newIndex = _parse(localStack, result, index);
                require(
                    newIndex == index + num,
                    "Return num and parsed return num not matched"
                );
                index = newIndex;
            }

            // Setup the process to be triggered in the post-process phase
            _setPostProcess(to);
        }
    }

    /**
     * @notice Trimming the execution data.
     * @param data The execution data.
     * @param config The configuration.
     * @param localStack The stack the be referenced.
     * @param index Current element count of localStack.
     */
    function _trim(
        bytes memory data,
        bytes32 config,
        bytes32[256] memory localStack,
        uint256 index
    ) internal pure {
        // Fetch the parameter configuration from config
        (uint256[] memory refs, uint256[] memory params) = config.getParams();
        // Trim the data with the reference and parameters
        for (uint256 i = 0; i < refs.length; i++) {
            require(refs[i] < index, "Reference to out of localStack");
            bytes32 ref = localStack[refs[i]];
            uint256 offset = params[i];
            uint256 base = PERCENTAGE_BASE;
            assembly {
                let loc := add(add(data, 0x20), offset)
                let m := mload(loc)
                // Adjust the value by multiplier if a dynamic parameter is not zero
                if iszero(iszero(m)) {
                    // Assert no overflow first
                    let p := mul(m, ref)
                    if iszero(eq(div(p, m), ref)) {
                        revert(0, 0)
                    } // require(p / m == ref)
                    ref := div(p, base)
                }
                mstore(loc, ref)
            }
        }
    }

    /**
     * @notice Parse the return data to the local stack.
     * @param localStack The local stack to place the return values.
     * @param ret The return data.
     * @param index The current tail.
     */
    function _parse(
        bytes32[256] memory localStack,
        bytes memory ret,
        uint256 index
    ) internal pure returns (uint256 newIndex) {
        uint256 len = ret.length;
        // The return value should be multiple of 32-bytes to be parsed.
        require(len % 32 == 0, "illegal length for _parse");
        // Estimate the tail after the process.
        newIndex = index + len / 32;
        require(newIndex <= 256, "stack overflow");
        assembly {
            let offset := shl(5, index)
            // Store the data into localStack
            for {
                let i := 0
            } lt(i, len) {
                i := add(i, 0x20)
            } {
                mstore(
                    add(localStack, add(i, offset)),
                    mload(add(add(ret, i), 0x20))
                )
            }
        }
    }

    /**
     * @notice The execution of a single cube.
     * @param to_ The handler of cube.
     * @param data_ The cube execution data.
     * @param counter_ The current counter of the cube.
     */
    function _exec(
        address to_,
        bytes memory data_,
        uint256 counter_
    ) internal returns (bytes memory result) {
        require(_isValidHandler(to_), "Invalid handler");
        bool success;
        assembly {
            success := delegatecall(
                sub(gas(), 5000),
                to_,
                add(data_, 0x20),
                mload(data_),
                0,
                0
            )
            let size := returndatasize()

            result := mload(0x40)
            mstore(
                0x40,
                add(result, and(add(add(size, 0x20), 0x1f), not(0x1f)))
            )
            mstore(result, size)
            returndatacopy(add(result, 0x20), 0, size)
        }

        if (!success) {
            if (result.length < 68) revert("_exec");
            assembly {
                result := add(result, 0x04)
            }

            if (counter_ == type(uint256).max) {
                revert(abi.decode(result, (string))); // Don't prepend counter
            } else {
                revert(
                    string(
                        abi.encodePacked(
                            counter_.toString(),
                            "_",
                            abi.decode(result, (string))
                        )
                    )
                );
            }
        }
    }

    /**
     * @notice Setup the post-process.
     * @param to_ The handler of post-process.
     */
    function _setPostProcess(address to_) internal {
        // If the stack length equals 0, just skip
        // If the top is a custom post-process, replace it with the handler
        // address.
        if (stack.length == 0) {
            return;
        } else if (
            stack.peek() == bytes32(bytes12(uint96(HandlerType.Custom))) &&
            bytes4(stack.peek(1)) != 0x00000000
        ) {
            stack.pop();
            stack.setAddress(to_);
            stack.setHandlerType(HandlerType.Custom);
        }
    }

    /// @notice The pre-process phase.
    function _preProcess(uint256[] memory ruleIndexes_)
        internal
        virtual
        isStackEmpty
    {
        // Set the sender.
        _setSender();
        // Set the fee collector
        cache._setFeeCollector(feeRuleRegistry.feeCollector());

        // Calculate fee
        uint256 feeRate =
            feeRuleRegistry.calFeeRateMulti(_getSender(), ruleIndexes_);
        require(feeRate <= PERCENTAGE_BASE, "fee rate out of range");
        cache._setFeeRate(feeRate);
        if (msg.value > 0 && feeRate > 0) {
            // Process ether fee
            uint256 feeEth = _calFee(msg.value, feeRate);

            // It will fail if fee collector is gnosis contract, because .transfer() will only consume 2300 gas limit.
            // Replacing .transfer() with .call('') to avoid out of gas
            address collector = cache._getFeeCollector();
            (bool success, ) = collector.call{value: feeEth}("");
            require(success, "Send fee to collector failed");
            emit ChargeFee(NATIVE_TOKEN, feeEth);
        }
    }

    /// @notice The post-process phase.
    function _postProcess() internal {
        // Handler type will be parsed at the beginning. Will send the token back to
        // user if the handler type is "Token". Will get the handler address and
        // execute the customized post-process if handler type is "Custom".
        while (stack.length > 0) {
            bytes32 top = stack.get();
            // Get handler type
            HandlerType handlerType = HandlerType(uint96(bytes12(top)));
            if (handlerType == HandlerType.Token) {
                address addr = address(uint160(uint256(top)));
                uint256 tokenAmount = IERC20(addr).balanceOf(address(this));
                if (tokenAmount > 0)
                    IERC20(addr).safeTransfer(msg.sender, tokenAmount);
            } else if (handlerType == HandlerType.Custom) {
                address addr = stack.getAddress();
                _exec(
                    addr,
                    abi.encodeWithSelector(POSTPROCESS_SIG),
                    type(uint256).max
                );
            } else {
                revert("Invalid handler type");
            }
        }

        // Balance should also be returned to user
        uint256 amount = address(this).balance;
        if (amount > 0) payable(msg.sender).transfer(amount);
        // Reset cached datas
        cache._resetFeeCollector();
        cache._resetFeeRate();
        _resetSender();
    }

    /// @notice Check if the handler is valid in registry.
    function _isValidHandler(address handler) internal view returns (bool) {
        return registry.isValidHandler(handler);
    }

    /// @notice Check if the caller is valid in registry.
    function _isValidCaller(address caller) internal view returns (bool) {
        return registry.isValidCaller(caller);
    }

    /// @notice Get payload function selector.
    function _getSelector(bytes memory payload)
        internal
        pure
        returns (bytes4 selector)
    {
        selector =
            payload[0] |
            (bytes4(payload[1]) >> 8) |
            (bytes4(payload[2]) >> 16) |
            (bytes4(payload[3]) >> 24);
    }

    function _calFee(uint256 amount, uint256 feeRate)
        internal
        pure
        returns (uint256)
    {
        return (amount * feeRate) / PERCENTAGE_BASE;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IProxy {
    function batchExec(address[] calldata tos, bytes32[] calldata configs, bytes[] memory datas, uint256[] calldata ruleIndexes) external payable;
    function execs(address[] calldata tos, bytes32[] calldata configs, bytes[] memory datas) external payable;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IRegistry {
    function handlers(address) external view returns (bytes32);
    function callers(address) external view returns (bytes32);
    function bannedAgents(address) external view returns (uint256);
    function fHalt() external view returns (bool);
    function isValidHandler(address handler) external view returns (bool);
    function isValidCaller(address handler) external view returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IFeeRuleRegistry {
    /* State Variables Getter */
    function rules(uint256) external view returns (address);
    function counter() external view returns (uint256);
    function basisFeeRate() external view returns (uint256);
    function feeCollector() external view returns (address);
    function BASE() external view returns (uint256);

    /* Restricted Functions */
    function setBasisFeeRate(uint256) external;
    function setFeeCollector(address) external;
    function registerRule(address rule) external;
    function unregisterRule(uint256 ruleIndex) external;

    /* View Functions */
    function calFeeRateMulti(address usr, uint256[] calldata ruleIndexes) external view returns (uint256 scaledRate);
    function calFeeRate(address usr, uint256 ruleIndex) external view returns (uint256 scaledRate);
    function calFeeRateMultiWithoutBasis(address usr, uint256[] calldata ruleIndexes) external view returns (uint256 scaledRate);
    function calFeeRateWithoutBasis(address usr, uint256 ruleIndex) external view returns (uint256 scaledRate);
}

File 8 of 15 : Config.sol
// SPDX-License-Identifier: MIT

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}
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./lib/LibCache.sol";
import "./lib/LibStack.sol";

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library LibParam {
    bytes32 private constant STATIC_MASK =
        0x0100000000000000000000000000000000000000000000000000000000000000;
    bytes32 private constant PARAMS_MASK =
        0x0000000000000000000000000000000000000000000000000000000000000001;
    bytes32 private constant REFS_MASK =
        0x00000000000000000000000000000000000000000000000000000000000000FF;
    bytes32 private constant RETURN_NUM_MASK =
        0x00FF000000000000000000000000000000000000000000000000000000000000;

    uint256 private constant REFS_LIMIT = 22;
    uint256 private constant PARAMS_SIZE_LIMIT = 64;
    uint256 private constant RETURN_NUM_OFFSET = 240;

    function isStatic(bytes32 conf) internal pure returns (bool) {
        if (conf & STATIC_MASK == 0) return true;
        else return false;
    }

    function isReferenced(bytes32 conf) internal pure returns (bool) {
        if (getReturnNum(conf) == 0) return false;
        else return true;
    }

    function getReturnNum(bytes32 conf) internal pure returns (uint256 num) {
        bytes32 temp = (conf & RETURN_NUM_MASK) >> RETURN_NUM_OFFSET;
        num = uint256(temp);
    }

    function getParams(bytes32 conf)
        internal
        pure
        returns (uint256[] memory refs, uint256[] memory params)
    {
        require(!isStatic(conf), "Static params");
        uint256 n = REFS_LIMIT;
        while (conf & REFS_MASK == REFS_MASK && n > 0) {
            n--;
            conf = conf >> 8;
        }
        require(n > 0, "No dynamic param");
        refs = new uint256[](n);
        params = new uint256[](n);
        for (uint256 i = 0; i < n; i++) {
            refs[i] = uint256(conf & REFS_MASK);
            conf = conf >> 8;
        }
        uint256 locCount = 0;
        for (uint256 k = 0; k < PARAMS_SIZE_LIMIT; k++) {
            if (conf & PARAMS_MASK != 0) {
                require(locCount < n, "Location count exceeds ref count");
                params[locCount] = k * 32 + 4;
                locCount++;
            }
            conf = conf >> 1;
        }
        require(locCount == n, "Location count less than ref count");
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./LibCache.sol";
import "../Storage.sol";

library LibFeeStorage {
    using LibCache for mapping(bytes32 => bytes32);

    // keccak256 hash of "furucombo.fee.rate"
    // prettier-ignore
    bytes32 public constant FEE_RATE_KEY = 0x142183525227cae0e4300fd0fc77d7f3b08ceb0fd9cb2a6c5488668fa0ea5ffa;

    // keccak256 hash of "furucombo.fee.collector"
    // prettier-ignore
    bytes32 public constant FEE_COLLECTOR_KEY = 0x60d7a7cc0a45d852bd613e4f527aaa2e4b81fff918a69a2aab88b6458751d614;

    function _setFeeRate(
        mapping(bytes32 => bytes32) storage _cache,
        uint256 _feeRate
    ) internal {
        require(_getFeeRate(_cache) == 0, "Fee rate not zero");
        _cache.setUint256(FEE_RATE_KEY, _feeRate);
    }

    function _resetFeeRate(mapping(bytes32 => bytes32) storage _cache)
        internal
    {
        _cache.setUint256(FEE_RATE_KEY, 0);
    }

    function _getFeeRate(mapping(bytes32 => bytes32) storage _cache)
        internal
        view
        returns (uint256)
    {
        return _cache.getUint256(FEE_RATE_KEY);
    }

    function _setFeeCollector(
        mapping(bytes32 => bytes32) storage _cache,
        address _collector
    ) internal {
        require(
            _getFeeCollector(_cache) == address(0),
            "Fee collector is initialized"
        );
        _cache.setAddress(FEE_COLLECTOR_KEY, _collector);
    }

    function _resetFeeCollector(mapping(bytes32 => bytes32) storage _cache)
        internal
    {
        _cache.setAddress(FEE_COLLECTOR_KEY, address(0));
    }

    function _getFeeCollector(mapping(bytes32 => bytes32) storage _cache)
        internal
        view
        returns (address)
    {
        return _cache.getAddress(FEE_COLLECTOR_KEY);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../Config.sol";

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"registry_","type":"address"},{"internalType":"address","name":"feeRuleRegistry_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"ChargeFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"handler","type":"address"},{"indexed":true,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"bytes","name":"payload","type":"bytes"}],"name":"LogBegin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"handler","type":"address"},{"indexed":true,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"bytes","name":"result","type":"bytes"}],"name":"LogEnd","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"MSG_SENDER_KEY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"address[]","name":"tos","type":"address[]"},{"internalType":"bytes32[]","name":"configs","type":"bytes32[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"},{"internalType":"uint256[]","name":"ruleIndexes","type":"uint256[]"}],"name":"batchExec","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"cache","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"bytes32[]","name":"configs","type":"bytes32[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"}],"name":"execs","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feeRuleRegistry","outputs":[{"internalType":"contract IFeeRuleRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stack","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040523480156200001157600080fd5b506040516200298938038062002989833981016040819052620000349162000069565b6001600160a01b039182166080521660a052620000a1565b80516001600160a01b03811681146200006457600080fd5b919050565b600080604083850312156200007d57600080fd5b62000088836200004c565b915062000098602084016200004c565b90509250929050565b60805160a051612876620001136000396000818161040001528181610d760152610e0201526000818160dd0152818161018f015281816102da0152818161045f0152818161057c01528181610749015281816107fb01528181610949015281816109fb0152610bf001526128766000f3fe60806040526004361061008a5760003560e01c80637b103999116100595780637b1039991461044d57806387c139431461048157806399eb59b91461049d578063dc9031c4146104ca578063fa2901a5146104ea576100db565b80630f532d18146103a657806341f188e1146103db578063678987bb146103ee578063719385091461043a576100db565b366100db57333b6100d95760405162461bcd60e51b81526020600482015260146024820152734e6f7420616c6c6f7765642066726f6d20454f4160601b60448201526064015b60405180910390fd5b005b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ea750af66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015d91906121c8565b1561017a5760405162461bcd60e51b81526004016100d0906121ea565b604051630c81ee5560e11b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631903dcaa90602401602060405180830381865afa1580156101de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610202919061220a565b1561021f5760405162461bcd60e51b81526004016100d090612223565b600061022961051e565b6001600160a01b0316141561027c5760405162461bcd60e51b815260206004820152601960248201527814d95b99195c881a5cc81b9bdd081a5b9a5d1a585b1a5e9959603a1b60448201526064016100d0565b6102853361055a565b6102c25760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21031b0b63632b960911b60448201526064016100d0565b604051637bbf4a3f60e01b81523360048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637bbf4a3f90602401602060405180830381865afa158015610329573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034d919061220a565b60601c90506000610399826000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060001992506105f0915050565b8051909150602082018181f35b3480156103b257600080fd5b506103c860008051602061282183398151915281565b6040519081526020015b60405180910390f35b6100d96103e93660046123e1565b610747565b3480156103fa57600080fd5b506104227f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016103d2565b6100d96104483660046124a0565b610947565b34801561045957600080fd5b506104227f000000000000000000000000000000000000000000000000000000000000000081565b34801561048d57600080fd5b506103c8670de0b6b3a764000081565b3480156104a957600080fd5b506103c86104b8366004612534565b60016020526000908152604090205481565b3480156104d657600080fd5b506103c86104e5366004612534565b610bad565b3480156104f657600080fd5b50610505636139148b60e11b81565b6040516001600160e01b031990911681526020016103d2565b60008051602061282183398151915260005260016020527fe066822ceb6294079ebca45035319f95ccb12306128dbdf5a257f0d1235733c95490565b60405163bb1010e960e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063bb1010e9906024015b602060405180830381865afa1580156105c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ea91906121c8565b92915050565b60606105fb84610bce565b6106395760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b2103430b7323632b960891b60448201526064016100d0565b6000806000855160208701886113885a03f490503d6040519250601f19601f6020830101168301604052808352806000602085013e508061073f576044825110156106ae5760405162461bcd60e51b81526020600482015260056024820152645f6578656360d81b60448201526064016100d0565b6004820191506000198314156106eb57818060200190518101906106d2919061257d565b60405162461bcd60e51b81526004016100d09190612620565b6106f483610c21565b82806020019051810190610708919061257d565b604051602001610719929190612633565b60408051601f198184030181529082905262461bcd60e51b82526100d091600401612620565b509392505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ea750af66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c991906121c8565b156107e65760405162461bcd60e51b81526004016100d0906121ea565b604051630c81ee5560e11b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631903dcaa90602401602060405180830381865afa15801561084a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086e919061220a565b1561088b5760405162461bcd60e51b81526004016100d090612223565b6108c7828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610d2792505050565b61093687878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250611018915050565b61093e6112d2565b50505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ea750af66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c991906121c8565b156109e65760405162461bcd60e51b81526004016100d0906121ea565b604051630c81ee5560e11b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631903dcaa90602401602060405180830381865afa158015610a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6e919061220a565b15610a8b5760405162461bcd60e51b81526004016100d090612223565b6000610a9561051e565b6001600160a01b03161415610ae85760405162461bcd60e51b815260206004820152601960248201527814d95b99195c881a5cc81b9bdd081a5b9a5d1a585b1a5e9959603a1b60448201526064016100d0565b333014610b375760405162461bcd60e51b815260206004820152601d60248201527f446f6573206e6f7420616c6c6f772065787465726e616c2063616c6c7300000060448201526064016100d0565b610ba685858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250869250611018915050565b5050505050565b60008181548110610bbd57600080fd5b600091825260209091200154905081565b604051631a98d06960e31b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063d4c68348906024016105a9565b606081610c455750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610c6f5780610c5981612685565b9150610c689050600a836126b6565b9150610c49565b60008167ffffffffffffffff811115610c8a57610c8a61228f565b6040519080825280601f01601f191660200182016040528015610cb4576020820181803683370190505b5090505b8415610d1f57610cc96001836126ca565b9150610cd6600a866126e1565b610ce19060306126f5565b60f81b818381518110610cf657610cf661270d565b60200101906001600160f81b031916908160001a905350610d18600a866126b6565b9450610cb8565b949350505050565b60005415610d695760405162461bcd60e51b815260206004820152600f60248201526e537461636b206e6f7420656d70747960881b60448201526064016100d0565b610d7161150e565b610dfe7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c415b95c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df69190612723565b6001906115a2565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637c4e1d1b610e3761051e565b846040518363ffffffff1660e01b8152600401610e5592919061274c565b602060405180830381865afa158015610e72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e96919061220a565b9050670de0b6b3a7640000811115610ee85760405162461bcd60e51b81526020600482015260156024820152746665652072617465206f7574206f662072616e676560581b60448201526064016100d0565b610ef3600182611642565b600034118015610f035750600081115b15611014576000610f1434836116c0565b90506000610f2260016116e6565b90506000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114610f71576040519150601f19603f3d011682016040523d82523d6000602084013e610f76565b606091505b5050905080610fc75760405162461bcd60e51b815260206004820152601c60248201527f53656e642066656520746f20636f6c6c6563746f72206661696c65640000000060448201526064016100d0565b60405183815273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee907ff842076a30ec58e71f31f5ded044f2790b403c5a75bdbfddea03130ee65e1a589060200160405180910390a25050505b5050565b6110206121a8565b600080835186511461107e5760405162461bcd60e51b815260206004820152602160248201527f546f7320616e64206461746173206c656e67746820696e636f6e73697374656e6044820152601d60fa1b60648201526084016100d0565b84518651146110db5760405162461bcd60e51b815260206004820152602360248201527f546f7320616e6420636f6e66696773206c656e67746820696e636f6e73697374604482015262195b9d60ea1b60648201526084016100d0565b60005b865181101561093e5760008782815181106110fb576110fb61270d565b6020026020010151905060008783815181106111195761111961270d565b6020026020010151905060008784815181106111375761113761270d565b6020026020010151905061114a8261171b565b61115a5761115a81838989611738565b60006111658261185b565b9050806001600160e01b031916846001600160a01b03167f1e4e60ae3aeb9909ff5e6502e86867f181eadfa0c215186eaf47665909d71eb1846040516111ab9190612620565b60405180910390a360006111c08584896105f0565b9050866111cc81612685565b975050816001600160e01b031916856001600160a01b03167fc4c643b243548ed55ba2a304003e28a0a82c202984eb15e1d80d811e02dec47f836040516112139190612620565b60405180910390a36112248461190c565b156112b15760ff60f085901c16600061123e8b848c61192a565b905061124a828b6126f5565b81146112ad5760405162461bcd60e51b815260206004820152602c60248201527f52657475726e206e756d20616e64207061727365642072657475726e206e756d60448201526b081b9bdd081b585d18da195960a21b60648201526084016100d0565b9850505b6112ba85611a0e565b505050505080806112ca90612685565b9150506110de565b600054156114525760006112e66000611a94565b9050600060a082901c6002811115611300576113006127a2565b90506000816002811115611316576113166127a2565b14156113ac576040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611365573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611389919061220a565b905080156113a5576113a56001600160a01b0383163383611acc565b505061144b565b60018160028111156113c0576113c06127a2565b141561140c5760006113d26000611b23565b6040805160048152602481019091526020810180516001600160e01b0316636139148b60e11b1790529091506113a59082906000196105f0565b60405162461bcd60e51b8152602060048201526014602482015273496e76616c69642068616e646c6572207479706560601b60448201526064016100d0565b50506112d2565b47801561148857604051339082156108fc029083906000818181858888f19350505050158015611486573d6000803e3d6000fd5b505b600160205260007fe3c27e9998c410cbc1bc99c043b2159f2223d768316452dd163c810fbf33d3938190557fb23c0bd6127fbb5e90a415ffb571bd6e4dfe0f2731ea5882703d050f6a0a0c9981905560008051602061282183398151915281527fe066822ceb6294079ebca45035319f95ccb12306128dbdf5a257f0d1235733c9555b50565b600061151861051e565b6001600160a01b0316146115665760405162461bcd60e51b815260206004820152601560248201527414d95b99195c881a5cc81a5b9a5d1a585b1a5e9959605a1b60448201526064016100d0565b6000805160206128218339815191526000526001602052337fe066822ceb6294079ebca45035319f95ccb12306128dbdf5a257f0d1235733c955565b60006115ad836116e6565b6001600160a01b0316146116035760405162461bcd60e51b815260206004820152601c60248201527f46656520636f6c6c6563746f7220697320696e697469616c697a65640000000060448201526064016100d0565b7f60d7a7cc0a45d852bd613e4f527aaa2e4b81fff918a69a2aab88b6458751d61460009081526020839052604090206001600160a01b03821690555050565b61164b82611b43565b1561168c5760405162461bcd60e51b81526020600482015260116024820152704665652072617465206e6f74207a65726f60781b60448201526064016100d0565b7f142183525227cae0e4300fd0fc77d7f3b08ceb0fd9cb2a6c5488668fa0ea5ffa6000908152602092909252604090912055565b6000670de0b6b3a76400006116d583856127b8565b6116df91906126b6565b9392505050565b7f60d7a7cc0a45d852bd613e4f527aaa2e4b81fff918a69a2aab88b6458751d6146000908152602082905260408120546105ea565b6000600160f81b821661173057506001919050565b506000919050565b60008061174485611b78565b9150915060005b825181101561093e57838382815181106117675761176761270d565b6020026020010151106117bc5760405162461bcd60e51b815260206004820152601e60248201527f5265666572656e636520746f206f7574206f66206c6f63616c537461636b000060448201526064016100d0565b6000858483815181106117d1576117d161270d565b602002602001015161010081106117ea576117ea61270d565b6020020151905060008383815181106118055761180561270d565b602002602001015190506000670de0b6b3a764000090508160208b01018051801561184157848102858282041461183b57600080fd5b83900494505b50929092525081905061185381612685565b91505061174b565b60006018826003815181106118725761187261270d565b016020015183516001600160f81b031990911690911c906010908490600290811061189f5761189f61270d565b016020015184516001600160f81b031990911690911c90600890859060019081106118cc576118cc61270d565b016020015185516001600160f81b031990911690911c9085906000906118f4576118f461270d565b01602001516001600160f81b03191617171792915050565b600060f082901c60ff1661192257506000919050565b506001919050565b815160009061193a6020826126e1565b156119875760405162461bcd60e51b815260206004820152601960248201527f696c6c6567616c206c656e67746820666f72205f70617273650000000000000060448201526064016100d0565b6119926020826126b6565b61199c90846126f5565b91506101008211156119e15760405162461bcd60e51b815260206004820152600e60248201526d737461636b206f766572666c6f7760901b60448201526064016100d0565b8260051b60005b82811015611a04576020818701810151838301890152016119e8565b5050509392505050565b600054611a185750565b600160a01b611a276000611e2b565b148015611a485750611a3b60006001611e9a565b6001600160e01b03191615155b1561150b576000805480611a5e57611a5e6127d7565b60019003818190600052602060002001600090559055611a88816000611f6490919063ffffffff16565b61150b60006001611f86565b6000611a9f82611e2b565b905081805480611ab157611ab16127d7565b60019003818190600052602060002001600090559055919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611b1e908490611fc2565b505050565b6000611b2e82611e2b565b60001c905081805480611ab157611ab16127d7565b7f142183525227cae0e4300fd0fc77d7f3b08ceb0fd9cb2a6c5488668fa0ea5ffa6000908152602082905260408120546105ea565b606080611b848361171b565b15611bc15760405162461bcd60e51b815260206004820152600d60248201526c53746174696320706172616d7360981b60448201526064016100d0565b60165b60ff848116148015611bd65750600081115b15611bf45780611be5816127ed565b915050600884901c9350611bc4565b60008111611c375760405162461bcd60e51b815260206004820152601060248201526f4e6f2064796e616d696320706172616d60801b60448201526064016100d0565b8067ffffffffffffffff811115611c5057611c5061228f565b604051908082528060200260200182016040528015611c79578160200160208202803683370190505b5092508067ffffffffffffffff811115611c9557611c9561228f565b604051908082528060200260200182016040528015611cbe578160200160208202803683370190505b50915060005b81811015611d0957835160ff861690859083908110611ce557611ce561270d565b602090810291909101015260089490941c9380611d0181612685565b915050611cc4565b506000805b6040811015611dc9576001861615611db057828210611d6f5760405162461bcd60e51b815260206004820181905260248201527f4c6f636174696f6e20636f756e7420657863656564732072656620636f756e7460448201526064016100d0565b611d7a8160206127b8565b611d859060046126f5565b848381518110611d9757611d9761270d565b602090810291909101015281611dac81612685565b9250505b60019590951c9480611dc181612685565b915050611d0e565b50818114611e245760405162461bcd60e51b815260206004820152602260248201527f4c6f636174696f6e20636f756e74206c657373207468616e2072656620636f756044820152611b9d60f21b60648201526084016100d0565b5050915091565b805460009080611e6b5760405162461bcd60e51b815260206004820152600b60248201526a737461636b20656d70747960a81b60448201526064016100d0565b82611e776001836126ca565b81548110611e8757611e8761270d565b9060005260206000200154915050919050565b815460009080611eda5760405162461bcd60e51b815260206004820152600b60248201526a737461636b20656d70747960a81b60448201526064016100d0565b828111611f295760405162461bcd60e51b815260206004820152601c60248201527f6e6f7420656e6f75676820656c656d656e747320696e20737461636b0000000060448201526064016100d0565b836001611f3685846126ca565b611f4091906126ca565b81548110611f5057611f5061270d565b906000526020600020015491505092915050565b8154600181018355600092835260209092206001600160a01b03909116910155565b81816002811115611f9957611f996127a2565b81546001810183556000928352602090922060a09190911b6001600160a01b0319169101555050565b6000612017826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120949092919063ffffffff16565b805190915015611b1e578080602001905181019061203591906121c8565b611b1e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016100d0565b6060610d1f8484600085856001600160a01b0385163b6120f65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100d0565b600080866001600160a01b031685876040516121129190612804565b60006040518083038185875af1925050503d806000811461214f576040519150601f19603f3d011682016040523d82523d6000602084013e612154565b606091505b509150915061216482828661216f565b979650505050505050565b6060831561217e5750816116df565b82511561218e5782518084602001fd5b8160405162461bcd60e51b81526004016100d09190612620565b604051806120000160405280610100906020820280368337509192915050565b6000602082840312156121da57600080fd5b815180151581146116df57600080fd5b60208082526006908201526512185b1d195960d21b604082015260600190565b60006020828403121561221c57600080fd5b5051919050565b60208082526006908201526510985b9b995960d21b604082015260600190565b60008083601f84011261225557600080fd5b50813567ffffffffffffffff81111561226d57600080fd5b6020830191508360208260051b850101111561228857600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156122ce576122ce61228f565b604052919050565b600067ffffffffffffffff8211156122f0576122f061228f565b50601f01601f191660200190565b600082601f83011261230f57600080fd5b8135602067ffffffffffffffff8083111561232c5761232c61228f565b8260051b61233b8382016122a5565b938452858101830193838101908886111561235557600080fd5b84880192505b858310156123d5578235848111156123735760008081fd5b8801603f81018a136123855760008081fd5b85810135604061239c612397836122d6565b6122a5565b8281528c828486010111156123b15760008081fd5b828285018a830137600092810189019290925250835250918401919084019061235b565b98975050505050505050565b60008060008060008060006080888a0312156123fc57600080fd5b873567ffffffffffffffff8082111561241457600080fd5b6124208b838c01612243565b909950975060208a013591508082111561243957600080fd5b6124458b838c01612243565b909750955060408a013591508082111561245e57600080fd5b61246a8b838c016122fe565b945060608a013591508082111561248057600080fd5b5061248d8a828b01612243565b989b979a50959850939692959293505050565b6000806000806000606086880312156124b857600080fd5b853567ffffffffffffffff808211156124d057600080fd5b6124dc89838a01612243565b909750955060208801359150808211156124f557600080fd5b61250189838a01612243565b9095509350604088013591508082111561251a57600080fd5b50612527888289016122fe565b9150509295509295909350565b60006020828403121561254657600080fd5b5035919050565b60005b83811015612568578181015183820152602001612550565b83811115612577576000848401525b50505050565b60006020828403121561258f57600080fd5b815167ffffffffffffffff8111156125a657600080fd5b8201601f810184136125b757600080fd5b80516125c5612397826122d6565b8181528560208385010111156125da57600080fd5b6125eb82602083016020860161254d565b95945050505050565b6000815180845261260c81602086016020860161254d565b601f01601f19169290920160200192915050565b6020815260006116df60208301846125f4565b6000835161264581846020880161254d565b605f60f81b908301908152835161266381600184016020880161254d565b01600101949350505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156126995761269961266f565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826126c5576126c56126a0565b500490565b6000828210156126dc576126dc61266f565b500390565b6000826126f0576126f06126a0565b500690565b600082198211156127085761270861266f565b500190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561273557600080fd5b81516001600160a01b03811681146116df57600080fd5b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b8181101561279557845183529383019391830191600101612779565b5090979650505050505050565b634e487b7160e01b600052602160045260246000fd5b60008160001904831182151516156127d2576127d261266f565b500290565b634e487b7160e01b600052603160045260246000fd5b6000816127fc576127fc61266f565b506000190190565b6000825161281681846020870161254d565b919091019291505056feb2f2618cecbbb6e7468cc0f2aa43858ad8d153e0280b22285e28e853bb9d453aa26469706673582212202dd3b04dbf4c682023490d4a18d6c3480cbfd368bfc98026423c45aa41b90c0e64736f6c634300080a003300000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6910000000000000000000000005be4b07ed69a4904cfe1a6d6b3e000fe070bdfcb

Deployed Bytecode

0x60806040526004361061008a5760003560e01c80637b103999116100595780637b1039991461044d57806387c139431461048157806399eb59b91461049d578063dc9031c4146104ca578063fa2901a5146104ea576100db565b80630f532d18146103a657806341f188e1146103db578063678987bb146103ee578063719385091461043a576100db565b366100db57333b6100d95760405162461bcd60e51b81526020600482015260146024820152734e6f7420616c6c6f7765642066726f6d20454f4160601b60448201526064015b60405180910390fd5b005b7f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6916001600160a01b031663ea750af66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015d91906121c8565b1561017a5760405162461bcd60e51b81526004016100d0906121ea565b604051630c81ee5560e11b81523060048201527f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6916001600160a01b031690631903dcaa90602401602060405180830381865afa1580156101de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610202919061220a565b1561021f5760405162461bcd60e51b81526004016100d090612223565b600061022961051e565b6001600160a01b0316141561027c5760405162461bcd60e51b815260206004820152601960248201527814d95b99195c881a5cc81b9bdd081a5b9a5d1a585b1a5e9959603a1b60448201526064016100d0565b6102853361055a565b6102c25760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21031b0b63632b960911b60448201526064016100d0565b604051637bbf4a3f60e01b81523360048201526000907f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6916001600160a01b031690637bbf4a3f90602401602060405180830381865afa158015610329573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034d919061220a565b60601c90506000610399826000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060001992506105f0915050565b8051909150602082018181f35b3480156103b257600080fd5b506103c860008051602061282183398151915281565b6040519081526020015b60405180910390f35b6100d96103e93660046123e1565b610747565b3480156103fa57600080fd5b506104227f0000000000000000000000005be4b07ed69a4904cfe1a6d6b3e000fe070bdfcb81565b6040516001600160a01b0390911681526020016103d2565b6100d96104483660046124a0565b610947565b34801561045957600080fd5b506104227f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e69181565b34801561048d57600080fd5b506103c8670de0b6b3a764000081565b3480156104a957600080fd5b506103c86104b8366004612534565b60016020526000908152604090205481565b3480156104d657600080fd5b506103c86104e5366004612534565b610bad565b3480156104f657600080fd5b50610505636139148b60e11b81565b6040516001600160e01b031990911681526020016103d2565b60008051602061282183398151915260005260016020527fe066822ceb6294079ebca45035319f95ccb12306128dbdf5a257f0d1235733c95490565b60405163bb1010e960e01b81526001600160a01b0382811660048301526000917f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6919091169063bb1010e9906024015b602060405180830381865afa1580156105c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ea91906121c8565b92915050565b60606105fb84610bce565b6106395760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b2103430b7323632b960891b60448201526064016100d0565b6000806000855160208701886113885a03f490503d6040519250601f19601f6020830101168301604052808352806000602085013e508061073f576044825110156106ae5760405162461bcd60e51b81526020600482015260056024820152645f6578656360d81b60448201526064016100d0565b6004820191506000198314156106eb57818060200190518101906106d2919061257d565b60405162461bcd60e51b81526004016100d09190612620565b6106f483610c21565b82806020019051810190610708919061257d565b604051602001610719929190612633565b60408051601f198184030181529082905262461bcd60e51b82526100d091600401612620565b509392505050565b7f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6916001600160a01b031663ea750af66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c991906121c8565b156107e65760405162461bcd60e51b81526004016100d0906121ea565b604051630c81ee5560e11b81523060048201527f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6916001600160a01b031690631903dcaa90602401602060405180830381865afa15801561084a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086e919061220a565b1561088b5760405162461bcd60e51b81526004016100d090612223565b6108c7828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610d2792505050565b61093687878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250889250611018915050565b61093e6112d2565b50505050505050565b7f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6916001600160a01b031663ea750af66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c991906121c8565b156109e65760405162461bcd60e51b81526004016100d0906121ea565b604051630c81ee5560e11b81523060048201527f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6916001600160a01b031690631903dcaa90602401602060405180830381865afa158015610a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6e919061220a565b15610a8b5760405162461bcd60e51b81526004016100d090612223565b6000610a9561051e565b6001600160a01b03161415610ae85760405162461bcd60e51b815260206004820152601960248201527814d95b99195c881a5cc81b9bdd081a5b9a5d1a585b1a5e9959603a1b60448201526064016100d0565b333014610b375760405162461bcd60e51b815260206004820152601d60248201527f446f6573206e6f7420616c6c6f772065787465726e616c2063616c6c7300000060448201526064016100d0565b610ba685858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250869250611018915050565b5050505050565b60008181548110610bbd57600080fd5b600091825260209091200154905081565b604051631a98d06960e31b81526001600160a01b0382811660048301526000917f00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6919091169063d4c68348906024016105a9565b606081610c455750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610c6f5780610c5981612685565b9150610c689050600a836126b6565b9150610c49565b60008167ffffffffffffffff811115610c8a57610c8a61228f565b6040519080825280601f01601f191660200182016040528015610cb4576020820181803683370190505b5090505b8415610d1f57610cc96001836126ca565b9150610cd6600a866126e1565b610ce19060306126f5565b60f81b818381518110610cf657610cf661270d565b60200101906001600160f81b031916908160001a905350610d18600a866126b6565b9450610cb8565b949350505050565b60005415610d695760405162461bcd60e51b815260206004820152600f60248201526e537461636b206e6f7420656d70747960881b60448201526064016100d0565b610d7161150e565b610dfe7f0000000000000000000000005be4b07ed69a4904cfe1a6d6b3e000fe070bdfcb6001600160a01b031663c415b95c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df69190612723565b6001906115a2565b60007f0000000000000000000000005be4b07ed69a4904cfe1a6d6b3e000fe070bdfcb6001600160a01b0316637c4e1d1b610e3761051e565b846040518363ffffffff1660e01b8152600401610e5592919061274c565b602060405180830381865afa158015610e72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e96919061220a565b9050670de0b6b3a7640000811115610ee85760405162461bcd60e51b81526020600482015260156024820152746665652072617465206f7574206f662072616e676560581b60448201526064016100d0565b610ef3600182611642565b600034118015610f035750600081115b15611014576000610f1434836116c0565b90506000610f2260016116e6565b90506000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114610f71576040519150601f19603f3d011682016040523d82523d6000602084013e610f76565b606091505b5050905080610fc75760405162461bcd60e51b815260206004820152601c60248201527f53656e642066656520746f20636f6c6c6563746f72206661696c65640000000060448201526064016100d0565b60405183815273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee907ff842076a30ec58e71f31f5ded044f2790b403c5a75bdbfddea03130ee65e1a589060200160405180910390a25050505b5050565b6110206121a8565b600080835186511461107e5760405162461bcd60e51b815260206004820152602160248201527f546f7320616e64206461746173206c656e67746820696e636f6e73697374656e6044820152601d60fa1b60648201526084016100d0565b84518651146110db5760405162461bcd60e51b815260206004820152602360248201527f546f7320616e6420636f6e66696773206c656e67746820696e636f6e73697374604482015262195b9d60ea1b60648201526084016100d0565b60005b865181101561093e5760008782815181106110fb576110fb61270d565b6020026020010151905060008783815181106111195761111961270d565b6020026020010151905060008784815181106111375761113761270d565b6020026020010151905061114a8261171b565b61115a5761115a81838989611738565b60006111658261185b565b9050806001600160e01b031916846001600160a01b03167f1e4e60ae3aeb9909ff5e6502e86867f181eadfa0c215186eaf47665909d71eb1846040516111ab9190612620565b60405180910390a360006111c08584896105f0565b9050866111cc81612685565b975050816001600160e01b031916856001600160a01b03167fc4c643b243548ed55ba2a304003e28a0a82c202984eb15e1d80d811e02dec47f836040516112139190612620565b60405180910390a36112248461190c565b156112b15760ff60f085901c16600061123e8b848c61192a565b905061124a828b6126f5565b81146112ad5760405162461bcd60e51b815260206004820152602c60248201527f52657475726e206e756d20616e64207061727365642072657475726e206e756d60448201526b081b9bdd081b585d18da195960a21b60648201526084016100d0565b9850505b6112ba85611a0e565b505050505080806112ca90612685565b9150506110de565b600054156114525760006112e66000611a94565b9050600060a082901c6002811115611300576113006127a2565b90506000816002811115611316576113166127a2565b14156113ac576040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611365573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611389919061220a565b905080156113a5576113a56001600160a01b0383163383611acc565b505061144b565b60018160028111156113c0576113c06127a2565b141561140c5760006113d26000611b23565b6040805160048152602481019091526020810180516001600160e01b0316636139148b60e11b1790529091506113a59082906000196105f0565b60405162461bcd60e51b8152602060048201526014602482015273496e76616c69642068616e646c6572207479706560601b60448201526064016100d0565b50506112d2565b47801561148857604051339082156108fc029083906000818181858888f19350505050158015611486573d6000803e3d6000fd5b505b600160205260007fe3c27e9998c410cbc1bc99c043b2159f2223d768316452dd163c810fbf33d3938190557fb23c0bd6127fbb5e90a415ffb571bd6e4dfe0f2731ea5882703d050f6a0a0c9981905560008051602061282183398151915281527fe066822ceb6294079ebca45035319f95ccb12306128dbdf5a257f0d1235733c9555b50565b600061151861051e565b6001600160a01b0316146115665760405162461bcd60e51b815260206004820152601560248201527414d95b99195c881a5cc81a5b9a5d1a585b1a5e9959605a1b60448201526064016100d0565b6000805160206128218339815191526000526001602052337fe066822ceb6294079ebca45035319f95ccb12306128dbdf5a257f0d1235733c955565b60006115ad836116e6565b6001600160a01b0316146116035760405162461bcd60e51b815260206004820152601c60248201527f46656520636f6c6c6563746f7220697320696e697469616c697a65640000000060448201526064016100d0565b7f60d7a7cc0a45d852bd613e4f527aaa2e4b81fff918a69a2aab88b6458751d61460009081526020839052604090206001600160a01b03821690555050565b61164b82611b43565b1561168c5760405162461bcd60e51b81526020600482015260116024820152704665652072617465206e6f74207a65726f60781b60448201526064016100d0565b7f142183525227cae0e4300fd0fc77d7f3b08ceb0fd9cb2a6c5488668fa0ea5ffa6000908152602092909252604090912055565b6000670de0b6b3a76400006116d583856127b8565b6116df91906126b6565b9392505050565b7f60d7a7cc0a45d852bd613e4f527aaa2e4b81fff918a69a2aab88b6458751d6146000908152602082905260408120546105ea565b6000600160f81b821661173057506001919050565b506000919050565b60008061174485611b78565b9150915060005b825181101561093e57838382815181106117675761176761270d565b6020026020010151106117bc5760405162461bcd60e51b815260206004820152601e60248201527f5265666572656e636520746f206f7574206f66206c6f63616c537461636b000060448201526064016100d0565b6000858483815181106117d1576117d161270d565b602002602001015161010081106117ea576117ea61270d565b6020020151905060008383815181106118055761180561270d565b602002602001015190506000670de0b6b3a764000090508160208b01018051801561184157848102858282041461183b57600080fd5b83900494505b50929092525081905061185381612685565b91505061174b565b60006018826003815181106118725761187261270d565b016020015183516001600160f81b031990911690911c906010908490600290811061189f5761189f61270d565b016020015184516001600160f81b031990911690911c90600890859060019081106118cc576118cc61270d565b016020015185516001600160f81b031990911690911c9085906000906118f4576118f461270d565b01602001516001600160f81b03191617171792915050565b600060f082901c60ff1661192257506000919050565b506001919050565b815160009061193a6020826126e1565b156119875760405162461bcd60e51b815260206004820152601960248201527f696c6c6567616c206c656e67746820666f72205f70617273650000000000000060448201526064016100d0565b6119926020826126b6565b61199c90846126f5565b91506101008211156119e15760405162461bcd60e51b815260206004820152600e60248201526d737461636b206f766572666c6f7760901b60448201526064016100d0565b8260051b60005b82811015611a04576020818701810151838301890152016119e8565b5050509392505050565b600054611a185750565b600160a01b611a276000611e2b565b148015611a485750611a3b60006001611e9a565b6001600160e01b03191615155b1561150b576000805480611a5e57611a5e6127d7565b60019003818190600052602060002001600090559055611a88816000611f6490919063ffffffff16565b61150b60006001611f86565b6000611a9f82611e2b565b905081805480611ab157611ab16127d7565b60019003818190600052602060002001600090559055919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611b1e908490611fc2565b505050565b6000611b2e82611e2b565b60001c905081805480611ab157611ab16127d7565b7f142183525227cae0e4300fd0fc77d7f3b08ceb0fd9cb2a6c5488668fa0ea5ffa6000908152602082905260408120546105ea565b606080611b848361171b565b15611bc15760405162461bcd60e51b815260206004820152600d60248201526c53746174696320706172616d7360981b60448201526064016100d0565b60165b60ff848116148015611bd65750600081115b15611bf45780611be5816127ed565b915050600884901c9350611bc4565b60008111611c375760405162461bcd60e51b815260206004820152601060248201526f4e6f2064796e616d696320706172616d60801b60448201526064016100d0565b8067ffffffffffffffff811115611c5057611c5061228f565b604051908082528060200260200182016040528015611c79578160200160208202803683370190505b5092508067ffffffffffffffff811115611c9557611c9561228f565b604051908082528060200260200182016040528015611cbe578160200160208202803683370190505b50915060005b81811015611d0957835160ff861690859083908110611ce557611ce561270d565b602090810291909101015260089490941c9380611d0181612685565b915050611cc4565b506000805b6040811015611dc9576001861615611db057828210611d6f5760405162461bcd60e51b815260206004820181905260248201527f4c6f636174696f6e20636f756e7420657863656564732072656620636f756e7460448201526064016100d0565b611d7a8160206127b8565b611d859060046126f5565b848381518110611d9757611d9761270d565b602090810291909101015281611dac81612685565b9250505b60019590951c9480611dc181612685565b915050611d0e565b50818114611e245760405162461bcd60e51b815260206004820152602260248201527f4c6f636174696f6e20636f756e74206c657373207468616e2072656620636f756044820152611b9d60f21b60648201526084016100d0565b5050915091565b805460009080611e6b5760405162461bcd60e51b815260206004820152600b60248201526a737461636b20656d70747960a81b60448201526064016100d0565b82611e776001836126ca565b81548110611e8757611e8761270d565b9060005260206000200154915050919050565b815460009080611eda5760405162461bcd60e51b815260206004820152600b60248201526a737461636b20656d70747960a81b60448201526064016100d0565b828111611f295760405162461bcd60e51b815260206004820152601c60248201527f6e6f7420656e6f75676820656c656d656e747320696e20737461636b0000000060448201526064016100d0565b836001611f3685846126ca565b611f4091906126ca565b81548110611f5057611f5061270d565b906000526020600020015491505092915050565b8154600181018355600092835260209092206001600160a01b03909116910155565b81816002811115611f9957611f996127a2565b81546001810183556000928352602090922060a09190911b6001600160a01b0319169101555050565b6000612017826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120949092919063ffffffff16565b805190915015611b1e578080602001905181019061203591906121c8565b611b1e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016100d0565b6060610d1f8484600085856001600160a01b0385163b6120f65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100d0565b600080866001600160a01b031685876040516121129190612804565b60006040518083038185875af1925050503d806000811461214f576040519150601f19603f3d011682016040523d82523d6000602084013e612154565b606091505b509150915061216482828661216f565b979650505050505050565b6060831561217e5750816116df565b82511561218e5782518084602001fd5b8160405162461bcd60e51b81526004016100d09190612620565b604051806120000160405280610100906020820280368337509192915050565b6000602082840312156121da57600080fd5b815180151581146116df57600080fd5b60208082526006908201526512185b1d195960d21b604082015260600190565b60006020828403121561221c57600080fd5b5051919050565b60208082526006908201526510985b9b995960d21b604082015260600190565b60008083601f84011261225557600080fd5b50813567ffffffffffffffff81111561226d57600080fd5b6020830191508360208260051b850101111561228857600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156122ce576122ce61228f565b604052919050565b600067ffffffffffffffff8211156122f0576122f061228f565b50601f01601f191660200190565b600082601f83011261230f57600080fd5b8135602067ffffffffffffffff8083111561232c5761232c61228f565b8260051b61233b8382016122a5565b938452858101830193838101908886111561235557600080fd5b84880192505b858310156123d5578235848111156123735760008081fd5b8801603f81018a136123855760008081fd5b85810135604061239c612397836122d6565b6122a5565b8281528c828486010111156123b15760008081fd5b828285018a830137600092810189019290925250835250918401919084019061235b565b98975050505050505050565b60008060008060008060006080888a0312156123fc57600080fd5b873567ffffffffffffffff8082111561241457600080fd5b6124208b838c01612243565b909950975060208a013591508082111561243957600080fd5b6124458b838c01612243565b909750955060408a013591508082111561245e57600080fd5b61246a8b838c016122fe565b945060608a013591508082111561248057600080fd5b5061248d8a828b01612243565b989b979a50959850939692959293505050565b6000806000806000606086880312156124b857600080fd5b853567ffffffffffffffff808211156124d057600080fd5b6124dc89838a01612243565b909750955060208801359150808211156124f557600080fd5b61250189838a01612243565b9095509350604088013591508082111561251a57600080fd5b50612527888289016122fe565b9150509295509295909350565b60006020828403121561254657600080fd5b5035919050565b60005b83811015612568578181015183820152602001612550565b83811115612577576000848401525b50505050565b60006020828403121561258f57600080fd5b815167ffffffffffffffff8111156125a657600080fd5b8201601f810184136125b757600080fd5b80516125c5612397826122d6565b8181528560208385010111156125da57600080fd5b6125eb82602083016020860161254d565b95945050505050565b6000815180845261260c81602086016020860161254d565b601f01601f19169290920160200192915050565b6020815260006116df60208301846125f4565b6000835161264581846020880161254d565b605f60f81b908301908152835161266381600184016020880161254d565b01600101949350505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156126995761269961266f565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826126c5576126c56126a0565b500490565b6000828210156126dc576126dc61266f565b500390565b6000826126f0576126f06126a0565b500690565b600082198211156127085761270861266f565b500190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561273557600080fd5b81516001600160a01b03811681146116df57600080fd5b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b8181101561279557845183529383019391830191600101612779565b5090979650505050505050565b634e487b7160e01b600052602160045260246000fd5b60008160001904831182151516156127d2576127d261266f565b500290565b634e487b7160e01b600052603160045260246000fd5b6000816127fc576127fc61266f565b506000190190565b6000825161281681846020870161254d565b919091019291505056feb2f2618cecbbb6e7468cc0f2aa43858ad8d153e0280b22285e28e853bb9d453aa26469706673582212202dd3b04dbf4c682023490d4a18d6c3480cbfd368bfc98026423c45aa41b90c0e64736f6c634300080a0033

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

00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e6910000000000000000000000005be4b07ed69a4904cfe1a6d6b3e000fe070bdfcb

-----Decoded View---------------
Arg [0] : registry_ (address): 0x84Faf5b559f58d651E51300C5a7D078cb964E691
Arg [1] : feeRuleRegistry_ (address): 0x5be4B07ED69A4904CFe1a6D6B3e000fe070bdfcb

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000084faf5b559f58d651e51300c5a7d078cb964e691
Arg [1] : 0000000000000000000000005be4b07ed69a4904cfe1a6d6b3e000fe070bdfcb


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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