ETH Price: $2,931.43 (-0.92%)

Contract

0x00C11D18871c93B375Dae1B781Da0949282f566E
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Transfer To294547732026-01-06 17:09:2118 days ago1767719361IN
0x00C11D18...9282f566E
0.000005 ETH0.000006240.001
Set Controller F...294464192026-01-06 12:30:5318 days ago1767702653IN
0x00C11D18...9282f566E
0 ETH0.000002520.00000025
Set Controllers294464172026-01-06 12:30:4918 days ago1767702649IN
0x00C11D18...9282f566E
0 ETH0.00000120.00000025
Transfer To W Pe...288157172025-12-22 22:07:2933 days ago1766441249IN
0x00C11D18...9282f566E
0.000005 ETH0.00000050.00100028
Transfer To W Pe...284126222025-12-13 14:10:5942 days ago1765635059IN
0x00C11D18...9282f566E
0.000005 ETH0.000000490.001
Transfer To W Pe...278848662025-12-01 8:59:0755 days ago1764579547IN
0x00C11D18...9282f566E
0.000005 ETH00.00000045
Transfer To W Pe...276186582025-11-25 5:05:3161 days ago1764047131IN
0x00C11D18...9282f566E
0.000005 ETH0.000000220.00060354
Set Controller F...275991712025-11-24 18:15:5761 days ago1764008157IN
0x00C11D18...9282f566E
0 ETH00.0000048
Set Controllers275991682025-11-24 18:15:5161 days ago1764008151IN
0x00C11D18...9282f566E
0 ETH00.00000481
Transfer To W Pe...275349752025-11-23 6:36:0563 days ago1763879765IN
0x00C11D18...9282f566E
0.000005 ETH00.00000391
Transfer To W Pe...274058892025-11-20 6:53:1366 days ago1763621593IN
0x00C11D18...9282f566E
0.000005 ETH0.000000010.00002122
Transfer To W Pe...273749772025-11-19 13:42:4966 days ago1763559769IN
0x00C11D18...9282f566E
0.000005 ETH00.00000068
Transfer To W Pe...273351822025-11-18 15:36:1967 days ago1763480179IN
0x00C11D18...9282f566E
0.000005 ETH00.00000072
Transfer To W Pe...272305212025-11-16 5:27:3770 days ago1763270857IN
0x00C11D18...9282f566E
0.000005 ETH00.00000081
Transfer To W Pe...271087002025-11-13 9:46:5573 days ago1763027215IN
0x00C11D18...9282f566E
0.000005 ETH0.000000240.00064368
Transfer To W Pe...268036962025-11-06 8:20:0780 days ago1762417207IN
0x00C11D18...9282f566E
0.000005 ETH00.00000043
Transfer To W Pe...268020052025-11-06 7:23:4580 days ago1762413825IN
0x00C11D18...9282f566E
0.000005 ETH00.00000041
Transfer To W Pe...266011782025-11-01 15:49:3184 days ago1762012171IN
0x00C11D18...9282f566E
0.000005 ETH00.00000042
Transfer To W Pe...265872612025-11-01 8:05:3785 days ago1761984337IN
0x00C11D18...9282f566E
0.000005 ETH00.00000041
Transfer To W Pe...265767902025-11-01 2:16:3585 days ago1761963395IN
0x00C11D18...9282f566E
0.000005 ETH00.00000043
Transfer To W Pe...265438432025-10-31 7:58:2186 days ago1761897501IN
0x00C11D18...9282f566E
0.000005 ETH00.00000061
Transfer To W Pe...265375402025-10-31 4:28:1586 days ago1761884895IN
0x00C11D18...9282f566E
0.000005 ETH00.00000047
Set Controller F...260718912025-10-20 9:46:3797 days ago1760953597IN
0x00C11D18...9282f566E
0 ETH0.000000730.00100037
Set Controller F...260718892025-10-20 9:46:3397 days ago1760953593IN
0x00C11D18...9282f566E
0 ETH00.00000038
Set Fee Rate252956602025-10-02 10:32:15115 days ago1759401135IN
0x00C11D18...9282f566E
0 ETH0.000000010.00050063

Latest 19 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
294547732026-01-06 17:09:2118 days ago1767719361
0x00C11D18...9282f566E
0.000005 ETH
288157172025-12-22 22:07:2933 days ago1766441249
0x00C11D18...9282f566E
0.000005 ETH
284126222025-12-13 14:10:5942 days ago1765635059
0x00C11D18...9282f566E
0.000005 ETH
278848662025-12-01 8:59:0755 days ago1764579547
0x00C11D18...9282f566E
0.000005 ETH
276186582025-11-25 5:05:3161 days ago1764047131
0x00C11D18...9282f566E
0.000005 ETH
275349752025-11-23 6:36:0563 days ago1763879765
0x00C11D18...9282f566E
0.000005 ETH
274058892025-11-20 6:53:1366 days ago1763621593
0x00C11D18...9282f566E
0.000005 ETH
273749772025-11-19 13:42:4966 days ago1763559769
0x00C11D18...9282f566E
0.000005 ETH
273351822025-11-18 15:36:1967 days ago1763480179
0x00C11D18...9282f566E
0.000005 ETH
272305212025-11-16 5:27:3770 days ago1763270857
0x00C11D18...9282f566E
0.000005 ETH
271087002025-11-13 9:46:5573 days ago1763027215
0x00C11D18...9282f566E
0.000005 ETH
268036962025-11-06 8:20:0780 days ago1762417207
0x00C11D18...9282f566E
0.000005 ETH
268020052025-11-06 7:23:4580 days ago1762413825
0x00C11D18...9282f566E
0.000005 ETH
266011782025-11-01 15:49:3184 days ago1762012171
0x00C11D18...9282f566E
0.000005 ETH
265872612025-11-01 8:05:3785 days ago1761984337
0x00C11D18...9282f566E
0.000005 ETH
265767902025-11-01 2:16:3585 days ago1761963395
0x00C11D18...9282f566E
0.000005 ETH
265438432025-10-31 7:58:2186 days ago1761897501
0x00C11D18...9282f566E
0.000005 ETH
265375402025-10-31 4:28:1586 days ago1761884895
0x00C11D18...9282f566E
0.000005 ETH
249139502025-09-23 14:28:35123 days ago1758637715  Contract Creation0 ETH

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ControllerWrapper

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {IAssetController} from "../interfaces/IAssetController.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {SafeERC20, IERC20, IERC20Permit} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract ControllerWrapper is AccessControl, ReentrancyGuard, Pausable {
    using SafeERC20 for IERC20;

    // ===== Events =====
    event TransferSent(
        address indexed sender,
        address indexed controller,
        bool resent,
        bool multi,
        uint256 grossAmount,
        uint256 netAmount,
        bytes data
    );
    event FeesCollected(address indexed payer, address indexed token, address indexed controller, uint256 feeAmount, address treasury);
    event FeeRateSet(uint256 oldRate, uint256 newRate);
    event TreasurySet(address indexed oldTreasury, address indexed newTreasury);
    event ControllerWhitelisted(address indexed controller, bool whitelisted);
    event ControllerFeeTiersSet(address indexed controller, uint256 indexed destChainId, uint256[] thresholds, uint256[] rates);
    event DestChainPremiumSet(uint256 indexed destChainId, uint256 rate);

    // ===== Errors =====
    error Wrapper_ControllerNotWhitelisted();
    error Wrapper_LengthMismatch();
    error Wrapper_InvalidParams();
    error Wrapper_InvalidFeeRate();
    error Wrapper_TreasuryZeroAddress();
    error Wrapper_ZeroAddress();
    error Wrapper_FeeOnTransferTokenNotSupported();
    error Wrapper_TransferFailed();
    error Wrapper_Unauthorized();

    struct PermitData {
        uint256 deadline;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    struct DepositInput {
        address controller;
        address recipient;
        uint256 amount;
        bool unwrap;
        uint256 destChainId;
    }

    // ===== Tiered Fee Mechanism =====
    struct FeeTier {
        uint256 threshold; // minimum amount for this tier (inclusive)
        uint256 rate; // fee rate for this tier
    }
    // Up to 3 tiers per (controller, destChainId)
    struct FeeTierConfig {
        FeeTier[3] tiers; // sorted ascending by threshold
        uint8 count; // number of active tiers (0-3)
    }

    // ===== Storage =====
    bytes32 public constant CONTROLLER_MANAGER_ROLE = keccak256("CONTROLLER_MANAGER_ROLE");

    uint256 public constant RATE_DENOMINATOR = 100_000; // 100.00%
    uint256 public constant MAX_FEE_RATE = 5_000; // 5.00%

    uint256 public feeRate; // global base rate
    address public treasury; // fee recipient

    mapping(address => bool) public controllers; // whitelist

    // controller => destChainId => FeeTierConfig
    mapping(address => mapping(uint256 => FeeTierConfig)) private _controllerFeeTiers;

    // Per-destination premium added on top of base (then clamped)
    mapping(uint256 => uint256) public destChainPremiumRate; // per-destination premium rate

    constructor(
        address[2] memory access, // admin, controller manager
        address _treasury,
        uint256 _feeRate,
        address[] memory initialControllers,
        uint256[] memory premiumChainIds,
        uint256[] memory premiumRate
    ) {
        _grantRole(DEFAULT_ADMIN_ROLE, access[0]);
        _grantRole(CONTROLLER_MANAGER_ROLE, access[1]);

        // Treasury + global rate
        if (_treasury == address(0) && _feeRate > 0) revert Wrapper_TreasuryZeroAddress();
        if (_feeRate > MAX_FEE_RATE) revert Wrapper_InvalidFeeRate();
        treasury = _treasury;
        feeRate = _feeRate;
        emit TreasurySet(address(0), _treasury);
        emit FeeRateSet(0, _feeRate);

        // Whitelist
        for (uint256 i = 0; i < initialControllers.length; i++) {
            controllers[initialControllers[i]] = true;
            emit ControllerWhitelisted(initialControllers[i], true);
        }

        // No tiered fee configuration in constructor. Use setControllerFeeTiers after deployment if needed.

        // Destination premiums
        if (premiumChainIds.length != premiumRate.length) revert Wrapper_LengthMismatch();
        for (uint256 i = 0; i < premiumChainIds.length; i++) {
            if (premiumRate[i] > MAX_FEE_RATE) revert Wrapper_InvalidFeeRate();
            destChainPremiumRate[premiumChainIds[i]] = premiumRate[i];
            emit DestChainPremiumSet(premiumChainIds[i], premiumRate[i]);
        }
    }

    /// @dev limits the function callers to `admin` or `controller manager`
    modifier adminOrManager() {
        if (!(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(CONTROLLER_MANAGER_ROLE, msg.sender))) {
            revert Wrapper_Unauthorized();
        }
        _;
    }

    // ===== External =====
    function transferTo(
        DepositInput calldata input,
        address adapter,
        bytes calldata bridgeOptions,
        bytes calldata data
    ) external payable nonReentrant whenNotPaused {
        (address token, uint256 net) = _process(input.controller, input.amount, input.destChainId);
        IAssetController(input.controller).transferTo{value: msg.value}(
            input.recipient,
            net,
            input.unwrap,
            input.destChainId,
            adapter,
            bridgeOptions
        );
        IERC20(token).forceApprove(input.controller, 0);
        emit TransferSent(msg.sender, input.controller, false, false, input.amount, net, data);
    }

    function transferToWPermit(
        DepositInput calldata input,
        PermitData calldata permit,
        address adapter,
        bytes calldata bridgeOptions,
        bytes calldata data
    ) external payable nonReentrant whenNotPaused {
        (address token, uint256 net) = _processPermit(input.controller, input.amount, input.destChainId, permit);
        IAssetController(input.controller).transferTo{value: msg.value}(
            input.recipient,
            net,
            input.unwrap,
            input.destChainId,
            adapter,
            bridgeOptions
        );
        IERC20(token).forceApprove(input.controller, 0);
        emit TransferSent(msg.sender, input.controller, false, false, input.amount, net, data);
    }

    function transferTo(
        DepositInput calldata input,
        address[] memory adapters,
        uint256[] memory fees,
        bytes[] calldata bridgeOptions,
        bytes calldata data
    ) external payable nonReentrant whenNotPaused {
        (address token, uint256 net) = _process(input.controller, input.amount, input.destChainId);
        IAssetController(input.controller).transferTo{value: msg.value}(
            input.recipient,
            net,
            input.unwrap,
            input.destChainId,
            adapters,
            fees,
            bridgeOptions
        );
        IERC20(token).forceApprove(input.controller, 0);
        emit TransferSent(msg.sender, input.controller, false, true, input.amount, net, data);
    }

    function transferToWPermit(
        DepositInput calldata input,
        PermitData calldata permit,
        address[] memory adapters,
        uint256[] memory fees,
        bytes[] calldata bridgeOptions,
        bytes calldata data
    ) external payable nonReentrant whenNotPaused {
        (address token, uint256 net) = _processPermit(input.controller, input.amount, input.destChainId, permit);
        IAssetController(input.controller).transferTo{value: msg.value}(
            input.recipient,
            net,
            input.unwrap,
            input.destChainId,
            adapters,
            fees,
            bridgeOptions
        );
        IERC20(token).forceApprove(input.controller, 0);
        emit TransferSent(msg.sender, input.controller, false, true, input.amount, net, data);
    }

    function resendTransfer(
        address controller,
        bytes32 transferId,
        address adapter,
        bytes calldata bridgeOptions,
        bytes calldata data
    ) external payable nonReentrant whenNotPaused {
        if (!controllers[controller]) revert Wrapper_ControllerNotWhitelisted();
        IAssetController(controller).resendTransfer{value: msg.value}(transferId, adapter, bridgeOptions);
        emit TransferSent(msg.sender, controller, true, false, 0, 0, data);
    }

    function resendTransfer(
        address controller,
        bytes32 transferId,
        address[] calldata adapters,
        uint256[] calldata fees,
        bytes[] calldata bridgeOptions,
        bytes calldata data
    ) external payable nonReentrant whenNotPaused {
        if (!controllers[controller]) revert Wrapper_ControllerNotWhitelisted();
        IAssetController(controller).resendTransfer{value: msg.value}(transferId, adapters, fees, bridgeOptions);
        emit TransferSent(msg.sender, controller, true, true, 0, 0, data);
    }

    // ===== Admin =====
    function setControllers(address[] calldata controller, bool[] calldata whitelisted) external adminOrManager {
        if (controller.length != whitelisted.length) revert Wrapper_LengthMismatch();
        for (uint256 i = 0; i < controller.length; i++) {
            controllers[controller[i]] = whitelisted[i];
            emit ControllerWhitelisted(controller[i], whitelisted[i]);
        }
    }

    function setFeeRate(uint256 newFeeRate) external adminOrManager {
        if (newFeeRate > MAX_FEE_RATE) revert Wrapper_InvalidFeeRate();
        if (newFeeRate > 0 && treasury == address(0)) revert Wrapper_TreasuryZeroAddress();
        emit FeeRateSet(feeRate, newFeeRate);
        feeRate = newFeeRate;
    }

    /**
     * @notice Set tiered fee configuration for a controller and multiple destination chains. The same tiered fee is applied to all specified destination chains.
     * @param controller The address of the controller.
     * @param destChainIds The IDs of the destination chains.
     * @param thresholds The thresholds for each fee tier.
     * @param bips The fee bips for each tier.
     */
    function setControllerFeeTiers(
        address controller,
        uint256[] calldata destChainIds,
        uint256[] calldata thresholds,
        uint256[] calldata bips
    ) external adminOrManager {
        if (thresholds.length != bips.length || thresholds.length > 3) revert Wrapper_LengthMismatch();
        for (uint256 i = 0; i < destChainIds.length; i++) {
            _setControllerFeeTiers(controller, destChainIds[i], thresholds, bips);
        }
    }

    function _setControllerFeeTiers(address controller_, uint256 destChainId, uint256[] memory thresholds, uint256[] memory bips) internal {
        FeeTierConfig storage config = _controllerFeeTiers[controller_][destChainId];
        // Clear existing tiers
        for (uint8 i = 0; i < 3; i++) {
            config.tiers[i] = FeeTier(0, 0);
        }
        uint256 items = thresholds.length;

        if (items > 0) {
            for (uint8 i = 0; i < items; i++) {
                // Ensure basis points are within valid range
                if (bips[i] > MAX_FEE_RATE) revert Wrapper_InvalidFeeRate();
                // Ensure threshold is not zero (except first tier)
                if (i > 0 && thresholds[i] == 0) revert Wrapper_InvalidParams();
                // Ensure thresholds are in strictly ascending order
                if (i > 0 && thresholds[i] <= thresholds[i - 1]) revert Wrapper_InvalidParams();

                config.tiers[i] = FeeTier(thresholds[i], bips[i]);
            }
        }
        config.count = uint8(items);
        emit ControllerFeeTiersSet(controller_, destChainId, thresholds, bips);
    }

    /**
     * @notice Set premium fee rates for specific destination chains. Each rate corresponds to the chain ID at the same index.
     * @param chainIds The IDs of the destination chains.
     * @param rates The premium fee rates for each chain.
     */
    function setDestChainPremiumRate(uint256[] calldata chainIds, uint256[] calldata rates) external adminOrManager {
        if (chainIds.length != rates.length) revert Wrapper_LengthMismatch();
        for (uint256 i = 0; i < chainIds.length; i++) {
            if (rates[i] > MAX_FEE_RATE) revert Wrapper_InvalidFeeRate();
            destChainPremiumRate[chainIds[i]] = rates[i];
            emit DestChainPremiumSet(chainIds[i], rates[i]);
        }
    }

    function setTreasury(address newTreasury) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (newTreasury == address(0)) revert Wrapper_TreasuryZeroAddress();
        emit TreasurySet(treasury, newTreasury);
        treasury = newTreasury;
    }

    function pause() external onlyRole(DEFAULT_ADMIN_ROLE) {
        _pause();
    }

    function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {
        _unpause();
    }

    function rescueTokens(address token, address to, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (to == address(0)) revert Wrapper_ZeroAddress();
        IERC20(token).safeTransfer(to, amount);
    }

    function rescueETH(address payable to, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (to == address(0)) revert Wrapper_ZeroAddress();
        (bool success, ) = to.call{value: amount}("");
        if (!success) revert Wrapper_TransferFailed();
    }

    // ===== Views =====
    function getControllerFeeTiers(
        address controller,
        uint256 destChainId
    ) external view returns (uint256[] memory thresholds, uint256[] memory bips) {
        FeeTierConfig memory config = _controllerFeeTiers[controller][destChainId];
        thresholds = new uint256[](config.count);
        bips = new uint256[](config.count);
        for (uint8 i = 0; i < config.count; i++) {
            thresholds[i] = config.tiers[i].threshold;
            bips[i] = config.tiers[i].rate;
        }
        return (thresholds, bips);
    }

    /// @notice Quote the fee and net given amount/controller/destChain.
    function quote(address controller, uint256 destChainId, uint256 amount) external view returns (uint256 fee, uint256 net) {
        (fee, net) = _quoteFee(controller, destChainId, amount);
    }

    // ===== Internal helpers =====
    /**
     * @notice Internal function to calculate the fee and net amount for a given controller, destChainId, and amount.
     * Implements tiered fee logic similar to LTokenUpgradeable, with fallback to global feeRate and addition of destChainPremiumRates.
     * @param controller The controller address
     * @param destChainId The destination chain ID
     * @param amount The gross amount
     * @return fee The total fee to be collected
     * @return net The net amount after fee
     */
    function _quoteFee(address controller, uint256 destChainId, uint256 amount) internal view returns (uint256 fee, uint256 net) {
        FeeTierConfig memory config = _controllerFeeTiers[controller][destChainId];
        uint256 baseFee = 0;
        if (config.count > 0 && amount > 0) {
            // Tiered fee calculation
            uint256 remaining = amount;
            uint256 processed = 0;
            uint256 tierStart = 0;
            for (uint8 i = 0; i < config.count; i++) {
                uint256 threshold = config.tiers[i].threshold;
                uint256 rate = config.tiers[i].rate;
                uint256 tierAmount;
                if (i == config.count - 1) {
                    // Last tier: everything above previous threshold
                    tierAmount = remaining;
                } else if (remaining > threshold - tierStart) {
                    tierAmount = threshold - tierStart;
                } else {
                    tierAmount = remaining;
                }
                if (tierAmount > 0) {
                    baseFee += (tierAmount * rate) / RATE_DENOMINATOR;
                    processed += tierAmount;
                    remaining -= tierAmount;
                }
                tierStart = threshold;
                if (remaining == 0) break;
            }
        } else if (feeRate > 0 && amount > 0) {
            // Fallback to global feeRate
            baseFee = (amount * feeRate) / RATE_DENOMINATOR;
        }

        // Add destination chain premium (if any)
        uint256 premiumRate = destChainPremiumRate[destChainId];
        if (premiumRate > 0 && amount > 0) {
            // Premium is applied on the original amount, then added to baseFee
            baseFee += (amount * premiumRate) / RATE_DENOMINATOR;
        }

        fee = baseFee;
        net = amount - fee;
    }

    function _process(address controller, uint256 amount, uint256 destChainId) internal returns (address token, uint256 netAmount) {
        if (!controllers[controller]) revert Wrapper_ControllerNotWhitelisted();
        token = IAssetController(controller).token();
        netAmount = _handleTransfers(token, controller, amount, destChainId);
    }

    function _processPermit(
        address controller,
        uint256 amount,
        uint256 destChainId,
        PermitData calldata permit
    ) internal returns (address token, uint256 netAmount) {
        if (!controllers[controller]) revert Wrapper_ControllerNotWhitelisted();
        token = IAssetController(controller).token();

        IERC20Permit(token).permit(msg.sender, address(this), amount, permit.deadline, permit.v, permit.r, permit.s);

        netAmount = _handleTransfers(token, controller, amount, destChainId);
    }

    function _handleTransfers(address token, address controller, uint256 amount, uint256 destChainId) internal returns (uint256 netAmount) {
        IERC20 t = IERC20(token);

        // Pull exactly `amount` and disallow fee-on-transfer tokens
        uint256 balBefore = t.balanceOf(address(this));
        t.safeTransferFrom(msg.sender, address(this), amount);
        uint256 received = t.balanceOf(address(this)) - balBefore;
        if (received != amount) revert Wrapper_FeeOnTransferTokenNotSupported();

        (uint256 fee, uint256 net) = _quoteFee(controller, destChainId, amount);

        if (fee > 0) {
            if (treasury == address(0)) revert Wrapper_TreasuryZeroAddress();
            t.safeTransfer(treasury, fee);
            emit FeesCollected(msg.sender, token, controller, fee, treasury);
        }

        t.forceApprove(controller, net);
        return net;
    }

    receive() external payable {}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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
// OpenZeppelin Contracts (last updated v4.9.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 (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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 v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

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

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _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) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <=0.8.20;

interface IAssetController {
    function token() external view returns (address);

    function transferTo(
        address recipient,
        uint256 amount,
        bool unwrap,
        uint256 destChainId,
        address bridgeAdapter,
        bytes memory bridgeOptions
    ) external payable;

    function transferTo(
        address recipient,
        uint256 amount,
        bool unwrap,
        uint256 destChainId,
        address[] memory adapters,
        uint256[] memory fees,
        bytes[] memory options
    ) external payable;

    function resendTransfer(bytes32 transferId, address adapter, bytes memory options) external payable;

    function resendTransfer(bytes32 transferId, address[] memory adapters, uint256[] memory fees, bytes[] memory options) external payable;
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address[2]","name":"access","type":"address[2]"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_feeRate","type":"uint256"},{"internalType":"address[]","name":"initialControllers","type":"address[]"},{"internalType":"uint256[]","name":"premiumChainIds","type":"uint256[]"},{"internalType":"uint256[]","name":"premiumRate","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Wrapper_ControllerNotWhitelisted","type":"error"},{"inputs":[],"name":"Wrapper_FeeOnTransferTokenNotSupported","type":"error"},{"inputs":[],"name":"Wrapper_InvalidFeeRate","type":"error"},{"inputs":[],"name":"Wrapper_InvalidParams","type":"error"},{"inputs":[],"name":"Wrapper_LengthMismatch","type":"error"},{"inputs":[],"name":"Wrapper_TransferFailed","type":"error"},{"inputs":[],"name":"Wrapper_TreasuryZeroAddress","type":"error"},{"inputs":[],"name":"Wrapper_Unauthorized","type":"error"},{"inputs":[],"name":"Wrapper_ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":true,"internalType":"uint256","name":"destChainId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"thresholds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"rates","type":"uint256[]"}],"name":"ControllerFeeTiersSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"ControllerWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"destChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"DestChainPremiumSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"FeeRateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payer","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"treasury","type":"address"}],"name":"FeesCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"bool","name":"resent","type":"bool"},{"indexed":false,"internalType":"bool","name":"multi","type":"bool"},{"indexed":false,"internalType":"uint256","name":"grossAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"netAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"TransferSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldTreasury","type":"address"},{"indexed":true,"internalType":"address","name":"newTreasury","type":"address"}],"name":"TreasurySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"CONTROLLER_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"destChainPremiumRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"uint256","name":"destChainId","type":"uint256"}],"name":"getControllerFeeTiers","outputs":[{"internalType":"uint256[]","name":"thresholds","type":"uint256[]"},{"internalType":"uint256[]","name":"bips","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"uint256","name":"destChainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"quote","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"net","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address","name":"adapter","type":"address"},{"internalType":"bytes","name":"bridgeOptions","type":"bytes"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"resendTransfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"bytes32","name":"transferId","type":"bytes32"},{"internalType":"address[]","name":"adapters","type":"address[]"},{"internalType":"uint256[]","name":"fees","type":"uint256[]"},{"internalType":"bytes[]","name":"bridgeOptions","type":"bytes[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"resendTransfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"uint256[]","name":"destChainIds","type":"uint256[]"},{"internalType":"uint256[]","name":"thresholds","type":"uint256[]"},{"internalType":"uint256[]","name":"bips","type":"uint256[]"}],"name":"setControllerFeeTiers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"controller","type":"address[]"},{"internalType":"bool[]","name":"whitelisted","type":"bool[]"}],"name":"setControllers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"chainIds","type":"uint256[]"},{"internalType":"uint256[]","name":"rates","type":"uint256[]"}],"name":"setDestChainPremiumRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"setFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"unwrap","type":"bool"},{"internalType":"uint256","name":"destChainId","type":"uint256"}],"internalType":"struct ControllerWrapper.DepositInput","name":"input","type":"tuple"},{"internalType":"address[]","name":"adapters","type":"address[]"},{"internalType":"uint256[]","name":"fees","type":"uint256[]"},{"internalType":"bytes[]","name":"bridgeOptions","type":"bytes[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"transferTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"unwrap","type":"bool"},{"internalType":"uint256","name":"destChainId","type":"uint256"}],"internalType":"struct ControllerWrapper.DepositInput","name":"input","type":"tuple"},{"internalType":"address","name":"adapter","type":"address"},{"internalType":"bytes","name":"bridgeOptions","type":"bytes"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"transferTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"unwrap","type":"bool"},{"internalType":"uint256","name":"destChainId","type":"uint256"}],"internalType":"struct ControllerWrapper.DepositInput","name":"input","type":"tuple"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ControllerWrapper.PermitData","name":"permit","type":"tuple"},{"internalType":"address[]","name":"adapters","type":"address[]"},{"internalType":"uint256[]","name":"fees","type":"uint256[]"},{"internalType":"bytes[]","name":"bridgeOptions","type":"bytes[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"transferToWPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"unwrap","type":"bool"},{"internalType":"uint256","name":"destChainId","type":"uint256"}],"internalType":"struct ControllerWrapper.DepositInput","name":"input","type":"tuple"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ControllerWrapper.PermitData","name":"permit","type":"tuple"},{"internalType":"address","name":"adapter","type":"address"},{"internalType":"bytes","name":"bridgeOptions","type":"bytes"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"transferToWPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162003dbb38038062003dbb8339810160408190526200003491620005d0565b600180556002805460ff1916905562000056600087815b60200201516200039a565b620000847f14031051ef64910ea26175284bbaea2d8f485c9aec1697121604906a168aebdb8760016200004b565b6001600160a01b0385161580156200009c5750600084115b15620000bb5760405163082398e560e31b815260040160405180910390fd5b611388841115620000de57604051625b37a160e41b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b03871690811790915560038590556040516000907f21eb548722a564f6e09f039f7aa858ae94c911910f3823b37af2250eeca4f403908290a36040805160008152602081018690527f959ec4191db1bd972bfbc60dc7d735d4cfb897ca3fd297f4ebd6ee918feb84d4910160405180910390a160005b835181101562000245576001600560008684815181106200018e576200018e620006db565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550838181518110620001e257620001e2620006db565b60200260200101516001600160a01b03167fbfd6f983ad3ebd9aeb58497a4e27c4a45c7c299f6895c05fe9204e405bce5b98600160405162000228911515815260200190565b60405180910390a2806200023c81620006f1565b91505062000169565b50805182511462000269576040516330dda05d60e01b815260040160405180910390fd5b60005b82518110156200038d576113888282815181106200028e576200028e620006db565b60200260200101511115620002b557604051625b37a160e41b815260040160405180910390fd5b818181518110620002ca57620002ca620006db565b602002602001015160076000858481518110620002eb57620002eb620006db565b60200260200101518152602001908152602001600020819055508281815181106200031a576200031a620006db565b60200260200101517f2b022a7462191d73614c0d3a87a34970ed11ca5ebe4e7ce53c9ed8bb664ae8d9838381518110620003585762000358620006db565b60200260200101516040516200037091815260200190565b60405180910390a2806200038481620006f1565b9150506200026c565b5050505050505062000719565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000437576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003f63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200047657620004766200043b565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620004a757620004a76200043b565b604052919050565b80516001600160a01b0381168114620004c757600080fd5b919050565b60006001600160401b03821115620004e857620004e86200043b565b5060051b60200190565b600082601f8301126200050457600080fd5b815160206200051d6200051783620004cc565b6200047c565b82815260059290921b840181019181810190868411156200053d57600080fd5b8286015b8481101562000563576200055581620004af565b835291830191830162000541565b509695505050505050565b600082601f8301126200058057600080fd5b81516020620005936200051783620004cc565b82815260059290921b84018101918181019086841115620005b357600080fd5b8286015b84811015620005635780518352918301918301620005b7565b60008060008060008060e08789031215620005ea57600080fd5b87601f880112620005fa57600080fd5b6200060462000451565b80604089018a8111156200061757600080fd5b895b818110156200063c576200062d81620004af565b84526020938401930162000619565b508198506200064b81620004af565b60608b015160808c0151919950975092506001600160401b03915050808211156200067557600080fd5b620006838a838b01620004f2565b945060a08901519150808211156200069a57600080fd5b620006a88a838b016200056e565b935060c0890151915080821115620006bf57600080fd5b50620006ce89828a016200056e565b9150509295509295509295565b634e487b7160e01b600052603260045260246000fd5b6000600182016200071257634e487b7160e01b600052601160045260246000fd5b5060010190565b61369280620007296000396000f3fe6080604052600436106101e75760003560e01c80638456cb5911610102578063a4acee9811610095578063da8c229e11610064578063da8c229e1461055c578063df965bb21461058c578063f0f44260146105ac578063fc68be85146105cc57600080fd5b8063a4acee98146104dc578063af42a26f14610509578063cea9d26f1461051c578063d547741f1461053c57600080fd5b806392f6576e116100d157806392f6576e14610466578063978bbdb91461047c5780639e8cc04b14610492578063a217fddf146104c757600080fd5b80638456cb591461040b57806388c11d521461042057806390f1c8d91461043357806391d148541461044657600080fd5b80633f4ba83a1161017a5780635c975abb116101495780635c975abb1461037657806361d027b31461038e5780637c50f938146103c65780637efad8e0146103f457600080fd5b80633f4ba83a1461030e57806345596e2e146103235780634766f56614610343578063519dd2fc1461035657600080fd5b80632c45e5a0116101b65780632c45e5a01461029b5780632f2ff15d146102bb57806336568abe146102db5780633bfa0ee5146102fb57600080fd5b806301ffc9a7146101f3578063099a04e5146102285780630d23f9b21461024a578063248a9ca31461025d57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5061021361020e36600461282d565b6105ee565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b5061024861024336600461286c565b610625565b005b6102486102583660046128e9565b6106d1565b34801561026957600080fd5b5061028d610278366004612987565b60009081526020819052604090206001015490565b60405190815260200161021f565b3480156102a757600080fd5b506102486102b63660046129e4565b6107d8565b3480156102c757600080fd5b506102486102d6366004612a4f565b610967565b3480156102e757600080fd5b506102486102f6366004612a4f565b610991565b610248610309366004612bcf565b610a14565b34801561031a57600080fd5b50610248610b6d565b34801561032f57600080fd5b5061024861033e366004612987565b610b83565b610248610351366004612c7b565b610c63565b34801561036257600080fd5b506102486103713660046129e4565b610dac565b34801561038257600080fd5b5060025460ff16610213565b34801561039a57600080fd5b506004546103ae906001600160a01b031681565b6040516001600160a01b03909116815260200161021f565b3480156103d257600080fd5b506103e66103e136600461286c565b610f1b565b60405161021f929190612d4a565b34801561040057600080fd5b5061028d620186a081565b34801561041757600080fd5b506102486110f3565b61024861042e366004612d81565b611106565b610248610441366004612e61565b611258565b34801561045257600080fd5b50610213610461366004612a4f565b61138a565b34801561047257600080fd5b5061028d61138881565b34801561048857600080fd5b5061028d60035481565b34801561049e57600080fd5b506104b26104ad366004612eea565b6113b3565b6040805192835260208301919091520161021f565b3480156104d357600080fd5b5061028d600081565b3480156104e857600080fd5b5061028d6104f7366004612987565b60076020526000908152604090205481565b610248610517366004612f1f565b6113cd565b34801561052857600080fd5b50610248610537366004612fff565b6114dc565b34801561054857600080fd5b50610248610557366004612a4f565b611522565b34801561056857600080fd5b50610213610577366004613040565b60056020526000908152604090205460ff1681565b34801561059857600080fd5b506102486105a736600461305d565b611547565b3480156105b857600080fd5b506102486105c7366004613040565b61165e565b3480156105d857600080fd5b5061028d60008051602061363d83398151915281565b60006001600160e01b03198216637965db0b60e01b148061061f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610630816116ed565b6001600160a01b038316610657576040516312cffc5760e01b815260040160405180910390fd5b6000836001600160a01b03168360405160006040518083038185875af1925050503d80600081146106a4576040519150601f19603f3d011682016040523d82523d6000602084013e6106a9565b606091505b50509050806106cb57604051630443456960e41b815260040160405180910390fd5b50505050565b6106d96116f7565b6106e1611750565b6001600160a01b03871660009081526005602052604090205460ff1661071a5760405163de83a4e960e01b815260040160405180910390fd5b604051634995c3e760e01b81526001600160a01b03881690634995c3e790349061074e908a908a908a908a9060040161311f565b6000604051808303818588803b15801561076757600080fd5b505af115801561077b573d6000803e3d6000fd5b5050505050866001600160a01b0316336001600160a01b031660008051602061361d8339815191526001600080600088886040516107be96959493929190613154565b60405180910390a36107cf60018055565b50505050505050565b6107e360003361138a565b80610801575061080160008051602061363d8339815191523361138a565b61081e57604051630992d00560e11b815260040160405180910390fd5b82811461083e576040516330dda05d60e01b815260040160405180910390fd5b60005b838110156109605782828281811061085b5761085b613190565b905060200201602081019061087091906131b4565b6005600087878581811061088657610886613190565b905060200201602081019061089b9190613040565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558484828181106108d5576108d5613190565b90506020020160208101906108ea9190613040565b6001600160a01b03167fbfd6f983ad3ebd9aeb58497a4e27c4a45c7c299f6895c05fe9204e405bce5b9884848481811061092657610926613190565b905060200201602081019061093b91906131b4565b604051901515815260200160405180910390a280610958816131e7565b915050610841565b5050505050565b600082815260208190526040902060010154610982816116ed565b61098c8383611798565b505050565b6001600160a01b0381163314610a065760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610a10828261181c565b5050565b610a1c6116f7565b610a24611750565b600080610a46610a3760208b018b613040565b8a604001358b60800135611881565b9092509050610a5860208a018a613040565b6001600160a01b03166339c82de634610a7760408d0160208e01613040565b848d6060016020810190610a8b91906131b4565b8e608001358e8e8e8e6040518a63ffffffff1660e01b8152600401610ab7989796959493929190613291565b6000604051808303818588803b158015610ad057600080fd5b505af1158015610ae4573d6000803e3d6000fd5b50610b0d9350610afb9250505060208b018b613040565b6001600160a01b038416906000611936565b610b1a60208a018a613040565b6001600160a01b0316336001600160a01b031660008051602061361d833981519152600060018d60400135868a8a604051610b5a96959493929190613154565b60405180910390a350506107cf60018055565b6000610b78816116ed565b610b806119f8565b50565b610b8e60003361138a565b80610bac5750610bac60008051602061363d8339815191523361138a565b610bc957604051630992d00560e11b815260040160405180910390fd5b611388811115610beb57604051625b37a160e41b815260040160405180910390fd5b600081118015610c0457506004546001600160a01b0316155b15610c225760405163082398e560e31b815260040160405180910390fd5b60035460408051918252602082018390527f959ec4191db1bd972bfbc60dc7d735d4cfb897ca3fd297f4ebd6ee918feb84d4910160405180910390a1600355565b610c6b6116f7565b610c73611750565b600080610c95610c8660208a018a613040565b89604001358a60800135611881565b9092509050610ca76020890189613040565b6001600160a01b031663d30a41c834610cc660408c0160208d01613040565b84610cd760808e0160608f016131b4565b8d608001358d8d8d6040518963ffffffff1660e01b8152600401610d01979695949392919061332d565b6000604051808303818588803b158015610d1a57600080fd5b505af1158015610d2e573d6000803e3d6000fd5b50610d459350610afb9250505060208a018a613040565b610d526020890189613040565b6001600160a01b0316336001600160a01b031660008051602061361d8339815191526000808c60400135868a8a604051610d9196959493929190613154565b60405180910390a35050610da460018055565b505050505050565b610db760003361138a565b80610dd55750610dd560008051602061363d8339815191523361138a565b610df257604051630992d00560e11b815260040160405180910390fd5b828114610e12576040516330dda05d60e01b815260040160405180910390fd5b60005b8381101561096057611388838383818110610e3257610e32613190565b905060200201351115610e5757604051625b37a160e41b815260040160405180910390fd5b828282818110610e6957610e69613190565b9050602002013560076000878785818110610e8657610e86613190565b90506020020135815260200190815260200160002081905550848482818110610eb157610eb1613190565b905060200201357f2b022a7462191d73614c0d3a87a34970ed11ca5ebe4e7ce53c9ed8bb664ae8d9848484818110610eeb57610eeb613190565b90506020020135604051610f0191815260200190565b60405180910390a280610f13816131e7565b915050610e15565b6001600160a01b0382166000908152600660209081526040808320848452909152808220815160a08101835260609384939092908290810182600386835b82821015610f95578382600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610f59565b505050908252506006919091015460ff90811660209283015290820151919250166001600160401b03811115610fcd57610fcd612a97565b604051908082528060200260200182016040528015610ff6578160200160208202803683370190505b509250806020015160ff166001600160401b0381111561101857611018612a97565b604051908082528060200260200182016040528015611041578160200160208202803683370190505b50915060005b816020015160ff168160ff1610156110e957815160ff82166003811061106f5761106f613190565b602002015160000151848260ff168151811061108d5761108d613190565b6020908102919091010152815160ff8216600381106110ae576110ae613190565b602002015160200151838260ff16815181106110cc576110cc613190565b6020908102919091010152806110e18161337d565b915050611047565b50505b9250929050565b60006110fe816116ed565b610b80611a4a565b61110e6116f7565b611116611750565b60008061113961112960208c018c613040565b8b604001358c608001358c611a87565b909250905061114b60208b018b613040565b6001600160a01b03166339c82de63461116a60408e0160208f01613040565b848e606001602081019061117e91906131b4565b8f608001358e8e8e8e6040518a63ffffffff1660e01b81526004016111aa989796959493929190613291565b6000604051808303818588803b1580156111c357600080fd5b505af11580156111d7573d6000803e3d6000fd5b506111ee9350610afb9250505060208c018c613040565b6111fb60208b018b613040565b6001600160a01b0316336001600160a01b031660008051602061361d833981519152600060018e60400135868a8a60405161123b96959493929190613154565b60405180910390a3505061124e60018055565b5050505050505050565b6112606116f7565b611268611750565b60008061128b61127b60208b018b613040565b8a604001358b608001358b611a87565b909250905061129d60208a018a613040565b6001600160a01b031663d30a41c8346112bc60408d0160208e01613040565b848d60600160208101906112d091906131b4565b8e608001358d8d8d6040518963ffffffff1660e01b81526004016112fa979695949392919061332d565b6000604051808303818588803b15801561131357600080fd5b505af1158015611327573d6000803e3d6000fd5b5061133e9350610afb9250505060208b018b613040565b61134b60208a018a613040565b6001600160a01b0316336001600160a01b031660008051602061361d8339815191526000808d60400135868a8a604051610b5a96959493929190613154565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000806113c1858585611beb565b90969095509350505050565b6113d56116f7565b6113dd611750565b6001600160a01b038a1660009081526005602052604090205460ff166114165760405163de83a4e960e01b815260040160405180910390fd5b60405163d3a8b63160e01b81526001600160a01b038b169063d3a8b631903490611450908d908d908d908d908d908d908d9060040161339c565b6000604051808303818588803b15801561146957600080fd5b505af115801561147d573d6000803e3d6000fd5b5050505050896001600160a01b0316336001600160a01b031660008051602061361d83398151915260018060008088886040516114bf96959493929190613154565b60405180910390a36114d060018055565b50505050505050505050565b60006114e7816116ed565b6001600160a01b03831661150e576040516312cffc5760e01b815260040160405180910390fd5b6106cb6001600160a01b0385168484611e51565b60008281526020819052604090206001015461153d816116ed565b61098c838361181c565b61155260003361138a565b80611570575061157060008051602061363d8339815191523361138a565b61158d57604051630992d00560e11b815260040160405180910390fd5b828114158061159c5750600383115b156115ba576040516330dda05d60e01b815260040160405180910390fd5b60005b8581101561124e5761164c888888848181106115db576115db613190565b9050602002013587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250611e8192505050565b80611656816131e7565b9150506115bd565b6000611669816116ed565b6001600160a01b0382166116905760405163082398e560e31b815260040160405180910390fd5b6004546040516001600160a01b038085169216907f21eb548722a564f6e09f039f7aa858ae94c911910f3823b37af2250eeca4f40390600090a350600480546001600160a01b0319166001600160a01b0392909216919091179055565b610b808133612113565b6002600154036117495760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109fd565b6002600155565b60025460ff16156117965760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109fd565b565b6117a2828261138a565b610a10576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556117d83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611826828261138a565b15610a10576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038316600090815260056020526040812054819060ff166118bc5760405163de83a4e960e01b815260040160405180910390fd5b846001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191e919061342f565b915061192c8286868661216c565b9050935093915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526119878482612359565b6106cb576040516001600160a01b0384166024820152600060448201526119ee90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612400565b6106cb8482612400565b611a006124d5565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b611a52611750565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611a2d3390565b6001600160a01b038416600090815260056020526040812054819060ff16611ac25760405163de83a4e960e01b815260040160405180910390fd5b856001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b24919061342f565b91506001600160a01b03821663d505accf3330888735611b4a60408a0160208b0161344c565b604080516001600160e01b031960e089901b1681526001600160a01b0396871660048201529590941660248601526044850192909252606484015260ff16608483015286013560a4820152606086013560c482015260e401600060405180830381600087803b158015611bbc57600080fd5b505af1158015611bd0573d6000803e3d6000fd5b50505050611be08287878761216c565b905094509492505050565b6001600160a01b0383166000908152600660209081526040808320858452909152808220815160a08101835283928392908290810182600386835b82821015611c62578382600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611c26565b505050908252506006919091015460ff908116602092830152908201519192506000911615801590611c945750600085115b15611db75784600080805b856020015160ff168160ff161015611dae57855160009060ff831660038110611cca57611cca613190565b602002015151875190915060009060ff841660038110611cec57611cec613190565b6020020151602001519050600060018960200151611d0a919061346f565b60ff168460ff1603611d1d575085611d42565b611d278584613488565b871115611d3f57611d388584613488565b9050611d42565b50855b8015611d8557620186a0611d56838361349b565b611d6091906134b2565b611d6a90896134d4565b9750611d7681876134d4565b9550611d828188613488565b96505b82945086600003611d9857505050611dae565b5050508080611da69061337d565b915050611c9f565b50505050611ded565b6000600354118015611dc95750600085115b15611ded57620186a060035486611de0919061349b565b611dea91906134b2565b90505b6000868152600760205260409020548015801590611e0b5750600086115b15611e3557620186a0611e1e828861349b565b611e2891906134b2565b611e3290836134d4565b91505b8194508486611e449190613488565b9350505050935093915050565b6040516001600160a01b03831660248201526044810182905261098c90849063a9059cbb60e01b906064016119b7565b6001600160a01b03841660009081526006602090815260408083208684529091528120905b60038160ff161015611f095760408051808201909152600080825260208201528260ff831660038110611edb57611edb613190565b6002020160008201518160000155602082015181600101559050508080611f019061337d565b915050611ea6565b50825180156120b35760005b818160ff1610156120b157611388848260ff1681518110611f3857611f38613190565b60200260200101511115611f5e57604051625b37a160e41b815260040160405180910390fd5b60008160ff16118015611f8d5750848160ff1681518110611f8157611f81613190565b60200260200101516000145b15611fab57604051630cdd0ebf60e31b815260040160405180910390fd5b60008160ff16118015612000575084611fc560018361346f565b60ff1681518110611fd857611fd8613190565b6020026020010151858260ff1681518110611ff557611ff5613190565b602002602001015111155b1561201e57604051630cdd0ebf60e31b815260040160405180910390fd5b6040518060400160405280868360ff168151811061203e5761203e613190565b60200260200101518152602001858360ff168151811061206057612060613190565b6020026020010151815250836000018260ff166003811061208357612083613190565b60020201600082015181600001556020820151816001015590505080806120a99061337d565b915050611f15565b505b60068201805460ff191660ff831617905560405185906001600160a01b038816907fe875e6846deb900a1c39242590238ce046f1880aceb983ceef966c09a50647a0906121039088908890612d4a565b60405180910390a3505050505050565b61211d828261138a565b610a105761212a8161251e565b612135836020612530565b60405160200161214692919061350b565b60408051601f198184030181529082905262461bcd60e51b82526109fd91600401613580565b6040516370a0823160e01b8152306004820152600090859082906001600160a01b038316906370a0823190602401602060405180830381865afa1580156121b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121db91906135b3565b90506121f26001600160a01b0383163330886126d2565b6040516370a0823160e01b815230600482015260009082906001600160a01b038516906370a0823190602401602060405180830381865afa15801561223b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061225f91906135b3565b6122699190613488565b905085811461228b5760405163a62c631560e01b815260040160405180910390fd5b60008061229989888a611beb565b90925090508115612336576004546001600160a01b03166122cd5760405163082398e560e31b815260040160405180910390fd5b6004546122e7906001600160a01b03878116911684611e51565b600454604080518481526001600160a01b0392831660208201528b8316928d169133917f0c7016eab065212f095b32ca6daf66b021b628b6457815d893fff6f43a374c34910160405180910390a45b61234a6001600160a01b0386168a83611936565b9450505050505b949350505050565b6000806000846001600160a01b03168460405161237691906135cc565b6000604051808303816000865af19150503d80600081146123b3576040519150601f19603f3d011682016040523d82523d6000602084013e6123b8565b606091505b50915091508180156123e25750805115806123e25750808060200190518101906123e291906135e8565b80156123f757506001600160a01b0385163b15155b95945050505050565b6000612455826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661270a9092919063ffffffff16565b905080516000148061247657508080602001905181019061247691906135e8565b61098c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016109fd565b60025460ff166117965760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109fd565b606061061f6001600160a01b03831660145b6060600061253f83600261349b565b61254a9060026134d4565b6001600160401b0381111561256157612561612a97565b6040519080825280601f01601f19166020018201604052801561258b576020820181803683370190505b509050600360fc1b816000815181106125a6576125a6613190565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106125d5576125d5613190565b60200101906001600160f81b031916908160001a90535060006125f984600261349b565b6126049060016134d4565b90505b600181111561267c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061263857612638613190565b1a60f81b82828151811061264e5761264e613190565b60200101906001600160f81b031916908160001a90535060049490941c9361267581613605565b9050612607565b5083156126cb5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109fd565b9392505050565b6040516001600160a01b03808516602483015283166044820152606481018290526106cb9085906323b872dd60e01b906084016119b7565b6060612351848460008585600080866001600160a01b0316858760405161273191906135cc565b60006040518083038185875af1925050503d806000811461276e576040519150601f19603f3d011682016040523d82523d6000602084013e612773565b606091505b50915091506127848783838761278f565b979650505050505050565b606083156127fe5782516000036127f7576001600160a01b0385163b6127f75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109fd565b5081612351565b61235183838151156128135781518083602001fd5b8060405162461bcd60e51b81526004016109fd9190613580565b60006020828403121561283f57600080fd5b81356001600160e01b0319811681146126cb57600080fd5b6001600160a01b0381168114610b8057600080fd5b6000806040838503121561287f57600080fd5b823561288a81612857565b946020939093013593505050565b80356128a381612857565b919050565b60008083601f8401126128ba57600080fd5b5081356001600160401b038111156128d157600080fd5b6020830191508360208285010111156110ec57600080fd5b600080600080600080600060a0888a03121561290457600080fd5b873561290f81612857565b965060208801359550604088013561292681612857565b945060608801356001600160401b038082111561294257600080fd5b61294e8b838c016128a8565b909650945060808a013591508082111561296757600080fd5b506129748a828b016128a8565b989b979a50959850939692959293505050565b60006020828403121561299957600080fd5b5035919050565b60008083601f8401126129b257600080fd5b5081356001600160401b038111156129c957600080fd5b6020830191508360208260051b85010111156110ec57600080fd5b600080600080604085870312156129fa57600080fd5b84356001600160401b0380821115612a1157600080fd5b612a1d888389016129a0565b90965094506020870135915080821115612a3657600080fd5b50612a43878288016129a0565b95989497509550505050565b60008060408385031215612a6257600080fd5b823591506020830135612a7481612857565b809150509250929050565b600060a08284031215612a9157600080fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612ad557612ad5612a97565b604052919050565b60006001600160401b03821115612af657612af6612a97565b5060051b60200190565b600082601f830112612b1157600080fd5b81356020612b26612b2183612add565b612aad565b82815260059290921b84018101918181019086841115612b4557600080fd5b8286015b84811015612b69578035612b5c81612857565b8352918301918301612b49565b509695505050505050565b600082601f830112612b8557600080fd5b81356020612b95612b2183612add565b82815260059290921b84018101918181019086841115612bb457600080fd5b8286015b84811015612b695780358352918301918301612bb8565b6000806000806000806000610120888a031215612beb57600080fd5b612bf58989612a7f565b965060a08801356001600160401b0380821115612c1157600080fd5b612c1d8b838c01612b00565b975060c08a0135915080821115612c3357600080fd5b612c3f8b838c01612b74565b965060e08a0135915080821115612c5557600080fd5b612c618b838c016129a0565b90965094506101008a013591508082111561296757600080fd5b6000806000806000806101008789031215612c9557600080fd5b612c9f8888612a7f565b955060a0870135612caf81612857565b945060c08701356001600160401b0380821115612ccb57600080fd5b612cd78a838b016128a8565b909650945060e0890135915080821115612cf057600080fd5b50612cfd89828a016128a8565b979a9699509497509295939492505050565b600081518084526020808501945080840160005b83811015612d3f57815187529582019590820190600101612d23565b509495945050505050565b604081526000612d5d6040830185612d0f565b82810360208401526123f78185612d0f565b600060808284031215612a9157600080fd5b6000806000806000806000806101a0898b031215612d9e57600080fd5b612da88a8a612a7f565b9750612db78a60a08b01612d6f565b96506101208901356001600160401b0380821115612dd457600080fd5b612de08c838d01612b00565b97506101408b0135915080821115612df757600080fd5b612e038c838d01612b74565b96506101608b0135915080821115612e1a57600080fd5b612e268c838d016129a0565b90965094506101808b0135915080821115612e4057600080fd5b50612e4d8b828c016128a8565b999c989b5096995094979396929594505050565b6000806000806000806000610180888a031215612e7d57600080fd5b612e878989612a7f565b9650612e968960a08a01612d6f565b9550610120880135612ea781612857565b94506101408801356001600160401b0380821115612ec457600080fd5b612ed08b838c016128a8565b90965094506101608a013591508082111561296757600080fd5b600080600060608486031215612eff57600080fd5b8335612f0a81612857565b95602085013595506040909401359392505050565b60008060008060008060008060008060c08b8d031215612f3e57600080fd5b612f478b612898565b995060208b0135985060408b01356001600160401b0380821115612f6a57600080fd5b612f768e838f016129a0565b909a50985060608d0135915080821115612f8f57600080fd5b612f9b8e838f016129a0565b909850965060808d0135915080821115612fb457600080fd5b612fc08e838f016129a0565b909650945060a08d0135915080821115612fd957600080fd5b50612fe68d828e016128a8565b915080935050809150509295989b9194979a5092959850565b60008060006060848603121561301457600080fd5b833561301f81612857565b9250602084013561302f81612857565b929592945050506040919091013590565b60006020828403121561305257600080fd5b81356126cb81612857565b60008060008060008060006080888a03121561307857600080fd5b873561308381612857565b965060208801356001600160401b038082111561309f57600080fd5b6130ab8b838c016129a0565b909850965060408a01359150808211156130c457600080fd5b6130d08b838c016129a0565b909650945060608a01359150808211156130e957600080fd5b506129748a828b016129a0565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8481526001600160a01b038416602082015260606040820181905260009061314a90830184866130f6565b9695505050505050565b8615158152851515602082015284604082015283606082015260a06080820152600061318460a0830184866130f6565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b8015158114610b8057600080fd5b6000602082840312156131c657600080fd5b81356126cb816131a6565b634e487b7160e01b600052601160045260246000fd5b6000600182016131f9576131f96131d1565b5060010190565b81835260006020808501808196508560051b810191508460005b878110156132845782840389528135601e1988360301811261323b57600080fd5b870185810190356001600160401b0381111561325657600080fd5b80360382131561326557600080fd5b6132708682846130f6565b9a87019a955050509084019060010161321a565b5091979650505050505050565b600060e0820160018060a01b03808c16845260208b818601528a1515604086015289606086015260e0608086015282895180855261010087019150828b01945060005b818110156132f25785518516835294830194918301916001016132d4565b505085810360a0870152613306818a612d0f565b935050505082810360c084015261331e818587613200565b9b9a5050505050505050505050565b6001600160a01b038881168252602082018890528615156040830152606082018690528416608082015260c060a0820181905260009061337090830184866130f6565b9998505050505050505050565b600060ff821660ff8103613393576133936131d1565b60010192915050565b87815260806020808301829052908201879052600090889060a08401835b8a8110156133e85783356133cd81612857565b6001600160a01b0316825292820192908201906001016133ba565b5084810360408601528781526001600160fb1b0388111561340857600080fd5b8760051b9250828983830137909101838103820160608501529061331e8183018688613200565b60006020828403121561344157600080fd5b81516126cb81612857565b60006020828403121561345e57600080fd5b813560ff811681146126cb57600080fd5b60ff828116828216039081111561061f5761061f6131d1565b8181038181111561061f5761061f6131d1565b808202811582820484141761061f5761061f6131d1565b6000826134cf57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561061f5761061f6131d1565b60005b838110156135025781810151838201526020016134ea565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516135438160178501602088016134e7565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516135748160288401602088016134e7565b01602801949350505050565b602081526000825180602084015261359f8160408501602087016134e7565b601f01601f19169190910160400192915050565b6000602082840312156135c557600080fd5b5051919050565b600082516135de8184602087016134e7565b9190910192915050565b6000602082840312156135fa57600080fd5b81516126cb816131a6565b600081613614576136146131d1565b50600019019056fedc35ec9c20a3583ca2942e2bf27861adb550876aefb2699c87769d4e0cddcd4d14031051ef64910ea26175284bbaea2d8f485c9aec1697121604906a168aebdba264697066735822122017304cfbcd8841f997b2ab409931d83ed70b197d553f9c553de8a607a50d4edb64736f6c634300081300330000000000000000000000005db7ad07d4903579a0342f7332bd4e3ed480d1af000000000000000000000000b30dc8ada8a9a704cc803b60f98ec92084a87942000000000000000000000000359f01614eed04dbe2b9a3f6d45835cb1b200b25000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000229ac52e807e83bc21507caa93138972da44a61b000000000000000000000000168b439f88ab57bf7633cb39131f91bc90a3b74d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101e75760003560e01c80638456cb5911610102578063a4acee9811610095578063da8c229e11610064578063da8c229e1461055c578063df965bb21461058c578063f0f44260146105ac578063fc68be85146105cc57600080fd5b8063a4acee98146104dc578063af42a26f14610509578063cea9d26f1461051c578063d547741f1461053c57600080fd5b806392f6576e116100d157806392f6576e14610466578063978bbdb91461047c5780639e8cc04b14610492578063a217fddf146104c757600080fd5b80638456cb591461040b57806388c11d521461042057806390f1c8d91461043357806391d148541461044657600080fd5b80633f4ba83a1161017a5780635c975abb116101495780635c975abb1461037657806361d027b31461038e5780637c50f938146103c65780637efad8e0146103f457600080fd5b80633f4ba83a1461030e57806345596e2e146103235780634766f56614610343578063519dd2fc1461035657600080fd5b80632c45e5a0116101b65780632c45e5a01461029b5780632f2ff15d146102bb57806336568abe146102db5780633bfa0ee5146102fb57600080fd5b806301ffc9a7146101f3578063099a04e5146102285780630d23f9b21461024a578063248a9ca31461025d57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5061021361020e36600461282d565b6105ee565b60405190151581526020015b60405180910390f35b34801561023457600080fd5b5061024861024336600461286c565b610625565b005b6102486102583660046128e9565b6106d1565b34801561026957600080fd5b5061028d610278366004612987565b60009081526020819052604090206001015490565b60405190815260200161021f565b3480156102a757600080fd5b506102486102b63660046129e4565b6107d8565b3480156102c757600080fd5b506102486102d6366004612a4f565b610967565b3480156102e757600080fd5b506102486102f6366004612a4f565b610991565b610248610309366004612bcf565b610a14565b34801561031a57600080fd5b50610248610b6d565b34801561032f57600080fd5b5061024861033e366004612987565b610b83565b610248610351366004612c7b565b610c63565b34801561036257600080fd5b506102486103713660046129e4565b610dac565b34801561038257600080fd5b5060025460ff16610213565b34801561039a57600080fd5b506004546103ae906001600160a01b031681565b6040516001600160a01b03909116815260200161021f565b3480156103d257600080fd5b506103e66103e136600461286c565b610f1b565b60405161021f929190612d4a565b34801561040057600080fd5b5061028d620186a081565b34801561041757600080fd5b506102486110f3565b61024861042e366004612d81565b611106565b610248610441366004612e61565b611258565b34801561045257600080fd5b50610213610461366004612a4f565b61138a565b34801561047257600080fd5b5061028d61138881565b34801561048857600080fd5b5061028d60035481565b34801561049e57600080fd5b506104b26104ad366004612eea565b6113b3565b6040805192835260208301919091520161021f565b3480156104d357600080fd5b5061028d600081565b3480156104e857600080fd5b5061028d6104f7366004612987565b60076020526000908152604090205481565b610248610517366004612f1f565b6113cd565b34801561052857600080fd5b50610248610537366004612fff565b6114dc565b34801561054857600080fd5b50610248610557366004612a4f565b611522565b34801561056857600080fd5b50610213610577366004613040565b60056020526000908152604090205460ff1681565b34801561059857600080fd5b506102486105a736600461305d565b611547565b3480156105b857600080fd5b506102486105c7366004613040565b61165e565b3480156105d857600080fd5b5061028d60008051602061363d83398151915281565b60006001600160e01b03198216637965db0b60e01b148061061f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610630816116ed565b6001600160a01b038316610657576040516312cffc5760e01b815260040160405180910390fd5b6000836001600160a01b03168360405160006040518083038185875af1925050503d80600081146106a4576040519150601f19603f3d011682016040523d82523d6000602084013e6106a9565b606091505b50509050806106cb57604051630443456960e41b815260040160405180910390fd5b50505050565b6106d96116f7565b6106e1611750565b6001600160a01b03871660009081526005602052604090205460ff1661071a5760405163de83a4e960e01b815260040160405180910390fd5b604051634995c3e760e01b81526001600160a01b03881690634995c3e790349061074e908a908a908a908a9060040161311f565b6000604051808303818588803b15801561076757600080fd5b505af115801561077b573d6000803e3d6000fd5b5050505050866001600160a01b0316336001600160a01b031660008051602061361d8339815191526001600080600088886040516107be96959493929190613154565b60405180910390a36107cf60018055565b50505050505050565b6107e360003361138a565b80610801575061080160008051602061363d8339815191523361138a565b61081e57604051630992d00560e11b815260040160405180910390fd5b82811461083e576040516330dda05d60e01b815260040160405180910390fd5b60005b838110156109605782828281811061085b5761085b613190565b905060200201602081019061087091906131b4565b6005600087878581811061088657610886613190565b905060200201602081019061089b9190613040565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558484828181106108d5576108d5613190565b90506020020160208101906108ea9190613040565b6001600160a01b03167fbfd6f983ad3ebd9aeb58497a4e27c4a45c7c299f6895c05fe9204e405bce5b9884848481811061092657610926613190565b905060200201602081019061093b91906131b4565b604051901515815260200160405180910390a280610958816131e7565b915050610841565b5050505050565b600082815260208190526040902060010154610982816116ed565b61098c8383611798565b505050565b6001600160a01b0381163314610a065760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610a10828261181c565b5050565b610a1c6116f7565b610a24611750565b600080610a46610a3760208b018b613040565b8a604001358b60800135611881565b9092509050610a5860208a018a613040565b6001600160a01b03166339c82de634610a7760408d0160208e01613040565b848d6060016020810190610a8b91906131b4565b8e608001358e8e8e8e6040518a63ffffffff1660e01b8152600401610ab7989796959493929190613291565b6000604051808303818588803b158015610ad057600080fd5b505af1158015610ae4573d6000803e3d6000fd5b50610b0d9350610afb9250505060208b018b613040565b6001600160a01b038416906000611936565b610b1a60208a018a613040565b6001600160a01b0316336001600160a01b031660008051602061361d833981519152600060018d60400135868a8a604051610b5a96959493929190613154565b60405180910390a350506107cf60018055565b6000610b78816116ed565b610b806119f8565b50565b610b8e60003361138a565b80610bac5750610bac60008051602061363d8339815191523361138a565b610bc957604051630992d00560e11b815260040160405180910390fd5b611388811115610beb57604051625b37a160e41b815260040160405180910390fd5b600081118015610c0457506004546001600160a01b0316155b15610c225760405163082398e560e31b815260040160405180910390fd5b60035460408051918252602082018390527f959ec4191db1bd972bfbc60dc7d735d4cfb897ca3fd297f4ebd6ee918feb84d4910160405180910390a1600355565b610c6b6116f7565b610c73611750565b600080610c95610c8660208a018a613040565b89604001358a60800135611881565b9092509050610ca76020890189613040565b6001600160a01b031663d30a41c834610cc660408c0160208d01613040565b84610cd760808e0160608f016131b4565b8d608001358d8d8d6040518963ffffffff1660e01b8152600401610d01979695949392919061332d565b6000604051808303818588803b158015610d1a57600080fd5b505af1158015610d2e573d6000803e3d6000fd5b50610d459350610afb9250505060208a018a613040565b610d526020890189613040565b6001600160a01b0316336001600160a01b031660008051602061361d8339815191526000808c60400135868a8a604051610d9196959493929190613154565b60405180910390a35050610da460018055565b505050505050565b610db760003361138a565b80610dd55750610dd560008051602061363d8339815191523361138a565b610df257604051630992d00560e11b815260040160405180910390fd5b828114610e12576040516330dda05d60e01b815260040160405180910390fd5b60005b8381101561096057611388838383818110610e3257610e32613190565b905060200201351115610e5757604051625b37a160e41b815260040160405180910390fd5b828282818110610e6957610e69613190565b9050602002013560076000878785818110610e8657610e86613190565b90506020020135815260200190815260200160002081905550848482818110610eb157610eb1613190565b905060200201357f2b022a7462191d73614c0d3a87a34970ed11ca5ebe4e7ce53c9ed8bb664ae8d9848484818110610eeb57610eeb613190565b90506020020135604051610f0191815260200190565b60405180910390a280610f13816131e7565b915050610e15565b6001600160a01b0382166000908152600660209081526040808320848452909152808220815160a08101835260609384939092908290810182600386835b82821015610f95578382600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610f59565b505050908252506006919091015460ff90811660209283015290820151919250166001600160401b03811115610fcd57610fcd612a97565b604051908082528060200260200182016040528015610ff6578160200160208202803683370190505b509250806020015160ff166001600160401b0381111561101857611018612a97565b604051908082528060200260200182016040528015611041578160200160208202803683370190505b50915060005b816020015160ff168160ff1610156110e957815160ff82166003811061106f5761106f613190565b602002015160000151848260ff168151811061108d5761108d613190565b6020908102919091010152815160ff8216600381106110ae576110ae613190565b602002015160200151838260ff16815181106110cc576110cc613190565b6020908102919091010152806110e18161337d565b915050611047565b50505b9250929050565b60006110fe816116ed565b610b80611a4a565b61110e6116f7565b611116611750565b60008061113961112960208c018c613040565b8b604001358c608001358c611a87565b909250905061114b60208b018b613040565b6001600160a01b03166339c82de63461116a60408e0160208f01613040565b848e606001602081019061117e91906131b4565b8f608001358e8e8e8e6040518a63ffffffff1660e01b81526004016111aa989796959493929190613291565b6000604051808303818588803b1580156111c357600080fd5b505af11580156111d7573d6000803e3d6000fd5b506111ee9350610afb9250505060208c018c613040565b6111fb60208b018b613040565b6001600160a01b0316336001600160a01b031660008051602061361d833981519152600060018e60400135868a8a60405161123b96959493929190613154565b60405180910390a3505061124e60018055565b5050505050505050565b6112606116f7565b611268611750565b60008061128b61127b60208b018b613040565b8a604001358b608001358b611a87565b909250905061129d60208a018a613040565b6001600160a01b031663d30a41c8346112bc60408d0160208e01613040565b848d60600160208101906112d091906131b4565b8e608001358d8d8d6040518963ffffffff1660e01b81526004016112fa979695949392919061332d565b6000604051808303818588803b15801561131357600080fd5b505af1158015611327573d6000803e3d6000fd5b5061133e9350610afb9250505060208b018b613040565b61134b60208a018a613040565b6001600160a01b0316336001600160a01b031660008051602061361d8339815191526000808d60400135868a8a604051610b5a96959493929190613154565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000806113c1858585611beb565b90969095509350505050565b6113d56116f7565b6113dd611750565b6001600160a01b038a1660009081526005602052604090205460ff166114165760405163de83a4e960e01b815260040160405180910390fd5b60405163d3a8b63160e01b81526001600160a01b038b169063d3a8b631903490611450908d908d908d908d908d908d908d9060040161339c565b6000604051808303818588803b15801561146957600080fd5b505af115801561147d573d6000803e3d6000fd5b5050505050896001600160a01b0316336001600160a01b031660008051602061361d83398151915260018060008088886040516114bf96959493929190613154565b60405180910390a36114d060018055565b50505050505050505050565b60006114e7816116ed565b6001600160a01b03831661150e576040516312cffc5760e01b815260040160405180910390fd5b6106cb6001600160a01b0385168484611e51565b60008281526020819052604090206001015461153d816116ed565b61098c838361181c565b61155260003361138a565b80611570575061157060008051602061363d8339815191523361138a565b61158d57604051630992d00560e11b815260040160405180910390fd5b828114158061159c5750600383115b156115ba576040516330dda05d60e01b815260040160405180910390fd5b60005b8581101561124e5761164c888888848181106115db576115db613190565b9050602002013587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a925089918291850190849080828437600092019190915250611e8192505050565b80611656816131e7565b9150506115bd565b6000611669816116ed565b6001600160a01b0382166116905760405163082398e560e31b815260040160405180910390fd5b6004546040516001600160a01b038085169216907f21eb548722a564f6e09f039f7aa858ae94c911910f3823b37af2250eeca4f40390600090a350600480546001600160a01b0319166001600160a01b0392909216919091179055565b610b808133612113565b6002600154036117495760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109fd565b6002600155565b60025460ff16156117965760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109fd565b565b6117a2828261138a565b610a10576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556117d83390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611826828261138a565b15610a10576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038316600090815260056020526040812054819060ff166118bc5760405163de83a4e960e01b815260040160405180910390fd5b846001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191e919061342f565b915061192c8286868661216c565b9050935093915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526119878482612359565b6106cb576040516001600160a01b0384166024820152600060448201526119ee90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612400565b6106cb8482612400565b611a006124d5565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b611a52611750565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611a2d3390565b6001600160a01b038416600090815260056020526040812054819060ff16611ac25760405163de83a4e960e01b815260040160405180910390fd5b856001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b24919061342f565b91506001600160a01b03821663d505accf3330888735611b4a60408a0160208b0161344c565b604080516001600160e01b031960e089901b1681526001600160a01b0396871660048201529590941660248601526044850192909252606484015260ff16608483015286013560a4820152606086013560c482015260e401600060405180830381600087803b158015611bbc57600080fd5b505af1158015611bd0573d6000803e3d6000fd5b50505050611be08287878761216c565b905094509492505050565b6001600160a01b0383166000908152600660209081526040808320858452909152808220815160a08101835283928392908290810182600386835b82821015611c62578382600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611c26565b505050908252506006919091015460ff908116602092830152908201519192506000911615801590611c945750600085115b15611db75784600080805b856020015160ff168160ff161015611dae57855160009060ff831660038110611cca57611cca613190565b602002015151875190915060009060ff841660038110611cec57611cec613190565b6020020151602001519050600060018960200151611d0a919061346f565b60ff168460ff1603611d1d575085611d42565b611d278584613488565b871115611d3f57611d388584613488565b9050611d42565b50855b8015611d8557620186a0611d56838361349b565b611d6091906134b2565b611d6a90896134d4565b9750611d7681876134d4565b9550611d828188613488565b96505b82945086600003611d9857505050611dae565b5050508080611da69061337d565b915050611c9f565b50505050611ded565b6000600354118015611dc95750600085115b15611ded57620186a060035486611de0919061349b565b611dea91906134b2565b90505b6000868152600760205260409020548015801590611e0b5750600086115b15611e3557620186a0611e1e828861349b565b611e2891906134b2565b611e3290836134d4565b91505b8194508486611e449190613488565b9350505050935093915050565b6040516001600160a01b03831660248201526044810182905261098c90849063a9059cbb60e01b906064016119b7565b6001600160a01b03841660009081526006602090815260408083208684529091528120905b60038160ff161015611f095760408051808201909152600080825260208201528260ff831660038110611edb57611edb613190565b6002020160008201518160000155602082015181600101559050508080611f019061337d565b915050611ea6565b50825180156120b35760005b818160ff1610156120b157611388848260ff1681518110611f3857611f38613190565b60200260200101511115611f5e57604051625b37a160e41b815260040160405180910390fd5b60008160ff16118015611f8d5750848160ff1681518110611f8157611f81613190565b60200260200101516000145b15611fab57604051630cdd0ebf60e31b815260040160405180910390fd5b60008160ff16118015612000575084611fc560018361346f565b60ff1681518110611fd857611fd8613190565b6020026020010151858260ff1681518110611ff557611ff5613190565b602002602001015111155b1561201e57604051630cdd0ebf60e31b815260040160405180910390fd5b6040518060400160405280868360ff168151811061203e5761203e613190565b60200260200101518152602001858360ff168151811061206057612060613190565b6020026020010151815250836000018260ff166003811061208357612083613190565b60020201600082015181600001556020820151816001015590505080806120a99061337d565b915050611f15565b505b60068201805460ff191660ff831617905560405185906001600160a01b038816907fe875e6846deb900a1c39242590238ce046f1880aceb983ceef966c09a50647a0906121039088908890612d4a565b60405180910390a3505050505050565b61211d828261138a565b610a105761212a8161251e565b612135836020612530565b60405160200161214692919061350b565b60408051601f198184030181529082905262461bcd60e51b82526109fd91600401613580565b6040516370a0823160e01b8152306004820152600090859082906001600160a01b038316906370a0823190602401602060405180830381865afa1580156121b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121db91906135b3565b90506121f26001600160a01b0383163330886126d2565b6040516370a0823160e01b815230600482015260009082906001600160a01b038516906370a0823190602401602060405180830381865afa15801561223b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061225f91906135b3565b6122699190613488565b905085811461228b5760405163a62c631560e01b815260040160405180910390fd5b60008061229989888a611beb565b90925090508115612336576004546001600160a01b03166122cd5760405163082398e560e31b815260040160405180910390fd5b6004546122e7906001600160a01b03878116911684611e51565b600454604080518481526001600160a01b0392831660208201528b8316928d169133917f0c7016eab065212f095b32ca6daf66b021b628b6457815d893fff6f43a374c34910160405180910390a45b61234a6001600160a01b0386168a83611936565b9450505050505b949350505050565b6000806000846001600160a01b03168460405161237691906135cc565b6000604051808303816000865af19150503d80600081146123b3576040519150601f19603f3d011682016040523d82523d6000602084013e6123b8565b606091505b50915091508180156123e25750805115806123e25750808060200190518101906123e291906135e8565b80156123f757506001600160a01b0385163b15155b95945050505050565b6000612455826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661270a9092919063ffffffff16565b905080516000148061247657508080602001905181019061247691906135e8565b61098c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016109fd565b60025460ff166117965760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109fd565b606061061f6001600160a01b03831660145b6060600061253f83600261349b565b61254a9060026134d4565b6001600160401b0381111561256157612561612a97565b6040519080825280601f01601f19166020018201604052801561258b576020820181803683370190505b509050600360fc1b816000815181106125a6576125a6613190565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106125d5576125d5613190565b60200101906001600160f81b031916908160001a90535060006125f984600261349b565b6126049060016134d4565b90505b600181111561267c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061263857612638613190565b1a60f81b82828151811061264e5761264e613190565b60200101906001600160f81b031916908160001a90535060049490941c9361267581613605565b9050612607565b5083156126cb5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109fd565b9392505050565b6040516001600160a01b03808516602483015283166044820152606481018290526106cb9085906323b872dd60e01b906084016119b7565b6060612351848460008585600080866001600160a01b0316858760405161273191906135cc565b60006040518083038185875af1925050503d806000811461276e576040519150601f19603f3d011682016040523d82523d6000602084013e612773565b606091505b50915091506127848783838761278f565b979650505050505050565b606083156127fe5782516000036127f7576001600160a01b0385163b6127f75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109fd565b5081612351565b61235183838151156128135781518083602001fd5b8060405162461bcd60e51b81526004016109fd9190613580565b60006020828403121561283f57600080fd5b81356001600160e01b0319811681146126cb57600080fd5b6001600160a01b0381168114610b8057600080fd5b6000806040838503121561287f57600080fd5b823561288a81612857565b946020939093013593505050565b80356128a381612857565b919050565b60008083601f8401126128ba57600080fd5b5081356001600160401b038111156128d157600080fd5b6020830191508360208285010111156110ec57600080fd5b600080600080600080600060a0888a03121561290457600080fd5b873561290f81612857565b965060208801359550604088013561292681612857565b945060608801356001600160401b038082111561294257600080fd5b61294e8b838c016128a8565b909650945060808a013591508082111561296757600080fd5b506129748a828b016128a8565b989b979a50959850939692959293505050565b60006020828403121561299957600080fd5b5035919050565b60008083601f8401126129b257600080fd5b5081356001600160401b038111156129c957600080fd5b6020830191508360208260051b85010111156110ec57600080fd5b600080600080604085870312156129fa57600080fd5b84356001600160401b0380821115612a1157600080fd5b612a1d888389016129a0565b90965094506020870135915080821115612a3657600080fd5b50612a43878288016129a0565b95989497509550505050565b60008060408385031215612a6257600080fd5b823591506020830135612a7481612857565b809150509250929050565b600060a08284031215612a9157600080fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612ad557612ad5612a97565b604052919050565b60006001600160401b03821115612af657612af6612a97565b5060051b60200190565b600082601f830112612b1157600080fd5b81356020612b26612b2183612add565b612aad565b82815260059290921b84018101918181019086841115612b4557600080fd5b8286015b84811015612b69578035612b5c81612857565b8352918301918301612b49565b509695505050505050565b600082601f830112612b8557600080fd5b81356020612b95612b2183612add565b82815260059290921b84018101918181019086841115612bb457600080fd5b8286015b84811015612b695780358352918301918301612bb8565b6000806000806000806000610120888a031215612beb57600080fd5b612bf58989612a7f565b965060a08801356001600160401b0380821115612c1157600080fd5b612c1d8b838c01612b00565b975060c08a0135915080821115612c3357600080fd5b612c3f8b838c01612b74565b965060e08a0135915080821115612c5557600080fd5b612c618b838c016129a0565b90965094506101008a013591508082111561296757600080fd5b6000806000806000806101008789031215612c9557600080fd5b612c9f8888612a7f565b955060a0870135612caf81612857565b945060c08701356001600160401b0380821115612ccb57600080fd5b612cd78a838b016128a8565b909650945060e0890135915080821115612cf057600080fd5b50612cfd89828a016128a8565b979a9699509497509295939492505050565b600081518084526020808501945080840160005b83811015612d3f57815187529582019590820190600101612d23565b509495945050505050565b604081526000612d5d6040830185612d0f565b82810360208401526123f78185612d0f565b600060808284031215612a9157600080fd5b6000806000806000806000806101a0898b031215612d9e57600080fd5b612da88a8a612a7f565b9750612db78a60a08b01612d6f565b96506101208901356001600160401b0380821115612dd457600080fd5b612de08c838d01612b00565b97506101408b0135915080821115612df757600080fd5b612e038c838d01612b74565b96506101608b0135915080821115612e1a57600080fd5b612e268c838d016129a0565b90965094506101808b0135915080821115612e4057600080fd5b50612e4d8b828c016128a8565b999c989b5096995094979396929594505050565b6000806000806000806000610180888a031215612e7d57600080fd5b612e878989612a7f565b9650612e968960a08a01612d6f565b9550610120880135612ea781612857565b94506101408801356001600160401b0380821115612ec457600080fd5b612ed08b838c016128a8565b90965094506101608a013591508082111561296757600080fd5b600080600060608486031215612eff57600080fd5b8335612f0a81612857565b95602085013595506040909401359392505050565b60008060008060008060008060008060c08b8d031215612f3e57600080fd5b612f478b612898565b995060208b0135985060408b01356001600160401b0380821115612f6a57600080fd5b612f768e838f016129a0565b909a50985060608d0135915080821115612f8f57600080fd5b612f9b8e838f016129a0565b909850965060808d0135915080821115612fb457600080fd5b612fc08e838f016129a0565b909650945060a08d0135915080821115612fd957600080fd5b50612fe68d828e016128a8565b915080935050809150509295989b9194979a5092959850565b60008060006060848603121561301457600080fd5b833561301f81612857565b9250602084013561302f81612857565b929592945050506040919091013590565b60006020828403121561305257600080fd5b81356126cb81612857565b60008060008060008060006080888a03121561307857600080fd5b873561308381612857565b965060208801356001600160401b038082111561309f57600080fd5b6130ab8b838c016129a0565b909850965060408a01359150808211156130c457600080fd5b6130d08b838c016129a0565b909650945060608a01359150808211156130e957600080fd5b506129748a828b016129a0565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8481526001600160a01b038416602082015260606040820181905260009061314a90830184866130f6565b9695505050505050565b8615158152851515602082015284604082015283606082015260a06080820152600061318460a0830184866130f6565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b8015158114610b8057600080fd5b6000602082840312156131c657600080fd5b81356126cb816131a6565b634e487b7160e01b600052601160045260246000fd5b6000600182016131f9576131f96131d1565b5060010190565b81835260006020808501808196508560051b810191508460005b878110156132845782840389528135601e1988360301811261323b57600080fd5b870185810190356001600160401b0381111561325657600080fd5b80360382131561326557600080fd5b6132708682846130f6565b9a87019a955050509084019060010161321a565b5091979650505050505050565b600060e0820160018060a01b03808c16845260208b818601528a1515604086015289606086015260e0608086015282895180855261010087019150828b01945060005b818110156132f25785518516835294830194918301916001016132d4565b505085810360a0870152613306818a612d0f565b935050505082810360c084015261331e818587613200565b9b9a5050505050505050505050565b6001600160a01b038881168252602082018890528615156040830152606082018690528416608082015260c060a0820181905260009061337090830184866130f6565b9998505050505050505050565b600060ff821660ff8103613393576133936131d1565b60010192915050565b87815260806020808301829052908201879052600090889060a08401835b8a8110156133e85783356133cd81612857565b6001600160a01b0316825292820192908201906001016133ba565b5084810360408601528781526001600160fb1b0388111561340857600080fd5b8760051b9250828983830137909101838103820160608501529061331e8183018688613200565b60006020828403121561344157600080fd5b81516126cb81612857565b60006020828403121561345e57600080fd5b813560ff811681146126cb57600080fd5b60ff828116828216039081111561061f5761061f6131d1565b8181038181111561061f5761061f6131d1565b808202811582820484141761061f5761061f6131d1565b6000826134cf57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561061f5761061f6131d1565b60005b838110156135025781810151838201526020016134ea565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516135438160178501602088016134e7565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516135748160288401602088016134e7565b01602801949350505050565b602081526000825180602084015261359f8160408501602087016134e7565b601f01601f19169190910160400192915050565b6000602082840312156135c557600080fd5b5051919050565b600082516135de8184602087016134e7565b9190910192915050565b6000602082840312156135fa57600080fd5b81516126cb816131a6565b600081613614576136146131d1565b50600019019056fedc35ec9c20a3583ca2942e2bf27861adb550876aefb2699c87769d4e0cddcd4d14031051ef64910ea26175284bbaea2d8f485c9aec1697121604906a168aebdba264697066735822122017304cfbcd8841f997b2ab409931d83ed70b197d553f9c553de8a607a50d4edb64736f6c63430008130033

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

0000000000000000000000005db7ad07d4903579a0342f7332bd4e3ed480d1af000000000000000000000000b30dc8ada8a9a704cc803b60f98ec92084a87942000000000000000000000000359f01614eed04dbe2b9a3f6d45835cb1b200b25000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000229ac52e807e83bc21507caa93138972da44a61b000000000000000000000000168b439f88ab57bf7633cb39131f91bc90a3b74d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : access (address[2]): 0x5dB7AD07D4903579A0342F7332Bd4E3eD480d1AF,0xb30DC8adA8a9a704cC803B60F98EC92084a87942
Arg [1] : _treasury (address): 0x359f01614EED04Dbe2b9A3F6d45835cB1b200B25
Arg [2] : _feeRate (uint256): 70
Arg [3] : initialControllers (address[]): 0x229ac52e807e83Bc21507CaA93138972Da44A61b,0x168B439F88AB57bF7633CB39131f91BC90A3b74d
Arg [4] : premiumChainIds (uint256[]):
Arg [5] : premiumRate (uint256[]):

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 0000000000000000000000005db7ad07d4903579a0342f7332bd4e3ed480d1af
Arg [1] : 000000000000000000000000b30dc8ada8a9a704cc803b60f98ec92084a87942
Arg [2] : 000000000000000000000000359f01614eed04dbe2b9a3f6d45835cb1b200b25
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000046
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [8] : 000000000000000000000000229ac52e807e83bc21507caa93138972da44a61b
Arg [9] : 000000000000000000000000168b439f88ab57bf7633cb39131f91bc90a3b74d
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.