ETH Price: $3,390.96 (+4.07%)

Contract

0x3b7157E5E732863170597790b4c005436572570F
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Transaction Hash
Method
Block
From
To
Withdraw202511362024-07-07 0:44:35170 days ago1720313075IN
JPEGd: Token Sale
0 ETH0.000091062.74714418
Withdraw202511362024-07-07 0:44:35170 days ago1720313075IN
JPEGd: Token Sale
0 ETH0.000069532.097656
Withdraw202511362024-07-07 0:44:35170 days ago1720313075IN
JPEGd: Token Sale
0 ETH0.000290553.59305605
Withdraw181643272023-09-18 17:31:59462 days ago1695058319IN
JPEGd: Token Sale
0 ETH0.0032966440.7662817
Withdraw173641302023-05-29 10:44:23574 days ago1685357063IN
JPEGd: Token Sale
0 ETH0.0026479937.30254858
Withdraw169132682023-03-26 18:05:11638 days ago1679853911IN
JPEGd: Token Sale
0 ETH0.0016121919.9363643
Withdraw167840492023-03-08 14:11:47656 days ago1678284707IN
JPEGd: Token Sale
0 ETH0.0028015834.64434641
Withdraw166758442023-02-21 9:00:23671 days ago1676970023IN
JPEGd: Token Sale
0 ETH0.0020794925.71498646
Withdraw165933542023-02-09 19:43:11683 days ago1675971791IN
JPEGd: Token Sale
0 ETH0.00707287.45233693
Withdraw165458562023-02-03 4:25:23689 days ago1675398323IN
JPEGd: Token Sale
0 ETH0.0022675328.04029365
Withdraw162293212022-12-20 23:54:11734 days ago1671580451IN
JPEGd: Token Sale
0 ETH0.0012224413.87768628
Withdraw160499252022-11-25 22:17:23759 days ago1669414643IN
JPEGd: Token Sale
0 ETH0.0009900312.24276771
Withdraw156570212022-10-02 0:58:11814 days ago1664672291IN
JPEGd: Token Sale
0 ETH0.000469045.80018718
Withdraw154786072022-09-05 15:27:02840 days ago1662391622IN
JPEGd: Token Sale
0 ETH0.0032104139.7
Withdraw154769302022-09-05 9:05:47840 days ago1662368747IN
JPEGd: Token Sale
0 ETH0.000585947.24581461
Withdraw153863182022-08-21 21:24:49855 days ago1661117089IN
JPEGd: Token Sale
0 ETH0.000617599.68513866
Withdraw153104162022-08-09 21:33:57867 days ago1660080837IN
JPEGd: Token Sale
0 ETH0.0011763714.54707636
Withdraw152872942022-08-06 7:05:31870 days ago1659769531IN
JPEGd: Token Sale
0 ETH0.000653768.08443254
Withdraw149572482022-06-13 17:39:42924 days ago1655141982IN
JPEGd: Token Sale
0 ETH0.0036668445.34413076
Withdraw149385552022-06-10 13:02:24927 days ago1654866144IN
JPEGd: Token Sale
0 ETH0.0055524468.66142404
Withdraw148905982022-06-02 11:02:09935 days ago1654167729IN
JPEGd: Token Sale
0 ETH0.0032346840
Withdraw148528542022-05-27 7:29:09941 days ago1653636549IN
JPEGd: Token Sale
0 ETH0.002842632.27041792
Withdraw148306912022-05-23 16:45:30945 days ago1653324330IN
JPEGd: Token Sale
0 ETH0.002074641.49205867
Withdraw148225712022-05-22 9:24:34946 days ago1653211474IN
JPEGd: Token Sale
0 ETH0.0013586715.42423758
Withdraw147330912022-05-08 0:59:21961 days ago1651971561IN
JPEGd: Token Sale
0 ETH0.0020010424.74489781
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
142977582022-02-28 23:59:581029 days ago1646092798
JPEGd: Token Sale
0.04 ETH
142977582022-02-28 23:59:581029 days ago1646092798
JPEGd: Token Sale
55 ETH
142977582022-02-28 23:59:581029 days ago1646092798
JPEGd: Token Sale
0.45 ETH
142977582022-02-28 23:59:581029 days ago1646092798
JPEGd: Token Sale
1.5 ETH
142977582022-02-28 23:59:581029 days ago1646092798
JPEGd: Token Sale
4 ETH
142977572022-02-28 23:59:381029 days ago1646092778
JPEGd: Token Sale
0.04 ETH
142977572022-02-28 23:59:381029 days ago1646092778
JPEGd: Token Sale
1 ETH
142977572022-02-28 23:59:381029 days ago1646092778
JPEGd: Token Sale
0.1 ETH
142977572022-02-28 23:59:381029 days ago1646092778
JPEGd: Token Sale
0.25 ETH
142977572022-02-28 23:59:381029 days ago1646092778
JPEGd: Token Sale
0.1 ETH
142977572022-02-28 23:59:381029 days ago1646092778
JPEGd: Token Sale
0.05 ETH
142977572022-02-28 23:59:381029 days ago1646092778
JPEGd: Token Sale
5.6 ETH
142977562022-02-28 23:59:331029 days ago1646092773
JPEGd: Token Sale
2 ETH
142977562022-02-28 23:59:331029 days ago1646092773
JPEGd: Token Sale
0.7 ETH
142977552022-02-28 23:59:311029 days ago1646092771
JPEGd: Token Sale
0.05 ETH
142977552022-02-28 23:59:311029 days ago1646092771
JPEGd: Token Sale
0.35 ETH
142977552022-02-28 23:59:311029 days ago1646092771
JPEGd: Token Sale
35 ETH
142977542022-02-28 23:59:121029 days ago1646092752
JPEGd: Token Sale
1 ETH
142977542022-02-28 23:59:121029 days ago1646092752
JPEGd: Token Sale
0.3 ETH
142977542022-02-28 23:59:121029 days ago1646092752
JPEGd: Token Sale
1 ETH
142977532022-02-28 23:58:581029 days ago1646092738
JPEGd: Token Sale
0.06 ETH
142977532022-02-28 23:58:581029 days ago1646092738
JPEGd: Token Sale
0.06 ETH
142977532022-02-28 23:58:581029 days ago1646092738
JPEGd: Token Sale
4 ETH
142977532022-02-28 23:58:581029 days ago1646092738
JPEGd: Token Sale
0.5 ETH
142977532022-02-28 23:58:581029 days ago1646092738
JPEGd: Token Sale
0.07 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenSale

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 12 : TokenSale.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import "../interfaces/IAggregatorV3Interface.sol";
import "../interfaces/IWETH.sol";

/// @title JPEG'd Governance token sale contract
/// @notice ETH (WETH) and USDC can be deposited in this contract to get JPEG tokens once the sale ends. The rate depends on the dollar value of the tokens raised
contract TokenSale is Ownable, ReentrancyGuard {
    using SafeCast for int256;
    using SafeERC20 for IERC20;
    using Address for address;

    /// @dev Data relative to a user's account
    /// @param token The token the user deposited
    /// @param depositedAmount the amount of `token` deposited by the user
    struct Account {
        address token;
        uint256 depositedAmount;
    }

    /// @dev Data relative to a supported token
    /// @param oracle Address of the token/USD chainlink feed
    /// @param totalRaised Amount of tokens raised
    /// @param USDPrice Dollar value of a single token, only set after the sale has been finalized
    struct SupportedToken {
        address oracle;
        uint256 totalRaised;
        uint256 USDPrice;
    }

    /// @dev The sale's schedule
    /// @param startTimestamp The sale's start timestamp
    /// @param endTimestamp The sale's end timestamp
    struct SaleSchedule {
        uint256 startTimestamp;
        uint256 endTimestamp;
    }

    /// @dev WETH address stored separately to allow wrapping/unwrapping
    address public immutable WETH;
    address public immutable treasury;
    /// @notice Address of the token being sold
    address public immutable saleToken;

    /// @notice Amount of `saleToken` allocated for this sale
    /// @dev Can only be set by the owner using the `allocateTokensForSale` function
    uint256 public availableTokens;
    /// @notice Dollar value of the tokens raised, only set after the end of the sale
    /// @dev Set by the `finalizeRaise` function, 8 decimals
    uint256 public totalRaisedUSD;
    /// @notice Whether or not `saleToken` can be withdrawn from this contract
    /// @dev Set to true by the `enableWithdrawals` function
    bool public withdrawalsEnabled;

    /// @notice Sale start and end times
    /// @dev Can only be set by the owner in the `setSaleSchedule` function
    SaleSchedule public saleSchedule;

    /// @dev Array containing the addresses of all supported tokens (WETH/USDC). Used in `finalizeRaise`
    address[] internal supportedTokens;

    mapping(address => SupportedToken) internal supportedTokensData;
    mapping(address => Account) public userAccounts;

    /// @notice Emitted after a deposit
    /// @param depositor Address that made the deposit
    /// @param token Token used for the deposit (either WETH or USDC)
    /// @param amount Amount of `token` deposited
    event Deposited(
        address indexed depositor,
        address indexed token,
        uint256 amount
    );
    /// @notice Emitted after a withdraw
    /// @param withdrawer Address that withdrew assets
    /// @param amount Amount withdrawn
    event Withdrawn(address indexed withdrawer, uint256 amount);
    /// @notice Emitted after the owner has allocated `amount` of `saleToken`
    /// @param amount amount of `saleToken` allocated
    event TokensAllocated(uint256 amount);
    /// @notice Emitted after the owner has set the sale's schedule
    /// @param startTimestamp The sale's start timestamp
    /// @param endTimestamp The sale's end timestamp
    event SaleScheduleSet(uint256 startTimestamp, uint256 endTimestamp);
    /// @notice Emitted after the raise has been finalized and the total value of the tokens raised has been calculated
    /// @param totalRaisedUSD Dollar value of the tokens raised at the time this even was emitted, 8 decimals
    event RaiseFinalized(uint256 totalRaisedUSD);
    /// @notice Emitted after withdrawals have been enabled by the owner
    event WithdrawalsEnabled();
    /// @notice Emitted after `token` has been transferred to the `treasury` address
    /// @param token The token that has been transferred
    /// @param amount The amount of `token` that has been transferred
    event TreasuryTransfer(address indexed token, uint256 amount);

    /// @param _weth WETH address
    /// @param _usdc USDC address
    /// @param _wethOracle WETH chainlink price feed
    /// @param _usdcOracle USDC chainlink price feed
    /// @param _saleToken The address of the token to sell
    /// @param _treasury The treasury address
    constructor(
        address _weth,
        address _usdc,
        address _wethOracle,
        address _usdcOracle,
        address _saleToken,
        address _treasury
    ) {
        require(_weth != address(0), "INVALID_WETH");
        require(_usdc != address(0), "INVALID_USDC");
        require(_wethOracle != address(0), "INVALID_WETH_ORACLE");
        require(_usdcOracle != address(0), "INVALID_USDC_ORACLE");
        require(_saleToken != address(0), "INVALID_SALE_TOKEN");
        require(_treasury != address(0), "INVALID_TREASURY");

        WETH = _weth;
        supportedTokensData[_weth] = SupportedToken(_wethOracle, 0, 0);
        supportedTokensData[_usdc] = SupportedToken(_usdcOracle, 0, 0);
        saleToken = _saleToken;
        treasury = _treasury;

        supportedTokens.push(_weth);
        supportedTokens.push(_usdc);
    }

    /// @dev Accept direct ETH deposits
    receive() external payable {
        depositETH();
    }

    /// @notice Function used to allocate the amount of `saleToken` available for sale. Can only be called by the owner
    /// @dev Can only be called once
    /// @param _amount Amount of `saleToken` to sell
    function allocateTokensForSale(uint256 _amount) external onlyOwner {
        require(availableTokens == 0, "TOKENS_ALREADY_ALLOCATED");
        require(_amount > 0, "INVALID_ALLOCATED_AMOUNT");

        IERC20(saleToken).safeTransferFrom(msg.sender, address(this), _amount);
        availableTokens = _amount;

        emit TokensAllocated(_amount);
    }

    /// @notice Function used to set the sale's start and end timestamps. Can only be called by the owner
    /// @dev Can only be called once and only AFTER the `allocateTokensForSale` function has been called
    /// @param _start The sale's start timestamp
    /// @param _end The sale's end timestamp
    function setSaleSchedule(uint256 _start, uint256 _end) external onlyOwner {
        require(availableTokens != 0, "TOKENS_NOT_ALLOCATED");
        require(_start > block.timestamp, "INVALID_START_TIMESTAMP");
        require(_end > _start, "INVALID_END_TIMESTAMP");
        require(saleSchedule.startTimestamp == 0, "SCHEDULE_ALREADY_SET");

        saleSchedule.startTimestamp = _start;
        saleSchedule.endTimestamp = _end;
    }

    /// @notice Function used to calculate the dollar value of the raised tokens, to ensure everyone gets `saleToken` at the same price. Can only be called by the owner at the end of the sale
    /// @dev Can only be called once
    function finalizeRaise() external onlyOwner {
        require(
            saleSchedule.endTimestamp > 0 &&
                block.timestamp >= saleSchedule.endTimestamp,
            "SALE_NOT_ENDED"
        );
        require(totalRaisedUSD == 0, "ALREADY_FINALIZED");

        //Total dollar value raised
        uint256 value;
        for (uint256 i = 0; i < supportedTokens.length; i++) {
            address token = supportedTokens[i];
            SupportedToken storage tokenData = supportedTokensData[token];

            uint256 answer = IAggregatorV3Interface(tokenData.oracle)
                .latestAnswer()
                .toUint256();
            require(answer > 0, "INVALID_ORACLE_ANSWER");

            value +=
                (tokenData.totalRaised * answer) /
                10**ERC20(token).decimals(); //Chainlink USD prices are always to 8
            tokenData.USDPrice = answer;
        }

        totalRaisedUSD = value;

        emit RaiseFinalized(value);
    }

    /// @notice Function used to enable withdrawals of `saleToken`. Can only be called by the owner after `finalizeRaise`
    /// @dev Can only be called once
    function enableWithdrawals() external onlyOwner {
        require(totalRaisedUSD != 0, "NOT_FINALIZED");
        require(!withdrawalsEnabled, "ALREADY_ENABLED");

        withdrawalsEnabled = true;

        emit WithdrawalsEnabled();
    }

    /// @notice Function used to transfer raised funds to the treasury. Can only be called after withdrawals have been enabled
    function transferToTreasury() external onlyOwner {
        require(withdrawalsEnabled, "WITHDRAWALS_NOT_ENABLED");

        for (uint256 i = 0; i < supportedTokens.length; i++) {
            IERC20 token = IERC20(supportedTokens[i]);
            uint256 balance = token.balanceOf(address(this));
            token.safeTransfer(treasury, balance);

            emit TreasuryTransfer(address(token), balance);
        }
    }

    /// @notice ETH deposit function. To deposit WETH/USDC please see `deposit`
    /// @dev `deposit` and `depositETH` have been split to simplify logic
    function depositETH() public payable nonReentrant {
        address _weth = WETH;
        _depositFor(msg.sender, _weth, msg.value);
        IWETH(_weth).deposit{value: msg.value}();
    }

    /// @notice Token deposit function (WETH/USDC, not ETH). Users can deposit more than once, but only using the same token
    /// @param _token The token to deposit
    /// @param _amount The amount of `_token` to deposit
    function deposit(address _token, uint256 _amount) external nonReentrant {
        _depositFor(msg.sender, _token, _amount);
        IERC20(_token).safeTransferFrom(msg.sender, address(this), _amount);
    }

    /// @notice `saleToken` withdraw function. Users get an amount of tokens based on their share of deposited dollar value. Can only be called after withdrawals have been enabled
    /// @dev Can only be called after the owner has called `enableWithdrawals`
    function withdraw() external nonReentrant {
        require(withdrawalsEnabled, "WITHDRAWALS_NOT_ENABLED");

        uint256 toSend = getUserClaimableTokens(msg.sender);
        require(toSend > 0, "NO_TOKENS");

        delete userAccounts[msg.sender];

        IERC20(saleToken).safeTransfer(msg.sender, toSend);

        emit Withdrawn(msg.sender, toSend);
    }

    /// @notice View function to get all supported tokens
    /// @return Array containing all supported token addresses
    function getSupportedTokens() external view returns (address[] memory) {
        return supportedTokens;
    }

    /// @notice View function to get all the oracles used by this contract
    /// @return oracles Array containing all oracle addresses
    function getTokenOracles() external view returns (address[] memory oracles) {
        oracles = new address[](supportedTokens.length);
        for (uint256 i = 0; i < supportedTokens.length; i++) {
            oracles[i] = supportedTokensData[supportedTokens[i]].oracle;
        }
    }

    /// @notice View function to get the oracle relative to a supported token's address
    /// @return Oracle address if found, else `address(0)`
    function getTokenOracle(address _token) external view returns (address) {
        return supportedTokensData[_token].oracle;
    }

    /// @notice Calculates the amount of claimable tokens by a user by calculating their share of the total dollar value deposited
    /// @dev Returns a meaningful result only after the sale has been finalized, otherwise it returns 0
    /// @param _user The user address
    /// @return The amount of tokens claimable by `_user`
    function getUserClaimableTokens(address _user) public view returns (uint256) {
        Account memory account = userAccounts[_user];
        
        if (account.depositedAmount == 0)
            return 0;

        uint256 totalRaise = totalRaisedUSD;
        //if sale hasn't been finalized yet
        if (totalRaise == 0)
            return 0;
        
        //calculates the dollar value of the amount of tokens deposited by msg.sender, multiplied by `account.token`'s decimals for additional precision
        uint256 depositedValueWithPrecision = supportedTokensData[account.token]
            .USDPrice * account.depositedAmount;
        //calculates the amount of `saleToken` claimable by calculating the user's share of deposited dollar value and multiplying it by
        //the total available tokens:
        //user share = user deposited value / total deposited value
        //user tokens = user share * total tokens
        return (depositedValueWithPrecision * availableTokens) /
            totalRaise /
            //remove `account.token`'s decimals
            10**ERC20(account.token).decimals();
    }

    /// @dev Deposit logic. Called by `deposit` and `depositETH`
    /// @param _account Depositor account
    /// @param _token The token being deposited
    /// @param _amount Amount of `_token` being deposited
    function _depositFor(
        address _account,
        address _token,
        uint256 _amount
    ) internal {
        require(
            block.timestamp >= saleSchedule.startTimestamp &&
                block.timestamp < saleSchedule.endTimestamp,
            "DEPOSITS_NOT_ACCEPTED"
        );
        require(_amount > 0, "INVALID_AMOUNT");
        require(
            supportedTokensData[_token].oracle != address(0),
            "TOKEN_NOT_SUPPORTED"
        );

        Account storage account = userAccounts[_account];
        if (account.token == address(0)) {
            account.token = _token;
        } else {
            //only allow users to deposit one of the two deposit assets (WETH and USDC)
            require(account.token == _token, "SINGLE_ASSET_DEPOSITS");
        }

        //a single `_account` can deposit more than once
        account.depositedAmount += _amount;
        supportedTokensData[_token].totalRaised += _amount;

        emit Deposited(_account, _token, _amount);
    }
}

File 2 of 12 : SafeCast.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 3 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _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), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 12 : 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 Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(sender, recipient, amount);

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

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 12 : 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'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

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

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

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

File 6 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 7 of 12 : IAggregatorV3Interface.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

interface IAggregatorV3Interface {
    function decimals() external view returns (uint8);
    function latestAnswer() external view returns (int256 answer);
}

File 8 of 12 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

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

interface IWETH is IERC20 {
    function deposit() external payable;
    function withdraw(uint wad) external;
}

File 9 of 12 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 10 of 12 : 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 11 of 12 : 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 12 of 12 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000,
    "details": {
      "yul": false
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_usdc","type":"address"},{"internalType":"address","name":"_wethOracle","type":"address"},{"internalType":"address","name":"_usdcOracle","type":"address"},{"internalType":"address","name":"_saleToken","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","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":false,"internalType":"uint256","name":"totalRaisedUSD","type":"uint256"}],"name":"RaiseFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"SaleScheduleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensAllocated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TreasuryTransfer","type":"event"},{"anonymous":false,"inputs":[],"name":"WithdrawalsEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"allocateTokensForSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"enableWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalizeRaise","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getSupportedTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getTokenOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenOracles","outputs":[{"internalType":"address[]","name":"oracles","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserClaimableTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleSchedule","outputs":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"setSaleSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalRaisedUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferToTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userAccounts","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"depositedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e06040523480156200001157600080fd5b5060405162002826380380620028268339810160408190526200003491620002cd565b620000486200004262000266565b6200026a565b600180556001600160a01b0386166200007e5760405162461bcd60e51b81526004016200007590620004ad565b60405180910390fd5b6001600160a01b038516620000a75760405162461bcd60e51b8152600401620000759062000489565b6001600160a01b038416620000d05760405162461bcd60e51b81526004016200007590620004d1565b6001600160a01b038316620000f95760405162461bcd60e51b815260040162000075906200049b565b6001600160a01b038216620001225760405162461bcd60e51b81526004016200007590620004bf565b6001600160a01b0381166200014b5760405162461bcd60e51b81526004016200007590620004e3565b6001600160601b0319606087811b82166080526040805180830182526001600160a01b039788168152600060208083018281528385018381529c8b16808452600880845286852095518654908e166001600160a01b031991821617875592516001808801919091559e51600296870155865180890188529b8d168c528b84018581528c88018681529e8e16808752919094529584209a518b549c169b82169b909b178a559051898d01559951979091019690965593811b821660c0529190911b1660a052600780548087018255928190527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68892830180548616909417909355825494850190925592909201805490911690911790556200052a565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8051620002c78162000510565b92915050565b60008060008060008060c08789031215620002e757600080fd5b6000620002f58989620002ba565b96505060206200030889828a01620002ba565b95505060406200031b89828a01620002ba565b94505060606200032e89828a01620002ba565b93505060806200034189828a01620002ba565b92505060a06200035489828a01620002ba565b9150509295509295509295565b600062000370600c83620004f5565b6b494e56414c49445f5553444360a01b815260200192915050565b60006200039a601383620004f5565b7f494e56414c49445f555344435f4f5241434c4500000000000000000000000000815260200192915050565b6000620003d5600c83620004f5565b6b0929cac82989288beae8aa8960a31b815260200192915050565b6000620003ff601283620004f5565b7124a72b20a624a22fa9a0a622afaa27a5a2a760711b815260200192915050565b60006200042f601383620004f5565b7f494e56414c49445f574554485f4f5241434c4500000000000000000000000000815260200192915050565b60006200046a601083620004f5565b6f494e56414c49445f545245415355525960801b815260200192915050565b60208082528101620002c78162000361565b60208082528101620002c7816200038b565b60208082528101620002c781620003c6565b60208082528101620002c781620003f0565b60208082528101620002c78162000420565b60208082528101620002c7816200045b565b90815260200190565b60006001600160a01b038216620002c7565b6200051b81620004fe565b81146200052757600080fd5b50565b60805160601c60a05160601c60c05160601c6122a76200057f6000396000818161066a015281816107bd01526110a8015260008181610a890152610bf70152600081816104430152610f6001526122a76000f3fe6080604052600436106101845760003560e01c806369bb4dc2116100d6578063d0dbcd241161007f578063e985e36711610059578063e985e367146103d7578063f2fde38b146103ec578063f6326fb31461040c57610193565b8063d0dbcd241461038b578063d3c7c2c7146103ad578063e8bac93b146103c257610193565b80638da5cb5b116100b05780638da5cb5b1461034c57806398e0191e14610361578063ad5c46481461037657610193565b806369bb4dc21461030d5780636ff8616214610322578063715018a61461033757610193565b806347e7ef24116101385780635251d91c116101125780635251d91c146102aa57806353eae691146102d857806361d027b3146102f857610193565b806347e7ef24146102485780634f86cc1e14610268578063519d5bee1461028857610193565b80632eb365b0116101695780632eb365b0146101f057806331672e20146102135780633ccfd60b1461023357610193565b80631252af751461019857806318f5f2a8146101c357610193565b3661019357610191610410565b005b600080fd5b3480156101a457600080fd5b506101ad6104c8565b6040516101ba9190611fa6565b60405180910390f35b3480156101cf57600080fd5b506101e36101de3660046115eb565b6104ce565b6040516101ba9190611da5565b3480156101fc57600080fd5b506102056104ef565b6040516101ba929190611fb4565b34801561021f57600080fd5b5061019161022e36600461169d565b6104f8565b34801561023f57600080fd5b506101916105bf565b34801561025457600080fd5b50610191610263366004611609565b6106e1565b34801561027457600080fd5b5061019161028336600461167f565b610731565b34801561029457600080fd5b5061029d610825565b6040516101ba9190611df6565b3480156102b657600080fd5b506102ca6102c53660046115eb565b61092c565b6040516101ba929190611ddb565b3480156102e457600080fd5b506101ad6102f33660046115eb565b610951565b34801561030457600080fd5b506101e3610a87565b34801561031957600080fd5b506101ad610aab565b34801561032e57600080fd5b50610191610ab1565b34801561034357600080fd5b50610191610c75565b34801561035857600080fd5b506101e3610cc0565b34801561036d57600080fd5b50610191610ccf565b34801561038257600080fd5b506101e3610f5e565b34801561039757600080fd5b506103a0610f82565b6040516101ba9190611e07565b3480156103b957600080fd5b5061029d610f8b565b3480156103ce57600080fd5b50610191610fed565b3480156103e357600080fd5b506101e36110a6565b3480156103f857600080fd5b506101916104073660046115eb565b6110ca565b6101915b6002600154141561043c5760405162461bcd60e51b815260040161043390611f86565b60405180910390fd5b60026001557f000000000000000000000000000000000000000000000000000000000000000061046d338234611138565b806001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156104a857600080fd5b505af11580156104bc573d6000803e3d6000fd5b50506001805550505050565b60035481565b6001600160a01b03808216600090815260086020526040902054165b919050565b60055460065482565b6105006112d3565b6001600160a01b0316610511610cc0565b6001600160a01b0316146105375760405162461bcd60e51b815260040161043390611ec6565b6002546105565760405162461bcd60e51b815260040161043390611f96565b4282116105755760405162461bcd60e51b815260040161043390611eb6565b8181116105945760405162461bcd60e51b815260040161043390611ef6565b600554156105b45760405162461bcd60e51b815260040161043390611f06565b600591909155600655565b600260015414156105e25760405162461bcd60e51b815260040161043390611f86565b600260015560045460ff166106095760405162461bcd60e51b815260040161043390611e26565b600061061433610951565b9050600081116106365760405162461bcd60e51b815260040161043390611ed6565b336000818152600960205260408120805473ffffffffffffffffffffffffffffffffffffffff1916815560010155610699907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690836112d7565b336001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516106d29190611fa6565b60405180910390a25060018055565b600260015414156107045760405162461bcd60e51b815260040161043390611f86565b6002600155610714338383611138565b6107296001600160a01b03831633308461135f565b505060018055565b6107396112d3565b6001600160a01b031661074a610cc0565b6001600160a01b0316146107705760405162461bcd60e51b815260040161043390611ec6565b600254156107905760405162461bcd60e51b815260040161043390611e46565b600081116107b05760405162461bcd60e51b815260040161043390611f66565b6107e56001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461135f565b60028190556040517fba7445eaa6a0e7a40d2e700b02577709a55b96288ff847b1cc397b2a6f1395209061081a908390611fa6565b60405180910390a150565b60075460609067ffffffffffffffff81111561085157634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561087a578160200160208202803683370190505b50905060005b6007548110156109285760086000600783815481106108af57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03908116845290830193909352604090910190205483519116908390839081106108fe57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280610920816121e0565b915050610880565b5090565b600960205260009081526040902080546001909101546001600160a01b039091169082565b6001600160a01b0380821660009081526009602090815260408083208151808301909252805490941681526001909301549083018190529091906109995760009150506104ea565b600354806109ac576000925050506104ea565b60208083015183516001600160a01b03166000908152600890925260408220600201546109d9919061215a565b905082600001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610a1857600080fd5b505afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5091906116bc565b610a5b90600a612074565b8260025483610a6a919061215a565b610a749190612003565b610a7e9190612003565b95945050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60025481565b610ab96112d3565b6001600160a01b0316610aca610cc0565b6001600160a01b031614610af05760405162461bcd60e51b815260040161043390611ec6565b60045460ff16610b125760405162461bcd60e51b815260040161043390611e26565b60005b600754811015610c7257600060078281548110610b4257634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03909116925082906370a0823190610b96903090600401611da5565b60206040518083038186803b158015610bae57600080fd5b505afa158015610bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be69190611661565b9050610c1c6001600160a01b0383167f0000000000000000000000000000000000000000000000000000000000000000836112d7565b816001600160a01b03167f0e0155fc4999bbb125969d44fd6a09db6b8682e20c096fe64f43c010ec14e1be82604051610c559190611fa6565b60405180910390a250508080610c6a906121e0565b915050610b15565b50565b610c7d6112d3565b6001600160a01b0316610c8e610cc0565b6001600160a01b031614610cb45760405162461bcd60e51b815260040161043390611ec6565b610cbe6000611386565b565b6000546001600160a01b031690565b610cd76112d3565b6001600160a01b0316610ce8610cc0565b6001600160a01b031614610d0e5760405162461bcd60e51b815260040161043390611ec6565b60065415801590610d2157506006544210155b610d3d5760405162461bcd60e51b815260040161043390611ea6565b60035415610d5d5760405162461bcd60e51b815260040161043390611ee6565b6000805b600754811015610f2857600060078281548110610d8e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03908116808452600883526040808520805482517f50d25bcd0000000000000000000000000000000000000000000000000000000081529251939750909594610e4a9491909116926350d25bcd926004808201939291829003018186803b158015610e0d57600080fd5b505afa158015610e21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e459190611661565b6113e3565b905060008111610e6c5760405162461bcd60e51b815260040161043390611e96565b826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd91906116bc565b610ee890600a612074565b818360010154610ef8919061215a565b610f029190612003565b610f0c9086611fd5565b6002909201559250819050610f20816121e0565b915050610d61565b5060038190556040517f1b5527fc73bbe9d608a44cf22c2708e9c08266cd62b5c1c9538d0c242328ba5b9061081a908390611fa6565b7f000000000000000000000000000000000000000000000000000000000000000081565b60045460ff1681565b60606007805480602002602001604051908101604052809291908181526020018280548015610fe357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fc5575b5050505050905090565b610ff56112d3565b6001600160a01b0316611006610cc0565b6001600160a01b03161461102c5760405162461bcd60e51b815260040161043390611ec6565b60035461104b5760405162461bcd60e51b815260040161043390611f16565b60045460ff161561106e5760405162461bcd60e51b815260040161043390611f46565b6004805460ff191660011790556040517fab2bf4ab08d6736c3ec6c77bb2b0eef4a5c46863d8df631be31ea5b59dc618de90600090a1565b7f000000000000000000000000000000000000000000000000000000000000000081565b6110d26112d3565b6001600160a01b03166110e3610cc0565b6001600160a01b0316146111095760405162461bcd60e51b815260040161043390611ec6565b6001600160a01b03811661112f5760405162461bcd60e51b815260040161043390611e36565b610c7281611386565b600554421080159061114b575060065442105b6111675760405162461bcd60e51b815260040161043390611e56565b600081116111875760405162461bcd60e51b815260040161043390611f76565b6001600160a01b03828116600090815260086020526040902054166111be5760405162461bcd60e51b815260040161043390611e76565b6001600160a01b038084166000908152600960205260409020805490911661120b57805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038416178155611237565b80546001600160a01b038481169116146112375760405162461bcd60e51b815260040161043390611f56565b8181600101600082825461124b9190611fd5565b90915550506001600160a01b0383166000908152600860205260408120600101805484929061127b908490611fd5565b92505081905550826001600160a01b0316846001600160a01b03167f8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a7846040516112c59190611fa6565b60405180910390a350505050565b3390565b61135a8363a9059cbb60e01b84846040516024016112f6929190611ddb565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611405565b505050565b611380846323b872dd60e01b8585856040516024016112f693929190611db3565b50505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000808212156109285760405162461bcd60e51b815260040161043390611e86565b600061145a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114949092919063ffffffff16565b80519091501561135a57808060200190518101906114789190611643565b61135a5760405162461bcd60e51b815260040161043390611f36565b60606114a384846000856114ad565b90505b9392505050565b6060824710156114cf5760405162461bcd60e51b815260040161043390611e66565b6114d88561156f565b6114f45760405162461bcd60e51b815260040161043390611f26565b600080866001600160a01b031685876040516115109190611d99565b60006040518083038185875af1925050503d806000811461154d576040519150601f19603f3d011682016040523d82523d6000602084013e611552565b606091505b5091509150611562828286611575565b925050505b949350505050565b3b151590565b606083156115845750816114a6565b8251156115945782518084602001fd5b8160405162461bcd60e51b81526004016104339190611e15565b80356115b981612242565b92915050565b80516115b981612256565b80516115b98161225f565b80356115b98161225f565b80516115b981612268565b6000602082840312156115fd57600080fd5b600061156784846115ae565b6000806040838503121561161c57600080fd5b600061162885856115ae565b9250506020611639858286016115d5565b9150509250929050565b60006020828403121561165557600080fd5b600061156784846115bf565b60006020828403121561167357600080fd5b600061156784846115ca565b60006020828403121561169157600080fd5b600061156784846115d5565b600080604083850312156116b057600080fd5b600061162885856115d5565b6000602082840312156116ce57600080fd5b600061156784846115e0565b60006116e683836116ee565b505060200190565b6116f78161218f565b82525050565b600061170882611fc8565b6117128185611fcc565b935061171d83611fc2565b8060005b8381101561174b57815161173588826116da565b975061174083611fc2565b925050600101611721565b509495945050505050565b6116f78161219a565b600061176a82611fc8565b61177481856104ea565b93506117848185602086016121b4565b9290920192915050565b600061179982611fc8565b6117a38185611fcc565b93506117b38185602086016121b4565b6117bc81612232565b9093019392505050565b60006117d3601783611fcc565b7f5749544844524157414c535f4e4f545f454e41424c4544000000000000000000815260200192915050565b600061180c602683611fcc565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b600061186b601883611fcc565b7f544f4b454e535f414c52454144595f414c4c4f43415445440000000000000000815260200192915050565b60006118a4601583611fcc565b7f4445504f534954535f4e4f545f41434345505445440000000000000000000000815260200192915050565b60006118dd602683611fcc565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f81527f722063616c6c0000000000000000000000000000000000000000000000000000602082015260400192915050565b600061193c601383611fcc565b7f544f4b454e5f4e4f545f535550504f5254454400000000000000000000000000815260200192915050565b6000611975602083611fcc565b7f53616665436173743a2076616c7565206d75737420626520706f736974697665815260200192915050565b60006119ae601583611fcc565b7f494e56414c49445f4f5241434c455f414e535745520000000000000000000000815260200192915050565b60006119e7600e83611fcc565b7f53414c455f4e4f545f454e444544000000000000000000000000000000000000815260200192915050565b6000611a20601783611fcc565b7f494e56414c49445f53544152545f54494d455354414d50000000000000000000815260200192915050565b6000611a59602083611fcc565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000611a92600983611fcc565b7f4e4f5f544f4b454e530000000000000000000000000000000000000000000000815260200192915050565b6000611acb601183611fcc565b7f414c52454144595f46494e414c495a4544000000000000000000000000000000815260200192915050565b6000611b04601583611fcc565b7f494e56414c49445f454e445f54494d455354414d500000000000000000000000815260200192915050565b6000611b3d601483611fcc565b7f5343484544554c455f414c52454144595f534554000000000000000000000000815260200192915050565b6000611b76600d83611fcc565b7f4e4f545f46494e414c495a454400000000000000000000000000000000000000815260200192915050565b6000611baf601d83611fcc565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000815260200192915050565b6000611be8602a83611fcc565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e81527f6f74207375636365656400000000000000000000000000000000000000000000602082015260400192915050565b6000611c47600f83611fcc565b7f414c52454144595f454e41424c45440000000000000000000000000000000000815260200192915050565b6000611c80601583611fcc565b7f53494e474c455f41535345545f4445504f534954530000000000000000000000815260200192915050565b6000611cb9601883611fcc565b7f494e56414c49445f414c4c4f43415445445f414d4f554e540000000000000000815260200192915050565b6000611cf2600e83611fcc565b7f494e56414c49445f414d4f554e54000000000000000000000000000000000000815260200192915050565b6000611d2b601f83611fcc565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b6000611d64601483611fcc565b7f544f4b454e535f4e4f545f414c4c4f4341544544000000000000000000000000815260200192915050565b6116f78161219f565b60006114a6828461175f565b602081016115b982846116ee565b60608101611dc182866116ee565b611dce60208301856116ee565b6115676040830184611d90565b60408101611de982856116ee565b6114a66020830184611d90565b602080825281016114a681846116fd565b602081016115b98284611756565b602080825281016114a6818461178e565b602080825281016115b9816117c6565b602080825281016115b9816117ff565b602080825281016115b98161185e565b602080825281016115b981611897565b602080825281016115b9816118d0565b602080825281016115b98161192f565b602080825281016115b981611968565b602080825281016115b9816119a1565b602080825281016115b9816119da565b602080825281016115b981611a13565b602080825281016115b981611a4c565b602080825281016115b981611a85565b602080825281016115b981611abe565b602080825281016115b981611af7565b602080825281016115b981611b30565b602080825281016115b981611b69565b602080825281016115b981611ba2565b602080825281016115b981611bdb565b602080825281016115b981611c3a565b602080825281016115b981611c73565b602080825281016115b981611cac565b602080825281016115b981611ce5565b602080825281016115b981611d1e565b602080825281016115b981611d57565b602081016115b98284611d90565b60408101611de98285611d90565b60200190565b5190565b90815260200190565b6000611fe08261219f565b9150611feb8361219f565b92508219821115611ffe57611ffe612206565b500190565b600061200e8261219f565b91506120198361219f565b9250826120285761202861221c565b500490565b80825b600185111561206b5780860481111561204b5761204b612206565b600185161561205957908102905b80026120648561223c565b9450612030565b94509492505050565b600061207f8261219f565b915061208a836121ae565b92506114a660001984846000826120a3575060016114a6565b816120b0575060006114a6565b81600181146120c657600281146120d0576120fd565b60019150506114a6565b60ff8411156120e1576120e1612206565b8360020a9150848211156120f7576120f7612206565b506114a6565b5060208310610133831016604e8410600b8410161715612130575081810a8381111561212b5761212b612206565b6114a6565b61213d848484600161202d565b9250905081840481111561215357612153612206565b0292915050565b60006121658261219f565b91506121708361219f565b925081600019048311821515161561218a5761218a612206565b500290565b60006115b9826121a2565b151590565b90565b6001600160a01b031690565b60ff1690565b60005b838110156121cf5781810151838201526020016121b7565b838111156113805750506000910152565b60006121eb8261219f565b91506000198214156121ff576121ff612206565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b601f01601f191690565b60011c90565b61224b8161218f565b8114610c7257600080fd5b61224b8161219a565b61224b8161219f565b61224b816121ae56fea2646970667358221220dc40a301197fb2954e6b640471e61bbaf71629e756113d205883d732a92beaf264736f6c63430008000033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84190000000000000000000000008fffffd4afb6115b954bd326cbe7b4ba576818f6000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a3000000000000000000000000a80c3bc69a0b69a62e777a8ada1e8807ff878a59

Deployed Bytecode

0x6080604052600436106101845760003560e01c806369bb4dc2116100d6578063d0dbcd241161007f578063e985e36711610059578063e985e367146103d7578063f2fde38b146103ec578063f6326fb31461040c57610193565b8063d0dbcd241461038b578063d3c7c2c7146103ad578063e8bac93b146103c257610193565b80638da5cb5b116100b05780638da5cb5b1461034c57806398e0191e14610361578063ad5c46481461037657610193565b806369bb4dc21461030d5780636ff8616214610322578063715018a61461033757610193565b806347e7ef24116101385780635251d91c116101125780635251d91c146102aa57806353eae691146102d857806361d027b3146102f857610193565b806347e7ef24146102485780634f86cc1e14610268578063519d5bee1461028857610193565b80632eb365b0116101695780632eb365b0146101f057806331672e20146102135780633ccfd60b1461023357610193565b80631252af751461019857806318f5f2a8146101c357610193565b3661019357610191610410565b005b600080fd5b3480156101a457600080fd5b506101ad6104c8565b6040516101ba9190611fa6565b60405180910390f35b3480156101cf57600080fd5b506101e36101de3660046115eb565b6104ce565b6040516101ba9190611da5565b3480156101fc57600080fd5b506102056104ef565b6040516101ba929190611fb4565b34801561021f57600080fd5b5061019161022e36600461169d565b6104f8565b34801561023f57600080fd5b506101916105bf565b34801561025457600080fd5b50610191610263366004611609565b6106e1565b34801561027457600080fd5b5061019161028336600461167f565b610731565b34801561029457600080fd5b5061029d610825565b6040516101ba9190611df6565b3480156102b657600080fd5b506102ca6102c53660046115eb565b61092c565b6040516101ba929190611ddb565b3480156102e457600080fd5b506101ad6102f33660046115eb565b610951565b34801561030457600080fd5b506101e3610a87565b34801561031957600080fd5b506101ad610aab565b34801561032e57600080fd5b50610191610ab1565b34801561034357600080fd5b50610191610c75565b34801561035857600080fd5b506101e3610cc0565b34801561036d57600080fd5b50610191610ccf565b34801561038257600080fd5b506101e3610f5e565b34801561039757600080fd5b506103a0610f82565b6040516101ba9190611e07565b3480156103b957600080fd5b5061029d610f8b565b3480156103ce57600080fd5b50610191610fed565b3480156103e357600080fd5b506101e36110a6565b3480156103f857600080fd5b506101916104073660046115eb565b6110ca565b6101915b6002600154141561043c5760405162461bcd60e51b815260040161043390611f86565b60405180910390fd5b60026001557f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc261046d338234611138565b806001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156104a857600080fd5b505af11580156104bc573d6000803e3d6000fd5b50506001805550505050565b60035481565b6001600160a01b03808216600090815260086020526040902054165b919050565b60055460065482565b6105006112d3565b6001600160a01b0316610511610cc0565b6001600160a01b0316146105375760405162461bcd60e51b815260040161043390611ec6565b6002546105565760405162461bcd60e51b815260040161043390611f96565b4282116105755760405162461bcd60e51b815260040161043390611eb6565b8181116105945760405162461bcd60e51b815260040161043390611ef6565b600554156105b45760405162461bcd60e51b815260040161043390611f06565b600591909155600655565b600260015414156105e25760405162461bcd60e51b815260040161043390611f86565b600260015560045460ff166106095760405162461bcd60e51b815260040161043390611e26565b600061061433610951565b9050600081116106365760405162461bcd60e51b815260040161043390611ed6565b336000818152600960205260408120805473ffffffffffffffffffffffffffffffffffffffff1916815560010155610699907f000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a36001600160a01b031690836112d7565b336001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040516106d29190611fa6565b60405180910390a25060018055565b600260015414156107045760405162461bcd60e51b815260040161043390611f86565b6002600155610714338383611138565b6107296001600160a01b03831633308461135f565b505060018055565b6107396112d3565b6001600160a01b031661074a610cc0565b6001600160a01b0316146107705760405162461bcd60e51b815260040161043390611ec6565b600254156107905760405162461bcd60e51b815260040161043390611e46565b600081116107b05760405162461bcd60e51b815260040161043390611f66565b6107e56001600160a01b037f000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a31633308461135f565b60028190556040517fba7445eaa6a0e7a40d2e700b02577709a55b96288ff847b1cc397b2a6f1395209061081a908390611fa6565b60405180910390a150565b60075460609067ffffffffffffffff81111561085157634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561087a578160200160208202803683370190505b50905060005b6007548110156109285760086000600783815481106108af57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03908116845290830193909352604090910190205483519116908390839081106108fe57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280610920816121e0565b915050610880565b5090565b600960205260009081526040902080546001909101546001600160a01b039091169082565b6001600160a01b0380821660009081526009602090815260408083208151808301909252805490941681526001909301549083018190529091906109995760009150506104ea565b600354806109ac576000925050506104ea565b60208083015183516001600160a01b03166000908152600890925260408220600201546109d9919061215a565b905082600001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610a1857600080fd5b505afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5091906116bc565b610a5b90600a612074565b8260025483610a6a919061215a565b610a749190612003565b610a7e9190612003565b95945050505050565b7f000000000000000000000000a80c3bc69a0b69a62e777a8ada1e8807ff878a5981565b60025481565b610ab96112d3565b6001600160a01b0316610aca610cc0565b6001600160a01b031614610af05760405162461bcd60e51b815260040161043390611ec6565b60045460ff16610b125760405162461bcd60e51b815260040161043390611e26565b60005b600754811015610c7257600060078281548110610b4257634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03909116925082906370a0823190610b96903090600401611da5565b60206040518083038186803b158015610bae57600080fd5b505afa158015610bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be69190611661565b9050610c1c6001600160a01b0383167f000000000000000000000000a80c3bc69a0b69a62e777a8ada1e8807ff878a59836112d7565b816001600160a01b03167f0e0155fc4999bbb125969d44fd6a09db6b8682e20c096fe64f43c010ec14e1be82604051610c559190611fa6565b60405180910390a250508080610c6a906121e0565b915050610b15565b50565b610c7d6112d3565b6001600160a01b0316610c8e610cc0565b6001600160a01b031614610cb45760405162461bcd60e51b815260040161043390611ec6565b610cbe6000611386565b565b6000546001600160a01b031690565b610cd76112d3565b6001600160a01b0316610ce8610cc0565b6001600160a01b031614610d0e5760405162461bcd60e51b815260040161043390611ec6565b60065415801590610d2157506006544210155b610d3d5760405162461bcd60e51b815260040161043390611ea6565b60035415610d5d5760405162461bcd60e51b815260040161043390611ee6565b6000805b600754811015610f2857600060078281548110610d8e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03908116808452600883526040808520805482517f50d25bcd0000000000000000000000000000000000000000000000000000000081529251939750909594610e4a9491909116926350d25bcd926004808201939291829003018186803b158015610e0d57600080fd5b505afa158015610e21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e459190611661565b6113e3565b905060008111610e6c5760405162461bcd60e51b815260040161043390611e96565b826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd91906116bc565b610ee890600a612074565b818360010154610ef8919061215a565b610f029190612003565b610f0c9086611fd5565b6002909201559250819050610f20816121e0565b915050610d61565b5060038190556040517f1b5527fc73bbe9d608a44cf22c2708e9c08266cd62b5c1c9538d0c242328ba5b9061081a908390611fa6565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60045460ff1681565b60606007805480602002602001604051908101604052809291908181526020018280548015610fe357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fc5575b5050505050905090565b610ff56112d3565b6001600160a01b0316611006610cc0565b6001600160a01b03161461102c5760405162461bcd60e51b815260040161043390611ec6565b60035461104b5760405162461bcd60e51b815260040161043390611f16565b60045460ff161561106e5760405162461bcd60e51b815260040161043390611f46565b6004805460ff191660011790556040517fab2bf4ab08d6736c3ec6c77bb2b0eef4a5c46863d8df631be31ea5b59dc618de90600090a1565b7f000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a381565b6110d26112d3565b6001600160a01b03166110e3610cc0565b6001600160a01b0316146111095760405162461bcd60e51b815260040161043390611ec6565b6001600160a01b03811661112f5760405162461bcd60e51b815260040161043390611e36565b610c7281611386565b600554421080159061114b575060065442105b6111675760405162461bcd60e51b815260040161043390611e56565b600081116111875760405162461bcd60e51b815260040161043390611f76565b6001600160a01b03828116600090815260086020526040902054166111be5760405162461bcd60e51b815260040161043390611e76565b6001600160a01b038084166000908152600960205260409020805490911661120b57805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038416178155611237565b80546001600160a01b038481169116146112375760405162461bcd60e51b815260040161043390611f56565b8181600101600082825461124b9190611fd5565b90915550506001600160a01b0383166000908152600860205260408120600101805484929061127b908490611fd5565b92505081905550826001600160a01b0316846001600160a01b03167f8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a7846040516112c59190611fa6565b60405180910390a350505050565b3390565b61135a8363a9059cbb60e01b84846040516024016112f6929190611ddb565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611405565b505050565b611380846323b872dd60e01b8585856040516024016112f693929190611db3565b50505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000808212156109285760405162461bcd60e51b815260040161043390611e86565b600061145a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114949092919063ffffffff16565b80519091501561135a57808060200190518101906114789190611643565b61135a5760405162461bcd60e51b815260040161043390611f36565b60606114a384846000856114ad565b90505b9392505050565b6060824710156114cf5760405162461bcd60e51b815260040161043390611e66565b6114d88561156f565b6114f45760405162461bcd60e51b815260040161043390611f26565b600080866001600160a01b031685876040516115109190611d99565b60006040518083038185875af1925050503d806000811461154d576040519150601f19603f3d011682016040523d82523d6000602084013e611552565b606091505b5091509150611562828286611575565b925050505b949350505050565b3b151590565b606083156115845750816114a6565b8251156115945782518084602001fd5b8160405162461bcd60e51b81526004016104339190611e15565b80356115b981612242565b92915050565b80516115b981612256565b80516115b98161225f565b80356115b98161225f565b80516115b981612268565b6000602082840312156115fd57600080fd5b600061156784846115ae565b6000806040838503121561161c57600080fd5b600061162885856115ae565b9250506020611639858286016115d5565b9150509250929050565b60006020828403121561165557600080fd5b600061156784846115bf565b60006020828403121561167357600080fd5b600061156784846115ca565b60006020828403121561169157600080fd5b600061156784846115d5565b600080604083850312156116b057600080fd5b600061162885856115d5565b6000602082840312156116ce57600080fd5b600061156784846115e0565b60006116e683836116ee565b505060200190565b6116f78161218f565b82525050565b600061170882611fc8565b6117128185611fcc565b935061171d83611fc2565b8060005b8381101561174b57815161173588826116da565b975061174083611fc2565b925050600101611721565b509495945050505050565b6116f78161219a565b600061176a82611fc8565b61177481856104ea565b93506117848185602086016121b4565b9290920192915050565b600061179982611fc8565b6117a38185611fcc565b93506117b38185602086016121b4565b6117bc81612232565b9093019392505050565b60006117d3601783611fcc565b7f5749544844524157414c535f4e4f545f454e41424c4544000000000000000000815260200192915050565b600061180c602683611fcc565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b600061186b601883611fcc565b7f544f4b454e535f414c52454144595f414c4c4f43415445440000000000000000815260200192915050565b60006118a4601583611fcc565b7f4445504f534954535f4e4f545f41434345505445440000000000000000000000815260200192915050565b60006118dd602683611fcc565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f81527f722063616c6c0000000000000000000000000000000000000000000000000000602082015260400192915050565b600061193c601383611fcc565b7f544f4b454e5f4e4f545f535550504f5254454400000000000000000000000000815260200192915050565b6000611975602083611fcc565b7f53616665436173743a2076616c7565206d75737420626520706f736974697665815260200192915050565b60006119ae601583611fcc565b7f494e56414c49445f4f5241434c455f414e535745520000000000000000000000815260200192915050565b60006119e7600e83611fcc565b7f53414c455f4e4f545f454e444544000000000000000000000000000000000000815260200192915050565b6000611a20601783611fcc565b7f494e56414c49445f53544152545f54494d455354414d50000000000000000000815260200192915050565b6000611a59602083611fcc565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000611a92600983611fcc565b7f4e4f5f544f4b454e530000000000000000000000000000000000000000000000815260200192915050565b6000611acb601183611fcc565b7f414c52454144595f46494e414c495a4544000000000000000000000000000000815260200192915050565b6000611b04601583611fcc565b7f494e56414c49445f454e445f54494d455354414d500000000000000000000000815260200192915050565b6000611b3d601483611fcc565b7f5343484544554c455f414c52454144595f534554000000000000000000000000815260200192915050565b6000611b76600d83611fcc565b7f4e4f545f46494e414c495a454400000000000000000000000000000000000000815260200192915050565b6000611baf601d83611fcc565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000815260200192915050565b6000611be8602a83611fcc565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e81527f6f74207375636365656400000000000000000000000000000000000000000000602082015260400192915050565b6000611c47600f83611fcc565b7f414c52454144595f454e41424c45440000000000000000000000000000000000815260200192915050565b6000611c80601583611fcc565b7f53494e474c455f41535345545f4445504f534954530000000000000000000000815260200192915050565b6000611cb9601883611fcc565b7f494e56414c49445f414c4c4f43415445445f414d4f554e540000000000000000815260200192915050565b6000611cf2600e83611fcc565b7f494e56414c49445f414d4f554e54000000000000000000000000000000000000815260200192915050565b6000611d2b601f83611fcc565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b6000611d64601483611fcc565b7f544f4b454e535f4e4f545f414c4c4f4341544544000000000000000000000000815260200192915050565b6116f78161219f565b60006114a6828461175f565b602081016115b982846116ee565b60608101611dc182866116ee565b611dce60208301856116ee565b6115676040830184611d90565b60408101611de982856116ee565b6114a66020830184611d90565b602080825281016114a681846116fd565b602081016115b98284611756565b602080825281016114a6818461178e565b602080825281016115b9816117c6565b602080825281016115b9816117ff565b602080825281016115b98161185e565b602080825281016115b981611897565b602080825281016115b9816118d0565b602080825281016115b98161192f565b602080825281016115b981611968565b602080825281016115b9816119a1565b602080825281016115b9816119da565b602080825281016115b981611a13565b602080825281016115b981611a4c565b602080825281016115b981611a85565b602080825281016115b981611abe565b602080825281016115b981611af7565b602080825281016115b981611b30565b602080825281016115b981611b69565b602080825281016115b981611ba2565b602080825281016115b981611bdb565b602080825281016115b981611c3a565b602080825281016115b981611c73565b602080825281016115b981611cac565b602080825281016115b981611ce5565b602080825281016115b981611d1e565b602080825281016115b981611d57565b602081016115b98284611d90565b60408101611de98285611d90565b60200190565b5190565b90815260200190565b6000611fe08261219f565b9150611feb8361219f565b92508219821115611ffe57611ffe612206565b500190565b600061200e8261219f565b91506120198361219f565b9250826120285761202861221c565b500490565b80825b600185111561206b5780860481111561204b5761204b612206565b600185161561205957908102905b80026120648561223c565b9450612030565b94509492505050565b600061207f8261219f565b915061208a836121ae565b92506114a660001984846000826120a3575060016114a6565b816120b0575060006114a6565b81600181146120c657600281146120d0576120fd565b60019150506114a6565b60ff8411156120e1576120e1612206565b8360020a9150848211156120f7576120f7612206565b506114a6565b5060208310610133831016604e8410600b8410161715612130575081810a8381111561212b5761212b612206565b6114a6565b61213d848484600161202d565b9250905081840481111561215357612153612206565b0292915050565b60006121658261219f565b91506121708361219f565b925081600019048311821515161561218a5761218a612206565b500290565b60006115b9826121a2565b151590565b90565b6001600160a01b031690565b60ff1690565b60005b838110156121cf5781810151838201526020016121b7565b838111156113805750506000910152565b60006121eb8261219f565b91506000198214156121ff576121ff612206565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b601f01601f191690565b60011c90565b61224b8161218f565b8114610c7257600080fd5b61224b8161219a565b61224b8161219f565b61224b816121ae56fea2646970667358221220dc40a301197fb2954e6b640471e61bbaf71629e756113d205883d732a92beaf264736f6c63430008000033

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

000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84190000000000000000000000008fffffd4afb6115b954bd326cbe7b4ba576818f6000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a3000000000000000000000000a80c3bc69a0b69a62e777a8ada1e8807ff878a59

-----Decoded View---------------
Arg [0] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [1] : _usdc (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : _wethOracle (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
Arg [3] : _usdcOracle (address): 0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6
Arg [4] : _saleToken (address): 0xE80C0cd204D654CEbe8dd64A4857cAb6Be8345a3
Arg [5] : _treasury (address): 0xa80c3BC69a0b69a62E777a8ADA1E8807fF878a59

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [3] : 0000000000000000000000008fffffd4afb6115b954bd326cbe7b4ba576818f6
Arg [4] : 000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a3
Arg [5] : 000000000000000000000000a80c3bc69a0b69a62e777a8ada1e8807ff878a59


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

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