POL Price: $0.124013 (-2.18%)
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Transfer Ownersh...477313732023-09-19 13:13:59858 days ago1695129239IN
0xe4AEED1B...254bb83bE
0 POL0.0026677894.09851475
Swap Native To T...328870402022-09-09 12:18:181233 days ago1662725898IN
0xe4AEED1B...254bb83bE
288.6 POL0.0021799830.00000002
Swap Tokens328771222022-09-09 6:36:361234 days ago1662705396IN
0xe4AEED1B...254bb83bE
0 POL0.0011015139.00000001
Swap Tokens328634242022-09-08 22:36:241234 days ago1662676584IN
0xe4AEED1B...254bb83bE
0 POL0.0015123839.00000001
Swap Tokens328632862022-09-08 22:31:361234 days ago1662676296IN
0xe4AEED1B...254bb83bE
0 POL0.0011015139.00000001
Remove Signer325138592022-08-31 10:08:181243 days ago1661940498IN
0xe4AEED1B...254bb83bE
0 POL0.00365241151.42072071
Remove Signer325138592022-08-31 10:08:181243 days ago1661940498IN
0xe4AEED1B...254bb83bE
0 POL0.0029845134.91741637
Swap Native To T...324997622022-08-31 0:31:471243 days ago1661905907IN
0xe4AEED1B...254bb83bE
334.5 POL0.0056321333.95
Swap Token To Na...324993542022-08-31 0:15:391243 days ago1661904939IN
0xe4AEED1B...254bb83bE
0 POL0.0039174432.01
Swap Token To Na...324966992022-08-30 22:31:251243 days ago1661898685IN
0xe4AEED1B...254bb83bE
0 POL0.0042384330.37999999
Swap Token To Na...324955132022-08-30 21:44:251243 days ago1661895865IN
0xe4AEED1B...254bb83bE
0 POL0.0043435830.00000063
Swap Token To Na...324944552022-08-30 21:05:511243 days ago1661893551IN
0xe4AEED1B...254bb83bE
0 POL0.0063490445.51222954
Swap Native To T...324911312022-08-30 18:45:551243 days ago1661885155IN
0xe4AEED1B...254bb83bE
0.1 POL0.0046568135.3896332
Swap Native To T...324840032022-08-30 13:38:421243 days ago1661866722IN
0xe4AEED1B...254bb83bE
248 POL0.0130348478.572851
Swap Tokens324818662022-08-30 12:12:261243 days ago1661861546IN
0xe4AEED1B...254bb83bE
0 POL0.0081684552.93772856
Swap Token To Na...324766422022-08-30 9:02:011244 days ago1661850121IN
0xe4AEED1B...254bb83bE
0 POL0.0038416137.2422924
Swap Token To Na...324728332022-08-30 6:44:401244 days ago1661841880IN
0xe4AEED1B...254bb83bE
0 POL0.0040410630.00000001
Swap Token To Na...324713262022-08-30 5:44:161244 days ago1661838256IN
0xe4AEED1B...254bb83bE
0 POL0.0043314931.04970002
Swap Token To Na...324702132022-08-30 5:03:541244 days ago1661835834IN
0xe4AEED1B...254bb83bE
0 POL0.003671730.00000002
Swap Native To T...324679792022-08-30 3:38:311244 days ago1661830711IN
0xe4AEED1B...254bb83bE
100 POL0.0039508530.00000149
Swap Token To Na...324646192022-08-30 0:55:461244 days ago1661820946IN
0xe4AEED1B...254bb83bE
0 POL0.0037077130.29624028
Swap Token To Na...324577202022-08-29 19:13:461244 days ago1661800426IN
0xe4AEED1B...254bb83bE
0 POL0.0036720630.00000005
Swap Tokens324570562022-08-29 18:41:281244 days ago1661798488IN
0xe4AEED1B...254bb83bE
0 POL0.005188833.08868992
Swap Token To Na...324479552022-08-29 12:12:351244 days ago1661775155IN
0xe4AEED1B...254bb83bE
0 POL0.0041850630.00000001
Swap Token To Na...324451782022-08-29 10:28:311245 days ago1661768911IN
0xe4AEED1B...254bb83bE
0 POL0.004330531.04970001
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
328870402022-09-09 12:18:181233 days ago1662725898
0xe4AEED1B...254bb83bE
288.6 POL
324997622022-08-31 0:31:471243 days ago1661905907
0xe4AEED1B...254bb83bE
334.5 POL
324993542022-08-31 0:15:391243 days ago1661904939
0xe4AEED1B...254bb83bE
29.55541434 POL
324993542022-08-31 0:15:391243 days ago1661904939
0xe4AEED1B...254bb83bE
29.55541434 POL
324966992022-08-30 22:31:251243 days ago1661898685
0xe4AEED1B...254bb83bE
714.00527976 POL
324966992022-08-30 22:31:251243 days ago1661898685
0xe4AEED1B...254bb83bE
714.00527976 POL
324955132022-08-30 21:44:251243 days ago1661895865
0xe4AEED1B...254bb83bE
0.60766006 POL
324955132022-08-30 21:44:251243 days ago1661895865
0xe4AEED1B...254bb83bE
0.60766006 POL
324944552022-08-30 21:05:511243 days ago1661893551
0xe4AEED1B...254bb83bE
39.69823159 POL
324944552022-08-30 21:05:511243 days ago1661893551
0xe4AEED1B...254bb83bE
39.69823159 POL
324911312022-08-30 18:45:551243 days ago1661885155
0xe4AEED1B...254bb83bE
0.1 POL
324840032022-08-30 13:38:421243 days ago1661866722
0xe4AEED1B...254bb83bE
248 POL
324728332022-08-30 6:44:401244 days ago1661841880
0xe4AEED1B...254bb83bE
25.99835921 POL
324728332022-08-30 6:44:401244 days ago1661841880
0xe4AEED1B...254bb83bE
25.99835921 POL
324713262022-08-30 5:44:161244 days ago1661838256
0xe4AEED1B...254bb83bE
369.2640743 POL
324713262022-08-30 5:44:161244 days ago1661838256
0xe4AEED1B...254bb83bE
369.2640743 POL
324702132022-08-30 5:03:541244 days ago1661835834
0xe4AEED1B...254bb83bE
9.48410252 POL
324702132022-08-30 5:03:541244 days ago1661835834
0xe4AEED1B...254bb83bE
9.48410252 POL
324679792022-08-30 3:38:311244 days ago1661830711
0xe4AEED1B...254bb83bE
100 POL
324646192022-08-30 0:55:461244 days ago1661820946
0xe4AEED1B...254bb83bE
29.57008552 POL
324646192022-08-30 0:55:461244 days ago1661820946
0xe4AEED1B...254bb83bE
29.57008552 POL
324577202022-08-29 19:13:461244 days ago1661800426
0xe4AEED1B...254bb83bE
62.52609107 POL
324577202022-08-29 19:13:461244 days ago1661800426
0xe4AEED1B...254bb83bE
62.52609107 POL
324479552022-08-29 12:12:351244 days ago1661775155
0xe4AEED1B...254bb83bE
18.5979715 POL
324479552022-08-29 12:12:351244 days ago1661775155
0xe4AEED1B...254bb83bE
18.5979715 POL
View All Internal Transactions
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DfynRFQ

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 9999999 runs

Other Settings:
default evmVersion
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./interfaces/IWETH.sol";

/**
 @title Facilitates verification of Signature and swap execution.
*/
contract DfynRFQ is Ownable {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    using ECDSA for bytes32;

    /// @dev Maximum `swapFee` is 1%.
    uint256 internal constant MAX_FEE = 1000;
    /// @dev 1 corresponds to 0.001% fee.
    uint256 public swapFee;

    address public feeAddress;
    uint256 public immutable chainId = block.chainid;
    address public immutable WETH;

    event SwapExecuted(
        address user,
        address indexed custodian,
        address token0,
        address token1,
        uint256 amount0,
        uint256 amount1,
        uint256 nonce,
        bytes signature
    );

    event SwapFeeUpdated(uint256 newSwapFee);

    event TokenFeeUpdated(address token, uint256 newSwapFee);

    event FeeAddressUpdated(address newFeeAddress);

    struct Swap {
        address user;
        address custodian;
        address token0;
        address token1;
        uint256 amount0;
        uint256 amount1;
        uint64 deadline;
        uint256 nonce;
        uint256 chainId;
    }

    // user => nonce
    mapping(address => uint256) public nonces;

    // custodian => signer => status
    mapping(address => mapping(address => bool)) public signers;

    // whitelisted custodians => access status
    mapping(address => bool) public whitelisted;

    // feeTokenAddress => feeValue
    mapping(address => uint256) public tokenFee;

    constructor(uint256 _swapFee, address _weth) {
        require(_swapFee <= MAX_FEE, "Swap fee cannot be > 1%");
        swapFee = _swapFee;
        feeAddress = owner();
        WETH = _weth;
    }

    /**
     * @dev Throws if custodian is not whitelisted.
     */
    modifier onlyWhitelisted(address _custodian) {
        require(whitelisted[_custodian], "Not a whitelisted custodian");
        _;
    }

    /// @dev Function to update the swap fee. Called only from the Owner.
    /// @param _swapFee the new swap fee
    function updateSwapFee(uint256 _swapFee) external onlyOwner {
        require(_swapFee <= MAX_FEE, "Swap fee cannot be > 1%");
        swapFee = _swapFee;
        emit SwapFeeUpdated(_swapFee);
    }

    /// @dev Function to update the swap fee. Called only from the Owner.
    /// @param _tokenAddress the address of token
    /// @param _swapFee the new swap fee
    function updateTokenFee(address _tokenAddress, uint256 _swapFee) external onlyOwner {
        require(_swapFee <= MAX_FEE, "Swap fee cannot be > 1%");
        tokenFee[_tokenAddress] = _swapFee;
        emit TokenFeeUpdated(_tokenAddress, _swapFee);
    }

    /// @dev Function to update the feeAddress. Called only from the Owner.
    /// @param _newFeeAddress the new swap fee address
    function updateFeeAddress(address _newFeeAddress) external onlyOwner {
        require(_newFeeAddress != address(0));
        feeAddress = _newFeeAddress;
        emit FeeAddressUpdated(_newFeeAddress);
    }

    /**
       @notice Add signer address for the respective Custodian
       @param _signer address provided by Custodian
    */
    function addSigner(address _signer) external onlyWhitelisted(msg.sender) {
        require(_signer != address(0), "_signer != address(0)");
        signers[msg.sender][_signer] = true;
    }

    /**
       @notice Removes signer address for the respective Custodian
       @param _signer address provided by Custodian
    */
    function removeSigner(address _signer) external {
        signers[msg.sender][_signer] = false;
    }

    /**
       @notice Add custodian address to whitelist.
       @param _custodian custodian to whitelist
    */
    function addWhitelist(address _custodian) external onlyOwner {
        require(!whitelisted[_custodian], "Custodian already in the whitelist");
        whitelisted[_custodian] = true;
    }

    /**
       @notice Remove custodian address from whitelist.
       @param _custodian custodian to remove from whitelist
    */
    function removeWhitelist(address _custodian) external onlyOwner onlyWhitelisted(_custodian) {
        whitelisted[_custodian] = false;
    }

    /**
       @notice Returns hash of swap parameters
       @param swap swap parameters from struct
    */
    function getMessageHash(Swap memory swap) public pure returns (bytes32) {
        return keccak256(abi.encode(swap));
    }

    /**
       @notice Returns true if address generated by the ethSignedMessageHash and signature
        is signer's address who signed the hashed message.
       @param swap swap parameters from struct
       @param signature returned by signer
    */
    function verify(Swap memory swap, bytes calldata signature) public view returns (bool) {
        bytes32 messageHash = getMessageHash(swap);
        bytes32 ethSignedMessageHash = messageHash.toEthSignedMessageHash();
        return signers[swap.custodian][ethSignedMessageHash.recover(signature)];
    }

    /**
       @notice Swaps from Native to ERC-20 token
    */
    function swapNativeToToken(
        address custodian,
        address[] calldata tokens,
        uint256[] calldata amounts,
        uint64 deadline,
        bytes calldata signature
    ) external payable returns (bool) {
        require(tokens[0] == WETH, "Invalid Native Token");
        require(amounts[0] == msg.value, "Excessive Input Amount");
        IWETH(WETH).deposit{ value: amounts[0] }();

        _swap(custodian, tokens, amounts, deadline, signature);

        uint256 feeAmount = _calculateFee(tokens[0], tokens[1], amounts[1]);

        IERC20(tokens[1]).safeTransferFrom(custodian, feeAddress, feeAmount);
        IERC20(tokens[1]).safeTransferFrom(custodian, msg.sender, amounts[1].sub(feeAmount));
        IWETH(WETH).transfer(custodian, amounts[0]);

        return true;
    }

    /**
       @notice Swaps from ERC-20 token to Native
    */
    function swapTokenToNative(
        address custodian,
        address[] calldata tokens,
        uint256[] calldata amounts,
        uint64 deadline,
        bytes calldata signature
    ) external returns (bool) {
        require(tokens[1] == WETH, "Invalid Native Token");

        _swap(custodian, tokens, amounts, deadline, signature);

        uint256 feeAmount = _calculateFee(tokens[0], tokens[1], amounts[1]);
        uint256 amountAfterFee = amounts[1].sub(feeAmount);

        IERC20(tokens[0]).safeTransferFrom(msg.sender, custodian, amounts[0]);
        IERC20(tokens[1]).safeTransferFrom(custodian, feeAddress, feeAmount);
        IERC20(tokens[1]).safeTransferFrom(custodian, address(this), amountAfterFee);
        IWETH(WETH).withdraw(amountAfterFee);
        (bool success,) =  msg.sender.call{value : amountAfterFee}("");
        require(success,"Transfer Failed");

        return true;
    }

    /**
       @notice Swaps from ERC-20 token to ERC-20.
    */
    function swapTokens(
        address custodian,
        address[] calldata tokens,
        uint256[] calldata amounts,
        uint64 deadline,
        bytes calldata signature
    ) external returns (bool) {
        _swap(custodian, tokens, amounts, deadline, signature);

        uint256 feeAmount = _calculateFee(tokens[0], tokens[1], amounts[1]);

        IERC20(tokens[1]).safeTransferFrom(custodian, feeAddress, feeAmount);
        IERC20(tokens[1]).safeTransferFrom(custodian, msg.sender, amounts[1].sub(feeAmount));
        IERC20(tokens[0]).safeTransferFrom(msg.sender, custodian, amounts[0]);

        return true;
    }

    /// @dev fee calculation logic
    /// @param token0 token0 address
    /// @param token1 token1 address
    /// @param amount1 output token amount
    /// @return feeAmount amount of fee to be deducted in token1
    function _calculateFee(
        address token0,
        address token1,
        uint256 amount1
    ) internal view returns (uint256 feeAmount) {
        uint256 fee;
        if (tokenFee[token0] == 0 || tokenFee[token1] == 0) fee = swapFee;
        else fee = tokenFee[token0] > tokenFee[token1] ? tokenFee[token0] : tokenFee[token1];

        feeAmount = amount1.mul(fee).div(100000);
    }

    /**
       @notice Swap execution logic
       @dev Internal function to verify and execute the swap
    */
    function _swap(
        address custodian,
        address[] calldata tokens,
        uint256[] calldata amounts,
        uint64 deadline,
        bytes calldata signature
    ) internal onlyWhitelisted(custodian) returns (bool) {

        require(tokens[0] != tokens[1], "Same token swap is not allowed");
        require(tokens.length == amounts.length, "Array size mismatch");
        require(tokens.length == 2, "Array with inadequate size");
        
        Swap memory swap = Swap({
            user: msg.sender,
            custodian: custodian,
            token0: tokens[0],
            token1: tokens[1],
            amount0: amounts[0],
            amount1: amounts[1],
            deadline: deadline,
            nonce: nonces[msg.sender],
            chainId: chainId
        });

        require(block.timestamp < swap.deadline, "Expired Order");
        require(verify(swap, signature), "Invalid Signer");
        require(swap.amount1 > 0 && swap.amount0 > 0, "amount != 0");

        // increase nonce for user (to avoid re-use)
        nonces[msg.sender] = swap.nonce + 1;

        emit SwapExecuted(
            swap.user,
            swap.custodian,
            swap.token0,
            swap.token1,
            swap.amount0,
            swap.amount1,
            swap.nonce,
            signature
        );

        return true;
    }

    function renounceOwnership() public view override onlyOwner{
        
        revert("This feature is not available");
    }

    receive() external payable {}
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../utils/Context.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 Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

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

interface IWETH {
    function deposit() external payable;

    function transfer(address to, uint256 value) external returns (bool);

    function withdraw(uint256) external;

    function transferFrom(
        address src,
        address dst,
        uint256 wad
    ) external returns (bool);

    function approve(address guy, uint256 wad) external returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"_swapFee","type":"uint256"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFeeAddress","type":"address"}],"name":"FeeAddressUpdated","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":false,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"custodian","type":"address"},{"indexed":false,"internalType":"address","name":"token0","type":"address"},{"indexed":false,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"}],"name":"SwapExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newSwapFee","type":"uint256"}],"name":"SwapFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"newSwapFee","type":"uint256"}],"name":"TokenFeeUpdated","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"addSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_custodian","type":"address"}],"name":"addWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"chainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"chainId","type":"uint256"}],"internalType":"struct DfynRFQ.Swap","name":"swap","type":"tuple"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"removeSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_custodian","type":"address"}],"name":"removeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"signers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"swapNativeToToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"swapTokenToNative","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"swapTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newFeeAddress","type":"address"}],"name":"updateFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_swapFee","type":"uint256"}],"name":"updateSwapFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_swapFee","type":"uint256"}],"name":"updateTokenFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"custodian","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint64","name":"deadline","type":"uint64"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"chainId","type":"uint256"}],"internalType":"struct DfynRFQ.Swap","name":"swap","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c0604052466080523480156200001557600080fd5b506040516200304238038062003042833981016040819052620000389162000119565b6200004333620000c9565b6103e88211156200009a5760405162461bcd60e51b815260206004820152601760248201527f53776170206665652063616e6e6f74206265203e203125000000000000000000604482015260640160405180910390fd5b600191909155600054600280546001600160a01b0319166001600160a01b039283161790551660a05262000158565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156200012d57600080fd5b825160208401519092506001600160a01b03811681146200014d57600080fd5b809150509250929050565b60805160a051612e9a620001a8600039600081816103b701528181610a8401528181610be201528181610cf701528181610df70152610fc40152600081816103830152611bb80152612e9a6000f3fe6080604052600436106101845760003560e01c8063ad5c4648116100d6578063d936547e1161007f578063f348f4fc11610059578063f348f4fc14610504578063f80f5dd514610531578063fc2dcf271461055157600080fd5b8063d936547e14610494578063eb12d61e146104c4578063f2fde38b146104e457600080fd5b8063bd9ee66b116100b0578063bd9ee66b14610419578063bf16f65a14610454578063d6fa53921461047457600080fd5b8063ad5c4648146103a5578063b372e90f146103d9578063bbcaac38146103f957600080fd5b8063715018a6116101385780637f449de1116101125780637f449de1146103335780638da5cb5b146103465780639a8a05921461037157600080fd5b8063715018a6146102d157806378c8cda7146102e65780637ecebe001461030657600080fd5b80634127535811610169578063412753581461022657806354cf2aeb1461027d5780635ab3adc8146102a157600080fd5b80630e316ab71461019057806312c4208a1461020657600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b506102046101ab366004612826565b33600090815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff9490941683529290522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b005b34801561021257600080fd5b50610204610221366004612841565b610571565b34801561023257600080fd5b506002546102539073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561028957600080fd5b5061029360015481565b604051908152602001610274565b3480156102ad57600080fd5b506102c16102bc36600461290a565b6106c8565b6040519015158152602001610274565b3480156102dd57600080fd5b5061020461083e565b3480156102f257600080fd5b50610204610301366004612826565b610921565b34801561031257600080fd5b50610293610321366004612826565b60036020526000908152604090205481565b6102c161034136600461290a565b610a80565b34801561035257600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610253565b34801561037d57600080fd5b506102937f000000000000000000000000000000000000000000000000000000000000000081565b3480156103b157600080fd5b506102537f000000000000000000000000000000000000000000000000000000000000000081565b3480156103e557600080fd5b506102c16103f436600461290a565b610df3565b34801561040557600080fd5b50610204610414366004612826565b6110f9565b34801561042557600080fd5b506102c16104343660046129c8565b600460209081526000928352604080842090915290825290205460ff1681565b34801561046057600080fd5b5061020461046f3660046129fb565b611214565b34801561048057600080fd5b5061029361048f366004612b01565b611336565b3480156104a057600080fd5b506102c16104af366004612826565b60056020526000908152604090205460ff1681565b3480156104d057600080fd5b506102046104df366004612826565b611366565b3480156104f057600080fd5b506102046104ff366004612826565b6114b9565b34801561051057600080fd5b5061029361051f366004612826565b60066020526000908152604090205481565b34801561053d57600080fd5b5061020461054c366004612826565b6115e9565b34801561055d57600080fd5b506102c161056c366004612b1e565b61176f565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103e8811115610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f53776170206665652063616e6e6f74206265203e20312500000000000000000060448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260066020908152604091829020849055815192835282018390527f7639b157d34198671a0e9b387fecaf60978a4f890a5e9d525781ebf1842cc325910160405180910390a15050565b60006106da898989898989898961182a565b50600061074f898960008181106106f3576106f3612b74565b90506020020160208101906107089190612826565b8a8a600181811061071b5761071b612b74565b90506020020160208101906107309190612826565b8989600181811061074357610743612b74565b90506020020135611e1e565b6002549091506107b8908b9073ffffffffffffffffffffffffffffffffffffffff16838c8c600181811061078557610785612b74565b905060200201602081019061079a9190612826565b73ffffffffffffffffffffffffffffffffffffffff16929190611f2d565b6107fc8a336107e9848b8b60018181106107d4576107d4612b74565b90506020020135611fc890919063ffffffff16565b8c8c600181811061078557610785612b74565b61082e338b8989600081811061081457610814612b74565b905060200201358c8c600081811061078557610785612b74565b5060019998505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f546869732066656174757265206973206e6f7420617661696c61626c6500000060448201526064016105ee565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040902054819060ff16610a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4e6f7420612077686974656c697374656420637573746f6469616e000000000060448201526064016105ee565b5073ffffffffffffffffffffffffffffffffffffffff16600090815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1688886000818110610acc57610acc612b74565b9050602002016020810190610ae19190612826565b73ffffffffffffffffffffffffffffffffffffffff1614610b5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e76616c6964204e617469766520546f6b656e00000000000000000000000060448201526064016105ee565b3486866000818110610b7257610b72612b74565b9050602002013514610be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f45786365737369766520496e70757420416d6f756e740000000000000000000060448201526064016105ee565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db087876000818110610c2f57610c2f612b74565b905060200201356040518263ffffffff1660e01b81526004016000604051808303818588803b158015610c6157600080fd5b505af1158015610c75573d6000803e3d6000fd5b5050505050610c8a898989898989898961182a565b506000610ca3898960008181106106f3576106f3612b74565b600254909150610cd9908b9073ffffffffffffffffffffffffffffffffffffffff16838c8c600181811061078557610785612b74565b610cf58a336107e9848b8b60018181106107d4576107d4612b74565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8b89896000818110610d4557610d45612b74565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff909416600485015260200291909101356024830152506044016020604051808303816000875af1158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de29190612ba3565b5060019a9950505050505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1688886001818110610e3f57610e3f612b74565b9050602002016020810190610e549190612826565b73ffffffffffffffffffffffffffffffffffffffff1614610ed1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e76616c6964204e617469766520546f6b656e00000000000000000000000060448201526064016105ee565b610ee1898989898989898961182a565b506000610efa898960008181106106f3576106f3612b74565b90506000610f1582898960018181106107d4576107d4612b74565b9050610f49338c8a8a6000818110610f2f57610f2f612b74565b905060200201358d8d600081811061078557610785612b74565b600254610f7c908c9073ffffffffffffffffffffffffffffffffffffffff16848d8d600181811061078557610785612b74565b610f958b30838d8d600181811061078557610785612b74565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b50506040516000925033915083908381818185875af1925050503d8060008114611077576040519150601f19603f3d011682016040523d82523d6000602084013e61107c565b606091505b50509050806110e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572204661696c6564000000000000000000000000000000000060448201526064016105ee565b5060019b9a5050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461117a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff811661119a57600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f446e39bcf1b47cfadfaa23442cb4b34682cfe6bd9220da084894e3b1f834e4f3906020015b60405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b6103e8811115611301576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f53776170206665652063616e6e6f74206265203e20312500000000000000000060448201526064016105ee565b60018190556040518181527f382455f3b749abde7721258dcfa10a22f30d4a28c69151a002dcbd8d1462e4f290602001611209565b6000816040516020016113499190612bc5565b604051602081830303815290604052805190602001209050919050565b3360008181526005602052604090205460ff166113df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4e6f7420612077686974656c697374656420637573746f6469616e000000000060448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff821661145c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5f7369676e657220213d2061646472657373283029000000000000000000000060448201526064016105ee565b5033600090815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff9490941683529290522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff81166115dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105ee565b6115e681611fd4565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461166a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090205460ff1615611720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f437573746f6469616e20616c726561647920696e207468652077686974656c6960448201527f737400000000000000000000000000000000000000000000000000000000000060648201526084016105ee565b73ffffffffffffffffffffffffffffffffffffffff16600090815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008061177b85611336565b9050600061178882612049565b60208088015173ffffffffffffffffffffffffffffffffffffffff1660009081526004825260408082208151601f8a0185900485028101850190925288825293945090916117f49190899089908190840183828082843760009201919091525087939250506120849050565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205460ff16925050505b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260056020526040812054899060ff166118bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4e6f7420612077686974656c697374656420637573746f6469616e000000000060448201526064016105ee565b888860018181106118ce576118ce612b74565b90506020020160208101906118e39190612826565b73ffffffffffffffffffffffffffffffffffffffff168989600081811061190c5761190c612b74565b90506020020160208101906119219190612826565b73ffffffffffffffffffffffffffffffffffffffff160361199e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f53616d6520746f6b656e2073776170206973206e6f7420616c6c6f776564000060448201526064016105ee565b878614611a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f41727261792073697a65206d69736d617463680000000000000000000000000060448201526064016105ee565b60028814611a71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4172726179207769746820696e61646571756174652073697a6500000000000060448201526064016105ee565b604080516101208101825233815273ffffffffffffffffffffffffffffffffffffffff8c16602082015260009181018b8b8481611ab057611ab0612b74565b9050602002016020810190611ac59190612826565b73ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110611af357611af3612b74565b9050602002016020810190611b089190612826565b73ffffffffffffffffffffffffffffffffffffffff16815260200189896000818110611b3657611b36612b74565b90506020020135815260200189896001818110611b5557611b55612b74565b9050602002013581526020018767ffffffffffffffff168152602001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020017f000000000000000000000000000000000000000000000000000000000000000081525090508060c0015167ffffffffffffffff164210611c53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f45787069726564204f726465720000000000000000000000000000000000000060448201526064016105ee565b611c5e81868661176f565b611cc4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c6964205369676e657200000000000000000000000000000000000060448201526064016105ee565b60008160a00151118015611cdc575060008160800151115b611d42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f616d6f756e7420213d203000000000000000000000000000000000000000000060448201526064016105ee565b60e0810151611d52906001612c88565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806020015173ffffffffffffffffffffffffffffffffffffffff167feca393cc3bbd0c290958867029e8d80ad07f800ea81a929c78a02b626727d49582600001518360400151846060015185608001518660a001518760e001518c8c604051611e05989796959493929190612ca0565b60405180910390a25060019a9950505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604081205481901580611e75575073ffffffffffffffffffffffffffffffffffffffff8416600090815260066020526040902054155b15611e835750600154611f0d565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526006602052604080822054928816825290205411611ee35773ffffffffffffffffffffffffffffffffffffffff8416600090815260066020526040902054611f0a565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600660205260409020545b90505b611f24620186a0611f1e85846120a8565b906120b4565b95945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611fc29085906120c0565b50505050565b60006118238284612d36565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611349565b600080600061209385856121d1565b915091506120a08161223f565b509392505050565b60006118238284612d4d565b60006118238284612d8a565b6000612122826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166124939092919063ffffffff16565b8051909150156121cc57808060200190518101906121409190612ba3565b6121cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105ee565b505050565b60008082516041036122075760208301516040840151606085015160001a6121fb878285856124aa565b94509450505050612238565b825160400361223057602083015160408401516122258683836125c2565b935093505050612238565b506000905060025b9250929050565b600081600481111561225357612253612dc5565b0361225b5750565b600181600481111561226f5761226f612dc5565b036122d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ee565b60028160048111156122ea576122ea612dc5565b03612351576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ee565b600381600481111561236557612365612dc5565b036123f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016105ee565b600481600481111561240657612406612dc5565b036115e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016105ee565b60606124a28484600085612614565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156124e157506000905060036125b9565b8460ff16601b141580156124f957508460ff16601c14155b1561250a57506000905060046125b9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561255e573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166125b2576000600192509250506125b9565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316816125f860ff86901c601b612c88565b9050612606878288856124aa565b935093505050935093915050565b6060824710156126a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105ee565b73ffffffffffffffffffffffffffffffffffffffff85163b612724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105ee565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161274d9190612e20565b60006040518083038185875af1925050503d806000811461278a576040519150601f19603f3d011682016040523d82523d6000602084013e61278f565b606091505b509150915061279f8282866127aa565b979650505050505050565b606083156127b9575081611823565b8251156127c95782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ee9190612e3c565b803573ffffffffffffffffffffffffffffffffffffffff8116811461282157600080fd5b919050565b60006020828403121561283857600080fd5b611823826127fd565b6000806040838503121561285457600080fd5b61285d836127fd565b946020939093013593505050565b60008083601f84011261287d57600080fd5b50813567ffffffffffffffff81111561289557600080fd5b6020830191508360208260051b850101111561223857600080fd5b803567ffffffffffffffff8116811461282157600080fd5b60008083601f8401126128da57600080fd5b50813567ffffffffffffffff8111156128f257600080fd5b60208301915083602082850101111561223857600080fd5b60008060008060008060008060a0898b03121561292657600080fd5b61292f896127fd565b9750602089013567ffffffffffffffff8082111561294c57600080fd5b6129588c838d0161286b565b909950975060408b013591508082111561297157600080fd5b61297d8c838d0161286b565b909750955085915061299160608c016128b0565b945060808b01359150808211156129a757600080fd5b506129b48b828c016128c8565b999c989b5096995094979396929594505050565b600080604083850312156129db57600080fd5b6129e4836127fd565b91506129f2602084016127fd565b90509250929050565b600060208284031215612a0d57600080fd5b5035919050565b604051610120810167ffffffffffffffff81118282101715612a5f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b60006101208284031215612a7857600080fd5b612a80612a14565b9050612a8b826127fd565b8152612a99602083016127fd565b6020820152612aaa604083016127fd565b6040820152612abb606083016127fd565b60608201526080820135608082015260a082013560a0820152612ae060c083016128b0565b60c082015260e082013560e082015261010080830135818301525092915050565b60006101208284031215612b1457600080fd5b6118238383612a65565b60008060006101408486031215612b3457600080fd5b612b3e8585612a65565b925061012084013567ffffffffffffffff811115612b5b57600080fd5b612b67868287016128c8565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215612bb557600080fd5b8151801515811461182357600080fd5b815173ffffffffffffffffffffffffffffffffffffffff908116825260208084015182169083015260408084015182169083015260608084015191821690830152610120820190506080830151608083015260a083015160a083015260c0830151612c3c60c084018267ffffffffffffffff169052565b5060e083015160e083015261010080840151818401525092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115612c9b57612c9b612c59565b500190565b600073ffffffffffffffffffffffffffffffffffffffff808b168352808a1660208401528089166040840152508660608301528560808301528460a083015260e060c08301528260e08301526101008385828501376000838501820152601f9093017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910190910198975050505050505050565b600082821015612d4857612d48612c59565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612d8557612d85612c59565b500290565b600082612dc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60005b83811015612e0f578181015183820152602001612df7565b83811115611fc25750506000910152565b60008251612e32818460208701612df4565b9190910192915050565b6020815260008251806020840152612e5b816040850160208701612df4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c634300080d000a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270

Deployed Bytecode

0x6080604052600436106101845760003560e01c8063ad5c4648116100d6578063d936547e1161007f578063f348f4fc11610059578063f348f4fc14610504578063f80f5dd514610531578063fc2dcf271461055157600080fd5b8063d936547e14610494578063eb12d61e146104c4578063f2fde38b146104e457600080fd5b8063bd9ee66b116100b0578063bd9ee66b14610419578063bf16f65a14610454578063d6fa53921461047457600080fd5b8063ad5c4648146103a5578063b372e90f146103d9578063bbcaac38146103f957600080fd5b8063715018a6116101385780637f449de1116101125780637f449de1146103335780638da5cb5b146103465780639a8a05921461037157600080fd5b8063715018a6146102d157806378c8cda7146102e65780637ecebe001461030657600080fd5b80634127535811610169578063412753581461022657806354cf2aeb1461027d5780635ab3adc8146102a157600080fd5b80630e316ab71461019057806312c4208a1461020657600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b506102046101ab366004612826565b33600090815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff9490941683529290522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b005b34801561021257600080fd5b50610204610221366004612841565b610571565b34801561023257600080fd5b506002546102539073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561028957600080fd5b5061029360015481565b604051908152602001610274565b3480156102ad57600080fd5b506102c16102bc36600461290a565b6106c8565b6040519015158152602001610274565b3480156102dd57600080fd5b5061020461083e565b3480156102f257600080fd5b50610204610301366004612826565b610921565b34801561031257600080fd5b50610293610321366004612826565b60036020526000908152604090205481565b6102c161034136600461290a565b610a80565b34801561035257600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610253565b34801561037d57600080fd5b506102937f000000000000000000000000000000000000000000000000000000000000008981565b3480156103b157600080fd5b506102537f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127081565b3480156103e557600080fd5b506102c16103f436600461290a565b610df3565b34801561040557600080fd5b50610204610414366004612826565b6110f9565b34801561042557600080fd5b506102c16104343660046129c8565b600460209081526000928352604080842090915290825290205460ff1681565b34801561046057600080fd5b5061020461046f3660046129fb565b611214565b34801561048057600080fd5b5061029361048f366004612b01565b611336565b3480156104a057600080fd5b506102c16104af366004612826565b60056020526000908152604090205460ff1681565b3480156104d057600080fd5b506102046104df366004612826565b611366565b3480156104f057600080fd5b506102046104ff366004612826565b6114b9565b34801561051057600080fd5b5061029361051f366004612826565b60066020526000908152604090205481565b34801561053d57600080fd5b5061020461054c366004612826565b6115e9565b34801561055d57600080fd5b506102c161056c366004612b1e565b61176f565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103e8811115610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f53776170206665652063616e6e6f74206265203e20312500000000000000000060448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260066020908152604091829020849055815192835282018390527f7639b157d34198671a0e9b387fecaf60978a4f890a5e9d525781ebf1842cc325910160405180910390a15050565b60006106da898989898989898961182a565b50600061074f898960008181106106f3576106f3612b74565b90506020020160208101906107089190612826565b8a8a600181811061071b5761071b612b74565b90506020020160208101906107309190612826565b8989600181811061074357610743612b74565b90506020020135611e1e565b6002549091506107b8908b9073ffffffffffffffffffffffffffffffffffffffff16838c8c600181811061078557610785612b74565b905060200201602081019061079a9190612826565b73ffffffffffffffffffffffffffffffffffffffff16929190611f2d565b6107fc8a336107e9848b8b60018181106107d4576107d4612b74565b90506020020135611fc890919063ffffffff16565b8c8c600181811061078557610785612b74565b61082e338b8989600081811061081457610814612b74565b905060200201358c8c600081811061078557610785612b74565b5060019998505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f546869732066656174757265206973206e6f7420617661696c61626c6500000060448201526064016105ee565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040902054819060ff16610a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4e6f7420612077686974656c697374656420637573746f6469616e000000000060448201526064016105ee565b5073ffffffffffffffffffffffffffffffffffffffff16600090815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b60007f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127073ffffffffffffffffffffffffffffffffffffffff1688886000818110610acc57610acc612b74565b9050602002016020810190610ae19190612826565b73ffffffffffffffffffffffffffffffffffffffff1614610b5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e76616c6964204e617469766520546f6b656e00000000000000000000000060448201526064016105ee565b3486866000818110610b7257610b72612b74565b9050602002013514610be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f45786365737369766520496e70757420416d6f756e740000000000000000000060448201526064016105ee565b7f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127073ffffffffffffffffffffffffffffffffffffffff1663d0e30db087876000818110610c2f57610c2f612b74565b905060200201356040518263ffffffff1660e01b81526004016000604051808303818588803b158015610c6157600080fd5b505af1158015610c75573d6000803e3d6000fd5b5050505050610c8a898989898989898961182a565b506000610ca3898960008181106106f3576106f3612b74565b600254909150610cd9908b9073ffffffffffffffffffffffffffffffffffffffff16838c8c600181811061078557610785612b74565b610cf58a336107e9848b8b60018181106107d4576107d4612b74565b7f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8b89896000818110610d4557610d45612b74565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff909416600485015260200291909101356024830152506044016020604051808303816000875af1158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de29190612ba3565b5060019a9950505050505050505050565b60007f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127073ffffffffffffffffffffffffffffffffffffffff1688886001818110610e3f57610e3f612b74565b9050602002016020810190610e549190612826565b73ffffffffffffffffffffffffffffffffffffffff1614610ed1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e76616c6964204e617469766520546f6b656e00000000000000000000000060448201526064016105ee565b610ee1898989898989898961182a565b506000610efa898960008181106106f3576106f3612b74565b90506000610f1582898960018181106107d4576107d4612b74565b9050610f49338c8a8a6000818110610f2f57610f2f612b74565b905060200201358d8d600081811061078557610785612b74565b600254610f7c908c9073ffffffffffffffffffffffffffffffffffffffff16848d8d600181811061078557610785612b74565b610f958b30838d8d600181811061078557610785612b74565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b50506040516000925033915083908381818185875af1925050503d8060008114611077576040519150601f19603f3d011682016040523d82523d6000602084013e61107c565b606091505b50509050806110e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572204661696c6564000000000000000000000000000000000060448201526064016105ee565b5060019b9a5050505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461117a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff811661119a57600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f446e39bcf1b47cfadfaa23442cb4b34682cfe6bd9220da084894e3b1f834e4f3906020015b60405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b6103e8811115611301576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f53776170206665652063616e6e6f74206265203e20312500000000000000000060448201526064016105ee565b60018190556040518181527f382455f3b749abde7721258dcfa10a22f30d4a28c69151a002dcbd8d1462e4f290602001611209565b6000816040516020016113499190612bc5565b604051602081830303815290604052805190602001209050919050565b3360008181526005602052604090205460ff166113df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4e6f7420612077686974656c697374656420637573746f6469616e000000000060448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff821661145c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5f7369676e657220213d2061646472657373283029000000000000000000000060448201526064016105ee565b5033600090815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff9490941683529290522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff81166115dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105ee565b6115e681611fd4565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461166a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ee565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090205460ff1615611720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f437573746f6469616e20616c726561647920696e207468652077686974656c6960448201527f737400000000000000000000000000000000000000000000000000000000000060648201526084016105ee565b73ffffffffffffffffffffffffffffffffffffffff16600090815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60008061177b85611336565b9050600061178882612049565b60208088015173ffffffffffffffffffffffffffffffffffffffff1660009081526004825260408082208151601f8a0185900485028101850190925288825293945090916117f49190899089908190840183828082843760009201919091525087939250506120849050565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205460ff16925050505b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260056020526040812054899060ff166118bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4e6f7420612077686974656c697374656420637573746f6469616e000000000060448201526064016105ee565b888860018181106118ce576118ce612b74565b90506020020160208101906118e39190612826565b73ffffffffffffffffffffffffffffffffffffffff168989600081811061190c5761190c612b74565b90506020020160208101906119219190612826565b73ffffffffffffffffffffffffffffffffffffffff160361199e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f53616d6520746f6b656e2073776170206973206e6f7420616c6c6f776564000060448201526064016105ee565b878614611a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f41727261792073697a65206d69736d617463680000000000000000000000000060448201526064016105ee565b60028814611a71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4172726179207769746820696e61646571756174652073697a6500000000000060448201526064016105ee565b604080516101208101825233815273ffffffffffffffffffffffffffffffffffffffff8c16602082015260009181018b8b8481611ab057611ab0612b74565b9050602002016020810190611ac59190612826565b73ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110611af357611af3612b74565b9050602002016020810190611b089190612826565b73ffffffffffffffffffffffffffffffffffffffff16815260200189896000818110611b3657611b36612b74565b90506020020135815260200189896001818110611b5557611b55612b74565b9050602002013581526020018767ffffffffffffffff168152602001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020017f000000000000000000000000000000000000000000000000000000000000008981525090508060c0015167ffffffffffffffff164210611c53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f45787069726564204f726465720000000000000000000000000000000000000060448201526064016105ee565b611c5e81868661176f565b611cc4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c6964205369676e657200000000000000000000000000000000000060448201526064016105ee565b60008160a00151118015611cdc575060008160800151115b611d42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f616d6f756e7420213d203000000000000000000000000000000000000000000060448201526064016105ee565b60e0810151611d52906001612c88565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806020015173ffffffffffffffffffffffffffffffffffffffff167feca393cc3bbd0c290958867029e8d80ad07f800ea81a929c78a02b626727d49582600001518360400151846060015185608001518660a001518760e001518c8c604051611e05989796959493929190612ca0565b60405180910390a25060019a9950505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604081205481901580611e75575073ffffffffffffffffffffffffffffffffffffffff8416600090815260066020526040902054155b15611e835750600154611f0d565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526006602052604080822054928816825290205411611ee35773ffffffffffffffffffffffffffffffffffffffff8416600090815260066020526040902054611f0a565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600660205260409020545b90505b611f24620186a0611f1e85846120a8565b906120b4565b95945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611fc29085906120c0565b50505050565b60006118238284612d36565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611349565b600080600061209385856121d1565b915091506120a08161223f565b509392505050565b60006118238284612d4d565b60006118238284612d8a565b6000612122826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166124939092919063ffffffff16565b8051909150156121cc57808060200190518101906121409190612ba3565b6121cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105ee565b505050565b60008082516041036122075760208301516040840151606085015160001a6121fb878285856124aa565b94509450505050612238565b825160400361223057602083015160408401516122258683836125c2565b935093505050612238565b506000905060025b9250929050565b600081600481111561225357612253612dc5565b0361225b5750565b600181600481111561226f5761226f612dc5565b036122d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ee565b60028160048111156122ea576122ea612dc5565b03612351576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ee565b600381600481111561236557612365612dc5565b036123f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016105ee565b600481600481111561240657612406612dc5565b036115e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016105ee565b60606124a28484600085612614565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156124e157506000905060036125b9565b8460ff16601b141580156124f957508460ff16601c14155b1561250a57506000905060046125b9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561255e573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166125b2576000600192509250506125b9565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316816125f860ff86901c601b612c88565b9050612606878288856124aa565b935093505050935093915050565b6060824710156126a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105ee565b73ffffffffffffffffffffffffffffffffffffffff85163b612724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105ee565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161274d9190612e20565b60006040518083038185875af1925050503d806000811461278a576040519150601f19603f3d011682016040523d82523d6000602084013e61278f565b606091505b509150915061279f8282866127aa565b979650505050505050565b606083156127b9575081611823565b8251156127c95782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ee9190612e3c565b803573ffffffffffffffffffffffffffffffffffffffff8116811461282157600080fd5b919050565b60006020828403121561283857600080fd5b611823826127fd565b6000806040838503121561285457600080fd5b61285d836127fd565b946020939093013593505050565b60008083601f84011261287d57600080fd5b50813567ffffffffffffffff81111561289557600080fd5b6020830191508360208260051b850101111561223857600080fd5b803567ffffffffffffffff8116811461282157600080fd5b60008083601f8401126128da57600080fd5b50813567ffffffffffffffff8111156128f257600080fd5b60208301915083602082850101111561223857600080fd5b60008060008060008060008060a0898b03121561292657600080fd5b61292f896127fd565b9750602089013567ffffffffffffffff8082111561294c57600080fd5b6129588c838d0161286b565b909950975060408b013591508082111561297157600080fd5b61297d8c838d0161286b565b909750955085915061299160608c016128b0565b945060808b01359150808211156129a757600080fd5b506129b48b828c016128c8565b999c989b5096995094979396929594505050565b600080604083850312156129db57600080fd5b6129e4836127fd565b91506129f2602084016127fd565b90509250929050565b600060208284031215612a0d57600080fd5b5035919050565b604051610120810167ffffffffffffffff81118282101715612a5f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b60006101208284031215612a7857600080fd5b612a80612a14565b9050612a8b826127fd565b8152612a99602083016127fd565b6020820152612aaa604083016127fd565b6040820152612abb606083016127fd565b60608201526080820135608082015260a082013560a0820152612ae060c083016128b0565b60c082015260e082013560e082015261010080830135818301525092915050565b60006101208284031215612b1457600080fd5b6118238383612a65565b60008060006101408486031215612b3457600080fd5b612b3e8585612a65565b925061012084013567ffffffffffffffff811115612b5b57600080fd5b612b67868287016128c8565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215612bb557600080fd5b8151801515811461182357600080fd5b815173ffffffffffffffffffffffffffffffffffffffff908116825260208084015182169083015260408084015182169083015260608084015191821690830152610120820190506080830151608083015260a083015160a083015260c0830151612c3c60c084018267ffffffffffffffff169052565b5060e083015160e083015261010080840151818401525092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115612c9b57612c9b612c59565b500190565b600073ffffffffffffffffffffffffffffffffffffffff808b168352808a1660208401528089166040840152508660608301528560808301528460a083015260e060c08301528260e08301526101008385828501376000838501820152601f9093017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910190910198975050505050505050565b600082821015612d4857612d48612c59565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612d8557612d85612c59565b500290565b600082612dc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60005b83811015612e0f578181015183820152602001612df7565b83811115611fc25750506000910152565b60008251612e32818460208701612df4565b9190910192915050565b6020815260008251806020840152612e5b816040850160208701612df4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c634300080d000a

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

00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270

-----Decoded View---------------
Arg [0] : _swapFee (uint256): 1
Arg [1] : _weth (address): 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [1] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270


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
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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