Contract 0xb8fe0b80787b79b41235c28901640813cc9ca120

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x0f41dc4209a727e58a9cec7c82d7e89de65edd1721adfcc30bb3c993b1ed6b740x60806040182828732022-08-06 8:55:5911 days 23 hrs ago0x3f68a3c1023d736d8be867ca49cb18c543373b99 IN  Create: AvaxBNIStrategy0 AVAX0.‍0745694525
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AvaxBNIStrategy

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 14 : AvaxBNIStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "./BNIStrategy.sol";
import "../../../interfaces/IL2Vault.sol";

contract AvaxBNIStrategy is BNIStrategy {
    using SafeERC20Upgradeable for IERC20Upgradeable;

    IERC20Upgradeable public constant WAVAX = IERC20Upgradeable(0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7);

    IL2Vault public WAVAXVault;

    event InvestWAVAX(uint USDTAmt, uint WAVAXAmt);
    event WithdrawWAVAX(uint WAVAXAmt, uint USDTAmt);

    function setWAVAXVault(IL2Vault _WAVAXVault) external onlyOwner {
        WAVAXVault = _WAVAXVault;
        if (WAVAX.allowance(address(this), address(WAVAXVault)) == 0) {
            WAVAX.safeApprove(address(WAVAXVault), type(uint).max);
        }
    }

    function _investWAVAX(uint USDTAmt) private {
        uint WAVAXAmt = WAVAX.balanceOf(address(this));
        if (WAVAXAmt > 0) {
            WAVAXVault.deposit(WAVAXAmt);
            emit InvestWAVAX(USDTAmt, WAVAXAmt);
        }
    }

    function _invest(uint[] memory _USDTAmts) internal virtual override {
        super._invest(_USDTAmts);

        uint poolCnt = _USDTAmts.length;
        for (uint i = 0; i < poolCnt; i ++) {
            address token = tokens[i];
            if (token == address(WAVAX)) {
                _investWAVAX(_USDTAmts[i]);
            }
        }
    }

    function _withdrawWAVAX(uint _sharePerc) private returns (uint USDTAmt) {
        uint amount = WAVAXVault.balanceOf(address(this)) * _sharePerc / 1e18;
        if (0 < amount) {
            WAVAXVault.withdraw(amount);
            uint WAVAXAmt = WAVAX.balanceOf(address(this));
            USDTAmt = _swapForUSDT(address(WAVAX), WAVAXAmt);
            emit WithdrawWAVAX(WAVAXAmt, USDTAmt);
        }
    }

    function _withdrawFromPool(uint _pid, uint _sharePerc) internal virtual override returns (uint USDTAmt) {
        address token = tokens[_pid];
        if (token == address(WAVAX)) {
            USDTAmt = _withdrawWAVAX(_sharePerc);
        } else {
            USDTAmt = super._withdrawFromPool(_pid, _sharePerc);
        }
    }

    function getWAVAXPoolInUSD() private view  returns (uint) {
        uint balance = WAVAXVault.balanceOf(address(this));
        return balance == 0 ? 0 : WAVAXVault.getAllPoolInUSD() * balance / WAVAXVault.totalSupply(); //to exclude L1 deposits from other addresses
    }

    function _getPoolInUSD(uint _pid) internal view virtual override returns (uint pool) {
        address token = tokens[_pid];
        if (token == address(WAVAX)) {
            pool = getWAVAXPoolInUSD();
        } else {
            pool = super._getPoolInUSD(_pid);
        }
    }

    function getAPR() public view override returns (uint) {
        (address[] memory _tokens, uint[] memory perc) = getCurrentTokenCompositionPerc();
        uint allApr;
        uint poolCnt = _tokens.length;
        for (uint i = 0; i < poolCnt; i ++) {
            address token = _tokens[i];
            if (token == address(WAVAX)) {
                allApr += WAVAXVault.getAPR() * perc[i];
            }
        }
        return (allApr / DENOMINATOR);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 14 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../extensions/draft-IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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));
        }
    }

    function safePermit(
        IERC20PermitUpgradeable token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

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

File 4 of 14 : BNIStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "../priceOracle/IPriceOracle.sol";
import "../../../interfaces/IERC20UpgradeableExt.sol";
import "../../../interfaces/IUniRouter.sol";
import "../../../libs/Token.sol";

contract BNIStrategy is OwnableUpgradeable {
    using SafeERC20Upgradeable for IERC20UpgradeableExt;

    IUniRouter public router;
    IERC20UpgradeableExt public SWAP_BASE_TOKEN; // It has same role with WETH on Ethereum Swaps. Most of tokens have been paired with this token.
    IERC20UpgradeableExt public USDT;
    uint8 usdtDecimals;

    uint constant DENOMINATOR = 10000;

    address public treasuryWallet;
    address public admin;
    address public vault;
    IPriceOracle public priceOracle;

    address[] public tokens;
    mapping(address => uint) public pid; // Pool indices in tokens array

    event AddToken(address token, uint pid);
    event RemoveToken(address token, uint pid);
    event Withdraw(uint sharePerc, uint USDTAmt);
    event EmergencyWithdraw(uint USDTAmt);
    event SetTreasuryWallet(address oldTreasuryWallet, address newTreasuryWallet);
    event SetAdminWallet(address oldAdmin, address newAdmin);

    modifier onlyVault {
        require(msg.sender == vault, "Only vault");
        _;
    }

    function initialize(
        address _treasuryWallet, address _admin,
        address _priceOracle,
        address _router, address _SWAP_BASE_TOKEN,
        address _USDT, address _token0
    ) public virtual initializer {
        require(_router != address(0), "Invalid router");
        require(_SWAP_BASE_TOKEN != address(0), "Invalid SWAP_BASE_TOKEN");
        require(_USDT != address(0), "Invalid USDT");
        require(_token0 != address(0), "Invalid token0");
        __Ownable_init();

        treasuryWallet = _treasuryWallet;
        admin = _admin;
        priceOracle = IPriceOracle(_priceOracle);
        router = IUniRouter(_router);
        SWAP_BASE_TOKEN = IERC20UpgradeableExt(_SWAP_BASE_TOKEN);

        USDT = IERC20UpgradeableExt(_USDT);
        usdtDecimals = USDT.decimals();
        require(6 <= usdtDecimals, "USDT decimals must >= 6");

        tokens.push(_token0);
        updatePid();

        USDT.safeApprove(address(router), type(uint).max);
        IERC20UpgradeableExt(_token0).safeApprove(address(router), type(uint).max);
    }

    function updatePid() internal {
        address[] memory _tokens = tokens;

        uint tokenCnt = _tokens.length;
        for (uint i = 0; i < tokenCnt; i ++) {
            pid[_tokens[i]] = i;
        }
    }

    function addToken(address _token) external onlyOwner {
        uint _pid = pid[_token];
        require ((_pid == 0 && _token != tokens[0]), "Already added");

        tokens.push(_token);
        _pid = tokens.length-1;
        pid[_token] = _pid;

        if (IERC20UpgradeableExt(_token).allowance(address(this), address(router)) == 0) {
            IERC20UpgradeableExt(_token).safeApprove(address(router), type(uint).max);
        }
        emit AddToken(_token, _pid);
    }

    function removeToken(uint _pid) external onlyOwner {
        uint tokenCnt = tokens.length;
        require(_pid < tokenCnt, "Invalid pid");
        uint pool = _getPoolInUSD(_pid);
        require(pool == 0, "Pool is not empty");

        address _token = tokens[_pid];
        tokens[_pid] = tokens[tokenCnt-1];
        tokens.pop();

        pid[_token] = 0;
        updatePid();

        emit RemoveToken(_token, _pid);
    }

    /// @param _USDTAmts amounts of USDT should be deposited to each pools. They have been denominated in USDT decimals
    function invest(address[] memory _tokens, uint[] memory _USDTAmts) external onlyVault {
        uint poolCnt = _tokens.length;
        uint USDTAmt;
        uint[] memory USDTAmts = new uint[](tokens.length);
        for (uint i = 0; i < poolCnt; i ++) {
            uint amount = _USDTAmts[i];
            USDTAmt += amount;
            uint _pid = pid[_tokens[i]];
            USDTAmts[_pid] += amount;
        }
        USDT.safeTransferFrom(vault, address(this), USDTAmt);

        _invest(USDTAmts);
    }

    function _invest(uint[] memory _USDTAmts) internal virtual {
        uint poolCnt = _USDTAmts.length;
        for (uint i = 0; i < poolCnt; i ++) {
            address token = tokens[i];
            if (token == address(USDT)) continue;

            uint USDTAmt = _USDTAmts[i];
            (uint USDTPriceInUSD, uint8 USDTPriceDecimals) = getUSDTPriceInUSD();
            (uint TOKENPriceInUSD, uint8 TOKENPriceDecimals) = priceOracle.getAssetPrice(token);
            uint8 tokenDecimals = IERC20UpgradeableExt(token).decimals();
            uint numerator = USDTPriceInUSD * (10 ** (TOKENPriceDecimals + tokenDecimals));
            uint denominator = TOKENPriceInUSD * (10 ** (USDTPriceDecimals + usdtDecimals));
            uint amountOutMin = USDTAmt * numerator * 95 / (denominator * 100);

            if (token == address(SWAP_BASE_TOKEN)) {
                _swap(address(USDT), token, USDTAmt, amountOutMin);
            } else {
                _swap2(address(USDT), token, USDTAmt, amountOutMin);
            }
        }
    }

    function withdrawPerc(uint _sharePerc) external onlyVault returns (uint USDTAmt) {
        require(_sharePerc <= 1e18, "Over 100%");
        USDTAmt = _withdraw(_sharePerc);
        USDT.safeTransfer(vault, USDTAmt);
        emit Withdraw(_sharePerc, USDTAmt);
    }

    function _withdraw(uint _sharePerc) internal virtual returns (uint USDTAmt) {
        uint poolCnt = tokens.length;
        for (uint i = 0; i < poolCnt; i ++) {
            USDTAmt += _withdrawFromPool(i, _sharePerc);
        }
    }

    function _withdrawFromPool(uint _pid, uint _sharePerc) internal virtual returns (uint USDTAmt) {
        IERC20UpgradeableExt token = IERC20UpgradeableExt(tokens[_pid]);
        uint amount = token.balanceOf(address(this)) * _sharePerc / 1e18;
        if (0 < amount) {
            if (address(token) == address(USDT)) {
                USDTAmt = amount;
            } else {
                USDTAmt = _swapForUSDT(address(token), amount);
            }
        }
    }

    function _swapForUSDT(address token, uint amount) internal returns (uint USDTAmt) {
        (uint USDTPriceInUSD, uint8 USDTPriceDecimals) = getUSDTPriceInUSD();
        (uint TOKENPriceInUSD, uint8 TOKENPriceDecimals) = priceOracle.getAssetPrice(address(token));
        uint8 tokenDecimals = IERC20UpgradeableExt(token).decimals();
        uint numerator = TOKENPriceInUSD * (10 ** (USDTPriceDecimals + usdtDecimals));
        uint denominator = USDTPriceInUSD * (10 ** (TOKENPriceDecimals + tokenDecimals));
        uint amountOutMin = amount * numerator * 95 / (denominator * 100);

        if (address(token) == address(SWAP_BASE_TOKEN)) {
            USDTAmt = _swap(address(token), address(USDT), amount, amountOutMin);
        } else{
            USDTAmt = _swap2(address(token), address(USDT), amount, amountOutMin);
        }
    }

    function _swap(address _tokenA, address _tokenB, uint _amt, uint _minAmount) private returns (uint) {
        address[] memory path = new address[](2);
        path[0] = _tokenA;
        path[1] = _tokenB;
        return (router.swapExactTokensForTokens(_amt, _minAmount, path, address(this), block.timestamp))[1];
    }

    function _swap2(address _tokenA, address _tokenB, uint _amt, uint _minAmount) private returns (uint) {
        address[] memory path = new address[](3);
        path[0] = _tokenA;
        path[1] = address(SWAP_BASE_TOKEN);
        path[2] = _tokenB;
        return (router.swapExactTokensForTokens(_amt, _minAmount, path, address(this), block.timestamp))[2];
    }

    function withdrawFromPool(uint _pid, uint _sharePerc) external onlyVault returns (uint USDTAmt) {
        require(_sharePerc <= 1e18, "Over 100%");
        USDTAmt = _withdrawFromPool(_pid, _sharePerc);
        USDT.safeTransfer(vault, USDTAmt);
    }

    function emergencyWithdraw() external onlyVault {
        // 1e18 == 100% of share
        uint USDTAmt = _withdraw(1e18);
        if (0 < USDTAmt) {
            USDT.safeTransfer(vault, USDTAmt);
        }
        emit EmergencyWithdraw(USDTAmt);
    }

    function setTreasuryWallet(address _treasuryWallet) external onlyOwner {
        address oldTreasuryWallet = treasuryWallet;
        treasuryWallet = _treasuryWallet;
        emit SetTreasuryWallet(oldTreasuryWallet, _treasuryWallet);
    }

    function setAdmin(address _admin) external onlyOwner {
        address oldAdmin = admin;
        admin = _admin;
        emit SetAdminWallet(oldAdmin, _admin);
    }

    function setVault(address _vault) external onlyOwner {
        require(vault == address(0), "Vault set");
        vault = _vault;
    }

    /// @return the price of USDT in USD.
    function getUSDTPriceInUSD() public view returns(uint, uint8) {
        return priceOracle.getAssetPrice(address(USDT));
    }

    function getEachPoolInUSD() public view returns (address[] memory, uint[] memory pools) {
        return (tokens, _getEachPoolInUSD());
    }

    function _getEachPoolInUSD() private view returns (uint[] memory pools) {
        uint poolCnt = tokens.length;
        pools = new uint[](poolCnt);
        for (uint i = 0; i < poolCnt; i ++) {
            pools[i] = _getPoolInUSD(i);
        }
    }

    function _getPoolInUSD(uint _pid) internal view virtual returns (uint pool) {
        IERC20UpgradeableExt token = IERC20UpgradeableExt(tokens[_pid]);
        uint amount = token.balanceOf(address(this));
        if (0 < amount) {
            (uint TOKENPriceInUSD, uint8 TOKENPriceDecimals) = priceOracle.getAssetPrice(address(token));
            uint8 tokenDecimals = IERC20UpgradeableExt(token).decimals();
            pool = Token.changeDecimals(amount, tokenDecimals, 18) * TOKENPriceInUSD / (10 ** (TOKENPriceDecimals));
        }
    }

    function getAllPoolInUSD() public view returns (uint) {
        uint[] memory pools = _getEachPoolInUSD();
        uint poolCnt = pools.length;
        uint allPool;
        for (uint i = 0; i < poolCnt; i ++) {
            allPool += pools[i];
        }
        return allPool;
    }

    function getCurrentTokenCompositionPerc() public view returns (address[] memory, uint[] memory percentages) {
        uint[] memory pools = _getEachPoolInUSD();
        uint poolCnt = pools.length;
        uint allPool;
        for (uint i = 0; i < poolCnt; i ++) {
            allPool += pools[i];
        }

        uint defaultTargetPerc = poolCnt == 0 ? 0 : DENOMINATOR / poolCnt;
        percentages = new uint[](poolCnt);
        for (uint i = 0; i < poolCnt; i ++) {
            percentages[i] = allPool == 0 ? defaultTargetPerc : pools[i] * DENOMINATOR / allPool;
        }
        return (tokens, percentages);
    }

    function getAPR() public view virtual returns (uint) {
        return 0;
    }

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

File 5 of 14 : IL2Vault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

interface IL2Vault is IERC20Upgradeable {
    function deposit(uint amount) external;
    function withdraw(uint share) external;
    function getAllPool() external view returns (uint);
    function getAllPoolInUSD() external view returns (uint);
    function getAPR() external view returns (uint);
}

File 6 of 14 : draft-IERC20PermitUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20PermitUpgradeable {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 7 of 14 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

File 8 of 14 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 14 : IPriceOracle.sol
//SPDX-License-Identifier: MIT
pragma solidity  0.8.9;

interface IPriceOracle {

    /**
     * @notice Sets or replaces price sources of assets
     * @param assets The addresses of the assets
     * @param sources The addresses of the price sources
     */
    function setAssetSources(address[] memory assets, address[] memory sources) external;

    /**
     * @notice Returns the address of the source for an asset address
     * @param asset The address of the asset
     * @return The address of the source
     */
    function getSourceOfAsset(address asset) external view returns (address);

    /**
     * @notice Returns a list of prices from a list of assets addresses
     * @param assets The list of assets addresses
     * @return prices The prices of the given assets
     */
    function getAssetsPrices(address[] memory assets) external view returns (uint[] memory prices, uint8[] memory decimalsArray);

    /**
     * @notice Returns a list of prices from a list of assets addresses
     * @param asset The asset address
     * @return price The prices of the given assets
     */
    function getAssetPrice(address asset) external view returns (uint price, uint8 decimals);
}

File 10 of 14 : IERC20UpgradeableExt.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

interface IERC20UpgradeableExt is IERC20Upgradeable {
    function decimals() external view returns (uint8);
}

File 11 of 14 : IUniRouter.sol
//SPDX-License-Identifier: MIT
pragma solidity  0.8.9;

interface IUniRouter {
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);

    function swapExactETHForTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable returns (uint[] memory amounts);

    function swapExactTokensForETH(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity) ;

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);

    function getAmountsOut(uint amountIn, address[] memory path) external view returns (uint[] memory amounts);
}

File 12 of 14 : Token.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

library Token {
    function changeDecimals(uint amount, uint curDecimals, uint newDecimals) internal pure returns(uint) {
        if (curDecimals == newDecimals) {
            return amount;
        } else if (curDecimals < newDecimals) {
            return amount * (10 ** (newDecimals - curDecimals));
        } else {
            return amount / (10 ** (curDecimals - newDecimals));
        }
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, "ETH transfer failed");
    }
}

File 13 of 14 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

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

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

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

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

File 14 of 14 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

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

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

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

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

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

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

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"AddToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"USDTAmt","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"USDTAmt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"WAVAXAmt","type":"uint256"}],"name":"InvestWAVAX","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"RemoveToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"SetAdminWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldTreasuryWallet","type":"address"},{"indexed":false,"internalType":"address","name":"newTreasuryWallet","type":"address"}],"name":"SetTreasuryWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"sharePerc","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"USDTAmt","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"WAVAXAmt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"USDTAmt","type":"uint256"}],"name":"WithdrawWAVAX","type":"event"},{"inputs":[],"name":"SWAP_BASE_TOKEN","outputs":[{"internalType":"contract IERC20UpgradeableExt","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDT","outputs":[{"internalType":"contract IERC20UpgradeableExt","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WAVAX","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WAVAXVault","outputs":[{"internalType":"contract IL2Vault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"addToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAPR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllPoolInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTokenCompositionPerc","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"percentages","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEachPoolInUSD","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"pools","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUSDTPriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_treasuryWallet","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_priceOracle","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_SWAP_BASE_TOKEN","type":"address"},{"internalType":"address","name":"_USDT","type":"address"},{"internalType":"address","name":"_token0","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_USDTAmts","type":"uint256[]"}],"name":"invest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceOracle","outputs":[{"internalType":"contract IPriceOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"removeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IUniRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasuryWallet","type":"address"}],"name":"setTreasuryWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"setVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IL2Vault","name":"_WAVAXVault","type":"address"}],"name":"setWAVAXVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_sharePerc","type":"uint256"}],"name":"withdrawFromPool","outputs":[{"internalType":"uint256","name":"USDTAmt","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sharePerc","type":"uint256"}],"name":"withdrawPerc","outputs":[{"internalType":"uint256","name":"USDTAmt","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506134fe806100206000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c8063a8602fea11610104578063d8274d0a116100a2578063f2fde38b11610071578063f2fde38b146103e5578063f851a440146103f8578063f887ea401461040b578063fbfa77cf1461041e57600080fd5b8063d8274d0a14610397578063db2e21bc146103b7578063ed47d909146103bf578063ef1b3166146103d257600080fd5b8063bd244af4116100de578063bd244af414610353578063c54e44eb14610369578063c89d5b8b1461037c578063d48bfca71461038457600080fd5b8063a8602fea14610319578063aae092361461032c578063b47c6a271461033457600080fd5b80634626402b1161017c578063704b6c021161014b578063704b6c02146102d2578063715018a6146102e557806373b295c2146102ed5780638da5cb5b1461030857600080fd5b80634626402b146102835780634631b246146102965780634f64b2be146102ac5780636817031b146102bf57600080fd5b806330703f32116101b857806330703f3214610237578063358764761461024a57806336c5d7241461025d5780633acf36541461027057600080fd5b80632630c12f146101df57806326b89b711461020f5780632b3c157b14610224575b600080fd5b606b546101f2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61022261021d366004612e48565b610431565b005b610222610232366004612f0a565b61059b565b6066546101f2906001600160a01b031681565b610222610258366004612f27565b610680565b61022261026b366004612fbd565b610a90565b6096546101f2906001600160a01b031681565b6068546101f2906001600160a01b031681565b61029e610c66565b60405161020692919061301a565b6101f26102ba366004612fbd565b610e06565b6102226102cd366004612f0a565b610e30565b6102226102e0366004612f0a565b610e9f565b610222610f09565b6101f273b31f66aa3c1e785363f0875a1b74e27b85fd66c781565b6033546001600160a01b03166101f2565b610222610327366004612f0a565b610f1d565b61029e610f7f565b61033c610fec565b6040805192835260ff909116602083015201610206565b61035b611076565b604051908152602001610206565b6067546101f2906001600160a01b031681565b61035b6110d3565b610222610392366004612f0a565b611220565b61035b6103a5366004612f0a565b606d6020526000908152604090205481565b610222611404565b61035b6103cd366004612fbd565b61149c565b61035b6103e0366004613071565b611574565b6102226103f3366004612f0a565b611615565b6069546101f2906001600160a01b031681565b6065546101f2906001600160a01b031681565b606a546101f2906001600160a01b031681565b606a546001600160a01b031633146104645760405162461bcd60e51b815260040161045b90613093565b60405180910390fd5b8151606c54600090819067ffffffffffffffff81111561048657610486612d5d565b6040519080825280602002602001820160405280156104af578160200160208202803683370190505b50905060005b8381101561056c5760008582815181106104d1576104d16130b7565b6020026020010151905080846104e791906130e3565b93506000606d6000898581518110610501576105016130b7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205490508184828151811061053f5761053f6130b7565b6020026020010181815161055391906130e3565b9052508291506105649050816130fb565b9150506104b5565b50606a5460675461058b916001600160a01b039182169116308561168b565b610594816116fc565b5050505050565b6105a3611794565b609680546001600160a01b0319166001600160a01b038316908117909155604051636eb1769f60e11b8152306004820152602481019190915273b31f66aa3c1e785363f0875a1b74e27b85fd66c79063dd62ed3e9060440160206040518083038186803b15801561061357600080fd5b505afa158015610627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064b9190613116565b61067d5760965461067d9073b31f66aa3c1e785363f0875a1b74e27b85fd66c7906001600160a01b03166000196117ee565b50565b600054610100900460ff16158080156106a05750600054600160ff909116105b806106ba5750303b1580156106ba575060005460ff166001145b61071d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161045b565b6000805460ff191660011790558015610740576000805461ff0019166101001790555b6001600160a01b0385166107875760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103937baba32b960911b604482015260640161045b565b6001600160a01b0384166107dd5760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420535741505f424153455f544f4b454e000000000000000000604482015260640161045b565b6001600160a01b0383166108225760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a59081554d11560a21b604482015260640161045b565b6001600160a01b0382166108695760405162461bcd60e51b815260206004820152600e60248201526d0496e76616c696420746f6b656e360941b604482015260640161045b565b610871611912565b606880546001600160a01b03199081166001600160a01b038b8116919091179092556069805482168a8416179055606b805482168984161790556065805482168884161790556066805482168784161790556067805490911691851691821790556040805163313ce56760e01b8152905163313ce56791600481810192602092909190829003018186803b15801561090857600080fd5b505afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109409190613145565b6067805460ff60a01b1916600160a01b60ff93841681029190911791829055900416600611156109b25760405162461bcd60e51b815260206004820152601760248201527f5553445420646563696d616c73206d757374203e3d2036000000000000000000604482015260640161045b565b606c80546001810182556000919091527f2b4a51ab505fc96a0952efda2ba61bcd3078d4c02c39a186ec16f21883fbe0160180546001600160a01b0319166001600160a01b038416179055610a05611941565b606554606754610a24916001600160a01b0391821691166000196117ee565b606554610a40906001600160a01b0384811691166000196117ee565b8015610a86576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b610a98611794565b606c54808210610ad85760405162461bcd60e51b815260206004820152600b60248201526a125b9d985b1a59081c1a5960aa1b604482015260640161045b565b6000610ae383611a05565b90508015610b275760405162461bcd60e51b8152602060048201526011602482015270506f6f6c206973206e6f7420656d70747960781b604482015260640161045b565b6000606c8481548110610b3c57610b3c6130b7565b6000918252602090912001546001600160a01b03169050606c610b60600185613160565b81548110610b7057610b706130b7565b600091825260209091200154606c80546001600160a01b039092169186908110610b9c57610b9c6130b7565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606c805480610bdb57610bdb613177565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0383168252606d90526040812055610c1e611941565b604080516001600160a01b0383168152602081018690527f67f5552e5abc48ba6305130450943fa23b76a0b6eb18c29d3eea39559139fc5a910160405180910390a150505050565b6060806000610c73611a6f565b80519091506000805b82811015610cbd57838181518110610c9657610c966130b7565b602002602001015182610ca991906130e3565b915080610cb5816130fb565b915050610c7c565b5060008215610cd757610cd28361271061318d565b610cda565b60005b90508267ffffffffffffffff811115610cf557610cf5612d5d565b604051908082528060200260200182016040528015610d1e578160200160208202803683370190505b50945060005b83811015610d9a578215610d695782612710868381518110610d4857610d486130b7565b6020026020010151610d5a91906131af565b610d64919061318d565b610d6b565b815b868281518110610d7d57610d7d6130b7565b602090810291909101015280610d92816130fb565b915050610d24565b50606c8581805480602002602001604051908101604052809291908181526020018280548015610df357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610dd5575b5050505050915095509550505050509091565b606c8181548110610e1657600080fd5b6000918252602090912001546001600160a01b0316905081565b610e38611794565b606a546001600160a01b031615610e7d5760405162461bcd60e51b815260206004820152600960248201526815985d5b1d081cd95d60ba1b604482015260640161045b565b606a80546001600160a01b0319166001600160a01b0392909216919091179055565b610ea7611794565b606980546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f9f0ac88be9159761bacf6c9e7c294c397ebf594607f6b3f2f70e7e0841ea68e891015b60405180910390a15050565b610f11611794565b610f1b6000611b02565b565b610f25611794565b606880546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527febcecb9db04071cf4b4ecc1e2e1e4603e74c9382d6e36c3531f0b62af4c78ed79101610efd565b606080606c610f8c611a6f565b815460408051602080840282018101909252828152918491830182828015610fdd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fbf575b50505050509150915091509091565b606b5460675460405163b3596f0760e01b81526001600160a01b0391821660048201526000928392169063b3596f0790602401604080518083038186803b15801561103657600080fd5b505afa15801561104a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106e91906131ce565b915091509091565b600080611081611a6f565b80519091506000805b828110156110cb578381815181106110a4576110a46130b7565b6020026020010151826110b791906130e3565b9150806110c3816130fb565b91505061108a565b509392505050565b60008060006110e0610c66565b81519193509150600090815b8181101561120a576000858281518110611108576111086130b7565b6020026020010151905073b31f66aa3c1e785363f0875a1b74e27b85fd66c76001600160a01b0316816001600160a01b031614156111f757848281518110611152576111526130b7565b6020026020010151609660009054906101000a90046001600160a01b03166001600160a01b031663c89d5b8b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a857600080fd5b505afa1580156111bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e09190613116565b6111ea91906131af565b6111f490856130e3565b93505b5080611202816130fb565b9150506110ec565b506112176127108361318d565b94505050505090565b611228611794565b6001600160a01b0381166000908152606d60205260409020548015801561127a5750606c60008154811061125e5761125e6130b7565b6000918252602090912001546001600160a01b03838116911614155b6112b65760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e481859191959609a1b604482015260640161045b565b606c80546001808201835560008390527f2b4a51ab505fc96a0952efda2ba61bcd3078d4c02c39a186ec16f21883fbe01690910180546001600160a01b0319166001600160a01b038616179055905461130f9190613160565b6001600160a01b038381166000818152606d6020526040908190208490556065549051636eb1769f60e11b81523060048201529216602483015291925063dd62ed3e9060440160206040518083038186803b15801561136d57600080fd5b505afa158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a59190613116565b6113c5576065546113c5906001600160a01b0384811691166000196117ee565b604080516001600160a01b0384168152602081018390527fe1bea1af9b1d1aede8b7fa043080de8690470a8ae61449360b3d0c0bf8104b469101610efd565b606a546001600160a01b0316331461142e5760405162461bcd60e51b815260040161045b90613093565b6000611441670de0b6b3a7640000611b54565b9050801561146657606a54606754611466916001600160a01b03918216911683611b93565b6040518181527f99d7f8b71cfb9126984f7a5eed3a40e64a8959e9b0e442221546fb04ec6a489c9060200160405180910390a150565b606a546000906001600160a01b031633146114c95760405162461bcd60e51b815260040161045b90613093565b670de0b6b3a764000082111561150d5760405162461bcd60e51b81526020600482015260096024820152684f766572203130302560b81b604482015260640161045b565b61151682611b54565b606a54606754919250611536916001600160a01b03908116911683611b93565b60408051838152602081018390527f56ca301a9219608c91e7bcee90e083c19671d2cdcc96752c7af291cee5f9c8c8910160405180910390a1919050565b606a546000906001600160a01b031633146115a15760405162461bcd60e51b815260040161045b90613093565b670de0b6b3a76400008211156115e55760405162461bcd60e51b81526020600482015260096024820152684f766572203130302560b81b604482015260640161045b565b6115ef8383611bc3565b606a5460675491925061160f916001600160a01b03908116911683611b93565b92915050565b61161d611794565b6001600160a01b0381166116825760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161045b565b61067d81611b02565b6040516001600160a01b03808516602483015283166044820152606481018290526116f69085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c30565b50505050565b61170581611d02565b805160005b8181101561178f576000606c8281548110611727576117276130b7565b6000918252602090912001546001600160a01b0316905073b31f66aa3c1e785363f0875a1b74e27b85fd66c781141561177c5761177c84838151811061176f5761176f6130b7565b6020026020010151611f65565b5080611787816130fb565b91505061170a565b505050565b6033546001600160a01b03163314610f1b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045b565b8015806118775750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561183d57600080fd5b505afa158015611851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118759190613116565b155b6118e25760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161045b565b6040516001600160a01b03831660248201526044810182905261178f90849063095ea7b360e01b906064016116bf565b600054610100900460ff166119395760405162461bcd60e51b815260040161045b906131fa565b610f1b61208b565b6000606c80548060200260200160405190810160405280929190818152602001828054801561199957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161197b575b505083519394506000925050505b8181101561178f5780606d60008584815181106119c6576119c66130b7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080806119fd906130fb565b9150506119a7565b600080606c8381548110611a1b57611a1b6130b7565b6000918252602090912001546001600160a01b0316905073b31f66aa3c1e785363f0875a1b74e27b85fd66c7811415611a5d57611a566120bb565b9150611a69565b611a6683612267565b91505b50919050565b606c546060908067ffffffffffffffff811115611a8e57611a8e612d5d565b604051908082528060200260200182016040528015611ab7578160200160208202803683370190505b50915060005b81811015611afd57611ace81611a05565b838281518110611ae057611ae06130b7565b602090810291909101015280611af5816130fb565b915050611abd565b505090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606c54600090815b81811015611b8c57611b6e8185611bc3565b611b7890846130e3565b925080611b84816130fb565b915050611b5c565b5050919050565b6040516001600160a01b03831660248201526044810182905261178f90849063a9059cbb60e01b906064016116bf565b600080606c8481548110611bd957611bd96130b7565b6000918252602090912001546001600160a01b0316905073b31f66aa3c1e785363f0875a1b74e27b85fd66c7811415611c1c57611c158361243e565b9150611c29565b611c26848461262c565b91505b5092915050565b6000611c85826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127239092919063ffffffff16565b80519091501561178f5780806020019051810190611ca39190613245565b61178f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161045b565b805160005b8181101561178f576000606c8281548110611d2457611d246130b7565b6000918252602090912001546067546001600160a01b03918216925016811415611d4e5750611f53565b6000848381518110611d6257611d626130b7565b60200260200101519050600080611d77610fec565b606b5460405163b3596f0760e01b81526001600160a01b038881166004830152939550919350600092839291169063b3596f0790602401604080518083038186803b158015611dc557600080fd5b505afa158015611dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd91906131ce565b915091506000866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3c57600080fd5b505afa158015611e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e749190613145565b90506000611e828284613267565b611e8d90600a613370565b611e9790876131af565b606754909150600090611eb490600160a01b900460ff1687613267565b611ebf90600a613370565b611ec990866131af565b90506000611ed88260646131af565b611ee2848b6131af565b611eed90605f6131af565b611ef7919061318d565b6066549091506001600160a01b038b811691161415611f2e57606754611f28906001600160a01b03168b8b8461273c565b50611f48565b606754611f46906001600160a01b03168b8b84612869565b505b505050505050505050505b80611f5d816130fb565b915050611d07565b6040516370a0823160e01b815230600482015260009073b31f66aa3c1e785363f0875a1b74e27b85fd66c7906370a082319060240160206040518083038186803b158015611fb257600080fd5b505afa158015611fc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fea9190613116565b905080156120875760965460405163b6b55f2560e01b8152600481018390526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b15801561203857600080fd5b505af115801561204c573d6000803e3d6000fd5b505060408051858152602081018590527fd7862f5d8dd515ad5e0f279ab2382ecb18537dff2d85d8e04aca497ea6cabbf89350019050610efd565b5050565b600054610100900460ff166120b25760405162461bcd60e51b815260040161045b906131fa565b610f1b33611b02565b6096546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b15801561210357600080fd5b505afa158015612117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213b9190613116565b9050801561225e57609660009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561219157600080fd5b505afa1580156121a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121c99190613116565b60965460408051632f4912bd60e21b8152905184926001600160a01b03169163bd244af4916004808301926020929190829003018186803b15801561220d57600080fd5b505afa158015612221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122459190613116565b61224f91906131af565b612259919061318d565b612261565b60005b91505090565b600080606c838154811061227d5761227d6130b7565b60009182526020822001546040516370a0823160e01b81523060048201526001600160a01b03909116925082906370a082319060240160206040518083038186803b1580156122cb57600080fd5b505afa1580156122df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123039190613116565b90508015611b8c57606b5460405163b3596f0760e01b81526001600160a01b038481166004830152600092839291169063b3596f0790602401604080518083038186803b15801561235357600080fd5b505afa158015612367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238b91906131ce565b915091506000846001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156123ca57600080fd5b505afa1580156123de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124029190613145565b905061240f82600a613370565b8361241f868460ff1660126129b5565b61242991906131af565b612433919061318d565b979650505050505050565b6096546040516370a0823160e01b81523060048201526000918291670de0b6b3a76400009185916001600160a01b03909116906370a082319060240160206040518083038186803b15801561249257600080fd5b505afa1580156124a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ca9190613116565b6124d491906131af565b6124de919061318d565b90508015611a6957609654604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561252c57600080fd5b505af1158015612540573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526000925073b31f66aa3c1e785363f0875a1b74e27b85fd66c791506370a082319060240160206040518083038186803b15801561259157600080fd5b505afa1580156125a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c99190613116565b90506125e973b31f66aa3c1e785363f0875a1b74e27b85fd66c782612a13565b60408051838152602081018390529194507ffe4be6880aac6b75b6c8bf553a9157fa365e629815171f9a0a95e9401bc57ddc910160405180910390a15050919050565b600080606c8481548110612642576126426130b7565b60009182526020822001546040516370a0823160e01b81523060048201526001600160a01b039091169250670de0b6b3a764000090859084906370a082319060240160206040518083038186803b15801561269c57600080fd5b505afa1580156126b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d49190613116565b6126de91906131af565b6126e8919061318d565b9050801561271b576067546001600160a01b038381169116141561270e5780925061271b565b6127188282612a13565b92505b505092915050565b60606127328484600085612c03565b90505b9392505050565b604080516002808252606082018352600092839291906020830190803683370190505090508581600081518110612775576127756130b7565b60200260200101906001600160a01b031690816001600160a01b03168152505084816001815181106127a9576127a96130b7565b6001600160a01b0392831660209182029290920101526065546040516338ed173960e01b81529116906338ed1739906127ee908790879086903090429060040161337f565b600060405180830381600087803b15801561280857600080fd5b505af115801561281c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261284491908101906133bb565b600181518110612856576128566130b7565b6020026020010151915050949350505050565b604080516003808252608082019092526000918291906020820160608036833701905050905085816000815181106128a3576128a36130b7565b6001600160a01b0392831660209182029290920101526066548251911690829060019081106128d4576128d46130b7565b60200260200101906001600160a01b031690816001600160a01b0316815250508481600281518110612908576129086130b7565b6001600160a01b0392831660209182029290920101526065546040516338ed173960e01b81529116906338ed17399061294d908790879086903090429060040161337f565b600060405180830381600087803b15801561296757600080fd5b505af115801561297b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526129a391908101906133bb565b600281518110612856576128566130b7565b6000818314156129c6575082612735565b818310156129f4576129d88383613160565b6129e390600a613441565b6129ed90856131af565b9050612735565b6129fe8284613160565b612a0990600a613441565b6129ed908561318d565b6000806000612a20610fec565b606b5460405163b3596f0760e01b81526001600160a01b038981166004830152939550919350600092839291169063b3596f0790602401604080518083038186803b158015612a6e57600080fd5b505afa158015612a82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa691906131ce565b915091506000876001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612ae557600080fd5b505afa158015612af9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b1d9190613145565b606754909150600090612b3a90600160a01b900460ff1686613267565b612b4590600a613370565b612b4f90856131af565b90506000612b5d8385613267565b612b6890600a613370565b612b7290886131af565b90506000612b818260646131af565b612b8b848c6131af565b612b9690605f6131af565b612ba0919061318d565b6066549091506001600160a01b038c811691161415612bd957606754612bd2908c906001600160a01b03168c8461273c565b9850612bf5565b606754612bf2908c906001600160a01b03168c84612869565b98505b505050505050505092915050565b606082471015612c645760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161045b565b6001600160a01b0385163b612cbb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161045b565b600080866001600160a01b03168587604051612cd79190613479565b60006040518083038185875af1925050503d8060008114612d14576040519150601f19603f3d011682016040523d82523d6000602084013e612d19565b606091505b509150915061243382828660608315612d33575081612735565b825115612d435782518084602001fd5b8160405162461bcd60e51b815260040161045b9190613495565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612d9c57612d9c612d5d565b604052919050565b600067ffffffffffffffff821115612dbe57612dbe612d5d565b5060051b60200190565b6001600160a01b038116811461067d57600080fd5b600082601f830112612dee57600080fd5b81356020612e03612dfe83612da4565b612d73565b82815260059290921b84018101918181019086841115612e2257600080fd5b8286015b84811015612e3d5780358352918301918301612e26565b509695505050505050565b60008060408385031215612e5b57600080fd5b823567ffffffffffffffff80821115612e7357600080fd5b818501915085601f830112612e8757600080fd5b81356020612e97612dfe83612da4565b82815260059290921b84018101918181019089841115612eb657600080fd5b948201945b83861015612edd578535612ece81612dc8565b82529482019490820190612ebb565b96505086013592505080821115612ef357600080fd5b50612f0085828601612ddd565b9150509250929050565b600060208284031215612f1c57600080fd5b813561273581612dc8565b600080600080600080600060e0888a031215612f4257600080fd5b8735612f4d81612dc8565b96506020880135612f5d81612dc8565b95506040880135612f6d81612dc8565b94506060880135612f7d81612dc8565b93506080880135612f8d81612dc8565b925060a0880135612f9d81612dc8565b915060c0880135612fad81612dc8565b8091505092959891949750929550565b600060208284031215612fcf57600080fd5b5035919050565b600081518084526020808501945080840160005b8381101561300f5781516001600160a01b031687529582019590820190600101612fea565b509495945050505050565b60408152600061302d6040830185612fd6565b82810360208481019190915284518083528582019282019060005b8181101561306457845183529383019391830191600101613048565b5090979650505050505050565b6000806040838503121561308457600080fd5b50508035926020909101359150565b6020808252600a908201526913db9b1e481d985d5b1d60b21b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156130f6576130f66130cd565b500190565b600060001982141561310f5761310f6130cd565b5060010190565b60006020828403121561312857600080fd5b5051919050565b805160ff8116811461314057600080fd5b919050565b60006020828403121561315757600080fd5b6127358261312f565b600082821015613172576131726130cd565b500390565b634e487b7160e01b600052603160045260246000fd5b6000826131aa57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156131c9576131c96130cd565b500290565b600080604083850312156131e157600080fd5b825191506131f16020840161312f565b90509250929050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020828403121561325757600080fd5b8151801515811461273557600080fd5b600060ff821660ff84168060ff03821115613284576132846130cd565b019392505050565b600181815b808511156132c75781600019048211156132ad576132ad6130cd565b808516156132ba57918102915b93841c9390800290613291565b509250929050565b6000826132de5750600161160f565b816132eb5750600061160f565b8160018114613301576002811461330b57613327565b600191505061160f565b60ff84111561331c5761331c6130cd565b50506001821b61160f565b5060208310610133831016604e8410600b841016171561334a575081810a61160f565b613354838361328c565b8060001904821115613368576133686130cd565b029392505050565b600061273560ff8416836132cf565b85815284602082015260a06040820152600061339e60a0830186612fd6565b6001600160a01b0394909416606083015250608001529392505050565b600060208083850312156133ce57600080fd5b825167ffffffffffffffff8111156133e557600080fd5b8301601f810185136133f657600080fd5b8051613404612dfe82612da4565b81815260059190911b8201830190838101908783111561342357600080fd5b928401925b8284101561243357835182529284019290840190613428565b600061273583836132cf565b60005b83811015613468578181015183820152602001613450565b838111156116f65750506000910152565b6000825161348b81846020870161344d565b9190910192915050565b60208152600082518060208401526134b481604085016020870161344d565b601f01601f1916919091016040019291505056fea2646970667358221220d8e9d2611f8a3b353821d9d0480a62efe52fe0d84f256805364f27f377013d3d64736f6c63430008090033

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