HYPE Price: $22.17 (+0.15%)
 

Overview

HYPE Balance

HyperEVM LogoHyperEVM LogoHyperEVM Logo0 HYPE

HYPE Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BridgePreFundingController

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 99999 runs

Other Settings:
default evmVersion
pragma solidity 0.8.20;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import "../../interfaces/IBridgePreFundingController.sol";
import "../../interfaces/ISwapPreFundingCaller.sol";
import "../../interfaces/IWETH.sol";
import "../../lib/LibUtil.sol";
import "../../lib/SafeERC20.sol";

contract BridgePreFundingController is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable, IBridgePreFundingController {
    using SafeERC20 for IERC20;
    using SafeTransferLib for address;
    address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);

    uint256 public currentOrderNonce;
    mapping(bytes32 orderId => IBridgePreFundingController.OrderInfo) public orderInfo;

    address public swapCaller;
    address public WETH;
    mapping(address => bool) public isExecutor;

    constructor() {
        _disableInitializers();
    }

    receive() external payable {}

    /// @param _swapCaller The address for caller.
    /// @param _WETH The address of WETH.
    function initialize(
        address _swapCaller,
        address _WETH
    ) external initializer {
        __Ownable_init();
        __ReentrancyGuard_init();

        swapCaller = _swapCaller;
        WETH = _WETH;
    }

    modifier onlyExecutor() {
        if (!isExecutor[msg.sender] && owner() != msg.sender) revert Unauthorized();
        _;
    }

    modifier ensure(uint256 deadline) {
        if (block.timestamp > deadline) revert Expired();
        _;
    }

    function createPreFundOrder(
        uint256 amount, IERC20 tokenIn, IERC20 hubToken,
        SwapData calldata swapData, address receiver, bytes memory toChain, bytes calldata auxiliaryData
    ) external payable nonReentrant returns (bytes32 orderId) {
        orderId = _nextGUID();

        if (isETH(tokenIn)) {
            if (amount > msg.value) revert InvalidAmount();
        } else {
            amount = _pullToken(tokenIn, msg.sender, amount);
        }
        if (amount == 0) revert InvalidAmount();

        uint256 balanceReceived;
        if (address(tokenIn) == WETH && isETH(hubToken)) {
            IWETH(WETH).withdraw(amount);
            balanceReceived = amount;
        } else if (isETH(tokenIn) && address(hubToken) == WETH) {
            IWETH(WETH).deposit{value: amount}();
            balanceReceived = amount;
        } else if (tokenIn != hubToken) {
            revert Unauthorized();
//            balanceReceived = _executeSwap(tokenIn, hubToken, swapData.router, address(this), amount, swapData.minSwapAmountOut, swapData.swapData);
//
//            // claim fund stuck in caller
//            ISwapPreFundingCaller(swapCaller).claimFund(tokenIn, 0);
//            emit Swapped(msg.sender, address(tokenIn), address(hubToken), amount, balanceReceived, block.timestamp);
        } else {
            balanceReceived = amount;
        }

        if (orderInfo[orderId].status != 0) revert InvalidState();
        orderInfo[orderId] = OrderInfo(msg.sender, receiver, amount, address(tokenIn), address(hubToken), balanceReceived, toChain, 1);

        emit CreatedOrder(orderId, msg.sender, receiver, amount, address(tokenIn), address(hubToken), balanceReceived, toChain, block.timestamp, auxiliaryData);
    }

    function refundPreFundOrder(bytes32 orderId, uint256 deadline) external nonReentrant onlyExecutor ensure(deadline) {
        OrderInfo memory order = orderInfo[orderId];
        if (order.status != 1) revert InvalidOrderState();
        orderInfo[orderId].status = 3;

        _transferTokenTo(IERC20(order.hubToken), order.user, order.hubAmount);
        emit RefundedOrder(orderId, block.timestamp);
    }

    function executePreFundOrder(
        bytes32 orderId, IERC20 tokenIn, uint256 amount, address receiver, address callTo, bytes memory swapData, uint deadline
    ) external nonReentrant onlyExecutor ensure(deadline) {
        if (swapCaller == address(0)) revert InvalidAddress();

        if (orderId != bytes32(0)) {
            if (orderInfo[orderId].status == 2) revert InvalidOrderState();
            orderInfo[orderId].status = 2;
        }

        bytes memory res;
        if (callTo != address(0) && swapData.length != 0) {
            res = _executeSwap(tokenIn, callTo, amount, swapData);

            // claim fund stuck in caller
            ISwapPreFundingCaller(swapCaller).claimFund(tokenIn, 0);
            emit CallExecutedOrder(orderId, callTo, swapData);
        } else {
            _transferTokenTo(tokenIn, receiver, amount);
        }

        emit ExecutedOrder(orderId, address(tokenIn), amount, receiver, res, callTo, block.timestamp);
    }

    function _executeSwap(
        IERC20 inputToken, IERC20 outputToken, address router, address receiver, uint256 amountSwap, uint256 minAmountOut, bytes memory swapData
    ) internal returns (uint256 balanceReceived) {
        // Execute the token swap
        if (minAmountOut < 1) revert InvalidAmount();
        uint balanceBefore = getBalance(outputToken, receiver);

        uint amtETH;
        if (isETH(inputToken)) {
            amtETH = amountSwap;
        } else {
            _transferTokenTo(inputToken, swapCaller, amountSwap);
        }

        ISwapPreFundingCaller(swapCaller).executeCall{value : amtETH}(inputToken, amountSwap, swapData, router, router);

        balanceReceived = getBalance(outputToken, receiver) - balanceBefore;
        if (balanceReceived < minAmountOut) revert SwapSlippage();
    }

    function _executeSwap(
        IERC20 inputToken, address router, uint256 amountSwap, bytes memory swapData
    ) internal returns (bytes memory res) {
        uint amtETH;
        if (isETH(inputToken)) {
            amtETH = amountSwap;
        } else {
            _transferTokenTo(inputToken, swapCaller, amountSwap);
        }

        res = ISwapPreFundingCaller(swapCaller).executeCall{value : amtETH}(inputToken, amountSwap, swapData, router, router);
    }

    function multicall(bytes[] calldata data) external onlyExecutor {
        for (uint256 i = 0; i < data.length; i++) {
            (bool success, bytes memory result) = address(this).delegatecall(data[i]);

            if (!success) {
                emit ExecuteFailedPreFundOrder(data[i], result, block.timestamp);
            }
        }
    }

    function _nextGUID() internal returns (bytes32) {
        currentOrderNonce++;

        uint256 chainid = block.chainid;

        return keccak256(abi.encodePacked(chainid, currentOrderNonce));
    }

    function getBalance(address token, address account) internal view returns (uint) {
        return getBalance(IERC20(token), account);
    }

    function getBalance(IERC20 token, address account) internal view returns (uint) {
        if (isETH(token)) {
            return account.balance;
        } else {
            return token.balanceOf(account);
        }
    }

    function isETH(IERC20 token) internal pure returns (bool) {
        return (address(token) == address(0) || address(token) == ETH_ADDRESS);
    }

    function _pullToken(IERC20 token, address user, uint256 amount) internal returns (uint256 amountPulled) {
        uint256 balanceBefore = token.balanceOf(address(this));
        token.safeTransferFrom(user, address(this), amount);
        amountPulled = token.balanceOf(address(this)) - balanceBefore;
    }

    function _transferTokenTo(IERC20 token, address to, uint256 amount) internal returns (uint256 amountSent) {
        uint256 balanceBefore = getBalance(token, to);
        if (isETH(token)) {
            to.safeTransferETH(amount);
        } else {
            token.safeTransfer(to, amount);
        }
        amountSent = getBalance(token, to) - balanceBefore;
    }

    function setExecutor(address _executor, bool _isAdd) external onlyOwner {
        if (_executor == address(0)) revert InvalidAddress();

        isExecutor[_executor] = _isAdd;
        emit ExecutorSet(_executor, _isAdd);
    }

    function setSwapCaller(address _swapCaller) external onlyOwner {
        swapCaller = _swapCaller;
    }

    function moveFunds(IERC20 token, address to, uint256 amount) external onlyExecutor {
        if (to == address(0)) revert InvalidAddress();
        _transferTokenTo(token, to, amount);
    }
}

File 2 of 16 : IBridgePreFundingController.sol
pragma solidity 0.8.20;

interface IBridgePreFundingController {
    struct OrderInfo {
        address user;
        address receiver;
        uint256 amount;
        address tokenIn;
        address hubToken;
        uint256 hubAmount;
        bytes toChain;
        uint8 status; // 1: created - 2: executed - 3: refunded
    }
    struct SwapData {
        uint256 minSwapAmountOut;
        address router;
        bytes swapData;
    }

    // ========== EVENTS =========
    event ExecutorSet(address indexed, bool isAdd);
    event Swapped(address indexed user, address tokenIn, address tokenOut, uint256 amountSwap, uint256 amountReceived, uint256 timestamp);
    event CreatedOrder(
        bytes32 indexed orderId,
        address indexed user,
        address receiver,
        uint256 amount,
        address tokenIn,
        address hubToken,
        uint256 hubAmount,
        bytes toChain,
        uint256 timestamp,
        bytes auxiliaryData
    );
    event ExecutedOrder(
        bytes32 indexed orderId,
        address tokenIn,
        uint256 amount,
        address receiver,
        bytes res,
        address callTo,
        uint256 timestamp
    );
    event ExecuteFailedPreFundOrder(bytes callData, bytes callResult, uint256 timestamp);
    event CallExecutedOrder(bytes32 indexed orderId, address callTo, bytes swapData);
    event RefundedOrder(bytes32 indexed orderId, uint256 timestamp);

    // ======= ERRORS ========
    error InvalidAmount();
    error InvalidState();
    error InvalidAddress();
    error SwapSlippage();
    error Unauthorized();
    error InvalidOrderState();
    error InvalidExecuteData();
    error Expired();

}

pragma solidity 0.8.20;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ISwapPreFundingCaller {
    function executeCall(IERC20 fromToken, uint amountIn, bytes calldata data, address bridgeCallee, address targetApprove) external payable returns (bytes memory res);
    function claimFund(IERC20 token, uint256 amount) external returns (uint256);
}

pragma solidity >=0.8.0;

interface IUSDCPermit {
    /**
     * @notice Update allowance with a signed permit
     * @dev EOA wallet signatures should be packed in the order of r, s, v.
     * @param owner       Token owner's address (Authorizer)
     * @param spender     Spender's address
     * @param value       Amount of allowance
     * @param deadline    The time at which the signature expires (unix time), or max uint256 value to signal no expiration
     * @param signature   Signature bytes signed by an EOA wallet or a contract wallet
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        bytes memory signature
    ) external;

    /**
     * @notice Update allowance with a signed permit
     * @param owner       Token owner's address (Authorizer)
     * @param spender     Spender's address
     * @param value       Amount of allowance
     * @param deadline    The time at which the signature expires (unix time), or max uint256 value to signal no expiration
     * @param v           v of the signature
     * @param r           r of the signature
     * @param s           s of the signature
     */
    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);

    /// @notice Returns the remaining number of tokens that `spender` is allowed
    /// to spend on behalf of `owner`
    function allowance(address owner, address spender) external view returns (uint256);
}

pragma solidity >= 0.8.0;

import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol";

interface IWETH is IERC20 {
    function deposit() external payable;
    function transfer(address to, uint256 value) external returns (bool);
    function withdraw(uint256) external;
}

pragma solidity 0.8.20;

library LibBytes {
    // solhint-disable no-inline-assembly

    // LibBytes specific errors
    error SliceOverflow();
    error SliceOutOfBounds();
    error AddressOutOfBounds();

    bytes16 private constant _SYMBOLS = "0123456789abcdef";

    // -------------------------

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    ) internal pure returns (bytes memory) {
        if (_length + 31 < _length) revert SliceOverflow();
        if (_bytes.length < _start + _length) revert SliceOutOfBounds();

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(
                    add(tempBytes, lengthmod),
                    mul(0x20, iszero(lengthmod))
                )
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(
                        add(
                            add(_bytes, lengthmod),
                            mul(0x20, iszero(lengthmod))
                        ),
                        _start
                    )
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(
        bytes memory _bytes,
        uint256 _start
    ) internal pure returns (address) {
        if (_bytes.length < _start + 20) {
            revert AddressOutOfBounds();
        }
        address tempAddress;

        assembly {
            tempAddress := div(
                mload(add(add(_bytes, 0x20), _start)),
                0x1000000000000000000000000
            )
        }

        return tempAddress;
    }

    /// Copied from OpenZeppelin's `Strings.sol` utility library.
    /// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/8335676b0e99944eef6a742e16dcd9ff6e68e609/contracts/utils/Strings.sol
    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);
    }
}

pragma solidity 0.8.20;

import "./LibBytes.sol";

library LibUtil {
    using LibBytes for bytes;

    function getRevertMsg(
        bytes memory _res
    ) internal pure returns (string memory) {
        // If the _res length is less than 68, then the transaction failed silently (without a revert message)
        if (_res.length < 68) return "Transaction reverted silently";
        bytes memory revertData = _res.slice(4, _res.length - 4); // Remove the selector which is the first 4 bytes
        return abi.decode(revertData, (string)); // All that remains is the revert string
    }

    /// @notice Determines whether the given address is the zero address
    /// @param addr The address to verify
    /// @return Boolean indicating if the address is the zero address
    function isZeroAddress(address addr) internal pure returns (bool) {
        return addr == address(0);
    }
}

pragma solidity >=0.8.0;

import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IUSDCPermit} from "../interfaces/IUSDCPermit.sol";

/**
 * wrap SafeTransferLib to retain oz SafeERC20 signature
 */
library SafeERC20 {
    function safeTransferFrom(IERC20 token, address from, address to, uint256 amount) internal {
        SafeTransferLib.safeTransferFrom(address(token), from, to, amount);
    }

    function safeTransfer(IERC20 token, address to, uint256 amount) internal {
        SafeTransferLib.safeTransfer(address(token), to, amount);
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 amount) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + amount;
        SafeTransferLib.safeApprove(address(token), spender, newAllowance);
    }

    function safePermit(
        IERC20 token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        bytes memory signature
    ) internal {
        IUSDCPermit tokenPermit = IUSDCPermit(address(token));
        try tokenPermit.permit(owner, spender, value, deadline, signature) {} catch {
            if (tokenPermit.allowance(owner, spender) < value) {
                revert("SafeERC20: permit did not succeed");
            }
        }
    }
}

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

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

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

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

    uint256 private _status;

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

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _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 This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 14 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Caution! This library won't check that a token has code, responsibility is delegated to the caller.
library SafeTransferLib {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ETH transfer has failed.
    error ETHTransferFailed();

    /// @dev The ERC20 `transferFrom` has failed.
    error TransferFromFailed();

    /// @dev The ERC20 `transfer` has failed.
    error TransferFailed();

    /// @dev The ERC20 `approve` has failed.
    error ApproveFailed();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Suggested gas stipend for contract receiving ETH
    /// that disallows any storage writes.
    uint256 internal constant _GAS_STIPEND_NO_STORAGE_WRITES = 2300;

    /// @dev Suggested gas stipend for contract receiving ETH to perform a few
    /// storage reads and writes, but low enough to prevent griefing.
    /// Multiply by a small constant (e.g. 2), if needed.
    uint256 internal constant _GAS_STIPEND_NO_GRIEF = 100000;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       ETH OPERATIONS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Sends `amount` (in wei) ETH to `to`.
    /// Reverts upon failure.
    function safeTransferETH(address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            // Transfer the ETH and check if it succeeded or not.
            if iszero(call(gas(), to, amount, 0, 0, 0, 0)) {
                // Store the function selector of `ETHTransferFailed()`.
                mstore(0x00, 0xb12d13eb)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
    /// The `gasStipend` can be set to a low enough value to prevent
    /// storage writes or gas griefing.
    ///
    /// If sending via the normal procedure fails, force sends the ETH by
    /// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH.
    ///
    /// Reverts if the current contract has insufficient balance.
    function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {
        /// @solidity memory-safe-assembly
        assembly {
            // If insufficient balance, revert.
            if lt(selfbalance(), amount) {
                // Store the function selector of `ETHTransferFailed()`.
                mstore(0x00, 0xb12d13eb)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }
            // Transfer the ETH and check if it succeeded or not.
            if iszero(call(gasStipend, to, amount, 0, 0, 0, 0)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                // We can directly use `SELFDESTRUCT` in the contract creation.
                // Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758
                if iszero(create(amount, 0x0b, 0x16)) {
                    // For better gas estimation.
                    if iszero(gt(gas(), 1000000)) { revert(0, 0) }
                }
            }
        }
    }

    /// @dev Force sends `amount` (in wei) ETH to `to`, with a gas stipend
    /// equal to `_GAS_STIPEND_NO_GRIEF`. This gas stipend is a reasonable default
    /// for 99% of cases and can be overriden with the three-argument version of this
    /// function if necessary.
    ///
    /// If sending via the normal procedure fails, force sends the ETH by
    /// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH.
    ///
    /// Reverts if the current contract has insufficient balance.
    function forceSafeTransferETH(address to, uint256 amount) internal {
        // Manually inlined because the compiler doesn't inline functions with branches.
        /// @solidity memory-safe-assembly
        assembly {
            // If insufficient balance, revert.
            if lt(selfbalance(), amount) {
                // Store the function selector of `ETHTransferFailed()`.
                mstore(0x00, 0xb12d13eb)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }
            // Transfer the ETH and check if it succeeded or not.
            if iszero(call(_GAS_STIPEND_NO_GRIEF, to, amount, 0, 0, 0, 0)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                // We can directly use `SELFDESTRUCT` in the contract creation.
                // Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758
                if iszero(create(amount, 0x0b, 0x16)) {
                    // For better gas estimation.
                    if iszero(gt(gas(), 1000000)) { revert(0, 0) }
                }
            }
        }
    }

    /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
    /// The `gasStipend` can be set to a low enough value to prevent
    /// storage writes or gas griefing.
    ///
    /// Simply use `gasleft()` for `gasStipend` if you don't need a gas stipend.
    ///
    /// Note: Does NOT revert upon failure.
    /// Returns whether the transfer of ETH is successful instead.
    function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)
        internal
        returns (bool success)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Transfer the ETH and check if it succeeded or not.
            success := call(gasStipend, to, amount, 0, 0, 0, 0)
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                      ERC20 OPERATIONS                      */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
    /// Reverts upon failure.
    ///
    /// The `from` account must have at least `amount` approved for
    /// the current contract to manage.
    function safeTransferFrom(address token, address from, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.

            mstore(0x60, amount) // Store the `amount` argument.
            mstore(0x40, to) // Store the `to` argument.
            mstore(0x2c, shl(96, from)) // Store the `from` argument.
            // Store the function selector of `transferFrom(address,address,uint256)`.
            mstore(0x0c, 0x23b872dd000000000000000000000000)

            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    // Set success to whether the call reverted, if not we check it either
                    // returned exactly 1 (can't just be non-zero data), or had no return data.
                    or(eq(mload(0x00), 1), iszero(returndatasize())),
                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                // Store the function selector of `TransferFromFailed()`.
                mstore(0x00, 0x7939f424)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }

            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Sends all of ERC20 `token` from `from` to `to`.
    /// Reverts upon failure.
    ///
    /// The `from` account must have at least `amount` approved for
    /// the current contract to manage.
    function safeTransferAllFrom(address token, address from, address to)
        internal
        returns (uint256 amount)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.

            mstore(0x40, to) // Store the `to` argument.
            mstore(0x2c, shl(96, from)) // Store the `from` argument.
            // Store the function selector of `balanceOf(address)`.
            mstore(0x0c, 0x70a08231000000000000000000000000)
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                    staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)
                )
            ) {
                // Store the function selector of `TransferFromFailed()`.
                mstore(0x00, 0x7939f424)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }

            // Store the function selector of `transferFrom(address,address,uint256)`.
            mstore(0x00, 0x23b872dd)
            // The `amount` argument is already written to the memory word at 0x6c.
            amount := mload(0x60)

            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    // Set success to whether the call reverted, if not we check it either
                    // returned exactly 1 (can't just be non-zero data), or had no return data.
                    or(eq(mload(0x00), 1), iszero(returndatasize())),
                    call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                // Store the function selector of `TransferFromFailed()`.
                mstore(0x00, 0x7939f424)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }

            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
    /// Reverts upon failure.
    function safeTransfer(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            // Store the function selector of `transfer(address,uint256)`.
            mstore(0x00, 0xa9059cbb000000000000000000000000)

            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    // Set success to whether the call reverted, if not we check it either
                    // returned exactly 1 (can't just be non-zero data), or had no return data.
                    or(eq(mload(0x00), 1), iszero(returndatasize())),
                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                )
            ) {
                // Store the function selector of `TransferFailed()`.
                mstore(0x00, 0x90b8ec18)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }
            // Restore the part of the free memory pointer that was overwritten.
            mstore(0x34, 0)
        }
    }

    /// @dev Sends all of ERC20 `token` from the current contract to `to`.
    /// Reverts upon failure.
    function safeTransferAll(address token, address to) internal returns (uint256 amount) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.
            mstore(0x20, address()) // Store the address of the current contract.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                    staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)
                )
            ) {
                // Store the function selector of `TransferFailed()`.
                mstore(0x00, 0x90b8ec18)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }

            mstore(0x14, to) // Store the `to` argument.
            // The `amount` argument is already written to the memory word at 0x34.
            amount := mload(0x34)
            // Store the function selector of `transfer(address,uint256)`.
            mstore(0x00, 0xa9059cbb000000000000000000000000)

            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    // Set success to whether the call reverted, if not we check it either
                    // returned exactly 1 (can't just be non-zero data), or had no return data.
                    or(eq(mload(0x00), 1), iszero(returndatasize())),
                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                )
            ) {
                // Store the function selector of `TransferFailed()`.
                mstore(0x00, 0x90b8ec18)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }
            // Restore the part of the free memory pointer that was overwritten.
            mstore(0x34, 0)
        }
    }

    /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
    /// Reverts upon failure.
    function safeApprove(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            // Store the function selector of `approve(address,uint256)`.
            mstore(0x00, 0x095ea7b3000000000000000000000000)

            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    // Set success to whether the call reverted, if not we check it either
                    // returned exactly 1 (can't just be non-zero data), or had no return data.
                    or(eq(mload(0x00), 1), iszero(returndatasize())),
                    call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                )
            ) {
                // Store the function selector of `ApproveFailed()`.
                mstore(0x00, 0x3e3f8f73)
                // Revert with (offset, size).
                revert(0x1c, 0x04)
            }
            // Restore the part of the free memory pointer that was overwritten.
            mstore(0x34, 0)
        }
    }

    /// @dev Returns the amount of ERC20 `token` owned by `account`.
    /// Returns zero if the `token` does not exist.
    function balanceOf(address token, address account) internal view returns (uint256 amount) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, account) // Store the `account` argument.
            // Store the function selector of `balanceOf(address)`.
            mstore(0x00, 0x70a08231000000000000000000000000)
            amount :=
                mul(
                    mload(0x20),
                    and( // The arguments of `and` are evaluated from right to left.
                        gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                        staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
                    )
                )
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 99999
  },
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "@chainlink/contracts-ccip/=lib/ccip/contracts/",
    "@layerzerolabs/lz-evm-oapp-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/oapp/",
    "@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/protocol/",
    "@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/",
    "@layerzerolabs/oft-evm/=lib/devtools/packages/oft-evm/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ccip/=lib/ccip/contracts/",
    "devtools/=lib/devtools/packages/toolbox-foundry/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "layerzero-v2/=lib/layerzero-v2/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solady/=lib/solady/src/",
    "solmate/=lib/solady/lib/solmate/src/"
  ]
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Expired","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidExecuteData","type":"error"},{"inputs":[],"name":"InvalidOrderState","type":"error"},{"inputs":[],"name":"InvalidState","type":"error"},{"inputs":[],"name":"SwapSlippage","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"orderId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"callTo","type":"address"},{"indexed":false,"internalType":"bytes","name":"swapData","type":"bytes"}],"name":"CallExecutedOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"orderId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"address","name":"hubToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"hubAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"toChain","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"CreatedOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"callData","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"callResult","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ExecuteFailedPreFundOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"orderId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"bytes","name":"res","type":"bytes"},{"indexed":false,"internalType":"address","name":"callTo","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ExecutedOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"bool","name":"isAdd","type":"bool"}],"name":"ExecutorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"orderId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RefundedOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSwap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Swapped","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"hubToken","type":"address"},{"components":[{"internalType":"uint256","name":"minSwapAmountOut","type":"uint256"},{"internalType":"address","name":"router","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct IBridgePreFundingController.SwapData","name":"swapData","type":"tuple"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes","name":"toChain","type":"bytes"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"createPreFundOrder","outputs":[{"internalType":"bytes32","name":"orderId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"currentOrderNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"orderId","type":"bytes32"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"callTo","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"executePreFundOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapCaller","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isExecutor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"moveFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"orderId","type":"bytes32"}],"name":"orderInfo","outputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"hubToken","type":"address"},{"internalType":"uint256","name":"hubAmount","type":"uint256"},{"internalType":"bytes","name":"toChain","type":"bytes"},{"internalType":"uint8","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"orderId","type":"bytes32"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"refundPreFundOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bool","name":"_isAdd","type":"bool"}],"name":"setExecutor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapCaller","type":"address"}],"name":"setSwapCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapCaller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801562000010575f80fd5b506200001b62000021565b620000e0565b5f54610100900460ff16156200008d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff9081161015620000de575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61281b80620000ee5f395ff3fe6080604052600436106100f2575f3560e01c806393b7cbb311610087578063debfda3011610057578063debfda30146102b6578063f2fde38b146102f4578063f420d00f14610313578063f78d76bb1461033f575f80fd5b806393b7cbb31461022d578063ac9650d81461024c578063ad5c46481461026b578063c783841214610297575f80fd5b8063453fde8b116100c2578063453fde8b1461019c578063485cc955146101af578063715018a6146101ce5780638da5cb5b146101e2575f80fd5b8063106dfda2146100fd5780631e1bff3f1461011e578063238e203f1461013d5780633cfe016b14610179575f80fd5b366100f957005b5f80fd5b348015610108575f80fd5b5061011c610117366004611dce565b61035e565b005b348015610129575f80fd5b5061011c610138366004611e1f565b610626565b348015610148575f80fd5b5061015c610157366004611e5a565b610704565b604051610170989796959493929190611edc565b60405180910390f35b348015610184575f80fd5b5061018e60975481565b604051908152602001610170565b61018e6101aa3660046120b8565b6107ee565b3480156101ba575f80fd5b5061011c6101c936600461217e565b610c53565b3480156101d9575f80fd5b5061011c610e43565b3480156101ed575f80fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610170565b348015610238575f80fd5b5061011c6102473660046121aa565b610e56565b348015610257575f80fd5b5061011c610266366004612236565b611176565b348015610276575f80fd5b50609a546102089073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102a2575f80fd5b5061011c6102b13660046122a5565b6112fb565b3480156102c1575f80fd5b506102e46102d03660046122a5565b609b6020525f908152604090205460ff1681565b6040519015158152602001610170565b3480156102ff575f80fd5b5061011c61030e3660046122a5565b61134a565b34801561031e575f80fd5b506099546102089073ffffffffffffffffffffffffffffffffffffffff1681565b34801561034a575f80fd5b5061011c6103593660046122c0565b611401565b6103666114e9565b335f908152609b602052604090205460ff161580156103b95750336103a060335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b156103f0576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808042111561042b576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f838152609860209081526040808320815161010081018352815473ffffffffffffffffffffffffffffffffffffffff9081168252600183015481169482019490945260028201549281019290925260038101548316606083015260048101549092166080820152600582015460a082015260068201805491929160c0840191906104b5906122fe565b80601f01602080910402602001604051908101604052809291908181526020018280546104e1906122fe565b801561052c5780601f106105035761010080835404028352916020019161052c565b820191905f5260205f20905b81548152906001019060200180831161050f57829003601f168201915b50505091835250506007919091015460ff90811660209092019190915260e08201519192501660011461058b576040517fac494dfc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f84815260986020526040902060070180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660031790556080810151815160a08301516105db92919061155c565b50837f8a0ed9f5a095ced10dc89cda8776801c588fb45b13795d8b6c156b02dba4c5904260405161060e91815260200190565b60405180910390a250506106226001606555565b5050565b61062e6115e3565b73ffffffffffffffffffffffffffffffffffffffff821661067b576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82165f818152609b602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f278b09622564dd3991fe7744514513d64ea2c8ed2b2b9ec1150ad964fde80a99910160405180910390a25050565b60986020525f9081526040902080546001820154600283015460038401546004850154600586015460068701805473ffffffffffffffffffffffffffffffffffffffff9788169896881697959694861695909316939192610764906122fe565b80601f0160208091040260200160405190810160405280929190818152602001828054610790906122fe565b80156107db5780601f106107b2576101008083540402835291602001916107db565b820191905f5260205f20905b8154815290600101906020018083116107be57829003601f168201915b5050506007909301549192505060ff1688565b5f6107f76114e9565b6107ff611664565b905061080a886116b5565b1561084e5734891115610849576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61085c565b61085988338b611708565b98505b885f03610895576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a545f9073ffffffffffffffffffffffffffffffffffffffff8a811691161480156108c557506108c5886116b5565b1561095157609a546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018c905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d906024015f604051808303815f87803b158015610933575f80fd5b505af1158015610945573d5f803e3d5ffd5b50505050899050610a73565b61095a896116b5565b80156109805750609a5473ffffffffffffffffffffffffffffffffffffffff8981169116145b15610a0b57609a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db08b6040518263ffffffff1660e01b81526004015f604051808303818588803b1580156109ec575f80fd5b505af11580156109fe573d5f803e3d5ffd5b5050505050899050610a73565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614610a70576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50885b5f8281526098602052604090206007015460ff1615610abe576040517fbaf3f0f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516101008101825233815273ffffffffffffffffffffffffffffffffffffffff88811660208084019182528385018f81528e8416606086019081528e85166080870190815260a0870189815260c088018e8152600160e08a018190525f8d8152609890975299909520885181549089167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216178255965199810180549a89169a88169a909a179099559251600289015590516003880180549187169186169190911790555160048701805491909516931692909217909255516005840155519091906006820190610bb49082612396565b5060e09190910151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055604051339083907f960cba593903712901f7189367c7784ccffc188446d1955b69f5049821ff1bed90610c34908a908f908f908f9089908e9042908f908f906124f5565b60405180910390a350610c476001606555565b98975050505050505050565b5f54610100900460ff1615808015610c7157505f54600160ff909116105b80610c8a5750303b158015610c8a57505f5460ff166001145b610d1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d77575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610d7f61184a565b610d876118e8565b6099805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255609a8054928516929091169190911790558015610e3e575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610e4b6115e3565b610e545f611986565b565b610e5e6114e9565b335f908152609b602052604090205460ff16158015610eb1575033610e9860335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610ee8576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8080421115610f23576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60995473ffffffffffffffffffffffffffffffffffffffff16610f72576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8715610fff575f8881526098602052604090206007015460ff16600203610fc5576040517fac494dfc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f88815260986020526040902060070180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021790555b606073ffffffffffffffffffffffffffffffffffffffff8516158015906110265750835115155b1561111257611037888689876119fc565b6099546040517f1eba0f4800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301525f6024830152929350911690631eba0f48906044016020604051808303815f875af11580156110ae573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d2919061256d565b50887fd32d05e82c3c45e81878a9d0426f33b8771cc27bcce84b515b26cb717a05a3c18686604051611105929190612584565b60405180910390a261111f565b61111d88878961155c565b505b887f94ec7cc2dd82cdcfeac3ae2da98d96874149eb84ca7a457c00c5c2c72047caff898989858a42604051611159969594939291906125ba565b60405180910390a2505061116d6001606555565b50505050505050565b335f908152609b602052604090205460ff161580156111c95750336111b060335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611200576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b81811015610e3e575f803085858581811061121f5761121f61260b565b90506020028101906112319190612638565b60405161123f929190612699565b5f60405180830381855af49150503d805f8114611277576040519150601f19603f3d011682016040523d82523d5f602084013e61127c565b606091505b5091509150816112e6577f7ccdb58eaaa21894794741dae6f766bd90f4de32757ce5a072fa569bccd6e2908585858181106112b9576112b961260b565b90506020028101906112cb9190612638565b83426040516112dd94939291906126a8565b60405180910390a15b505080806112f39061270c565b915050611202565b6113036115e3565b609980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6113526115e3565b73ffffffffffffffffffffffffffffffffffffffff81166113f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d12565b6113fe81611986565b50565b335f908152609b602052604090205460ff1615801561145457503361143b60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561148b576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166114d8576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114e383838361155c565b50505050565b600260655403611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d12565b6002606555565b5f806115688585611b06565b9050611573856116b5565b1561159d5761159873ffffffffffffffffffffffffffffffffffffffff851684611bc8565b6115be565b6115be73ffffffffffffffffffffffffffffffffffffffff86168585611be1565b806115c98686611b06565b6115d39190612743565b95945050505050565b6001606555565b60335473ffffffffffffffffffffffffffffffffffffffff163314610e54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d12565b609780545f91826116748361270c565b9091555050609754604051469161169991839190602001918252602082015260400190565b6040516020818303038152906040528051906020012091505090565b5f73ffffffffffffffffffffffffffffffffffffffff82161580611702575073ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b92915050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f90819073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611774573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611798919061256d565b90506117bc73ffffffffffffffffffffffffffffffffffffffff8616853086611bec565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152819073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015611826573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c9919061256d565b5f54610100900460ff166118e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b610e54611bf8565b5f54610100900460ff1661197e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b610e54611c97565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60605f611a08866116b5565b15611a14575082611a3b565b609954611a3990879073ffffffffffffffffffffffffffffffffffffffff168661155c565b505b6099546040517fb820ec3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063b820ec3e908390611a9b908a90899089908c908190600401612756565b5f6040518083038185885af1158015611ab6573d5f803e3d5ffd5b50505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611afc91908101906127a5565b9695505050505050565b5f611b10836116b5565b15611b33575073ffffffffffffffffffffffffffffffffffffffff811631611702565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015611b9d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bc1919061256d565b9392505050565b5f805f8084865af16106225763b12d13eb5f526004601cfd5b610e3e838383611d2d565b6114e384848484611d76565b5f54610100900460ff16611c8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b610e5433611986565b5f54610100900460ff166115dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611d6d576390b8ec185f526004601cfd5b5f603452505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f51141716611dc157637939f4245f526004601cfd5b5f60605260405250505050565b5f8060408385031215611ddf575f80fd5b50508035926020909101359150565b73ffffffffffffffffffffffffffffffffffffffff811681146113fe575f80fd5b8035611e1a81611dee565b919050565b5f8060408385031215611e30575f80fd5b8235611e3b81611dee565b915060208301358015158114611e4f575f80fd5b809150509250929050565b5f60208284031215611e6a575f80fd5b5035919050565b5f5b83811015611e8b578181015183820152602001611e73565b50505f910152565b5f8151808452611eaa816020860160208601611e71565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b5f61010073ffffffffffffffffffffffffffffffffffffffff808c168452808b16602085015289604085015280891660608501528088166080850152508560a08401528060c0840152611f3181840186611e93565b91505060ff831660e08301529998505050505050505050565b5f60608284031215611f5a575f80fd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611fd457611fd4611f60565b604052919050565b5f67ffffffffffffffff821115611ff557611ff5611f60565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f830112612030575f80fd5b813561204361203e82611fdc565b611f8d565b818152846020838601011115612057575f80fd5b816020850160208301375f918101602001919091529392505050565b5f8083601f840112612083575f80fd5b50813567ffffffffffffffff81111561209a575f80fd5b6020830191508360208285010111156120b1575f80fd5b9250929050565b5f805f805f805f8060e0898b0312156120cf575f80fd5b8835975060208901356120e181611dee565b965060408901356120f181611dee565b9550606089013567ffffffffffffffff8082111561210d575f80fd5b6121198c838d01611f4a565b965061212760808c01611e0f565b955060a08b013591508082111561213c575f80fd5b6121488c838d01612021565b945060c08b013591508082111561215d575f80fd5b5061216a8b828c01612073565b999c989b5096995094979396929594505050565b5f806040838503121561218f575f80fd5b823561219a81611dee565b91506020830135611e4f81611dee565b5f805f805f805f60e0888a0312156121c0575f80fd5b8735965060208801356121d281611dee565b95506040880135945060608801356121e981611dee565b935060808801356121f981611dee565b925060a088013567ffffffffffffffff811115612214575f80fd5b6122208a828b01612021565b92505060c0880135905092959891949750929550565b5f8060208385031215612247575f80fd5b823567ffffffffffffffff8082111561225e575f80fd5b818501915085601f830112612271575f80fd5b81358181111561227f575f80fd5b8660208260051b8501011115612293575f80fd5b60209290920196919550909350505050565b5f602082840312156122b5575f80fd5b8135611bc181611dee565b5f805f606084860312156122d2575f80fd5b83356122dd81611dee565b925060208401356122ed81611dee565b929592945050506040919091013590565b600181811c9082168061231257607f821691505b602082108103611f5a577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f821115610e3e575f81815260208120601f850160051c8101602086101561236f5750805b601f850160051c820191505b8181101561238e5782815560010161237b565b505050505050565b815167ffffffffffffffff8111156123b0576123b0611f60565b6123c4816123be84546122fe565b84612349565b602080601f831160018114612416575f84156123e05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561238e565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561246257888601518255948401946001909101908401612443565b508582101561249e57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b5f61010073ffffffffffffffffffffffffffffffffffffffff808d1684528b6020850152808b166040850152808a166060850152508760808401528060a084015261254281840188611e93565b90508560c084015282810360e084015261255d8185876124ae565b9c9b505050505050505050505050565b5f6020828403121561257d575f80fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f6125b26040830184611e93565b949350505050565b5f73ffffffffffffffffffffffffffffffffffffffff8089168352876020840152808716604084015260c060608401526125f760c0840187611e93565b941660808301525060a00152949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261266b575f80fd5b83018035915067ffffffffffffffff821115612685575f80fd5b6020019150368190038213156120b1575f80fd5b818382375f9101908152919050565b606081525f6126bb6060830186886124ae565b82810360208401526126cd8186611e93565b91505082604083015295945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361273c5761273c6126df565b5060010190565b81810381811115611702576117026126df565b5f73ffffffffffffffffffffffffffffffffffffffff808816835286602084015260a0604084015261278b60a0840187611e93565b948116606084015292909216608090910152509392505050565b5f602082840312156127b5575f80fd5b815167ffffffffffffffff8111156127cb575f80fd5b8201601f810184136127db575f80fd5b80516127e961203e82611fdc565b8181528560208385010111156127fd575f80fd5b6115d3826020830160208601611e7156fea164736f6c6343000814000a

Deployed Bytecode

0x6080604052600436106100f2575f3560e01c806393b7cbb311610087578063debfda3011610057578063debfda30146102b6578063f2fde38b146102f4578063f420d00f14610313578063f78d76bb1461033f575f80fd5b806393b7cbb31461022d578063ac9650d81461024c578063ad5c46481461026b578063c783841214610297575f80fd5b8063453fde8b116100c2578063453fde8b1461019c578063485cc955146101af578063715018a6146101ce5780638da5cb5b146101e2575f80fd5b8063106dfda2146100fd5780631e1bff3f1461011e578063238e203f1461013d5780633cfe016b14610179575f80fd5b366100f957005b5f80fd5b348015610108575f80fd5b5061011c610117366004611dce565b61035e565b005b348015610129575f80fd5b5061011c610138366004611e1f565b610626565b348015610148575f80fd5b5061015c610157366004611e5a565b610704565b604051610170989796959493929190611edc565b60405180910390f35b348015610184575f80fd5b5061018e60975481565b604051908152602001610170565b61018e6101aa3660046120b8565b6107ee565b3480156101ba575f80fd5b5061011c6101c936600461217e565b610c53565b3480156101d9575f80fd5b5061011c610e43565b3480156101ed575f80fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610170565b348015610238575f80fd5b5061011c6102473660046121aa565b610e56565b348015610257575f80fd5b5061011c610266366004612236565b611176565b348015610276575f80fd5b50609a546102089073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102a2575f80fd5b5061011c6102b13660046122a5565b6112fb565b3480156102c1575f80fd5b506102e46102d03660046122a5565b609b6020525f908152604090205460ff1681565b6040519015158152602001610170565b3480156102ff575f80fd5b5061011c61030e3660046122a5565b61134a565b34801561031e575f80fd5b506099546102089073ffffffffffffffffffffffffffffffffffffffff1681565b34801561034a575f80fd5b5061011c6103593660046122c0565b611401565b6103666114e9565b335f908152609b602052604090205460ff161580156103b95750336103a060335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b156103f0576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808042111561042b576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f838152609860209081526040808320815161010081018352815473ffffffffffffffffffffffffffffffffffffffff9081168252600183015481169482019490945260028201549281019290925260038101548316606083015260048101549092166080820152600582015460a082015260068201805491929160c0840191906104b5906122fe565b80601f01602080910402602001604051908101604052809291908181526020018280546104e1906122fe565b801561052c5780601f106105035761010080835404028352916020019161052c565b820191905f5260205f20905b81548152906001019060200180831161050f57829003601f168201915b50505091835250506007919091015460ff90811660209092019190915260e08201519192501660011461058b576040517fac494dfc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f84815260986020526040902060070180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660031790556080810151815160a08301516105db92919061155c565b50837f8a0ed9f5a095ced10dc89cda8776801c588fb45b13795d8b6c156b02dba4c5904260405161060e91815260200190565b60405180910390a250506106226001606555565b5050565b61062e6115e3565b73ffffffffffffffffffffffffffffffffffffffff821661067b576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82165f818152609b602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f278b09622564dd3991fe7744514513d64ea2c8ed2b2b9ec1150ad964fde80a99910160405180910390a25050565b60986020525f9081526040902080546001820154600283015460038401546004850154600586015460068701805473ffffffffffffffffffffffffffffffffffffffff9788169896881697959694861695909316939192610764906122fe565b80601f0160208091040260200160405190810160405280929190818152602001828054610790906122fe565b80156107db5780601f106107b2576101008083540402835291602001916107db565b820191905f5260205f20905b8154815290600101906020018083116107be57829003601f168201915b5050506007909301549192505060ff1688565b5f6107f76114e9565b6107ff611664565b905061080a886116b5565b1561084e5734891115610849576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61085c565b61085988338b611708565b98505b885f03610895576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a545f9073ffffffffffffffffffffffffffffffffffffffff8a811691161480156108c557506108c5886116b5565b1561095157609a546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018c905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d906024015f604051808303815f87803b158015610933575f80fd5b505af1158015610945573d5f803e3d5ffd5b50505050899050610a73565b61095a896116b5565b80156109805750609a5473ffffffffffffffffffffffffffffffffffffffff8981169116145b15610a0b57609a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db08b6040518263ffffffff1660e01b81526004015f604051808303818588803b1580156109ec575f80fd5b505af11580156109fe573d5f803e3d5ffd5b5050505050899050610a73565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614610a70576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50885b5f8281526098602052604090206007015460ff1615610abe576040517fbaf3f0f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516101008101825233815273ffffffffffffffffffffffffffffffffffffffff88811660208084019182528385018f81528e8416606086019081528e85166080870190815260a0870189815260c088018e8152600160e08a018190525f8d8152609890975299909520885181549089167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216178255965199810180549a89169a88169a909a179099559251600289015590516003880180549187169186169190911790555160048701805491909516931692909217909255516005840155519091906006820190610bb49082612396565b5060e09190910151600790910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff909216919091179055604051339083907f960cba593903712901f7189367c7784ccffc188446d1955b69f5049821ff1bed90610c34908a908f908f908f9089908e9042908f908f906124f5565b60405180910390a350610c476001606555565b98975050505050505050565b5f54610100900460ff1615808015610c7157505f54600160ff909116105b80610c8a5750303b158015610c8a57505f5460ff166001145b610d1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d77575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610d7f61184a565b610d876118e8565b6099805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255609a8054928516929091169190911790558015610e3e575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610e4b6115e3565b610e545f611986565b565b610e5e6114e9565b335f908152609b602052604090205460ff16158015610eb1575033610e9860335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610ee8576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8080421115610f23576040517f203d82d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60995473ffffffffffffffffffffffffffffffffffffffff16610f72576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8715610fff575f8881526098602052604090206007015460ff16600203610fc5576040517fac494dfc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f88815260986020526040902060070180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021790555b606073ffffffffffffffffffffffffffffffffffffffff8516158015906110265750835115155b1561111257611037888689876119fc565b6099546040517f1eba0f4800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301525f6024830152929350911690631eba0f48906044016020604051808303815f875af11580156110ae573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d2919061256d565b50887fd32d05e82c3c45e81878a9d0426f33b8771cc27bcce84b515b26cb717a05a3c18686604051611105929190612584565b60405180910390a261111f565b61111d88878961155c565b505b887f94ec7cc2dd82cdcfeac3ae2da98d96874149eb84ca7a457c00c5c2c72047caff898989858a42604051611159969594939291906125ba565b60405180910390a2505061116d6001606555565b50505050505050565b335f908152609b602052604090205460ff161580156111c95750336111b060335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15611200576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b81811015610e3e575f803085858581811061121f5761121f61260b565b90506020028101906112319190612638565b60405161123f929190612699565b5f60405180830381855af49150503d805f8114611277576040519150601f19603f3d011682016040523d82523d5f602084013e61127c565b606091505b5091509150816112e6577f7ccdb58eaaa21894794741dae6f766bd90f4de32757ce5a072fa569bccd6e2908585858181106112b9576112b961260b565b90506020028101906112cb9190612638565b83426040516112dd94939291906126a8565b60405180910390a15b505080806112f39061270c565b915050611202565b6113036115e3565b609980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6113526115e3565b73ffffffffffffffffffffffffffffffffffffffff81166113f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d12565b6113fe81611986565b50565b335f908152609b602052604090205460ff1615801561145457503361143b60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561148b576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166114d8576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114e383838361155c565b50505050565b600260655403611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d12565b6002606555565b5f806115688585611b06565b9050611573856116b5565b1561159d5761159873ffffffffffffffffffffffffffffffffffffffff851684611bc8565b6115be565b6115be73ffffffffffffffffffffffffffffffffffffffff86168585611be1565b806115c98686611b06565b6115d39190612743565b95945050505050565b6001606555565b60335473ffffffffffffffffffffffffffffffffffffffff163314610e54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d12565b609780545f91826116748361270c565b9091555050609754604051469161169991839190602001918252602082015260400190565b6040516020818303038152906040528051906020012091505090565b5f73ffffffffffffffffffffffffffffffffffffffff82161580611702575073ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b92915050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f90819073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611774573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611798919061256d565b90506117bc73ffffffffffffffffffffffffffffffffffffffff8616853086611bec565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152819073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015611826573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c9919061256d565b5f54610100900460ff166118e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b610e54611bf8565b5f54610100900460ff1661197e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b610e54611c97565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60605f611a08866116b5565b15611a14575082611a3b565b609954611a3990879073ffffffffffffffffffffffffffffffffffffffff168661155c565b505b6099546040517fb820ec3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063b820ec3e908390611a9b908a90899089908c908190600401612756565b5f6040518083038185885af1158015611ab6573d5f803e3d5ffd5b50505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611afc91908101906127a5565b9695505050505050565b5f611b10836116b5565b15611b33575073ffffffffffffffffffffffffffffffffffffffff811631611702565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015611b9d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611bc1919061256d565b9392505050565b5f805f8084865af16106225763b12d13eb5f526004601cfd5b610e3e838383611d2d565b6114e384848484611d76565b5f54610100900460ff16611c8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b610e5433611986565b5f54610100900460ff166115dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d12565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f51141716611d6d576390b8ec185f526004601cfd5b5f603452505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f51141716611dc157637939f4245f526004601cfd5b5f60605260405250505050565b5f8060408385031215611ddf575f80fd5b50508035926020909101359150565b73ffffffffffffffffffffffffffffffffffffffff811681146113fe575f80fd5b8035611e1a81611dee565b919050565b5f8060408385031215611e30575f80fd5b8235611e3b81611dee565b915060208301358015158114611e4f575f80fd5b809150509250929050565b5f60208284031215611e6a575f80fd5b5035919050565b5f5b83811015611e8b578181015183820152602001611e73565b50505f910152565b5f8151808452611eaa816020860160208601611e71565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b5f61010073ffffffffffffffffffffffffffffffffffffffff808c168452808b16602085015289604085015280891660608501528088166080850152508560a08401528060c0840152611f3181840186611e93565b91505060ff831660e08301529998505050505050505050565b5f60608284031215611f5a575f80fd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611fd457611fd4611f60565b604052919050565b5f67ffffffffffffffff821115611ff557611ff5611f60565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f830112612030575f80fd5b813561204361203e82611fdc565b611f8d565b818152846020838601011115612057575f80fd5b816020850160208301375f918101602001919091529392505050565b5f8083601f840112612083575f80fd5b50813567ffffffffffffffff81111561209a575f80fd5b6020830191508360208285010111156120b1575f80fd5b9250929050565b5f805f805f805f8060e0898b0312156120cf575f80fd5b8835975060208901356120e181611dee565b965060408901356120f181611dee565b9550606089013567ffffffffffffffff8082111561210d575f80fd5b6121198c838d01611f4a565b965061212760808c01611e0f565b955060a08b013591508082111561213c575f80fd5b6121488c838d01612021565b945060c08b013591508082111561215d575f80fd5b5061216a8b828c01612073565b999c989b5096995094979396929594505050565b5f806040838503121561218f575f80fd5b823561219a81611dee565b91506020830135611e4f81611dee565b5f805f805f805f60e0888a0312156121c0575f80fd5b8735965060208801356121d281611dee565b95506040880135945060608801356121e981611dee565b935060808801356121f981611dee565b925060a088013567ffffffffffffffff811115612214575f80fd5b6122208a828b01612021565b92505060c0880135905092959891949750929550565b5f8060208385031215612247575f80fd5b823567ffffffffffffffff8082111561225e575f80fd5b818501915085601f830112612271575f80fd5b81358181111561227f575f80fd5b8660208260051b8501011115612293575f80fd5b60209290920196919550909350505050565b5f602082840312156122b5575f80fd5b8135611bc181611dee565b5f805f606084860312156122d2575f80fd5b83356122dd81611dee565b925060208401356122ed81611dee565b929592945050506040919091013590565b600181811c9082168061231257607f821691505b602082108103611f5a577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f821115610e3e575f81815260208120601f850160051c8101602086101561236f5750805b601f850160051c820191505b8181101561238e5782815560010161237b565b505050505050565b815167ffffffffffffffff8111156123b0576123b0611f60565b6123c4816123be84546122fe565b84612349565b602080601f831160018114612416575f84156123e05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561238e565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561246257888601518255948401946001909101908401612443565b508582101561249e57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b5f61010073ffffffffffffffffffffffffffffffffffffffff808d1684528b6020850152808b166040850152808a166060850152508760808401528060a084015261254281840188611e93565b90508560c084015282810360e084015261255d8185876124ae565b9c9b505050505050505050505050565b5f6020828403121561257d575f80fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f6125b26040830184611e93565b949350505050565b5f73ffffffffffffffffffffffffffffffffffffffff8089168352876020840152808716604084015260c060608401526125f760c0840187611e93565b941660808301525060a00152949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261266b575f80fd5b83018035915067ffffffffffffffff821115612685575f80fd5b6020019150368190038213156120b1575f80fd5b818382375f9101908152919050565b606081525f6126bb6060830186886124ae565b82810360208401526126cd8186611e93565b91505082604083015295945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361273c5761273c6126df565b5060010190565b81810381811115611702576117026126df565b5f73ffffffffffffffffffffffffffffffffffffffff808816835286602084015260a0604084015261278b60a0840187611e93565b948116606084015292909216608090910152509392505050565b5f602082840312156127b5575f80fd5b815167ffffffffffffffff8111156127cb575f80fd5b8201601f810184136127db575f80fd5b80516127e961203e82611fdc565b8181528560208385010111156127fd575f80fd5b6115d3826020830160208601611e7156fea164736f6c6343000814000a

Block Transaction 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

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.