Contract 0xc693C8AAD9745588e95995fef4570d6DcEF98000 2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x06fdba36893f9481abd23601ca6ffcba13e9ae461d849565fa8c0133727a0fb50x8218b58f201573932022-08-13 12:57:493 hrs 3 mins ago0xfdb090d9cc4ba9bffe42aa0729647c7708468120 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.001 ETH0.000168089793 ETH
0x46e92e41d343b0468f4c4df01f29b9ab4a04b556054c1296e1e3f5a5a631c0980x8218b58f197960332022-08-09 11:11:514 days 4 hrs ago0x0d703ccd7debd7f6f4b0ffb29d2d710d19b09025 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.00019945719 ETH
0x6c845e531e5482f9842dc10d3ecd0a835f0ed5e5b264a21d37843a1198a6ae970x8218b58f195035482022-08-06 2:37:387 days 13 hrs ago0x680eb56d580df9450df7634a6643923b45a933c0 IN  0xc693c8aad9745588e95995fef4570d6dcef980001.4 ETH0.000180323152 ETH
0x9b534e5c982a13266ab8f478f64e28d58294668dce46019c58850a4a88ced6600x8218b58f192573082022-08-03 6:30:2710 days 9 hrs ago0x95630e0b33634ca00766c97ad3c9697fb5e4cb43 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000139636805 ETH
0x866d4a9aaa38f2e5be001786357905e5e7459332142f570712321f73ecf51d870x8218b58f191308162022-08-01 15:59:0512 days 2 mins ago0xe7911fd11b0d6a6ed3a8aaf2815801be57a05702 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.1 ETH0.000133581428 ETH
0xc9c2ec2ac049ca091bbc7a84b5f48ae101bdb3c3f0863f00569105e1b30dadca0x8218b58f191294722022-08-01 15:32:2312 days 29 mins ago0xfde085b10d847e29bf7166d21437f57feed6989b IN  0xc693c8aad9745588e95995fef4570d6dcef980000.073 ETH0.000133933186 ETH
0x2cea4f6fab4370f8ae5e78800e87cac4c99d6f44f93f9981563f18aeae1b79a00x8218b58f191189492022-08-01 13:12:4912 days 2 hrs ago0x374cb27a8753520bb153906a0a34cc823cea3c3e IN  0xc693c8aad9745588e95995fef4570d6dcef980000.02 ETH0.000128880248 ETH
0x434f39e7e0bd4ce3e1482959da8966422b4a4b5e6e2de6c954837a759632aba60x8218b58f190660402022-07-31 20:39:0312 days 19 hrs ago0x53c9b2e00ed635c3d2efd2a553e6a4a909db7081 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000191871353 ETH
0x8e8c7e283b37eb83e60037edbc5b93cbfc72db173c59401e045ea0a9f06c4cff0x8218b58f190120532022-07-31 7:18:0313 days 8 hrs ago0x95630e0b33634ca00766c97ad3c9697fb5e4cb43 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000129545049 ETH
0x553c5528872de9677e11722004a0ef089a887e0a08a21856e6f9f501d284ea740x8218b58f190085952022-07-31 6:26:0013 days 9 hrs ago0x95630e0b33634ca00766c97ad3c9697fb5e4cb43 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.105554159146518 ETH0.000098403031 ETH
0xd5d41ec6de410d103f2e38923d999c2fa5d24e7bbfb63b056f66d96ca1a6387d0x8218b58f190069492022-07-31 6:02:0713 days 9 hrs ago0xf77489096e6a321b8bb3aa467ac584c6c8b21d61 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.003 ETH0.000093562836 ETH
0xd7deb03f3c994b5fdea572e63fed3ce3df9ffcca0cf862b148cae6a6360392b20x8218b58f189860732022-07-30 23:48:3013 days 16 hrs ago0x38f7bbceab52e0ef4f3f46d9b58f76a8d2834a64 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000112238244 ETH
0x4c0592be88b14a3313abd6b8f513424e334998e9656f42931b1ac9bc68c6d9260x8218b58f189784122022-07-30 21:28:5613 days 18 hrs ago0x9204fc8af49599432db577a92df5aac162dbdc5c IN  0xc693c8aad9745588e95995fef4570d6dcef980000.033455 ETH0.000124333214 ETH
0x81050c93d5934321e41e2b78f0b56ad10a5539550e6bb75871762edbf4905ab00x8218b58f189528322022-07-30 14:21:5114 days 1 hr ago0x2a1be95104545075724498eb26b8e7f432042b19 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.2 ETH0.000136508397 ETH
0xb44194ca1e779400d42dcc861254b64b2d82d9440706d17b54e3aaee3067f03c0x8218b58f188847982022-07-29 16:33:4814 days 23 hrs ago0xb3ad5adc6aee45e95c2a2d27b8a8888915caa8d6 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.01 ETH0.000255622067 ETH
0xe187e3847a1b9b4f2a28bd9ee389e1be92b85e2e267438ea03b9f7c7ff735cc10x8218b58f186973032022-07-27 13:38:3017 days 2 hrs ago0x2a1be95104545075724498eb26b8e7f432042b19 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000164820265 ETH
0xfcd8c4a7f53d80a8b25d18386db047bb78c16d1f8699c202899342321ec3a0530x8218b58f186965642022-07-27 13:27:1717 days 2 hrs ago0x2a1be95104545075724498eb26b8e7f432042b19 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.16 ETH0.000171386522 ETH
0xbd12b8ca03b448a89c6192d38688249eb7c0a93c75c626a05a5e3ecf926c46820x8218b58f186957022022-07-27 13:14:2617 days 2 hrs ago0x2a1be95104545075724498eb26b8e7f432042b19 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000164663147 ETH
0xebfd1a309710a6c27083ca13e2b141a0eec3f1b42d9b53daf7ef6b2b6e1342b60x8218b58f186956352022-07-27 13:13:0417 days 2 hrs ago0x2a1be95104545075724498eb26b8e7f432042b19 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.16 ETH0.000171412996 ETH
0xfc3691b60329765c7e6f6689d53f50a8a016c994947f54b9f79e11d367f94c1e0x8218b58f185811262022-07-26 2:48:3118 days 13 hrs ago0xcc439f69c721d54755abf8166c70e863a1f3a21b IN  0xc693c8aad9745588e95995fef4570d6dcef980000.0000398815 ETH0.000353389017 ETH
0xd36ea0abfe033b4ee21abfff08caec884eb0e2f39864de4daf9671e8f1a969750x8218b58f185118052022-07-25 8:34:4019 days 7 hrs ago0x69a07d98b081810df86ab12456e436f0b9d57439 IN  0xc693c8aad9745588e95995fef4570d6dcef980000.05 ETH0.000118487862 ETH
0x37fe5cf29108e6531625554b41618d738f8309bd754c0452b21525c5aef0e6480x8218b58f183714412022-07-23 13:29:0621 days 2 hrs ago0x9204fc8af49599432db577a92df5aac162dbdc5c IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000166694324 ETH
0x61e391820dffe64fa6bc3f5a10a1d8c54ea64c75f6cd823ea67fecc1ad8227450x8218b58f183549402022-07-23 8:53:4121 days 7 hrs ago0x05f76a48b77c3e7864ad1af702af8dcec5eeaf2c IN  0xc693c8aad9745588e95995fef4570d6dcef980000.008 ETH0.000140631864 ETH
0x75d35de3c3aa56ded82ce1884a689534ddb490cea34bdb0091c471bb091b6cfb0x8218b58f182141602022-07-21 14:51:0323 days 1 hr ago0x97c9b49b19b7f5cad4bec2933a68cfef21f45939 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000244215319 ETH
0x4d335cacdf17a291fffdcb6b4567590a0f9f8b43645408998e0677f5f5aaad6d0x8218b58f182140702022-07-21 14:48:4223 days 1 hr ago0x97c9b49b19b7f5cad4bec2933a68cfef21f45939 IN  0xc693c8aad9745588e95995fef4570d6dcef980000 ETH0.000244309729 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x06fdba36893f9481abd23601ca6ffcba13e9ae461d849565fa8c0133727a0fb5201573932022-08-13 12:57:493 hrs 3 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xda10009cbd5d07dd0cecc66161fc93d7c9000da10 ETH
0x06fdba36893f9481abd23601ca6ffcba13e9ae461d849565fa8c0133727a0fb5201573932022-08-13 12:57:493 hrs 3 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89280.001 ETH
0x06fdba36893f9481abd23601ca6ffcba13e9ae461d849565fa8c0133727a0fb5201573932022-08-13 12:57:493 hrs 3 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xda10009cbd5d07dd0cecc66161fc93d7c9000da10 ETH
0x46e92e41d343b0468f4c4df01f29b9ab4a04b556054c1296e1e3f5a5a631c098197960332022-08-09 11:11:514 days 4 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89280 ETH
0x46e92e41d343b0468f4c4df01f29b9ab4a04b556054c1296e1e3f5a5a631c098197960332022-08-09 11:11:514 days 4 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef980000x51fc0f6660482ea73330e414efd7808811a57fa20 ETH
0x46e92e41d343b0468f4c4df01f29b9ab4a04b556054c1296e1e3f5a5a631c098197960332022-08-09 11:11:514 days 4 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef980000x51fc0f6660482ea73330e414efd7808811a57fa20 ETH
0x46e92e41d343b0468f4c4df01f29b9ab4a04b556054c1296e1e3f5a5a631c098197960332022-08-09 11:11:514 days 4 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef980000x51fc0f6660482ea73330e414efd7808811a57fa20 ETH
0x6c845e531e5482f9842dc10d3ecd0a835f0ed5e5b264a21d37843a1198a6ae97195035482022-08-06 2:37:387 days 13 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0x6c845e531e5482f9842dc10d3ecd0a835f0ed5e5b264a21d37843a1198a6ae97195035482022-08-06 2:37:387 days 13 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89281.4 ETH
0x6c845e531e5482f9842dc10d3ecd0a835f0ed5e5b264a21d37843a1198a6ae97195035482022-08-06 2:37:387 days 13 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0x9b534e5c982a13266ab8f478f64e28d58294668dce46019c58850a4a88ced660192573082022-08-03 6:30:2710 days 9 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89280 ETH
0x9b534e5c982a13266ab8f478f64e28d58294668dce46019c58850a4a88ced660192573082022-08-03 6:30:2710 days 9 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x9b534e5c982a13266ab8f478f64e28d58294668dce46019c58850a4a88ced660192573082022-08-03 6:30:2710 days 9 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x9b534e5c982a13266ab8f478f64e28d58294668dce46019c58850a4a88ced660192573082022-08-03 6:30:2710 days 9 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x866d4a9aaa38f2e5be001786357905e5e7459332142f570712321f73ecf51d87191308162022-08-01 15:59:0512 days 2 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0x866d4a9aaa38f2e5be001786357905e5e7459332142f570712321f73ecf51d87191308162022-08-01 15:59:0512 days 2 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89280.1 ETH
0x866d4a9aaa38f2e5be001786357905e5e7459332142f570712321f73ecf51d87191308162022-08-01 15:59:0512 days 2 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0xc9c2ec2ac049ca091bbc7a84b5f48ae101bdb3c3f0863f00569105e1b30dadca191294722022-08-01 15:32:2312 days 29 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0xc9c2ec2ac049ca091bbc7a84b5f48ae101bdb3c3f0863f00569105e1b30dadca191294722022-08-01 15:32:2312 days 29 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89280.073 ETH
0xc9c2ec2ac049ca091bbc7a84b5f48ae101bdb3c3f0863f00569105e1b30dadca191294722022-08-01 15:32:2312 days 29 mins ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x2cea4f6fab4370f8ae5e78800e87cac4c99d6f44f93f9981563f18aeae1b79a0191189492022-08-01 13:12:4912 days 2 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x2cea4f6fab4370f8ae5e78800e87cac4c99d6f44f93f9981563f18aeae1b79a0191189492022-08-01 13:12:4912 days 2 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89280.02 ETH
0x2cea4f6fab4370f8ae5e78800e87cac4c99d6f44f93f9981563f18aeae1b79a0191189492022-08-01 13:12:4912 days 2 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x434f39e7e0bd4ce3e1482959da8966422b4a4b5e6e2de6c954837a759632aba6190660402022-07-31 20:39:0312 days 19 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0x434f39e7e0bd4ce3e1482959da8966422b4a4b5e6e2de6c954837a759632aba6190660402022-07-31 20:39:0312 days 19 hrs ago 0xc693c8aad9745588e95995fef4570d6dcef98000 0x35d0c393d81a25c8d45aac5a6b9d399e497e89280 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AggregatorSingleChain

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 16 : AggregatorSingleChain.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.2;

import { Address } from "Address.sol";
import "SafeERC20.sol";
import "ERC20.sol";
import "SafeMath.sol";
import "AccessControl.sol";
import "ReentrancyGuard.sol";
import "IAggregator.sol";
import "UniERC20.sol";


/// @title AggregatorSingleChain is the single-chain version of Aggregator. It exchanges assets based on swap description struct
/// @notice Users can call `swap` method to swap assets
/// AggregatorSingleChain will forward the swap description to `caller` contract to perform multi-swap of assets
contract AggregatorSingleChain is IAggregator, AccessControl, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using UniERC20 for IERC20;

    /* ========== STATE VARIABLES ========== */

    // ROLE_OWNER is superior to ROLE_STAFF
    bytes32 public constant ROLE_OWNER = keccak256("ROLE_OWNER");
    bytes32 public constant ROLE_STAFF = keccak256("ROLE_STAFF");

    /// A contract that performs multi-swap according to given input data
    /// See Multicaller.sol for more info
    address payable public caller;


    /* ========== CONSTRUCTOR ========== */

    /// @dev Constuctor with owner / staff / caller
    /// @param owner The owner address
    /// @param staff The staff address
    /// @param _caller The caller contract address (MUST be a contract)
    constructor(address owner, address staff, address payable _caller) {
        _setRoleAdmin(ROLE_OWNER, ROLE_OWNER);
        _setRoleAdmin(ROLE_STAFF, ROLE_OWNER);
        _setupRole(ROLE_OWNER, owner);
        _setupRole(ROLE_STAFF, staff);

        require(Address.isContract(_caller), "ERR_MULTICALLER_NOT_CONTRACT");
        caller = _caller;
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    /// @notice Set caller address (could be set only by staff)
    /// @param _caller The multicaller contract address that performs multi-swap
    function setCaller(address payable _caller) external onlyRole(ROLE_STAFF) {
        require(Address.isContract(_caller), "ERR_MULTICALLER_NOT_CONTRACT");
        caller = _caller;
    }

    /* ========== WRITE FUNCTIONS ========== */

    /// @notice Swap and check if it's done correctly according to swap description `desc`
    /// This function transfers asset from sender `msg.sender` and then call multicaller contract `caller` to perform multi-swap,
    /// and checks `minReturnAmount` in `desc` to ensure enough amount of desired token `toToken` is received after the swap.
    /// @param desc The description of the swap. See IAggregator.sol for more info.
    /// @param data Bytecode to execute the swap, forwarded to `caller`
    /// @return Received amount of `toToken` after the swap
    function swap(
        SwapDescription calldata desc,
        bytes calldata data
    )
        external
        override
        payable
        nonReentrant
        returns (uint256)
    {
        require(desc.minReturnAmount > 0, "Min return should not be 0");
        require(data.length > 0, "data should be not zero");

        IERC20 fromToken = desc.fromToken;
        IERC20 toToken = desc.toToken;

        require(msg.value == (fromToken.isETH() ? desc.amount : 0), "Invalid msg.value");

        uint256 amount = desc.amount;
        if (!fromToken.isETH()) {
            amount = fromToken.balanceOf(caller);
            fromToken.safeTransferFrom(msg.sender, caller, desc.amount);
            amount = fromToken.balanceOf(caller) - amount;
        }

        require(desc.receiver != address(0), "Invalid receiver");
        address receiver = desc.receiver;
        uint256 toTokenBalance = toToken.uniBalanceOf(receiver);

        Address.functionCallWithValue(caller, data, msg.value, "Caller multiswap failed");

        uint256 returnAmount = toToken.uniBalanceOf(receiver) - toTokenBalance;
        require(returnAmount >= desc.minReturnAmount, "Return amount is not enough");

        emit Swapped(
            msg.sender,
            fromToken,
            toToken,
            receiver,
            amount,
            returnAmount
        );
        return returnAmount;
    }

    /* ========== EVENTS ========== */

    event Swapped(
        address sender,
        IERC20 fromToken,
        IERC20 toToken,
        address receiver,
        uint256 spentAmount,
        uint256 returnAmount
    );
}

File 2 of 16 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 3 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";
import "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");
        }
    }
}

File 4 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 16 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";
import "IERC20Metadata.sol";
import "Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 6 of 16 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 7 of 16 : Context.sol
// SPDX-License-Identifier: MIT

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

File 8 of 16 : SafeMath.sol
// SPDX-License-Identifier: MIT

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 no longer needed starting with Solidity 0.8. 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 substraction 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;
        }
    }
}

File 9 of 16 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IAccessControl.sol";
import "Context.sol";
import "Strings.sol";
import "ERC165.sol";

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 10 of 16 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 11 of 16 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 12 of 16 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC165.sol";

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

File 13 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 14 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 15 of 16 : IAggregator.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.2;
pragma experimental ABIEncoderV2;

import { IERC20 } from "ERC20.sol";


interface IAggregator {
    struct SwapDescription {
        IERC20 fromToken;
        IERC20 toToken;
        address receiver;
        uint256 amount;
        uint256 minReturnAmount;
    }
    function swap(SwapDescription calldata desc, bytes calldata data) external payable returns (uint256 returnAmount);
}

File 16 of 16 : UniERC20.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.2;

import "ERC20.sol";

/// @title Library for unifying getting balance in one interface
/// @notice Use `uniBalanceOf` to get amount of the desired token or native token balance
library UniERC20 {

    // native token addresses
    address private constant _ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
    address private constant _ZERO_ADDRESS = address(0);

    /// @notice Check if the given token address is native token
    /// @param token The token address to be checked
    /// @return `true` if native token, otherwise `false`
    function isETH(IERC20 token) internal pure returns (bool) {
        return (address(token) == _ZERO_ADDRESS || address(token) == _ETH_ADDRESS);
    }

    /// @notice Get balance of the desired account address of the given token
    /// @param token The token address to be checked
    /// @param account The address to be checked
    /// @return The token balance of the desired account address
    function uniBalanceOf(IERC20 token, address account) internal view returns (uint256) {
        if (isETH(token)) {
            return account.balance;
        } else {
            return token.balanceOf(account);
        }
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"staff","type":"address"},{"internalType":"address payable","name":"_caller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"fromToken","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"toToken","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"spentAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"returnAmount","type":"uint256"}],"name":"Swapped","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_OWNER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_STAFF","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"caller","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_caller","type":"address"}],"name":"setCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"fromToken","type":"address"},{"internalType":"contract IERC20","name":"toToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"}],"internalType":"struct IAggregator.SwapDescription","name":"desc","type":"tuple"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"}]

60806040523480156200001157600080fd5b50604051620015d2380380620015d2833981016040819052620000349162000244565b6001805562000053600080516020620015b28339815191528062000143565b6200007d60008051602062001592833981519152600080516020620015b283398151915262000143565b62000098600080516020620015b2833981519152846200018e565b620000b360008051602062001592833981519152836200018e565b620000c9816200019e60201b620009141760201c565b6200011a5760405162461bcd60e51b815260206004820152601c60248201527f4552525f4d554c544943414c4c45525f4e4f545f434f4e545241435400000000604482015260640160405180910390fd5b600280546001600160a01b0319166001600160a01b039290921691909117905550620002b09050565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6200019a8282620001a4565b5050565b3b151590565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200019a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002003390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008060006060848603121562000259578283fd5b8351620002668162000297565b6020850151909350620002798162000297565b60408501519092506200028c8162000297565b809150509250925092565b6001600160a01b0381168114620002ad57600080fd5b50565b6112d280620002c06000396000f3fe6080604052600436106100a75760003560e01c80638ad682af116100645780638ad682af146101a857806391d14854146101dc578063a217fddf146101fc578063beb92f5514610211578063d547741f14610231578063fc9c8d3914610251576100a7565b806301ffc9a7146100ac57806322bf2e24146100e1578063248a9ca3146101235780632f2ff15d1461015357806336568abe146101755780638218b58f14610195575b600080fd5b3480156100b857600080fd5b506100cc6100c7366004611054565b610289565b60405190151581526020015b60405180910390f35b3480156100ed57600080fd5b506101157f358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd81565b6040519081526020016100d8565b34801561012f57600080fd5b5061011561013e36600461100d565b60009081526020819052604090206001015490565b34801561015f57600080fd5b5061017361016e366004611025565b6102c0565b005b34801561018157600080fd5b50610173610190366004611025565b6102ec565b6101156101a336600461107c565b61036f565b3480156101b457600080fd5b506101157f9f4e1c871d5fdd0aee1cd182666698a4492b24c6832aac230d07b11046af5a8981565b3480156101e857600080fd5b506100cc6101f7366004611025565b610829565b34801561020857600080fd5b50610115600081565b34801561021d57600080fd5b5061017361022c366004610fd1565b610852565b34801561023d57600080fd5b5061017361024c366004611025565b6108ee565b34801561025d57600080fd5b50600254610271906001600160a01b031681565b6040516001600160a01b0390911681526020016100d8565b60006001600160e01b03198216637965db0b60e01b14806102ba57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102dd81335b61091a565b6102e7838361097e565b505050565b6001600160a01b03811633146103615760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61036b8282610a02565b5050565b6000600260015414156103c45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610358565b6002600155608084013561041a5760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f7420626520300000000000006044820152606401610358565b816104675760405162461bcd60e51b815260206004820152601760248201527f646174612073686f756c64206265206e6f74207a65726f0000000000000000006044820152606401610358565b60006104766020860186610fd1565b9050600061048a6040870160208801610fd1565b905061049e826001600160a01b0316610a67565b6104a95760006104af565b85606001355b34146104f15760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206d73672e76616c756560781b6044820152606401610358565b60608601356105086001600160a01b038416610a67565b610637576002546040516370a0823160e01b81526001600160a01b039182166004820152908416906370a082319060240160206040518083038186803b15801561055157600080fd5b505afa158015610565573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105899190611101565b6002549091506105ac906001600160a01b038581169133911660608b0135610a9d565b6002546040516370a0823160e01b81526001600160a01b03918216600482015282918516906370a082319060240160206040518083038186803b1580156105f257600080fd5b505afa158015610606573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062a9190611101565b6106349190611214565b90505b60006106496060890160408a01610fd1565b6001600160a01b031614156106935760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103932b1b2b4bb32b960811b6044820152606401610358565b60006106a56060890160408a01610fd1565b905060006106bc6001600160a01b03851683610afd565b600254604080516020601f8c018190048102820181019092528a8152929350610742926001600160a01b0390921691908b908b90819084018382808284376000920191909152505060408051808201909152601781527f43616c6c6572206d756c746973776170206661696c656400000000000000000060208201523492509050610b9e565b506000816107596001600160a01b03871685610afd565b6107639190611214565b905089608001358110156107b95760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f75676800000000006044820152606401610358565b604080513381526001600160a01b03888116602083015287811682840152851660608201526080810186905260a0810183905290517fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f89181900360c00190a1600180559998505050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b7f358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd61087d81336102d8565b813b6108cb5760405162461bcd60e51b815260206004820152601c60248201527f4552525f4d554c544943414c4c45525f4e4f545f434f4e5452414354000000006044820152606401610358565b50600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526020819052604090206001015461090a81336102d8565b6102e78383610a02565b3b151590565b6109248282610829565b61036b5761093c816001600160a01b03166014610cc6565b610947836020610cc6565b604051602001610958929190611135565b60408051601f198184030181529082905262461bcd60e51b8252610358916004016111aa565b6109888282610829565b61036b576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556109be3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610a0c8282610829565b1561036b576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006001600160a01b03821615806102ba5750506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610af7908590610eaf565b50505050565b6000610b0883610a67565b15610b1e57506001600160a01b038116316102ba565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b158015610b5f57600080fd5b505afa158015610b73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b979190611101565b90506102ba565b606082471015610bff5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610358565b843b610c4d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610358565b600080866001600160a01b03168587604051610c699190611119565b60006040518083038185875af1925050503d8060008114610ca6576040519150601f19603f3d011682016040523d82523d6000602084013e610cab565b606091505b5091509150610cbb828286610f81565b979650505050505050565b60606000610cd58360026111f5565b610ce09060026111dd565b67ffffffffffffffff811115610d0657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610d30576020820181803683370190505b509050600360fc1b81600081518110610d5957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610d9657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000610dba8460026111f5565b610dc59060016111dd565b90505b6001811115610e59576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610e0757634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110610e2b57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93610e5281611257565b9050610dc8565b508315610ea85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610358565b9392505050565b6000610f04826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fba9092919063ffffffff16565b8051909150156102e75780806020019051810190610f229190610fed565b6102e75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610358565b60608315610f90575081610ea8565b825115610fa05782518084602001fd5b8160405162461bcd60e51b815260040161035891906111aa565b6060610fc98484600085610b9e565b949350505050565b600060208284031215610fe2578081fd5b8135610ea881611284565b600060208284031215610ffe578081fd5b81518015158114610ea8578182fd5b60006020828403121561101e578081fd5b5035919050565b60008060408385031215611037578081fd5b82359150602083013561104981611284565b809150509250929050565b600060208284031215611065578081fd5b81356001600160e01b031981168114610ea8578182fd5b600080600083850360c0811215611091578182fd5b60a081121561109e578182fd5b5083925060a084013567ffffffffffffffff808211156110bc578283fd5b818601915086601f8301126110cf578283fd5b8135818111156110dd578384fd5b8760208285010111156110ee578384fd5b6020830194508093505050509250925092565b600060208284031215611112578081fd5b5051919050565b6000825161112b81846020870161122b565b9190910192915050565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161116d81601785016020880161122b565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161119e81602884016020880161122b565b01602801949350505050565b60006020825282518060208401526111c981604085016020870161122b565b601f01601f19169190910160400192915050565b600082198211156111f0576111f061126e565b500190565b600081600019048311821515161561120f5761120f61126e565b500290565b6000828210156112265761122661126e565b500390565b60005b8381101561124657818101518382015260200161122e565b83811115610af75750506000910152565b6000816112665761126661126e565b506000190190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461129957600080fd5b5056fea2646970667358221220da4f6d6302fd9a1c8356e09d3af011cd97a389f04ffd1084cc5ba4de09ad304c64736f6c63430008020033358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd9f4e1c871d5fdd0aee1cd182666698a4492b24c6832aac230d07b11046af5a890000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b00000000000000000000000035d0c393d81a25c8d45aac5a6b9d399e497e8928

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

0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b00000000000000000000000035d0c393d81a25c8d45aac5a6b9d399e497e8928

-----Decoded View---------------
Arg [0] : owner (address): 0x0132613b3a1061816f4661ad301612910e3cce0b
Arg [1] : staff (address): 0x0132613b3a1061816f4661ad301612910e3cce0b
Arg [2] : _caller (address): 0x35d0c393d81a25c8d45aac5a6b9d399e497e8928

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b
Arg [1] : 0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b
Arg [2] : 00000000000000000000000035d0c393d81a25c8d45aac5a6b9d399e497e8928


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.