ETH Price: $3,252.31 (-0.59%)

Contract

0xB2e8aCBac1f1f049618ADE2c1F526127dF596622
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NonLinearTimeLockSwapperV2_0_6

Compiler Version
v0.8.5+commit.a4f2e591

Optimization Enabled:
Yes with 999 runs

Other Settings:
default evmVersion
File 1 of 19 : NonLinearTimeLockSwapperV2_0_6.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.5; // solhint-disable-line compiler-version

import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol";

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

import { DSMath } from "../lib/ds-hub.sol";
import { StorageSlotOwnable } from "../lib/StorageSlotOwnable.sol";
import { OnApprove } from "../token/ERC20OnApprove.sol";

import { NonLinearTimeLockSwapperV2_0_4__2_0_6Storage } from "./NonLinearTimeLockSwapperV2_0_4__2_0_6Storage.sol";

contract NonLinearTimeLockSwapperV2_0_6 is
    NonLinearTimeLockSwapperV2_0_4__2_0_6Storage,
    StorageSlotOwnable,
    DSMath,
    OnApprove,
    Multicall
{
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    modifier onlyValidAddress(address account) {
        require(account != address(0), "zero-address");
        _;
    }

    modifier onlyDeposit(address sourceToken, address account) {
        require(depositAmounts[sourceToken][account] != 0, "no-deposit");
        _;
    }

    event Deposited(
        address indexed sourceToken,
        address indexed beneficiary,
        uint256 sourceTokenAmount,
        uint256 targetTokenAmount
    );

    event Undeposited(address indexed sourceToken, address indexed beneficiary, uint256 amount, address receiver);

    event Claimed(address indexed sourceToken, address indexed beneficiary, uint256 targetTokenAmount);
    event TokenWalletChanged(address indexed previousWallet, address newWallet);

    //////////////////////////////////////////
    //
    // kernel
    //
    //////////////////////////////////////////

    function implementationVersion() public view virtual override returns (string memory) {
        return "2.0.6";
    }

    function _initializeKernel(bytes memory data) internal override {
        (address owner_, address token_, address tokenWallet_) = abi.decode(data, (address, address, address));
        _initializeV2(owner_, token_, tokenWallet_);
    }

    function _initializeV2(
        address owner_,
        address token_,
        address tokenWallet_
    ) private onlyValidAddress(owner_) onlyValidAddress(token_) onlyValidAddress(tokenWallet_) {
        if (owner() == address(0)) _setOwner(owner_);
        if (address(token) == address(0)) token = IERC20(token_);
        if (tokenWallet == address(0)) tokenWallet = tokenWallet_;

        _registerInterface(OnApprove(this).onApprove.selector);
    }

    //////////////////////////////////////////
    //
    // register source token
    //
    //////////////////////////////////////////

    /**
     * @dev register source token with vesting data
     */
    function register(
        address sourceToken,
        uint128 rate,
        uint128 startTime,
        uint256[] memory stepEndTimes,
        uint256[] memory stepRatio
    ) external onlyOwner {
        require(!isRegistered(sourceToken), "duplicate-register");

        require(rate > 0, "invalid-rate");

        require(stepEndTimes.length == stepRatio.length, "invalid-array-length");

        uint256 n = stepEndTimes.length;
        uint256[] memory accStepRatio = new uint256[](n);

        uint256 accRatio;
        for (uint256 i = 0; i < n; i++) {
            accRatio = add(accRatio, stepRatio[i]);
            accStepRatio[i] = accRatio;
        }
        require(accRatio == WAD, "invalid-acc-ratio");

        for (uint256 i = 1; i < n; i++) {
            require(stepEndTimes[i - 1] < stepEndTimes[i], "unsorted-times");
        }

        sourceTokenDatas[sourceToken] = SourceTokeData({
            rate: rate,
            startTime: startTime,
            stepEndTimes: stepEndTimes,
            accStepRatio: accStepRatio
        });
    }

    function isRegistered(address sourceToken) public view returns (bool) {
        return sourceTokenDatas[sourceToken].startTime > 0;
    }

    function getStepEndTimes(address sourceToken) external view returns (uint256[] memory) {
        return sourceTokenDatas[sourceToken].stepEndTimes;
    }

    function getAccStepRatio(address sourceToken) external view returns (uint256[] memory) {
        return sourceTokenDatas[sourceToken].accStepRatio;
    }

    //////////////////////////////////////////
    //
    // source token deposit
    //
    //////////////////////////////////////////

    function onApprove(
        address owner,
        address spender,
        uint256 amount,
        bytes calldata data
    ) external override returns (bool) {
        require(spender == address(this), "invalid-approval");
        require(isRegistered(msg.sender), "unregistered-source-token");

        deposit(msg.sender, owner, amount);

        data;
        return true;
    }

    // deposit sender's token
    function deposit(
        address sourceToken,
        address beneficiary,
        uint256 sourceTokenAmount
    ) public onlyValidAddress(beneficiary) {
        require(isRegistered(sourceToken), "unregistered-source-token");
        require(sourceTokenAmount > 0, "invalid-amount");

        require(msg.sender == address(sourceToken) || msg.sender == beneficiary, "no-auth");

        SourceTokeData storage data = sourceTokenDatas[sourceToken];
        uint256 targetTokenAmount = wmul(sourceTokenAmount, data.rate);

        // update initial balance
        depositAmounts[sourceToken][beneficiary] = depositAmounts[sourceToken][beneficiary].add(sourceTokenAmount);

        // get source token from beneficiary
        IERC20(sourceToken).safeTransferFrom(beneficiary, address(this), sourceTokenAmount);

        emit Deposited(sourceToken, beneficiary, sourceTokenAmount, targetTokenAmount);
    }

    //////////////////////////////////////////
    //
    // claim
    //
    //////////////////////////////////////////

    /// @dev get token beneficiary for token depositor. this can rescue compromised account by chainging beneficiary.
    function _getBeneficiary(address depositor) internal pure returns (address) {
        // compromised address 1
        if (
            depositor == address(0xdedFa1416829f9aCC90082Cdff27C73352e7dF98) ||
            depositor == address(0xAA7ca534E1624A096c0E210a4D23625c6be0b3A7) ||
            depositor == address(0x3f7f6F6CC658B3e8C1A77b0C5fa30A9FbCae834b) ||
            depositor == address(0x926d0cf1F249BbD011D5328D4e862c48fe73ad56) ||
            depositor == address(0x00936b8F13B205a3c7b54672B61b75B8DAa6162a)
        ) return address(0x3352c49Fe72A8e94681EB1216BB29c173b4a35C2);
        return depositor;
    }

    /// @dev claim on behalf of the depositor. msg.sender cannot be the beneficiary
    function claimFor(address sourceToken, address depositor) external {
        _claim(sourceToken, depositor);
    }

    /// @dev internal function to execute swap
    function _claim(address sourceToken, address depositor) internal onlyDeposit(sourceToken, depositor) {
        uint256 amount = claimable(sourceToken, depositor);
        require(amount > 0, "invalid-amount");

        address beneficiary = _getBeneficiary(depositor);

        claimedAmounts[sourceToken][depositor] = claimedAmounts[sourceToken][depositor].add(amount);
        token.safeTransferFrom(tokenWallet, beneficiary, amount);

        emit Claimed(sourceToken, beneficiary, amount);
    }

    /// @dev claim for deposited a single sourceToken
    function claim(address sourceToken) public {
        _claim(sourceToken, msg.sender);
    }

    /// @dev claim for a list of deposited sourceTokens
    function claimTokens(address[] calldata sourceTokens) external {
        for (uint256 i = 0; i < sourceTokens.length; i++) {
            claim(sourceTokens[i]);
        }
    }

    /**
     * @dev get claimable tokens now
     */
    function claimable(address sourceToken, address beneficiary) public view returns (uint256) {
        return claimableAt(sourceToken, beneficiary, block.timestamp);
    }

    /**
     * @dev get claimable tokens at `timestamp`
     */
    function claimableAt(
        address sourceToken,
        address beneficiary,
        uint256 timestamp
    ) public view returns (uint256) {
        require(block.timestamp <= timestamp, "invalid-timestamp");

        SourceTokeData storage sourceTokenData = sourceTokenDatas[sourceToken];

        uint256 totalClaimable = wmul(depositAmounts[sourceToken][beneficiary], sourceTokenData.rate);
        uint256 claimedAmount = claimedAmounts[sourceToken][beneficiary];

        if (timestamp < sourceTokenData.startTime) return 0;
        if (timestamp >= sourceTokenData.stepEndTimes[sourceTokenData.stepEndTimes.length - 1])
            return totalClaimable.sub(claimedAmount);

        uint256 step = getStepAt(sourceToken, timestamp);
        uint256 accRatio = sourceTokenData.accStepRatio[step];

        uint256 claimableAmount = wmul(totalClaimable, accRatio);

        return claimableAmount > claimedAmount ? claimableAmount.sub(claimedAmount) : 0;
    }

    function initialBalance(address sourceToken, address beneficiary) external view returns (uint256) {
        return depositAmounts[sourceToken][beneficiary];
    }

    /**
     * @dev get current step
     */
    function getStep(address sourceToken) public view returns (uint256) {
        return getStepAt(sourceToken, block.timestamp);
    }

    /**
     * @dev get step at `timestamp`
     */
    function getStepAt(address sourceToken, uint256 timestamp) public view returns (uint256) {
        SourceTokeData storage sourceTokenData = sourceTokenDatas[sourceToken];

        require(timestamp >= sourceTokenData.startTime, "not-started");
        uint256 n = sourceTokenData.stepEndTimes.length;
        if (timestamp >= sourceTokenData.stepEndTimes[n - 1]) {
            return n - 1;
        }
        if (timestamp <= sourceTokenData.stepEndTimes[0]) {
            return 0;
        }

        uint256 lo = 1;
        uint256 hi = n - 1;
        uint256 md;

        while (lo < hi) {
            md = (hi + lo + 1) / 2;
            if (timestamp < sourceTokenData.stepEndTimes[md - 1]) {
                hi = md - 1;
            } else {
                lo = md;
            }
        }

        return lo;
    }
}

File 2 of 19 : 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. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * 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 3 of 19 : 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 4 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT

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'
        // solhint-disable-next-line max-line-length
        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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 19 : Multicall.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Address.sol";

/**
 * @dev Provides a function to batch together multiple calls in a single external call.
 *
 * _Available since v4.1._
 */
abstract contract Multicall {
    /**
    * @dev Receives and executes a batch of function calls on this contract.
    */
    function multicall(bytes[] calldata data) external returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint i = 0; i < data.length; i++) {
            results[i] = Address.functionDelegateCall(address(this), data[i]);
        }
        return results;
    }
}

File 6 of 19 : ds-hub.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface DSAuthority {
    function canCall(
        address src,
        address dst,
        bytes4 sig
    ) external view returns (bool);
}

contract DSAuthEvents {
    event LogSetAuthority(address indexed authority);
    event LogSetOwner(address indexed owner);
}

contract DSAuth is DSAuthEvents {
    DSAuthority public authority;
    address public owner;

    constructor() public {
        owner = msg.sender;
        emit LogSetOwner(msg.sender);
    }

    function setOwner(address owner_) public auth {
        owner = owner_;
        emit LogSetOwner(owner);
    }

    function setAuthority(DSAuthority authority_) public auth {
        authority = authority_;
        emit LogSetAuthority(address(authority));
    }

    modifier auth {
        require(isAuthorized(msg.sender, msg.sig), "ds-auth-unauthorized");
        _;
    }

    function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
        if (src == address(this)) {
            return true;
        } else if (src == owner) {
            return true;
        } else if (authority == DSAuthority(address(0))) {
            return false;
        } else {
            return authority.canCall(src, address(this), sig);
        }
    }
}

contract DSNote {
    event LogNote(
        bytes4 indexed sig,
        address indexed guy,
        bytes32 indexed foo,
        bytes32 indexed bar,
        uint256 wad,
        bytes fax
    ) anonymous;

    modifier note {
        bytes32 foo;
        bytes32 bar;
        uint256 wad;

        assembly {
            foo := calldataload(4)
            bar := calldataload(36)
            wad := callvalue()
        }

        _;

        emit LogNote(msg.sig, msg.sender, foo, bar, wad, msg.data);
    }
}

contract DSMath {
    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x + y) >= x, "ds-math-add-overflow");
    }

    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x - y) <= x, "ds-math-sub-underflow");
    }

    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
    }

    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        return x <= y ? x : y;
    }

    function max(uint256 x, uint256 y) internal pure returns (uint256 z) {
        return x >= y ? x : y;
    }

    function imin(int256 x, int256 y) internal pure returns (int256 z) {
        return x <= y ? x : y;
    }

    function imax(int256 x, int256 y) internal pure returns (int256 z) {
        return x >= y ? x : y;
    }

    uint256 constant WAD = 10**18;
    uint256 constant RAY = 10**27;

    //rounds to zero if x*y < WAD / 2
    function wmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = add(mul(x, y), WAD / 2) / WAD;
    }

    //rounds to zero if x*y < WAD / 2
    function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = add(mul(x, y), RAY / 2) / RAY;
    }

    //rounds to zero if x*y < WAD / 2
    function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = add(mul(x, WAD), y / 2) / y;
    }

    //rounds to zero if x*y < RAY / 2
    function rdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = add(mul(x, RAY), y / 2) / y;
    }

    // This famous algorithm is called "exponentiation by squaring"
    // and calculates x^n with x as fixed-point and n as regular unsigned.
    //
    // It's O(log n), instead of O(n) for naive repeated multiplication.
    //
    // These facts are why it works:
    //
    //  If n is even, then x^n = (x^2)^(n/2).
    //  If n is odd,  then x^n = x * x^(n-1),
    //   and applying the equation for even x gives
    //    x^n = x * (x^2)^((n-1) / 2).
    //
    //  Also, EVM division is flooring and
    //    floor[(n-1) / 2] = floor[n / 2].
    //
    function rpow(uint256 x, uint256 n) internal pure returns (uint256 z) {
        z = n % 2 != 0 ? x : RAY;

        for (n /= 2; n != 0; n /= 2) {
            x = rmul(x, x);

            if (n % 2 != 0) {
                z = rmul(z, x);
            }
        }
    }
}

contract DSThing is DSAuth, DSNote, DSMath {
    function S(string memory s) internal pure returns (bytes4) {
        return bytes4(keccak256(abi.encodePacked(s)));
    }
}

contract DSValue is DSThing {
    bool has;
    bytes32 val;

    function peek() public view returns (bytes32, bool) {
        return (val, has);
    }

    function read() public view returns (bytes32) {
        bytes32 wut;
        bool haz;
        (wut, haz) = peek();
        require(haz, "haz-not");
        return wut;
    }

    function poke(bytes32 wut) public note auth {
        val = wut;
        has = true;
    }

    function void() public note auth {
        // unset the value
        has = false;
    }
}

File 7 of 19 : StorageSlotOwnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/StorageSlot.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 StorageSlotOwnable is Context {
    bytes32 private constant _OWNER_SLOT = bytes32(uint256(keccak256("StorageSlotOwnable.owner")) - 1);

    /**
     * @dev Returns the current owner.
     */
    function _getOwner() internal view returns (address) {
        return StorageSlot.getAddressSlot(_OWNER_SLOT).value;
    }

    /**
     * @dev Stores a new address in the owner slot.
     */
    function _setOwner(address newOwner) internal {
        require(newOwner != address(0), "StorageSlotOwnable: new admin is the zero address");
        StorageSlot.getAddressSlot(_OWNER_SLOT).value = newOwner;
    }

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "StorageSlotOwnable: 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 {
        emit OwnershipTransferred(_getOwner(), address(0));
        _setOwner(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), "StorageSlotOwnable: new owner is the zero address");
        emit OwnershipTransferred(_getOwner(), newOwner);
        _setOwner(newOwner);
    }
}

File 8 of 19 : ERC20OnApprove.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0; // solhint-disable-line compiler-version

import { ERC165 } from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import { ERC165Storage } from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

abstract contract OnApprove is ERC165Storage {
    constructor() {
        _registerInterface(OnApprove(this).onApprove.selector);
    }

    function onApprove(
        address owner,
        address spender,
        uint256 amount,
        bytes calldata data
    ) external virtual returns (bool);
}

abstract contract ERC20OnApprove is ERC20 {
    function approveAndCall(
        address spender,
        uint256 amount,
        bytes calldata data
    ) external returns (bool) {
        require(approve(spender, amount), "ERC20OnApprove: fail to approve");
        _callOnApprove(msg.sender, spender, amount, data);
        return true;
    }

    function _callOnApprove(
        address owner,
        address spender,
        uint256 amount,
        bytes memory data
    ) internal {
        bytes4 onApproveSelector = OnApprove(spender).onApprove.selector;

        require(
            ERC165Checker.supportsInterface(spender, onApproveSelector),
            "ERC20OnApprove: spender doesn't support onApprove"
        );

        (bool ok, bytes memory res) = spender.call(
            abi.encodeWithSelector(onApproveSelector, owner, spender, amount, data)
        );

        // check if low-level call reverted or not
        require(ok, string(res));

        assembly {
            ok := mload(add(res, 0x20))
        }

        // check if OnApprove.onApprove returns true or false
        require(ok, "ERC20OnApprove: failed to call onApprove");
    }
}

File 9 of 19 : NonLinearTimeLockSwapperV2_0_4__2_0_6Storage.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.5; // solhint-disable-line compiler-version

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

import { Kernel } from "../proxy/Kernel.sol";

abstract contract NonLinearTimeLockSwapperV2_0_4__2_0_6Storage is Kernel {
    // swap data for each source token, i.e., teamCFX, ecoCFX, backCFX
    struct SourceTokeData {
        uint128 rate; // convertion rate from source token to target token
        uint128 startTime;
        uint256[] stepEndTimes;
        uint256[] accStepRatio;
    }

    IERC20 public token; // target token, i.e., CFX
    address public tokenWallet; // address who supply target token

    /// @dev `migrationStopped` is deprecated. this exists only to remain storage layout.
    bool public _____DEPRECATED_____migrationStopped;

    // time lock data for each source token
    mapping(address => SourceTokeData) public sourceTokenDatas;

    // source token deposit amounts
    // sourceToken => beneficiary => deposit amounts
    mapping(address => mapping(address => uint256)) public depositAmounts;

    // source token claimed amounts
    // sourceToken => beneficiary => claimed amounts
    mapping(address => mapping(address => uint256)) public claimedAmounts;
}

File 10 of 19 : 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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 11 of 19 : 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) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 12 of 19 : StorageSlot.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

File 13 of 19 : 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 14 of 19 : ERC165Checker.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Library used to query support of an interface declared via {IERC165}.
 *
 * Note that these functions return the actual result of the query: they do not
 * `revert` if an interface is not supported. It is up to the caller to decide
 * what to do in these cases.
 */
library ERC165Checker {
    // As per the EIP-165 spec, no interface should ever match 0xffffffff
    bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;

    /**
     * @dev Returns true if `account` supports the {IERC165} interface,
     */
    function supportsERC165(address account) internal view returns (bool) {
        // Any contract that implements ERC165 must explicitly indicate support of
        // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
        return _supportsERC165Interface(account, type(IERC165).interfaceId) &&
            !_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
    }

    /**
     * @dev Returns true if `account` supports the interface defined by
     * `interfaceId`. Support for {IERC165} itself is queried automatically.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
        // query support of both ERC165 as per the spec and support of _interfaceId
        return supportsERC165(account) &&
            _supportsERC165Interface(account, interfaceId);
    }

    /**
     * @dev Returns a boolean array where each value corresponds to the
     * interfaces passed in and whether they're supported or not. This allows
     * you to batch check interfaces for a contract where your expectation
     * is that some interfaces may not be supported.
     *
     * See {IERC165-supportsInterface}.
     *
     * _Available since v3.4._
     */
    function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) {
        // an array of booleans corresponding to interfaceIds and whether they're supported or not
        bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);

        // query support of ERC165 itself
        if (supportsERC165(account)) {
            // query support of each interface in interfaceIds
            for (uint256 i = 0; i < interfaceIds.length; i++) {
                interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
            }
        }

        return interfaceIdsSupported;
    }

    /**
     * @dev Returns true if `account` supports all the interfaces defined in
     * `interfaceIds`. Support for {IERC165} itself is queried automatically.
     *
     * Batch-querying can lead to gas savings by skipping repeated checks for
     * {IERC165} support.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
        // query support of ERC165 itself
        if (!supportsERC165(account)) {
            return false;
        }

        // query support of each interface in _interfaceIds
        for (uint256 i = 0; i < interfaceIds.length; i++) {
            if (!_supportsERC165Interface(account, interfaceIds[i])) {
                return false;
            }
        }

        // all interfaces supported
        return true;
    }

    /**
     * @notice Query if a contract implements an interface, does not check ERC165 support
     * @param account The address of the contract to query for support of an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @return true if the contract at account indicates support of the interface with
     * identifier interfaceId, false otherwise
     * @dev Assumes that account contains a contract that supports ERC165, otherwise
     * the behavior of this method is undefined. This precondition can be checked
     * with {supportsERC165}.
     * Interface identification is specified in ERC-165.
     */
    function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
        bytes memory encodedParams = abi.encodeWithSelector(IERC165(account).supportsInterface.selector, interfaceId);
        (bool success, bytes memory result) = account.staticcall{ gas: 30000 }(encodedParams);
        if (result.length < 32) return false;
        return success && abi.decode(result, (bool));
    }
}

File 15 of 19 : ERC165Storage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ERC165.sol";

/**
 * @dev Storage based implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165Storage is ERC165 {
    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

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

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

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

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/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 guidelines: functions revert instead
 * of 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 defaut 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");
        _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");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is 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");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;

        emit Transfer(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:
     *
     * - `to` 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);
    }

    /**
     * @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");
        _balances[account] = accountBalance - amount;
        _totalSupply -= amount;

        emit Transfer(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 to 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 { }
}

File 17 of 19 : 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 18 of 19 : 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 19 of 19 : Kernel.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @dev This contains proxy initialization data
 */
abstract contract Kernel {
    bytes32 private constant INITIALIZED = bytes32(uint256(keccak256("Kernel.INITIALIZED")) - 1);

    // initialized for the version
    mapping(bytes32 => bool) private _initialized;

    modifier onlyKernelInitialized() {
        require(kernelInitialized(), "Kernel: no-init");
        _;
    }

    modifier onlyKernelInitializedWithVersion(string memory version) {
        require(kernelInitialized(getVersionHash(version)), "Kernel: no-init");
        _;
    }

    /// @dev Each implementation contract must implement `implementationVersion` with unique return value for a proxy.
    function implementationVersion() public view virtual returns (string memory);

    /// @dev External function to initialize proxy, with specific `_initializeKernel`
    ///      implemented in each implementation contract.
    function initializeKernel(bytes calldata data) external returns (bool) {
        require(!kernelInitialized(), "Kernel: already-init");

        bytes32 h = getVersionHash();
        _initialized[h] = true;

        _initializeKernel(data);

        return true;
    }

    /// @dev Implementation contract have to override `_initializeKernel` to initialize after proxy upgraded.
    function _initializeKernel(bytes memory data) internal virtual;

    function kernelInitialized() public view returns (bool) {
        bytes32 h = getVersionHash();
        return _initialized[h];
    }

    /// @dev Return whether kernel is initialized with version hash.
    function kernelInitialized(bytes32 h) public view returns (bool) {
        return _initialized[h];
    }

    /// @dev Return hash of current implementation version.
    function getVersionHash() public view returns (bytes32) {
        return getVersionHash(implementationVersion());
    }

    /// @dev Return hash of given implementation version.
    function getVersionHash(string memory version) public pure returns (bytes32) {
        bytes32 h = keccak256(abi.encode(INITIALIZED, version));
        return h;
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sourceToken","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"targetTokenAmount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sourceToken","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"sourceTokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"targetTokenAmount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousWallet","type":"address"},{"indexed":false,"internalType":"address","name":"newWallet","type":"address"}],"name":"TokenWalletChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sourceToken","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"Undeposited","type":"event"},{"inputs":[],"name":"_____DEPRECATED_____migrationStopped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"},{"internalType":"address","name":"depositor","type":"address"}],"name":"claimFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"sourceTokens","type":"address[]"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"claimableAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"claimedAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"sourceTokenAmount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"depositAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"}],"name":"getAccStepRatio","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"}],"name":"getStep","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getStepAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"}],"name":"getStepEndTimes","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"version","type":"string"}],"name":"getVersionHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getVersionHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementationVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"}],"name":"initialBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"initializeKernel","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"}],"name":"isRegistered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"kernelInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kernelInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onApprove","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sourceToken","type":"address"},{"internalType":"uint128","name":"rate","type":"uint128"},{"internalType":"uint128","name":"startTime","type":"uint128"},{"internalType":"uint256[]","name":"stepEndTimes","type":"uint256[]"},{"internalType":"uint256[]","name":"stepRatio","type":"uint256[]"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"sourceTokenDatas","outputs":[{"internalType":"uint128","name":"rate","type":"uint128"},{"internalType":"uint128","name":"startTime","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610021632139e50b60e11b610026565b6100a9565b6001600160e01b031980821614156100845760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015260640160405180910390fd5b6001600160e01b0319166000908152600660205260409020805460ff19166001179055565b61288780620000b96000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806397f877961161010f578063c6217f55116100a2578063d4570c1c11610071578063d4570c1c1461050b578063eef72a3c1461051e578063f2fde38b14610531578063fc0c546a1461054457600080fd5b8063c6217f5514610494578063c6590930146104a7578063d041864c146104af578063d346fb4b146104b757600080fd5b8063bd160e64116100de578063bd160e6414610408578063bff99c6c1461041b578063c253b5da1461042e578063c3c5a5471461045957600080fd5b806397f8779614610389578063ac9650d81461039c578063ae5ed22b146103bc578063b4ba9e11146103f557600080fd5b806346f2180c116101875780638316f427116101565780638316f427146103305780638340f54914610343578063884520d6146103565780638da5cb5b1461036957600080fd5b806346f2180c146102d057806349e4c01a146102f5578063715018a614610315578063766b17f71461031d57600080fd5b80631e83409a116101c35780631e83409a14610272578063227720ca1461028757806337e22767146102aa5780634273ca16146102bd57600080fd5b806301ffc9a7146101ea57806306bfcec614610212578063143b82f114610239575b600080fd5b6101fd6101f83660046124ca565b610557565b60405190151581526020015b60405180910390f35b6040805180820182526005815264191718171b60d91b6020820152905161020991906126ba565b61026461024736600461229c565b600460209081526000928352604080842090915290825290205481565b604051908152602001610209565b610285610280366004612232565b6105b0565b005b6101fd6102953660046124b1565b60009081526020819052604090205460ff1690565b6102646102b836600461252a565b6105bd565b6101fd6102cb366004612316565b61061c565b6002546101fd9074010000000000000000000000000000000000000000900460ff1681565b610308610303366004612232565b6106fe565b6040516102099190612669565b61028561076d565b61026461032b366004612232565b61082b565b61030861033e366004612232565b610837565b6102856103513660046122d5565b6108a4565b610264610364366004612421565b610b05565b610371610c8e565b6040516001600160a01b039091168152602001610209565b610285610397366004612389565b610c9d565b6103af6103aa36600461244d565b61107a565b6040516102099190612607565b6102646103ca36600461229c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b61028561040336600461229c565b61116f565b6102646104163660046122d5565b61117d565b600254610371906001600160a01b031681565b61026461043c36600461229c565b600560209081526000928352604080842090915290825290205481565b6101fd610467366004612232565b6001600160a01b0316600090815260036020526040902054600160801b90046001600160801b0316151590565b6101fd6104a23660046124f4565b611311565b6102646113d3565b6101fd6113fa565b6104eb6104c5366004612232565b6003602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610209565b61026461051936600461229c565b61141d565b61028561052c36600461244d565b61142a565b61028561053f366004612232565b611476565b600154610371906001600160a01b031681565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614806105aa57506001600160e01b0319821660009081526006602052604090205460ff165b92915050565b6105ba81336115b5565b50565b6000806105eb60017fb9f9fca3715f91a88b971c15f18c3ac86a2c14233273cf673a84fdd011a0bdd961279e565b6040516105fd919085906020016126a1565b60408051601f1981840301815291905280516020909101209392505050565b60006001600160a01b038516301461067b5760405162461bcd60e51b815260206004820152601060248201527f696e76616c69642d617070726f76616c0000000000000000000000000000000060448201526064015b60405180910390fd5b33600090815260036020526040902054600160801b90046001600160801b03166106e75760405162461bcd60e51b815260206004820152601960248201527f756e726567697374657265642d736f757263652d746f6b656e000000000000006044820152606401610672565b6106f23387866108a4565b50600195945050505050565b6001600160a01b03811660009081526003602090815260409182902060010180548351818402810184019094528084526060939283018282801561076157602002820191906000526020600020905b81548152602001906001019080831161074d575b50505050509050919050565b33610776610c8e565b6001600160a01b0316146107e05760405162461bcd60e51b815260206004820152602b60248201527f53746f72616765536c6f744f776e61626c653a2063616c6c6572206973206e6f60448201526a3a103a34329037bbb732b960a91b6064820152608401610672565b60006107ea61173d565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3610829600061177f565b565b60006105aa8242610b05565b6001600160a01b038116600090815260036020908152604091829020600201805483518184028101840190945280845260609392830182828015610761576020028201919060005260206000209081548152602001906001019080831161074d5750505050509050919050565b816001600160a01b0381166108ea5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b6001600160a01b038416600090815260036020526040902054600160801b90046001600160801b031661095f5760405162461bcd60e51b815260206004820152601960248201527f756e726567697374657265642d736f757263652d746f6b656e000000000000006044820152606401610672565b600082116109a05760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a590b585b5bdd5b9d60921b6044820152606401610672565b336001600160a01b03851614806109bf5750336001600160a01b038416145b610a0b5760405162461bcd60e51b815260206004820152600760248201527f6e6f2d61757468000000000000000000000000000000000000000000000000006044820152606401610672565b6001600160a01b03841660009081526003602052604081208054909190610a3c9085906001600160801b0316611858565b6001600160a01b038088166000908152600460209081526040808320938a1683529290522054909150610a6f9085611892565b6001600160a01b038088166000818152600460209081526040808320948b1683529390529190912091909155610aa79086308761189e565b846001600160a01b0316866001600160a01b03167ff5681f9d0db1b911ac18ee83d515a1cf1051853a9eae418316a2fdf7dea427c58684604051610af5929190918252602082015260400190565b60405180910390a3505050505050565b6001600160a01b03821660009081526003602052604081208054600160801b90046001600160801b0316831015610b7e5760405162461bcd60e51b815260206004820152600b60248201527f6e6f742d737461727465640000000000000000000000000000000000000000006044820152606401610672565b6001808201805491610b90908361279e565b81548110610ba057610ba0612812565b90600052602060002001548410610bc557610bbc60018261279e565b925050506105aa565b81600101600081548110610bdb57610bdb612812565b90600052602060002001548411610bf7576000925050506105aa565b60016000610c05828461279e565b905060005b81831015610c82576002610c1e8484612745565b610c29906001612745565b610c33919061275d565b905084600101600182610c46919061279e565b81548110610c5657610c56612812565b9060005260206000200154871015610c7a57610c7360018261279e565b9150610c0a565b809250610c0a565b50909695505050505050565b6000610c9861173d565b905090565b33610ca6610c8e565b6001600160a01b031614610d105760405162461bcd60e51b815260206004820152602b60248201527f53746f72616765536c6f744f776e61626c653a2063616c6c6572206973206e6f60448201526a3a103a34329037bbb732b960a91b6064820152608401610672565b6001600160a01b038516600090815260036020526040902054600160801b90046001600160801b031615610d865760405162461bcd60e51b815260206004820152601260248201527f6475706c69636174652d726567697374657200000000000000000000000000006044820152606401610672565b6000846001600160801b031611610ddf5760405162461bcd60e51b815260206004820152600c60248201527f696e76616c69642d7261746500000000000000000000000000000000000000006044820152606401610672565b8051825114610e305760405162461bcd60e51b815260206004820152601460248201527f696e76616c69642d61727261792d6c656e6774680000000000000000000000006044820152606401610672565b815160008167ffffffffffffffff811115610e4d57610e4d612828565b604051908082528060200260200182016040528015610e76578160200160208202803683370190505b5090506000805b83811015610eda57610ea882868381518110610e9b57610e9b612812565b602002602001015161192c565b915081838281518110610ebd57610ebd612812565b602090810291909101015280610ed2816127e1565b915050610e7d565b50670de0b6b3a76400008114610f325760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642d6163632d726174696f0000000000000000000000000000006044820152606401610672565b60015b83811015610fdc57858181518110610f4f57610f4f612812565b602002602001015186600183610f65919061279e565b81518110610f7557610f75612812565b602002602001015110610fca5760405162461bcd60e51b815260206004820152600e60248201527f756e736f727465642d74696d65730000000000000000000000000000000000006044820152606401610672565b80610fd4816127e1565b915050610f35565b50604080516080810182526001600160801b03808a16825288811660208084019182528385018a8152606085018890526001600160a01b038e1660009081526003835295909520845192518416600160801b0292909316919091178255925180519293919261105192600185019201906120ab565b506060820151805161106d9160028401916020909101906120ab565b5050505050505050505050565b60608167ffffffffffffffff81111561109557611095612828565b6040519080825280602002602001820160405280156110c857816020015b60608152602001906001900390816110b35790505b50905060005b8281101561116857611138308585848181106110ec576110ec612812565b90506020028101906110fe91906126cd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061198a92505050565b82828151811061114a5761114a612812565b60200260200101819052508080611160906127e1565b9150506110ce565b5092915050565b61117982826115b5565b5050565b6000814211156111cf5760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642d74696d657374616d700000000000000000000000000000006044820152606401610672565b6001600160a01b03808516600090815260036020908152604080832060048352818420948816845293909152812054825461121391906001600160801b0316611858565b6001600160a01b038781166000908152600560209081526040808320938a1683529290522054835491925090600160801b90046001600160801b0316851015611262576000935050505061130a565b6001808401805490916112749161279e565b8154811061128457611284612812565b906000526020600020015485106112a95761129f82826119af565b935050505061130a565b60006112b58887610b05565b905060008460020182815481106112ce576112ce612812565b9060005260206000200154905060006112e78583611858565b90508381116112f7576000611301565b61130181856119af565b96505050505050505b9392505050565b600061131b6113fa565b156113685760405162461bcd60e51b815260206004820152601460248201527f4b65726e656c3a20616c72656164792d696e69740000000000000000000000006044820152606401610672565b60006113726113d3565b60008181526020818152604091829020805460ff191660011790558151601f87018290048202810182019092528582529192506113c99186908690819084018382808284376000920191909152506119bb92505050565b5060019392505050565b6000610c986102b8604080518082019091526005815264191718171b60d91b602082015290565b6000806114056113d3565b60009081526020819052604090205460ff1692915050565b600061130a83834261117d565b60005b818110156114715761145f83838381811061144a5761144a612812565b90506020020160208101906102809190612232565b80611469816127e1565b91505061142d565b505050565b3361147f610c8e565b6001600160a01b0316146114e95760405162461bcd60e51b815260206004820152602b60248201527f53746f72616765536c6f744f776e61626c653a2063616c6c6572206973206e6f60448201526a3a103a34329037bbb732b960a91b6064820152608401610672565b6001600160a01b0381166115655760405162461bcd60e51b815260206004820152603160248201527f53746f72616765536c6f744f776e61626c653a206e6577206f776e657220697360448201527f20746865207a65726f20616464726573730000000000000000000000000000006064820152608401610672565b806001600160a01b031661157761173d565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36105ba8161177f565b6001600160a01b038083166000908152600460209081526040808320938516835292905220548290829061162b5760405162461bcd60e51b815260206004820152600a60248201527f6e6f2d6465706f736974000000000000000000000000000000000000000000006044820152606401610672565b6000611637858561141d565b90506000811161167a5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a590b585b5bdd5b9d60921b6044820152606401610672565b6000611685856119e5565b6001600160a01b038088166000908152600560209081526040808320938a16835292905220549091506116b89083611892565b6001600160a01b0380881660009081526005602090815260408083208a851684529091529020919091556002546001546116f8929081169116838561189e565b806001600160a01b0316866001600160a01b03167ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd399268384604051610af591815260200190565b600061177061176d60017fa42ac066737193710fc0b00f1f3fe7bdc37fa408d5ed79d4c5205ec0f19caf6761279e565b90565b546001600160a01b0316919050565b6001600160a01b0381166117fb5760405162461bcd60e51b815260206004820152603160248201527f53746f72616765536c6f744f776e61626c653a206e65772061646d696e20697360448201527f20746865207a65726f20616464726573730000000000000000000000000000006064820152608401610672565b8061182a61176d60017fa42ac066737193710fc0b00f1f3fe7bdc37fa408d5ed79d4c5205ec0f19caf6761279e565b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905550565b6000670de0b6b3a76400006118886118708585611ac6565b6118836002670de0b6b3a764000061275d565b61192c565b61130a919061275d565b600061130a8284612745565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611926908590611b36565b50505050565b6000826119398382612745565b91508110156105aa5760405162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f770000000000000000000000006044820152606401610672565b606061130a838360405180606001604052806027815260200161285460279139611c1b565b600061130a828461279e565b6000806000838060200190518101906119d4919061224f565b925092509250611926838383611d06565b60006001600160a01b03821673dedfa1416829f9acc90082cdff27c73352e7df981480611a2e57506001600160a01b03821673aa7ca534e1624a096c0e210a4d23625c6be0b3a7145b80611a5557506001600160a01b038216733f7f6f6cc658b3e8c1a77b0c5fa30a9fbcae834b145b80611a7c57506001600160a01b03821673926d0cf1f249bbd011d5328d4e862c48fe73ad56145b80611aa257506001600160a01b03821672936b8f13b205a3c7b54672b61b75b8daa6162a145b15611ac25750733352c49fe72a8e94681eb1216bb29c173b4a35c2919050565b5090565b6000811580611aea57508282611adc818361277f565b9250611ae8908361275d565b145b6105aa5760405162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f770000000000000000000000006044820152606401610672565b6000611b8b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e9d9092919063ffffffff16565b8051909150156114715780806020019051810190611ba9919061248f565b6114715760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610672565b6060833b611c915760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610672565b600080856001600160a01b031685604051611cac91906125eb565b600060405180830381855af49150503d8060008114611ce7576040519150601f19603f3d011682016040523d82523d6000602084013e611cec565b606091505b5091509150611cfc828286611eb4565b9695505050505050565b826001600160a01b038116611d4c5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b826001600160a01b038116611d925760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b826001600160a01b038116611dd85760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b6000611de2610c8e565b6001600160a01b03161415611dfa57611dfa8661177f565b6001546001600160a01b0316611e33576001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387161790555b6002546001600160a01b0316611e6c576002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386161790555b611e957f4273ca1600000000000000000000000000000000000000000000000000000000611eed565b505050505050565b6060611eac8484600085611f6c565b949350505050565b60608315611ec357508161130a565b825115611ed35782518084602001fd5b8160405162461bcd60e51b815260040161067291906126ba565b6001600160e01b03198082161415611f475760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e74657266616365206964000000006044820152606401610672565b6001600160e01b0319166000908152600660205260409020805460ff19166001179055565b606082471015611fe45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610672565b843b6120325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610672565b600080866001600160a01b0316858760405161204e91906125eb565b60006040518083038185875af1925050503d806000811461208b576040519150601f19603f3d011682016040523d82523d6000602084013e612090565b606091505b50915091506120a0828286611eb4565b979650505050505050565b8280548282559060005260206000209081019282156120e6579160200282015b828111156120e65782518255916020019190600101906120cb565b50611ac29291505b80821115611ac257600081556001016120ee565b60008083601f84011261211457600080fd5b50813567ffffffffffffffff81111561212c57600080fd5b6020830191508360208260051b850101111561214757600080fd5b9250929050565b600082601f83011261215f57600080fd5b8135602067ffffffffffffffff82111561217b5761217b612828565b8160051b61218a828201612714565b8381528281019086840183880185018910156121a557600080fd5b600093505b858410156121c85780358352600193909301929184019184016121aa565b50979650505050505050565b60008083601f8401126121e657600080fd5b50813567ffffffffffffffff8111156121fe57600080fd5b60208301915083602082850101111561214757600080fd5b80356001600160801b038116811461222d57600080fd5b919050565b60006020828403121561224457600080fd5b813561130a8161283e565b60008060006060848603121561226457600080fd5b835161226f8161283e565b60208501519093506122808161283e565b60408501519092506122918161283e565b809150509250925092565b600080604083850312156122af57600080fd5b82356122ba8161283e565b915060208301356122ca8161283e565b809150509250929050565b6000806000606084860312156122ea57600080fd5b83356122f58161283e565b925060208401356123058161283e565b929592945050506040919091013590565b60008060008060006080868803121561232e57600080fd5b85356123398161283e565b945060208601356123498161283e565b935060408601359250606086013567ffffffffffffffff81111561236c57600080fd5b612378888289016121d4565b969995985093965092949392505050565b600080600080600060a086880312156123a157600080fd5b85356123ac8161283e565b94506123ba60208701612216565b93506123c860408701612216565b9250606086013567ffffffffffffffff808211156123e557600080fd5b6123f189838a0161214e565b9350608088013591508082111561240757600080fd5b506124148882890161214e565b9150509295509295909350565b6000806040838503121561243457600080fd5b823561243f8161283e565b946020939093013593505050565b6000806020838503121561246057600080fd5b823567ffffffffffffffff81111561247757600080fd5b61248385828601612102565b90969095509350505050565b6000602082840312156124a157600080fd5b8151801515811461130a57600080fd5b6000602082840312156124c357600080fd5b5035919050565b6000602082840312156124dc57600080fd5b81356001600160e01b03198116811461130a57600080fd5b6000806020838503121561250757600080fd5b823567ffffffffffffffff81111561251e57600080fd5b612483858286016121d4565b6000602080838503121561253d57600080fd5b823567ffffffffffffffff8082111561255557600080fd5b818501915085601f83011261256957600080fd5b81358181111561257b5761257b612828565b61258d601f8201601f19168501612714565b915080825286848285010111156125a357600080fd5b8084840185840137600090820190930192909252509392505050565b600081518084526125d78160208601602086016127b5565b601f01601f19169290920160200192915050565b600082516125fd8184602087016127b5565b9190910192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561265c57603f1988860301845261264a8583516125bf565b9450928501929085019060010161262e565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015610c8257835183529284019291840191600101612685565b828152604060208201526000611eac60408301846125bf565b60208152600061130a60208301846125bf565b6000808335601e198436030181126126e457600080fd5b83018035915067ffffffffffffffff8211156126ff57600080fd5b60200191503681900382131561214757600080fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561273d5761273d612828565b604052919050565b60008219821115612758576127586127fc565b500190565b60008261277a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612799576127996127fc565b500290565b6000828210156127b0576127b06127fc565b500390565b60005b838110156127d05781810151838201526020016127b8565b838111156119265750506000910152565b60006000198214156127f5576127f56127fc565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146105ba57600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000805000a

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806397f877961161010f578063c6217f55116100a2578063d4570c1c11610071578063d4570c1c1461050b578063eef72a3c1461051e578063f2fde38b14610531578063fc0c546a1461054457600080fd5b8063c6217f5514610494578063c6590930146104a7578063d041864c146104af578063d346fb4b146104b757600080fd5b8063bd160e64116100de578063bd160e6414610408578063bff99c6c1461041b578063c253b5da1461042e578063c3c5a5471461045957600080fd5b806397f8779614610389578063ac9650d81461039c578063ae5ed22b146103bc578063b4ba9e11146103f557600080fd5b806346f2180c116101875780638316f427116101565780638316f427146103305780638340f54914610343578063884520d6146103565780638da5cb5b1461036957600080fd5b806346f2180c146102d057806349e4c01a146102f5578063715018a614610315578063766b17f71461031d57600080fd5b80631e83409a116101c35780631e83409a14610272578063227720ca1461028757806337e22767146102aa5780634273ca16146102bd57600080fd5b806301ffc9a7146101ea57806306bfcec614610212578063143b82f114610239575b600080fd5b6101fd6101f83660046124ca565b610557565b60405190151581526020015b60405180910390f35b6040805180820182526005815264191718171b60d91b6020820152905161020991906126ba565b61026461024736600461229c565b600460209081526000928352604080842090915290825290205481565b604051908152602001610209565b610285610280366004612232565b6105b0565b005b6101fd6102953660046124b1565b60009081526020819052604090205460ff1690565b6102646102b836600461252a565b6105bd565b6101fd6102cb366004612316565b61061c565b6002546101fd9074010000000000000000000000000000000000000000900460ff1681565b610308610303366004612232565b6106fe565b6040516102099190612669565b61028561076d565b61026461032b366004612232565b61082b565b61030861033e366004612232565b610837565b6102856103513660046122d5565b6108a4565b610264610364366004612421565b610b05565b610371610c8e565b6040516001600160a01b039091168152602001610209565b610285610397366004612389565b610c9d565b6103af6103aa36600461244d565b61107a565b6040516102099190612607565b6102646103ca36600461229c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b61028561040336600461229c565b61116f565b6102646104163660046122d5565b61117d565b600254610371906001600160a01b031681565b61026461043c36600461229c565b600560209081526000928352604080842090915290825290205481565b6101fd610467366004612232565b6001600160a01b0316600090815260036020526040902054600160801b90046001600160801b0316151590565b6101fd6104a23660046124f4565b611311565b6102646113d3565b6101fd6113fa565b6104eb6104c5366004612232565b6003602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610209565b61026461051936600461229c565b61141d565b61028561052c36600461244d565b61142a565b61028561053f366004612232565b611476565b600154610371906001600160a01b031681565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614806105aa57506001600160e01b0319821660009081526006602052604090205460ff165b92915050565b6105ba81336115b5565b50565b6000806105eb60017fb9f9fca3715f91a88b971c15f18c3ac86a2c14233273cf673a84fdd011a0bdd961279e565b6040516105fd919085906020016126a1565b60408051601f1981840301815291905280516020909101209392505050565b60006001600160a01b038516301461067b5760405162461bcd60e51b815260206004820152601060248201527f696e76616c69642d617070726f76616c0000000000000000000000000000000060448201526064015b60405180910390fd5b33600090815260036020526040902054600160801b90046001600160801b03166106e75760405162461bcd60e51b815260206004820152601960248201527f756e726567697374657265642d736f757263652d746f6b656e000000000000006044820152606401610672565b6106f23387866108a4565b50600195945050505050565b6001600160a01b03811660009081526003602090815260409182902060010180548351818402810184019094528084526060939283018282801561076157602002820191906000526020600020905b81548152602001906001019080831161074d575b50505050509050919050565b33610776610c8e565b6001600160a01b0316146107e05760405162461bcd60e51b815260206004820152602b60248201527f53746f72616765536c6f744f776e61626c653a2063616c6c6572206973206e6f60448201526a3a103a34329037bbb732b960a91b6064820152608401610672565b60006107ea61173d565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3610829600061177f565b565b60006105aa8242610b05565b6001600160a01b038116600090815260036020908152604091829020600201805483518184028101840190945280845260609392830182828015610761576020028201919060005260206000209081548152602001906001019080831161074d5750505050509050919050565b816001600160a01b0381166108ea5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b6001600160a01b038416600090815260036020526040902054600160801b90046001600160801b031661095f5760405162461bcd60e51b815260206004820152601960248201527f756e726567697374657265642d736f757263652d746f6b656e000000000000006044820152606401610672565b600082116109a05760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a590b585b5bdd5b9d60921b6044820152606401610672565b336001600160a01b03851614806109bf5750336001600160a01b038416145b610a0b5760405162461bcd60e51b815260206004820152600760248201527f6e6f2d61757468000000000000000000000000000000000000000000000000006044820152606401610672565b6001600160a01b03841660009081526003602052604081208054909190610a3c9085906001600160801b0316611858565b6001600160a01b038088166000908152600460209081526040808320938a1683529290522054909150610a6f9085611892565b6001600160a01b038088166000818152600460209081526040808320948b1683529390529190912091909155610aa79086308761189e565b846001600160a01b0316866001600160a01b03167ff5681f9d0db1b911ac18ee83d515a1cf1051853a9eae418316a2fdf7dea427c58684604051610af5929190918252602082015260400190565b60405180910390a3505050505050565b6001600160a01b03821660009081526003602052604081208054600160801b90046001600160801b0316831015610b7e5760405162461bcd60e51b815260206004820152600b60248201527f6e6f742d737461727465640000000000000000000000000000000000000000006044820152606401610672565b6001808201805491610b90908361279e565b81548110610ba057610ba0612812565b90600052602060002001548410610bc557610bbc60018261279e565b925050506105aa565b81600101600081548110610bdb57610bdb612812565b90600052602060002001548411610bf7576000925050506105aa565b60016000610c05828461279e565b905060005b81831015610c82576002610c1e8484612745565b610c29906001612745565b610c33919061275d565b905084600101600182610c46919061279e565b81548110610c5657610c56612812565b9060005260206000200154871015610c7a57610c7360018261279e565b9150610c0a565b809250610c0a565b50909695505050505050565b6000610c9861173d565b905090565b33610ca6610c8e565b6001600160a01b031614610d105760405162461bcd60e51b815260206004820152602b60248201527f53746f72616765536c6f744f776e61626c653a2063616c6c6572206973206e6f60448201526a3a103a34329037bbb732b960a91b6064820152608401610672565b6001600160a01b038516600090815260036020526040902054600160801b90046001600160801b031615610d865760405162461bcd60e51b815260206004820152601260248201527f6475706c69636174652d726567697374657200000000000000000000000000006044820152606401610672565b6000846001600160801b031611610ddf5760405162461bcd60e51b815260206004820152600c60248201527f696e76616c69642d7261746500000000000000000000000000000000000000006044820152606401610672565b8051825114610e305760405162461bcd60e51b815260206004820152601460248201527f696e76616c69642d61727261792d6c656e6774680000000000000000000000006044820152606401610672565b815160008167ffffffffffffffff811115610e4d57610e4d612828565b604051908082528060200260200182016040528015610e76578160200160208202803683370190505b5090506000805b83811015610eda57610ea882868381518110610e9b57610e9b612812565b602002602001015161192c565b915081838281518110610ebd57610ebd612812565b602090810291909101015280610ed2816127e1565b915050610e7d565b50670de0b6b3a76400008114610f325760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642d6163632d726174696f0000000000000000000000000000006044820152606401610672565b60015b83811015610fdc57858181518110610f4f57610f4f612812565b602002602001015186600183610f65919061279e565b81518110610f7557610f75612812565b602002602001015110610fca5760405162461bcd60e51b815260206004820152600e60248201527f756e736f727465642d74696d65730000000000000000000000000000000000006044820152606401610672565b80610fd4816127e1565b915050610f35565b50604080516080810182526001600160801b03808a16825288811660208084019182528385018a8152606085018890526001600160a01b038e1660009081526003835295909520845192518416600160801b0292909316919091178255925180519293919261105192600185019201906120ab565b506060820151805161106d9160028401916020909101906120ab565b5050505050505050505050565b60608167ffffffffffffffff81111561109557611095612828565b6040519080825280602002602001820160405280156110c857816020015b60608152602001906001900390816110b35790505b50905060005b8281101561116857611138308585848181106110ec576110ec612812565b90506020028101906110fe91906126cd565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061198a92505050565b82828151811061114a5761114a612812565b60200260200101819052508080611160906127e1565b9150506110ce565b5092915050565b61117982826115b5565b5050565b6000814211156111cf5760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642d74696d657374616d700000000000000000000000000000006044820152606401610672565b6001600160a01b03808516600090815260036020908152604080832060048352818420948816845293909152812054825461121391906001600160801b0316611858565b6001600160a01b038781166000908152600560209081526040808320938a1683529290522054835491925090600160801b90046001600160801b0316851015611262576000935050505061130a565b6001808401805490916112749161279e565b8154811061128457611284612812565b906000526020600020015485106112a95761129f82826119af565b935050505061130a565b60006112b58887610b05565b905060008460020182815481106112ce576112ce612812565b9060005260206000200154905060006112e78583611858565b90508381116112f7576000611301565b61130181856119af565b96505050505050505b9392505050565b600061131b6113fa565b156113685760405162461bcd60e51b815260206004820152601460248201527f4b65726e656c3a20616c72656164792d696e69740000000000000000000000006044820152606401610672565b60006113726113d3565b60008181526020818152604091829020805460ff191660011790558151601f87018290048202810182019092528582529192506113c99186908690819084018382808284376000920191909152506119bb92505050565b5060019392505050565b6000610c986102b8604080518082019091526005815264191718171b60d91b602082015290565b6000806114056113d3565b60009081526020819052604090205460ff1692915050565b600061130a83834261117d565b60005b818110156114715761145f83838381811061144a5761144a612812565b90506020020160208101906102809190612232565b80611469816127e1565b91505061142d565b505050565b3361147f610c8e565b6001600160a01b0316146114e95760405162461bcd60e51b815260206004820152602b60248201527f53746f72616765536c6f744f776e61626c653a2063616c6c6572206973206e6f60448201526a3a103a34329037bbb732b960a91b6064820152608401610672565b6001600160a01b0381166115655760405162461bcd60e51b815260206004820152603160248201527f53746f72616765536c6f744f776e61626c653a206e6577206f776e657220697360448201527f20746865207a65726f20616464726573730000000000000000000000000000006064820152608401610672565b806001600160a01b031661157761173d565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36105ba8161177f565b6001600160a01b038083166000908152600460209081526040808320938516835292905220548290829061162b5760405162461bcd60e51b815260206004820152600a60248201527f6e6f2d6465706f736974000000000000000000000000000000000000000000006044820152606401610672565b6000611637858561141d565b90506000811161167a5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a590b585b5bdd5b9d60921b6044820152606401610672565b6000611685856119e5565b6001600160a01b038088166000908152600560209081526040808320938a16835292905220549091506116b89083611892565b6001600160a01b0380881660009081526005602090815260408083208a851684529091529020919091556002546001546116f8929081169116838561189e565b806001600160a01b0316866001600160a01b03167ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd399268384604051610af591815260200190565b600061177061176d60017fa42ac066737193710fc0b00f1f3fe7bdc37fa408d5ed79d4c5205ec0f19caf6761279e565b90565b546001600160a01b0316919050565b6001600160a01b0381166117fb5760405162461bcd60e51b815260206004820152603160248201527f53746f72616765536c6f744f776e61626c653a206e65772061646d696e20697360448201527f20746865207a65726f20616464726573730000000000000000000000000000006064820152608401610672565b8061182a61176d60017fa42ac066737193710fc0b00f1f3fe7bdc37fa408d5ed79d4c5205ec0f19caf6761279e565b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905550565b6000670de0b6b3a76400006118886118708585611ac6565b6118836002670de0b6b3a764000061275d565b61192c565b61130a919061275d565b600061130a8284612745565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611926908590611b36565b50505050565b6000826119398382612745565b91508110156105aa5760405162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f770000000000000000000000006044820152606401610672565b606061130a838360405180606001604052806027815260200161285460279139611c1b565b600061130a828461279e565b6000806000838060200190518101906119d4919061224f565b925092509250611926838383611d06565b60006001600160a01b03821673dedfa1416829f9acc90082cdff27c73352e7df981480611a2e57506001600160a01b03821673aa7ca534e1624a096c0e210a4d23625c6be0b3a7145b80611a5557506001600160a01b038216733f7f6f6cc658b3e8c1a77b0c5fa30a9fbcae834b145b80611a7c57506001600160a01b03821673926d0cf1f249bbd011d5328d4e862c48fe73ad56145b80611aa257506001600160a01b03821672936b8f13b205a3c7b54672b61b75b8daa6162a145b15611ac25750733352c49fe72a8e94681eb1216bb29c173b4a35c2919050565b5090565b6000811580611aea57508282611adc818361277f565b9250611ae8908361275d565b145b6105aa5760405162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f770000000000000000000000006044820152606401610672565b6000611b8b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e9d9092919063ffffffff16565b8051909150156114715780806020019051810190611ba9919061248f565b6114715760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610672565b6060833b611c915760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610672565b600080856001600160a01b031685604051611cac91906125eb565b600060405180830381855af49150503d8060008114611ce7576040519150601f19603f3d011682016040523d82523d6000602084013e611cec565b606091505b5091509150611cfc828286611eb4565b9695505050505050565b826001600160a01b038116611d4c5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b826001600160a01b038116611d925760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b826001600160a01b038116611dd85760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2d6164647265737360a01b6044820152606401610672565b6000611de2610c8e565b6001600160a01b03161415611dfa57611dfa8661177f565b6001546001600160a01b0316611e33576001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387161790555b6002546001600160a01b0316611e6c576002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386161790555b611e957f4273ca1600000000000000000000000000000000000000000000000000000000611eed565b505050505050565b6060611eac8484600085611f6c565b949350505050565b60608315611ec357508161130a565b825115611ed35782518084602001fd5b8160405162461bcd60e51b815260040161067291906126ba565b6001600160e01b03198082161415611f475760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e74657266616365206964000000006044820152606401610672565b6001600160e01b0319166000908152600660205260409020805460ff19166001179055565b606082471015611fe45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610672565b843b6120325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610672565b600080866001600160a01b0316858760405161204e91906125eb565b60006040518083038185875af1925050503d806000811461208b576040519150601f19603f3d011682016040523d82523d6000602084013e612090565b606091505b50915091506120a0828286611eb4565b979650505050505050565b8280548282559060005260206000209081019282156120e6579160200282015b828111156120e65782518255916020019190600101906120cb565b50611ac29291505b80821115611ac257600081556001016120ee565b60008083601f84011261211457600080fd5b50813567ffffffffffffffff81111561212c57600080fd5b6020830191508360208260051b850101111561214757600080fd5b9250929050565b600082601f83011261215f57600080fd5b8135602067ffffffffffffffff82111561217b5761217b612828565b8160051b61218a828201612714565b8381528281019086840183880185018910156121a557600080fd5b600093505b858410156121c85780358352600193909301929184019184016121aa565b50979650505050505050565b60008083601f8401126121e657600080fd5b50813567ffffffffffffffff8111156121fe57600080fd5b60208301915083602082850101111561214757600080fd5b80356001600160801b038116811461222d57600080fd5b919050565b60006020828403121561224457600080fd5b813561130a8161283e565b60008060006060848603121561226457600080fd5b835161226f8161283e565b60208501519093506122808161283e565b60408501519092506122918161283e565b809150509250925092565b600080604083850312156122af57600080fd5b82356122ba8161283e565b915060208301356122ca8161283e565b809150509250929050565b6000806000606084860312156122ea57600080fd5b83356122f58161283e565b925060208401356123058161283e565b929592945050506040919091013590565b60008060008060006080868803121561232e57600080fd5b85356123398161283e565b945060208601356123498161283e565b935060408601359250606086013567ffffffffffffffff81111561236c57600080fd5b612378888289016121d4565b969995985093965092949392505050565b600080600080600060a086880312156123a157600080fd5b85356123ac8161283e565b94506123ba60208701612216565b93506123c860408701612216565b9250606086013567ffffffffffffffff808211156123e557600080fd5b6123f189838a0161214e565b9350608088013591508082111561240757600080fd5b506124148882890161214e565b9150509295509295909350565b6000806040838503121561243457600080fd5b823561243f8161283e565b946020939093013593505050565b6000806020838503121561246057600080fd5b823567ffffffffffffffff81111561247757600080fd5b61248385828601612102565b90969095509350505050565b6000602082840312156124a157600080fd5b8151801515811461130a57600080fd5b6000602082840312156124c357600080fd5b5035919050565b6000602082840312156124dc57600080fd5b81356001600160e01b03198116811461130a57600080fd5b6000806020838503121561250757600080fd5b823567ffffffffffffffff81111561251e57600080fd5b612483858286016121d4565b6000602080838503121561253d57600080fd5b823567ffffffffffffffff8082111561255557600080fd5b818501915085601f83011261256957600080fd5b81358181111561257b5761257b612828565b61258d601f8201601f19168501612714565b915080825286848285010111156125a357600080fd5b8084840185840137600090820190930192909252509392505050565b600081518084526125d78160208601602086016127b5565b601f01601f19169290920160200192915050565b600082516125fd8184602087016127b5565b9190910192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561265c57603f1988860301845261264a8583516125bf565b9450928501929085019060010161262e565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015610c8257835183529284019291840191600101612685565b828152604060208201526000611eac60408301846125bf565b60208152600061130a60208301846125bf565b6000808335601e198436030181126126e457600080fd5b83018035915067ffffffffffffffff8211156126ff57600080fd5b60200191503681900382131561214757600080fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561273d5761273d612828565b604052919050565b60008219821115612758576127586127fc565b500190565b60008261277a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612799576127996127fc565b500290565b6000828210156127b0576127b06127fc565b500390565b60005b838110156127d05781810151838201526020016127b8565b838111156119265750506000910152565b60006000198214156127f5576127f56127fc565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146105ba57600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000805000a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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