ETH Price: $2,445.44 (+1.83%)

Contract

0x178Bf8fD04b47D2De3eF3f6b3D112106375ad584
 
Transaction Hash
Method
Block
From
To
Approve176626162023-07-10 10:17:35459 days ago1688984255IN
unagii.com: Old uUSDT Token
0 ETH0.0003385913.93963909
Approve174341342023-06-08 7:33:23492 days ago1686209603IN
unagii.com: Old uUSDT Token
0 ETH0.000464919.13956718
Withdraw159323422022-11-09 12:02:23702 days ago1667995343IN
unagii.com: Old uUSDT Token
0 ETH0.0044302728
Withdraw156139432022-09-26 0:23:11747 days ago1664151791IN
unagii.com: Old uUSDT Token
0 ETH0.000939576
Withdraw148413242022-05-25 10:17:40870 days ago1653473860IN
unagii.com: Old uUSDT Token
0 ETH0.0025319616
Withdraw145900752022-04-15 12:59:23910 days ago1650027563IN
unagii.com: Old uUSDT Token
0 ETH0.0066415142.41203462
Withdraw142950142022-02-28 13:51:46956 days ago1646056306IN
unagii.com: Old uUSDT Token
0 ETH0.0059077741
Withdraw142095712022-02-15 8:11:51970 days ago1644912711IN
unagii.com: Old uUSDT Token
0 ETH0.0064773941.36401714
Withdraw142023342022-02-14 5:24:10971 days ago1644816250IN
unagii.com: Old uUSDT Token
0 ETH0.00410725.95690371
Withdraw141680902022-02-08 22:23:58976 days ago1644359038IN
unagii.com: Old uUSDT Token
0 ETH0.0121508177.59391925
Withdraw139253982022-01-02 10:13:211013 days ago1641118401IN
unagii.com: Old uUSDT Token
0 ETH0.0066624747.76140876
Withdraw138023652021-12-14 9:02:461033 days ago1639472566IN
unagii.com: Old uUSDT Token
0 ETH0.0081651457.85794187
Withdraw138023032021-12-14 8:48:131033 days ago1639471693IN
unagii.com: Old uUSDT Token
0 ETH0.0063617545.0791943
Approve137959532021-12-13 9:16:521034 days ago1639387012IN
unagii.com: Old uUSDT Token
0 ETH0.0018843240.45880742
Approve137753912021-12-10 5:04:491037 days ago1639112689IN
unagii.com: Old uUSDT Token
0 ETH0.0031204567
Withdraw134788732021-10-24 7:35:101084 days ago1635060910IN
unagii.com: Old uUSDT Token
0 ETH0.0089292164
Withdraw134517902021-10-20 1:52:131088 days ago1634694733IN
unagii.com: Old uUSDT Token
0 ETH0.0097821162.46761666
Approve134409092021-10-18 9:05:151090 days ago1634547915IN
unagii.com: Old uUSDT Token
0 ETH0.003213669
Approve134366182021-10-17 16:56:521090 days ago1634489812IN
unagii.com: Old uUSDT Token
0 ETH0.003352271.97578431
Approve134326262021-10-17 1:49:031091 days ago1634435343IN
unagii.com: Old uUSDT Token
0 ETH0.0027292758.60074463
Withdraw134326192021-10-17 1:47:381091 days ago1634435258IN
unagii.com: Old uUSDT Token
0 ETH0.0084195453.76638549
Approve134288982021-10-16 11:57:231091 days ago1634385443IN
unagii.com: Old uUSDT Token
0 ETH0.0032983970.82046426
Withdraw134286582021-10-16 11:07:311091 days ago1634382451IN
unagii.com: Old uUSDT Token
0 ETH0.0084561354
Approve134026632021-10-12 8:51:581096 days ago1634028718IN
unagii.com: Old uUSDT Token
0 ETH0.0038242982.11218816
Approve134023312021-10-12 7:31:491096 days ago1634023909IN
unagii.com: Old uUSDT Token
0 ETH0.0031651567.9597257
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vault

Compiler Version
v0.6.11+commit.5ef660b1

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Audited
File 1 of 11 : Vault.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.6.11;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "./protocol/IStrategy.sol";
import "./protocol/IVault.sol";
import "./protocol/IController.sol";

contract Vault is IVault, ERC20, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using SafeMath for uint;

    event SetStrategy(address strategy);
    event ApproveStrategy(address strategy);
    event RevokeStrategy(address strategy);
    event SetWhitelist(address addr, bool approved);

    address public override admin;
    address public override controller;
    address public override timeLock;
    address public immutable override token;
    address public override strategy;

    // mapping of approved strategies
    mapping(address => bool) public override strategies;

    // percentange of token reserved in vault for cheap withdraw
    uint public override reserveMin = 500;
    uint private constant RESERVE_MAX = 10000;

    // Denominator used to calculate fees
    uint private constant FEE_MAX = 10000;

    uint public override withdrawFee;
    uint private constant WITHDRAW_FEE_CAP = 500; // upper limit to withdrawFee

    bool public override paused;

    // whitelisted addresses
    // used to prevent flash loah attacks
    mapping(address => bool) public override whitelist;

    /*
    @dev vault decimals must be equal to token decimals
    */
    constructor(
        address _controller,
        address _timeLock,
        address _token
    )
        public
        ERC20(
            string(abi.encodePacked("unagii_", ERC20(_token).name())),
            string(abi.encodePacked("u", ERC20(_token).symbol()))
        )
    {
        require(_controller != address(0), "controller = zero address");
        require(_timeLock != address(0), "time lock = zero address");

        _setupDecimals(ERC20(_token).decimals());

        admin = msg.sender;
        controller = _controller;
        token = _token;
        timeLock = _timeLock;
    }

    modifier onlyAdmin() {
        require(msg.sender == admin, "!admin");
        _;
    }

    modifier onlyTimeLock() {
        require(msg.sender == timeLock, "!time lock");
        _;
    }

    modifier onlyAdminOrController() {
        require(msg.sender == admin || msg.sender == controller, "!authorized");
        _;
    }

    modifier whenStrategyDefined() {
        require(strategy != address(0), "strategy = zero address");
        _;
    }

    modifier whenNotPaused() {
        require(!paused, "paused");
        _;
    }

    /*
    @dev modifier to prevent flash loan
    @dev caller is restricted to EOA or whitelisted contract
    @dev Warning: Users can have their funds stuck if shares is transferred to a contract
    */
    modifier guard() {
        require((msg.sender == tx.origin) || whitelist[msg.sender], "!whitelist");
        _;
    }

    function setAdmin(address _admin) external override onlyAdmin {
        require(_admin != address(0), "admin = zero address");
        admin = _admin;
    }

    function setController(address _controller) external override onlyAdmin {
        require(_controller != address(0), "controller = zero address");
        controller = _controller;
    }

    function setTimeLock(address _timeLock) external override onlyTimeLock {
        require(_timeLock != address(0), "time lock = zero address");
        timeLock = _timeLock;
    }

    function setPause(bool _paused) external override onlyAdmin {
        paused = _paused;
    }

    function setWhitelist(address _addr, bool _approve) external override onlyAdmin {
        whitelist[_addr] = _approve;
        emit SetWhitelist(_addr, _approve);
    }

    function setReserveMin(uint _reserveMin) external override onlyAdmin {
        require(_reserveMin <= RESERVE_MAX, "reserve min > max");
        reserveMin = _reserveMin;
    }

    function setWithdrawFee(uint _fee) external override onlyAdmin {
        require(_fee <= WITHDRAW_FEE_CAP, "withdraw fee > cap");
        withdrawFee = _fee;
    }

    function _balanceInVault() private view returns (uint) {
        return IERC20(token).balanceOf(address(this));
    }

    /*
    @notice Returns balance of tokens in vault
    @return Amount of token in vault
    */
    function balanceInVault() external view override returns (uint) {
        return _balanceInVault();
    }

    function _balanceInStrategy() private view returns (uint) {
        if (strategy == address(0)) {
            return 0;
        }

        return IStrategy(strategy).totalAssets();
    }

    /*
    @notice Returns the estimate amount of token in strategy
    @dev Output may vary depending on price of liquidity provider token
         where the underlying token is invested
    */
    function balanceInStrategy() external view override returns (uint) {
        return _balanceInStrategy();
    }

    function _totalDebtInStrategy() private view returns (uint) {
        if (strategy == address(0)) {
            return 0;
        }
        return IStrategy(strategy).totalDebt();
    }

    /*
    @notice Returns amount of tokens invested strategy
    */
    function totalDebtInStrategy() external view override returns (uint) {
        return _totalDebtInStrategy();
    }

    function _totalAssets() private view returns (uint) {
        return _balanceInVault().add(_totalDebtInStrategy());
    }

    /*
    @notice Returns the total amount of tokens in vault + total debt
    @return Total amount of tokens in vault + total debt
    */
    function totalAssets() external view override returns (uint) {
        return _totalAssets();
    }

    function _minReserve() private view returns (uint) {
        return _totalAssets().mul(reserveMin) / RESERVE_MAX;
    }

    /*
    @notice Returns minimum amount of tokens that should be kept in vault for
            cheap withdraw
    @return Reserve amount
    */
    function minReserve() external view override returns (uint) {
        return _minReserve();
    }

    function _availableToInvest() private view returns (uint) {
        if (strategy == address(0)) {
            return 0;
        }

        uint balInVault = _balanceInVault();
        uint reserve = _minReserve();

        if (balInVault <= reserve) {
            return 0;
        }

        return balInVault - reserve;
    }

    /*
    @notice Returns amount of token available to be invested into strategy
    @return Amount of token available to be invested into strategy
    */
    function availableToInvest() external view override returns (uint) {
        return _availableToInvest();
    }

    /*
    @notice Approve strategy
    @param _strategy Address of strategy to revoke
    */
    function approveStrategy(address _strategy) external override onlyTimeLock {
        require(_strategy != address(0), "strategy = zero address");
        strategies[_strategy] = true;

        emit ApproveStrategy(_strategy);
    }

    /*
    @notice Revoke strategy
    @param _strategy Address of strategy to revoke
    */
    function revokeStrategy(address _strategy) external override onlyAdmin {
        require(_strategy != address(0), "strategy = zero address");
        strategies[_strategy] = false;

        emit RevokeStrategy(_strategy);
    }

    /*
    @notice Set strategy to approved strategy
    @param _strategy Address of strategy used
    @param _min Minimum undelying token current strategy must return. Prevents slippage
    */
    function setStrategy(address _strategy, uint _min)
        external
        override
        onlyAdminOrController
    {
        require(strategies[_strategy], "!approved");
        require(_strategy != strategy, "new strategy = current strategy");
        require(
            IStrategy(_strategy).underlying() == token,
            "strategy.token != vault.token"
        );
        require(
            IStrategy(_strategy).vault() == address(this),
            "strategy.vault != vault"
        );

        // withdraw from current strategy
        if (strategy != address(0)) {
            IERC20(token).safeApprove(strategy, 0);

            uint balBefore = _balanceInVault();
            IStrategy(strategy).exit();
            uint balAfter = _balanceInVault();

            require(balAfter.sub(balBefore) >= _min, "withdraw < min");
        }

        strategy = _strategy;

        emit SetStrategy(strategy);
    }

    /*
    @notice Invest token from vault into strategy.
            Some token are kept in vault for cheap withdraw.
    */
    function invest()
        external
        override
        whenStrategyDefined
        whenNotPaused
        onlyAdminOrController
    {
        uint amount = _availableToInvest();
        require(amount > 0, "available = 0");

        IERC20(token).safeApprove(strategy, 0);
        IERC20(token).safeApprove(strategy, amount);

        IStrategy(strategy).deposit(amount);

        IERC20(token).safeApprove(strategy, 0);
    }

    /*
    @notice Deposit token into vault
    @param _amount Amount of token to transfer from `msg.sender`
    */
    function deposit(uint _amount) external override whenNotPaused nonReentrant guard {
        require(_amount > 0, "amount = 0");

        uint totalUnderlying = _totalAssets();
        uint totalShares = totalSupply();

        /*
        s = shares to mint
        T = total shares before mint
        d = deposit amount
        A = total assets in vault + strategy before deposit

        s / (T + s) = d / (A + d)
        s = d / A * T
        */
        uint shares;
        if (totalShares == 0) {
            shares = _amount;
        } else {
            shares = _amount.mul(totalShares).div(totalUnderlying);
        }

        _mint(msg.sender, shares);
        IERC20(token).safeTransferFrom(msg.sender, address(this), _amount);
    }

    function _getExpectedReturn(
        uint _shares,
        uint _balInVault,
        uint _balInStrat
    ) private view returns (uint) {
        /*
        s = shares
        T = total supply of shares
        w = amount of underlying token to withdraw
        U = total amount of redeemable underlying token in vault + strategy

        s / T = w / U
        w = s / T * U
        */

        /*
        total underlying = bal in vault + min(total debt, bal in strat)
        if bal in strat > total debt, redeemable = total debt
        else redeemable = bal in strat
        */
        uint totalDebt = _totalDebtInStrategy();
        uint totalUnderlying;
        if (_balInStrat > totalDebt) {
            totalUnderlying = _balInVault.add(totalDebt);
        } else {
            totalUnderlying = _balInVault.add(_balInStrat);
        }

        uint totalShares = totalSupply();
        if (totalShares > 0) {
            return _shares.mul(totalUnderlying) / totalShares;
        }
        return 0;
    }

    /*
    @notice Calculate amount of underlying token that can be withdrawn
    @param _shares Amount of shares
    @return Amount of underlying token that can be withdrawn
    */
    function getExpectedReturn(uint _shares) external view override returns (uint) {
        uint balInVault = _balanceInVault();
        uint balInStrat = _balanceInStrategy();

        return _getExpectedReturn(_shares, balInVault, balInStrat);
    }

    /*
    @notice Withdraw underlying token
    @param _shares Amount of shares to burn
    @param _min Minimum amount of underlying token to return
    @dev Keep `guard` modifier, else attacker can deposit and then use smart
         contract to attack from withdraw
    */
    function withdraw(uint _shares, uint _min) external override nonReentrant guard {
        require(_shares > 0, "shares = 0");

        uint balInVault = _balanceInVault();
        uint balInStrat = _balanceInStrategy();
        uint withdrawAmount = _getExpectedReturn(_shares, balInVault, balInStrat);

        // Must burn after calculating withdraw amount
        _burn(msg.sender, _shares);

        if (balInVault < withdrawAmount) {
            // maximize withdraw amount from strategy
            uint amountFromStrat = withdrawAmount;
            if (balInStrat < withdrawAmount) {
                amountFromStrat = balInStrat;
            }

            IStrategy(strategy).withdraw(amountFromStrat);

            uint balAfter = _balanceInVault();
            uint diff = balAfter.sub(balInVault);

            if (diff < amountFromStrat) {
                // withdraw amount - withdraw amount from strat = amount to withdraw from vault
                // diff = actual amount returned from strategy
                // NOTE: withdrawAmount >= amountFromStrat
                withdrawAmount = (withdrawAmount - amountFromStrat).add(diff);
            }

            // transfer to treasury
            uint fee = withdrawAmount.mul(withdrawFee) / FEE_MAX;
            if (fee > 0) {
                address treasury = IController(controller).treasury();
                require(treasury != address(0), "treasury = zero address");

                withdrawAmount = withdrawAmount - fee;
                IERC20(token).safeTransfer(treasury, fee);
            }
        }

        require(withdrawAmount >= _min, "withdraw < min");

        IERC20(token).safeTransfer(msg.sender, withdrawAmount);
    }

    /*
    @notice Transfer token != underlying token in vault to admin
    @param _token Address of token to transfer
    @dev Must transfer token to admin
    @dev _token must not be equal to underlying token
    @dev Used to transfer token that was accidentally sent to this vault
    */
    function sweep(address _token) external override onlyAdmin {
        require(_token != token, "token = vault.token");
        IERC20(_token).safeTransfer(admin, IERC20(_token).balanceOf(address(this)));
    }
}

File 2 of 11 : IController.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.6.11;

interface IController {
    function ADMIN_ROLE() external view returns (bytes32);

    function HARVESTER_ROLE() external view returns (bytes32);

    function admin() external view returns (address);

    function treasury() external view returns (address);

    function setAdmin(address _admin) external;

    function setTreasury(address _treasury) external;

    function grantRole(bytes32 _role, address _addr) external;

    function revokeRole(bytes32 _role, address _addr) external;

    /*
    @notice Set strategy for vault
    @param _vault Address of vault
    @param _strategy Address of strategy
    @param _min Minimum undelying token current strategy must return. Prevents slippage
    */
    function setStrategy(
        address _vault,
        address _strategy,
        uint _min
    ) external;

    // calls to strategy
    /*
    @notice Invest token in vault into strategy
    @param _vault Address of vault
    */
    function invest(address _vault) external;

    function harvest(address _strategy) external;

    function skim(address _strategy) external;

    /*
    @notice Withdraw from strategy to vault
    @param _strategy Address of strategy
    @param _amount Amount of underlying token to withdraw
    @param _min Minimum amount of underlying token to withdraw
    */
    function withdraw(
        address _strategy,
        uint _amount,
        uint _min
    ) external;

    /*
    @notice Withdraw all from strategy to vault
    @param _strategy Address of strategy
    @param _min Minimum amount of underlying token to withdraw
    */
    function withdrawAll(address _strategy, uint _min) external;

    /*
    @notice Exit from strategy
    @param _strategy Address of strategy
    @param _min Minimum amount of underlying token to withdraw
    */
    function exit(address _strategy, uint _min) external;
}

File 3 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when 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.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

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

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

        return c;
    }

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

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

File 4 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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].
 */
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 () internal {
        _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 5 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    using Address for address;

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

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

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

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

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

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

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

File 6 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 7 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

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

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view 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 {_setupDecimals} is
     * called.
     *
     * 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 returns (uint8) {
        return _decimals;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view 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);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        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].add(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) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

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

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

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

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

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

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

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

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

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

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

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

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

File 8 of 11 : IStrategy.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.6.11;

interface IStrategy {
    function admin() external view returns (address);

    function controller() external view returns (address);

    function vault() external view returns (address);

    /*
    @notice Returns address of underlying token
    */
    function underlying() external view returns (address);

    /*
    @notice Returns total amount of underlying transferred from vault
    */
    function totalDebt() external view returns (uint);

    function performanceFee() external view returns (uint);

    /*
    @notice Returns true if token cannot be swept
    */
    function assets(address _token) external view returns (bool);

    function setAdmin(address _admin) external;

    function setController(address _controller) external;

    function setPerformanceFee(uint _fee) external;

    /*
    @notice Returns amount of underlying stable coin locked in this contract
    @dev Output may vary depending on price of liquidity provider token
         where the underlying token is invested
    */
    function totalAssets() external view returns (uint);

    /*
    @notice Deposit `amount` underlying token for yield token
    @param amount Amount of underlying token to deposit
    */
    function deposit(uint _amount) external;

    /*
    @notice Withdraw `amount` yield token to withdraw
    @param amount Amount of yield token to withdraw
    */
    function withdraw(uint _amount) external;

    /*
    @notice Withdraw all underlying token from strategy
    */
    function withdrawAll() external;

    function harvest() external;

    /*
    @notice Exit from strategy
    @dev Must transfer all underlying tokens back to vault
    */
    function exit() external;

    /*
    @notice Transfer profit over total debt to vault
    */
    function skim() external;

    /*
    @notice Transfer token in strategy to admin
    @param _token Address of token to transfer
    @dev Must transfer token to admin
    @dev _token must not be equal to underlying token
    @dev Used to transfer token that was accidentally sent or
         claim dust created from this strategy
    */
    function sweep(address _token) external;
}

File 9 of 11 : IVault.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.6.11;

interface IVault {
    function admin() external view returns (address);

    function controller() external view returns (address);

    function timeLock() external view returns (address);

    function token() external view returns (address);

    function strategy() external view returns (address);

    function strategies(address _strategy) external view returns (bool);

    function reserveMin() external view returns (uint);

    function withdrawFee() external view returns (uint);

    function paused() external view returns (bool);

    function whitelist(address _addr) external view returns (bool);

    function setWhitelist(address _addr, bool _approve) external;

    function setAdmin(address _admin) external;

    function setController(address _controller) external;

    function setTimeLock(address _timeLock) external;

    function setPause(bool _paused) external;

    function setReserveMin(uint _reserveMin) external;

    function setWithdrawFee(uint _fee) external;

    /*
    @notice Returns the amount of token in the vault
    */
    function balanceInVault() external view returns (uint);

    /*
    @notice Returns the estimate amount of token in strategy
    @dev Output may vary depending on price of liquidity provider token
         where the underlying token is invested
    */
    function balanceInStrategy() external view returns (uint);

    /*
    @notice Returns amount of tokens invested strategy
    */
    function totalDebtInStrategy() external view returns (uint);

    /*
    @notice Returns the total amount of token in vault + total debt
    */
    function totalAssets() external view returns (uint);

    /*
    @notice Returns minimum amount of tokens that should be kept in vault for
            cheap withdraw
    @return Reserve amount
    */
    function minReserve() external view returns (uint);

    /*
    @notice Returns the amount of tokens available to be invested
    */
    function availableToInvest() external view returns (uint);

    /*
    @notice Approve strategy
    @param _strategy Address of strategy
    */
    function approveStrategy(address _strategy) external;

    /*
    @notice Revoke strategy
    @param _strategy Address of strategy
    */
    function revokeStrategy(address _strategy) external;

    /*
    @notice Set strategy
    @param _min Minimum undelying token current strategy must return. Prevents slippage
    */
    function setStrategy(address _strategy, uint _min) external;

    /*
    @notice Transfers token in vault to strategy
    */
    function invest() external;

    /*
    @notice Deposit undelying token into this vault
    @param _amount Amount of token to deposit
    */
    function deposit(uint _amount) external;

    /*
    @notice Calculate amount of token that can be withdrawn
    @param _shares Amount of shares
    @return Amount of token that can be withdrawn
    */
    function getExpectedReturn(uint _shares) external view returns (uint);

    /*
    @notice Withdraw token
    @param _shares Amount of shares to burn
    @param _min Minimum amount of token expected to return
    */
    function withdraw(uint _shares, uint _min) external;

    /*
    @notice Transfer token in vault to admin
    @param _token Address of token to transfer
    @dev _token must not be equal to vault token
    */
    function sweep(address _token) external;
}

File 10 of 11 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @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 in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

pragma solidity ^0.6.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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_controller","type":"address"},{"internalType":"address","name":"_timeLock","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategy","type":"address"}],"name":"ApproveStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategy","type":"address"}],"name":"RevokeStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategy","type":"address"}],"name":"SetStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"SetWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"approveStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableToInvest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceInStrategy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceInVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"getExpectedReturn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"invest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserveMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"revokeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reserveMin","type":"uint256"}],"name":"setReserveMin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"},{"internalType":"uint256","name":"_min","type":"uint256"}],"name":"setStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_timeLock","type":"address"}],"name":"setTimeLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"bool","name":"_approve","type":"bool"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setWithdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"strategies","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"strategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeLock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDebtInStrategy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"},{"internalType":"uint256","name":"_min","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a06040526101f4600c553480156200001757600080fd5b506040516200349e3803806200349e833981810160405260608110156200003d57600080fd5b508051602082015160409283015183516306fdde0360e01b815293519293919290916001600160a01b038316916306fdde0391600480820192600092909190829003018186803b1580156200009157600080fd5b505afa158015620000a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015620000d057600080fd5b8101908080516040519392919084640100000000821115620000f157600080fd5b9083019060208201858111156200010757600080fd5b82516401000000008111828201881017156200012257600080fd5b82525081516020918201929091019080838360005b838110156200015157818101518382015260200162000137565b50505050905090810190601f1680156200017f5780820380516001836020036101000a031916815260200191505b50604052505050604051602001808066756e616769695f60c81b81525060070182805190602001908083835b60208310620001cc5780518252601f199092019160209182019101620001ab565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052816001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156200023a57600080fd5b505afa1580156200024f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156200027957600080fd5b81019080805160405193929190846401000000008211156200029a57600080fd5b908301906020820185811115620002b057600080fd5b8251640100000000811182820188101715620002cb57600080fd5b82525081516020918201929091019080838360005b83811015620002fa578181015183820152602001620002e0565b50505050905090810190601f168015620003285780820380516001836020036101000a031916815260200191505b506040525050506040516020018080607560f81b81525060010182805190602001908083835b602083106200036f5780518252601f1990920191602091820191016200034e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528160039080519060200190620003bb9291906200057f565b508051620003d19060049060208401906200057f565b50506005805460ff191660121790555060016006556001600160a01b03831662000442576040805162461bcd60e51b815260206004820152601960248201527f636f6e74726f6c6c6572203d207a65726f206164647265737300000000000000604482015290519081900360640190fd5b6001600160a01b0382166200049e576040805162461bcd60e51b815260206004820152601860248201527f74696d65206c6f636b203d207a65726f20616464726573730000000000000000604482015290519081900360640190fd5b62000519816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620004dc57600080fd5b505afa158015620004f1573d6000803e3d6000fd5b505050506040513d60208110156200050857600080fd5b50516001600160e01b036200056916565b60078054336001600160a01b0319918216179091556008805482166001600160a01b0395861617905560609190911b6001600160601b031916608052600980549091169190921617905562000624565b6005805460ff191660ff92909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620005c257805160ff1916838001178555620005f2565b82800160010185558215620005f2579182015b82811115620005f2578251825591602001919060010190620005d5565b506200060092915062000604565b5090565b6200062191905b808211156200060057600081556001016200060b565b90565b60805160601c612e2a620006746000398061078e5280610e635280610eea528061104352806112175280611ab55280611dd45280611e0f5280611ead5280611efe528061232f5250612e2a6000f3fe608060405234801561001057600080fd5b506004361061025e5760003560e01c80637373bc5a11610146578063b6ac642a116100c3578063dd62ed3e11610087578063dd62ed3e146106ee578063e8b5e51f1461071c578063e941fa7814610724578063f77c47911461072c578063f851a44014610734578063fc0c546a1461073c5761025e565b8063b6ac642a14610667578063b6b55f2514610684578063bb994d48146106a1578063bedb86fb146106c7578063d085835a146106e65761025e565b80639b19251a1161010a5780639b19251a146105bd5780639c8234b3146105e3578063a457c2d7146105eb578063a8c62e7614610617578063a9059cbb1461063b5761025e565b80637373bc5a14610544578063891682d21461054c57806392eefe9b1461057257806395d89b4114610598578063965c0f28146105a05761025e565b806339ebf823116101df578063596252fc116101a3578063596252fc146104c357806359c077d7146104cb5780635c975abb146104e85780636cb64d8f146104f0578063704b6c02146104f857806370a082311461051e5761025e565b806339ebf823146103fa5780633b8ae39714610420578063441a3e701461044657806345d34def1461046957806353d6fd59146104955761025e565b80631b4a2001116102265780631b4a20011461036a578063232870211461037257806323b872dd1461037a578063313ce567146103b057806339509351146103ce5761025e565b806301681a621461026357806301e1d1141461028b57806306fdde03146102a5578063095ea7b31461032257806318160ddd14610362575b600080fd5b6102896004803603602081101561027957600080fd5b50356001600160a01b0316610744565b005b6102936108a2565b60408051918252519081900360200190f35b6102ad6108b2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102e75781810151838201526020016102cf565b50505050905090810190601f1680156103145780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61034e6004803603604081101561033857600080fd5b506001600160a01b038135169060200135610948565b604080519115158252519081900360200190f35b610293610966565b61029361096c565b610293610976565b61034e6004803603606081101561039057600080fd5b506001600160a01b0381358116916020810135909116906040013561097c565b6103b8610a0a565b6040805160ff9092168252519081900360200190f35b61034e600480360360408110156103e457600080fd5b506001600160a01b038135169060200135610a13565b61034e6004803603602081101561041057600080fd5b50356001600160a01b0316610a67565b6102896004803603602081101561043657600080fd5b50356001600160a01b0316610a7c565b6102896004803603604081101561045c57600080fd5b5080359060200135610b78565b6102896004803603604081101561047f57600080fd5b506001600160a01b038135169060200135610f23565b610289600480360360408110156104ab57600080fd5b506001600160a01b0381351690602001351515611374565b610293611420565b610289600480360360208110156104e157600080fd5b503561142a565b61034e6114c2565b6102936114cb565b6102896004803603602081101561050e57600080fd5b50356001600160a01b03166114d5565b6102936004803603602081101561053457600080fd5b50356001600160a01b0316611591565b6102936115ac565b6102896004803603602081101561056257600080fd5b50356001600160a01b03166115b6565b6102896004803603602081101561058857600080fd5b50356001600160a01b031661167f565b6102ad611744565b610293600480360360208110156105b657600080fd5b50356117a5565b61034e600480360360208110156105d357600080fd5b50356001600160a01b03166117d1565b6102936117e6565b61034e6004803603604081101561060157600080fd5b506001600160a01b0381351690602001356117f0565b61061f61185e565b604080516001600160a01b039092168252519081900360200190f35b61034e6004803603604081101561065157600080fd5b506001600160a01b03813516906020013561186d565b6102896004803603602081101561067d57600080fd5b5035611881565b6102896004803603602081101561069a57600080fd5b503561191a565b610289600480360360208110156106b757600080fd5b50356001600160a01b0316611aee565b610289600480360360208110156106dd57600080fd5b50351515611be3565b61061f611c3e565b6102936004803603604081101561070457600080fd5b506001600160a01b0381358116916020013516611c4d565b610289611c78565b610293611ed8565b61061f611ede565b61061f611eed565b61061f611efc565b6007546001600160a01b0316331461078c576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03161415610809576040805162461bcd60e51b81526020600482015260136024820152723a37b5b2b7101e903b30bab63a173a37b5b2b760691b604482015290519081900360640190fd5b600754604080516370a0823160e01b8152306004820152905161089f926001600160a01b0390811692908516916370a0823191602480820192602092909190829003018186803b15801561085c57600080fd5b505afa158015610870573d6000803e3d6000fd5b505050506040513d602081101561088657600080fd5b50516001600160a01b038416919063ffffffff611f2016565b50565b60006108ac611f77565b90505b90565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561093e5780601f106109135761010080835404028352916020019161093e565b820191906000526020600020905b81548152906001019060200180831161092157829003601f168201915b5050505050905090565b600061095c610955611f98565b8484611f9c565b5060015b92915050565b60025490565b60006108ac612088565b600c5481565b60006109898484846120b4565b6109ff84610995611f98565b6109fa85604051806060016040528060288152602001612cde602891396001600160a01b038a166000908152600160205260408120906109d3611f98565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61221b16565b611f9c565b5060015b9392505050565b60055460ff1690565b600061095c610a20611f98565b846109fa8560016000610a31611f98565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6122b216565b600b6020526000908152604090205460ff1681565b6009546001600160a01b03163314610ac8576040805162461bcd60e51b815260206004820152600a6024820152692174696d65206c6f636b60b01b604482015290519081900360640190fd5b6001600160a01b038116610b1d576040805162461bcd60e51b81526020600482015260176024820152767374726174656779203d207a65726f206164647265737360481b604482015290519081900360640190fd5b6001600160a01b0381166000818152600b6020908152604091829020805460ff19166001179055815192835290517f4c6d0fbb89373829bc56000a87d561331bca06f725fd8861d055215ed90f209b9281900390910190a150565b60026006541415610bd0576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260065533321480610bf25750336000908152600f602052604090205460ff165b610c30576040805162461bcd60e51b815260206004820152600a602482015269085dda1a5d195b1a5cdd60b21b604482015290519081900360640190fd5b60008211610c72576040805162461bcd60e51b815260206004820152600a6024820152690736861726573203d20360b41b604482015290519081900360640190fd5b6000610c7c61230c565b90506000610c886123a7565b90506000610c97858484612410565b9050610ca33386612493565b80831015610e97578080831015610cb75750815b600a5460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b158015610d0457600080fd5b505af1158015610d18573d6000803e3d6000fd5b505050506000610d2661230c565b90506000610d3a828763ffffffff61259b16565b905082811015610d5957610d568385038263ffffffff6122b216565b93505b6000612710610d73600d54876125dd90919063ffffffff16565b81610d7a57fe5b0490508015610e9257600854604080516361d027b360e01b815290516000926001600160a01b0316916361d027b3916004808301926020929190829003018186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d6020811015610df257600080fd5b505190506001600160a01b038116610e51576040805162461bcd60e51b815260206004820152601760248201527f7472656173757279203d207a65726f2061646472657373000000000000000000604482015290519081900360640190fd5b9481900394610e906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016828463ffffffff611f2016565b505b505050505b83811015610edd576040805162461bcd60e51b815260206004820152600e60248201526d3bb4ba34323930bb901e1036b4b760911b604482015290519081900360640190fd5b610f176001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338363ffffffff611f2016565b50506001600655505050565b6007546001600160a01b0316331480610f4657506008546001600160a01b031633145b610f85576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600b602052604090205460ff16610fde576040805162461bcd60e51b815260206004820152600960248201526808585c1c1c9bdd995960ba1b604482015290519081900360640190fd5b600a546001600160a01b0383811691161415611041576040805162461bcd60e51b815260206004820152601f60248201527f6e6577207374726174656779203d2063757272656e7420737472617465677900604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156110a457600080fd5b505afa1580156110b8573d6000803e3d6000fd5b505050506040513d60208110156110ce57600080fd5b50516001600160a01b03161461112b576040805162461bcd60e51b815260206004820152601d60248201527f73747261746567792e746f6b656e20213d207661756c742e746f6b656e000000604482015290519081900360640190fd5b306001600160a01b0316826001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561116e57600080fd5b505afa158015611182573d6000803e3d6000fd5b505050506040513d602081101561119857600080fd5b50516001600160a01b0316146111f5576040805162461bcd60e51b815260206004820152601760248201527f73747261746567792e7661756c7420213d207661756c74000000000000000000604482015290519081900360640190fd5b600a546001600160a01b03161561131957600a54611241906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691166000612636565b600061124b61230c565b9050600a60009054906101000a90046001600160a01b03166001600160a01b031663e9fad8ee6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561129d57600080fd5b505af11580156112b1573d6000803e3d6000fd5b5050505060006112bf61230c565b9050826112d2828463ffffffff61259b16565b1015611316576040805162461bcd60e51b815260206004820152600e60248201526d3bb4ba34323930bb901e1036b4b760911b604482015290519081900360640190fd5b50505b600a80546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517f3412691e1ea2503d6eec15597247048016213c19646b73d4320a20c790b67ee2916020908290030190a15050565b6007546001600160a01b031633146113bc576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b0382166000818152600f6020908152604091829020805460ff191685151590811790915582519384529083015280517ff6019ec0a78d156d249a1ec7579e2321f6ac7521d6e1d2eacf90ba4a184dcceb9281900390910190a15050565b60006108ac61230c565b6007546001600160a01b03163314611472576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6127108111156114bd576040805162461bcd60e51b81526020600482015260116024820152700e4cae6cae4ecca40dad2dc407c40dac2f607b1b604482015290519081900360640190fd5b600c55565b600e5460ff1681565b60006108ac612749565b6007546001600160a01b0316331461151d576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b03811661156f576040805162461bcd60e51b815260206004820152601460248201527361646d696e203d207a65726f206164647265737360601b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b031660009081526020819052604090205490565b60006108ac6123a7565b6009546001600160a01b03163314611602576040805162461bcd60e51b815260206004820152600a6024820152692174696d65206c6f636b60b01b604482015290519081900360640190fd5b6001600160a01b03811661165d576040805162461bcd60e51b815260206004820152601860248201527f74696d65206c6f636b203d207a65726f20616464726573730000000000000000604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6007546001600160a01b031633146116c7576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b038116611722576040805162461bcd60e51b815260206004820152601960248201527f636f6e74726f6c6c6572203d207a65726f206164647265737300000000000000604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561093e5780601f106109135761010080835404028352916020019161093e565b6000806117b061230c565b905060006117bc6123a7565b90506117c9848383612410565b949350505050565b600f6020526000908152604090205460ff1681565b60006108ac6127b2565b600061095c6117fd611f98565b846109fa85604051806060016040528060258152602001612dd06025913960016000611827611f98565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61221b16565b600a546001600160a01b031681565b600061095c61187a611f98565b84846120b4565b6007546001600160a01b031633146118c9576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6101f4811115611915576040805162461bcd60e51b81526020600482015260126024820152710776974686472617720666565203e206361760741b604482015290519081900360640190fd5b600d55565b600e5460ff161561195b576040805162461bcd60e51b81526020600482015260066024820152651c185d5cd95960d21b604482015290519081900360640190fd5b600260065414156119b3576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600655333214806119d55750336000908152600f602052604090205460ff165b611a13576040805162461bcd60e51b815260206004820152600a602482015269085dda1a5d195b1a5cdd60b21b604482015290519081900360640190fd5b60008111611a55576040805162461bcd60e51b815260206004820152600a6024820152690616d6f756e74203d20360b41b604482015290519081900360640190fd5b6000611a5f611f77565b90506000611a6b610966565b9050600081611a7b575082611a9e565b611a9b83611a8f868563ffffffff6125dd16565b9063ffffffff6127fe16565b90505b611aa83382612840565b611ae36001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308763ffffffff61293c16565b505060016006555050565b6007546001600160a01b03163314611b36576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b038116611b8b576040805162461bcd60e51b81526020600482015260176024820152767374726174656779203d207a65726f206164647265737360481b604482015290519081900360640190fd5b6001600160a01b0381166000818152600b6020908152604091829020805460ff19169055815192835290517f7d3e35e217272b8400fec8397b08eb8c60c4db9ae834af14ac0fc9c0bb914a8f9281900390910190a150565b6007546001600160a01b03163314611c2b576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b600e805460ff1916911515919091179055565b6009546001600160a01b031681565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600a546001600160a01b0316611ccf576040805162461bcd60e51b81526020600482015260176024820152767374726174656779203d207a65726f206164647265737360481b604482015290519081900360640190fd5b600e5460ff1615611d10576040805162461bcd60e51b81526020600482015260066024820152651c185d5cd95960d21b604482015290519081900360640190fd5b6007546001600160a01b0316331480611d3357506008546001600160a01b031633145b611d72576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6000611d7c6127b2565b905060008111611dc3576040805162461bcd60e51b815260206004820152600d60248201526c0617661696c61626c65203d203609c1b604482015290519081900360640190fd5b600a54611dfe906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691166000612636565b600a54611e38906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683612636565b600a546040805163b6b55f2560e01b81526004810184905290516001600160a01b039092169163b6b55f259160248082019260009290919082900301818387803b158015611e8557600080fd5b505af1158015611e99573d6000803e3d6000fd5b5050600a5461089f92506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169250166000612636565b600d5481565b6008546001600160a01b031681565b6007546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611f7290849061299c565b505050565b60006108ac611f84612749565b611f8c61230c565b9063ffffffff6122b216565b3390565b6001600160a01b038316611fe15760405162461bcd60e51b8152600401808060200182810382526024815260200180612d4c6024913960400191505060405180910390fd5b6001600160a01b0382166120265760405162461bcd60e51b8152600401808060200182810382526022815260200180612c756022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60006127106120a7600c5461209b611f77565b9063ffffffff6125dd16565b816120ae57fe5b04905090565b6001600160a01b0383166120f95760405162461bcd60e51b8152600401808060200182810382526025815260200180612d276025913960400191505060405180910390fd5b6001600160a01b03821661213e5760405162461bcd60e51b8152600401808060200182810382526023815260200180612c306023913960400191505060405180910390fd5b612149838383611f72565b61218c81604051806060016040528060268152602001612c97602691396001600160a01b038616600090815260208190526040902054919063ffffffff61221b16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546121c1908263ffffffff6122b216565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156122aa5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561226f578181015183820152602001612257565b50505050905090810190601f16801561229c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610a03576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b15801561237657600080fd5b505afa15801561238a573d6000803e3d6000fd5b505050506040513d60208110156123a057600080fd5b5051905090565b600a546000906001600160a01b03166123c2575060006108af565b600a60009054906101000a90046001600160a01b03166001600160a01b03166301e1d1146040518163ffffffff1660e01b815260040160206040518083038186803b15801561237657600080fd5b60008061241b612749565b905060008184111561243e57612437858363ffffffff6122b216565b9050612451565b61244e858563ffffffff6122b216565b90505b600061245b610966565b905080156124865780612474888463ffffffff6125dd16565b8161247b57fe5b049350505050610a03565b5060009695505050505050565b6001600160a01b0382166124d85760405162461bcd60e51b8152600401808060200182810382526021815260200180612d066021913960400191505060405180910390fd5b6124e482600083611f72565b61252781604051806060016040528060228152602001612c53602291396001600160a01b038516600090815260208190526040902054919063ffffffff61221b16565b6001600160a01b038316600090815260208190526040902055600254612553908263ffffffff61259b16565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610a0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061221b565b6000826125ec57506000610960565b828202828482816125f957fe5b0414610a035760405162461bcd60e51b8152600401808060200182810382526021815260200180612cbd6021913960400191505060405180910390fd5b8015806126bc575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561268e57600080fd5b505afa1580156126a2573d6000803e3d6000fd5b505050506040513d60208110156126b857600080fd5b5051155b6126f75760405162461bcd60e51b8152600401808060200182810382526036815260200180612d9a6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052611f7290849061299c565b600a546000906001600160a01b0316612764575060006108af565b600a60009054906101000a90046001600160a01b03166001600160a01b031663fc7b9c186040518163ffffffff1660e01b815260040160206040518083038186803b15801561237657600080fd5b600a546000906001600160a01b03166127cd575060006108af565b60006127d761230c565b905060006127e3612088565b90508082116127f7576000925050506108af565b9003905090565b6000610a0383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a4d565b6001600160a01b03821661289b576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6128a760008383611f72565b6002546128ba908263ffffffff6122b216565b6002556001600160a01b0382166000908152602081905260409020546128e6908263ffffffff6122b216565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261299690859061299c565b50505050565b60606129f1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612ab29092919063ffffffff16565b805190915015611f7257808060200190516020811015612a1057600080fd5b5051611f725760405162461bcd60e51b815260040180806020018281038252602a815260200180612d70602a913960400191505060405180910390fd5b60008183612a9c5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561226f578181015183820152602001612257565b506000838581612aa857fe5b0495945050505050565b60606117c984846000856060612ac785612c29565b612b18576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612b575780518252601f199092019160209182019101612b38565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612bb9576040519150601f19603f3d011682016040523d82523d6000602084013e612bbe565b606091505b50915091508115612bd25791506117c99050565b805115612be25780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561226f578181015183820152602001612257565b3b15159056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212200b32d90beed6a4d69867c4fed9b3bfeee3722d8f8bc1c8785ee16d66aee59ac864736f6c634300060b003300000000000000000000000013195fa27de3fc1b5adcfb9b005989157600efcc00000000000000000000000086d10751b18f3fe331c146546868a07224a8598b000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061025e5760003560e01c80637373bc5a11610146578063b6ac642a116100c3578063dd62ed3e11610087578063dd62ed3e146106ee578063e8b5e51f1461071c578063e941fa7814610724578063f77c47911461072c578063f851a44014610734578063fc0c546a1461073c5761025e565b8063b6ac642a14610667578063b6b55f2514610684578063bb994d48146106a1578063bedb86fb146106c7578063d085835a146106e65761025e565b80639b19251a1161010a5780639b19251a146105bd5780639c8234b3146105e3578063a457c2d7146105eb578063a8c62e7614610617578063a9059cbb1461063b5761025e565b80637373bc5a14610544578063891682d21461054c57806392eefe9b1461057257806395d89b4114610598578063965c0f28146105a05761025e565b806339ebf823116101df578063596252fc116101a3578063596252fc146104c357806359c077d7146104cb5780635c975abb146104e85780636cb64d8f146104f0578063704b6c02146104f857806370a082311461051e5761025e565b806339ebf823146103fa5780633b8ae39714610420578063441a3e701461044657806345d34def1461046957806353d6fd59146104955761025e565b80631b4a2001116102265780631b4a20011461036a578063232870211461037257806323b872dd1461037a578063313ce567146103b057806339509351146103ce5761025e565b806301681a621461026357806301e1d1141461028b57806306fdde03146102a5578063095ea7b31461032257806318160ddd14610362575b600080fd5b6102896004803603602081101561027957600080fd5b50356001600160a01b0316610744565b005b6102936108a2565b60408051918252519081900360200190f35b6102ad6108b2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102e75781810151838201526020016102cf565b50505050905090810190601f1680156103145780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61034e6004803603604081101561033857600080fd5b506001600160a01b038135169060200135610948565b604080519115158252519081900360200190f35b610293610966565b61029361096c565b610293610976565b61034e6004803603606081101561039057600080fd5b506001600160a01b0381358116916020810135909116906040013561097c565b6103b8610a0a565b6040805160ff9092168252519081900360200190f35b61034e600480360360408110156103e457600080fd5b506001600160a01b038135169060200135610a13565b61034e6004803603602081101561041057600080fd5b50356001600160a01b0316610a67565b6102896004803603602081101561043657600080fd5b50356001600160a01b0316610a7c565b6102896004803603604081101561045c57600080fd5b5080359060200135610b78565b6102896004803603604081101561047f57600080fd5b506001600160a01b038135169060200135610f23565b610289600480360360408110156104ab57600080fd5b506001600160a01b0381351690602001351515611374565b610293611420565b610289600480360360208110156104e157600080fd5b503561142a565b61034e6114c2565b6102936114cb565b6102896004803603602081101561050e57600080fd5b50356001600160a01b03166114d5565b6102936004803603602081101561053457600080fd5b50356001600160a01b0316611591565b6102936115ac565b6102896004803603602081101561056257600080fd5b50356001600160a01b03166115b6565b6102896004803603602081101561058857600080fd5b50356001600160a01b031661167f565b6102ad611744565b610293600480360360208110156105b657600080fd5b50356117a5565b61034e600480360360208110156105d357600080fd5b50356001600160a01b03166117d1565b6102936117e6565b61034e6004803603604081101561060157600080fd5b506001600160a01b0381351690602001356117f0565b61061f61185e565b604080516001600160a01b039092168252519081900360200190f35b61034e6004803603604081101561065157600080fd5b506001600160a01b03813516906020013561186d565b6102896004803603602081101561067d57600080fd5b5035611881565b6102896004803603602081101561069a57600080fd5b503561191a565b610289600480360360208110156106b757600080fd5b50356001600160a01b0316611aee565b610289600480360360208110156106dd57600080fd5b50351515611be3565b61061f611c3e565b6102936004803603604081101561070457600080fd5b506001600160a01b0381358116916020013516611c4d565b610289611c78565b610293611ed8565b61061f611ede565b61061f611eed565b61061f611efc565b6007546001600160a01b0316331461078c576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec76001600160a01b0316816001600160a01b03161415610809576040805162461bcd60e51b81526020600482015260136024820152723a37b5b2b7101e903b30bab63a173a37b5b2b760691b604482015290519081900360640190fd5b600754604080516370a0823160e01b8152306004820152905161089f926001600160a01b0390811692908516916370a0823191602480820192602092909190829003018186803b15801561085c57600080fd5b505afa158015610870573d6000803e3d6000fd5b505050506040513d602081101561088657600080fd5b50516001600160a01b038416919063ffffffff611f2016565b50565b60006108ac611f77565b90505b90565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561093e5780601f106109135761010080835404028352916020019161093e565b820191906000526020600020905b81548152906001019060200180831161092157829003601f168201915b5050505050905090565b600061095c610955611f98565b8484611f9c565b5060015b92915050565b60025490565b60006108ac612088565b600c5481565b60006109898484846120b4565b6109ff84610995611f98565b6109fa85604051806060016040528060288152602001612cde602891396001600160a01b038a166000908152600160205260408120906109d3611f98565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61221b16565b611f9c565b5060015b9392505050565b60055460ff1690565b600061095c610a20611f98565b846109fa8560016000610a31611f98565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6122b216565b600b6020526000908152604090205460ff1681565b6009546001600160a01b03163314610ac8576040805162461bcd60e51b815260206004820152600a6024820152692174696d65206c6f636b60b01b604482015290519081900360640190fd5b6001600160a01b038116610b1d576040805162461bcd60e51b81526020600482015260176024820152767374726174656779203d207a65726f206164647265737360481b604482015290519081900360640190fd5b6001600160a01b0381166000818152600b6020908152604091829020805460ff19166001179055815192835290517f4c6d0fbb89373829bc56000a87d561331bca06f725fd8861d055215ed90f209b9281900390910190a150565b60026006541415610bd0576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260065533321480610bf25750336000908152600f602052604090205460ff165b610c30576040805162461bcd60e51b815260206004820152600a602482015269085dda1a5d195b1a5cdd60b21b604482015290519081900360640190fd5b60008211610c72576040805162461bcd60e51b815260206004820152600a6024820152690736861726573203d20360b41b604482015290519081900360640190fd5b6000610c7c61230c565b90506000610c886123a7565b90506000610c97858484612410565b9050610ca33386612493565b80831015610e97578080831015610cb75750815b600a5460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b158015610d0457600080fd5b505af1158015610d18573d6000803e3d6000fd5b505050506000610d2661230c565b90506000610d3a828763ffffffff61259b16565b905082811015610d5957610d568385038263ffffffff6122b216565b93505b6000612710610d73600d54876125dd90919063ffffffff16565b81610d7a57fe5b0490508015610e9257600854604080516361d027b360e01b815290516000926001600160a01b0316916361d027b3916004808301926020929190829003018186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d6020811015610df257600080fd5b505190506001600160a01b038116610e51576040805162461bcd60e51b815260206004820152601760248201527f7472656173757279203d207a65726f2061646472657373000000000000000000604482015290519081900360640190fd5b9481900394610e906001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec716828463ffffffff611f2016565b505b505050505b83811015610edd576040805162461bcd60e51b815260206004820152600e60248201526d3bb4ba34323930bb901e1036b4b760911b604482015290519081900360640190fd5b610f176001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec716338363ffffffff611f2016565b50506001600655505050565b6007546001600160a01b0316331480610f4657506008546001600160a01b031633145b610f85576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600b602052604090205460ff16610fde576040805162461bcd60e51b815260206004820152600960248201526808585c1c1c9bdd995960ba1b604482015290519081900360640190fd5b600a546001600160a01b0383811691161415611041576040805162461bcd60e51b815260206004820152601f60248201527f6e6577207374726174656779203d2063757272656e7420737472617465677900604482015290519081900360640190fd5b7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec76001600160a01b0316826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156110a457600080fd5b505afa1580156110b8573d6000803e3d6000fd5b505050506040513d60208110156110ce57600080fd5b50516001600160a01b03161461112b576040805162461bcd60e51b815260206004820152601d60248201527f73747261746567792e746f6b656e20213d207661756c742e746f6b656e000000604482015290519081900360640190fd5b306001600160a01b0316826001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561116e57600080fd5b505afa158015611182573d6000803e3d6000fd5b505050506040513d602081101561119857600080fd5b50516001600160a01b0316146111f5576040805162461bcd60e51b815260206004820152601760248201527f73747261746567792e7661756c7420213d207661756c74000000000000000000604482015290519081900360640190fd5b600a546001600160a01b03161561131957600a54611241906001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7811691166000612636565b600061124b61230c565b9050600a60009054906101000a90046001600160a01b03166001600160a01b031663e9fad8ee6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561129d57600080fd5b505af11580156112b1573d6000803e3d6000fd5b5050505060006112bf61230c565b9050826112d2828463ffffffff61259b16565b1015611316576040805162461bcd60e51b815260206004820152600e60248201526d3bb4ba34323930bb901e1036b4b760911b604482015290519081900360640190fd5b50505b600a80546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517f3412691e1ea2503d6eec15597247048016213c19646b73d4320a20c790b67ee2916020908290030190a15050565b6007546001600160a01b031633146113bc576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b0382166000818152600f6020908152604091829020805460ff191685151590811790915582519384529083015280517ff6019ec0a78d156d249a1ec7579e2321f6ac7521d6e1d2eacf90ba4a184dcceb9281900390910190a15050565b60006108ac61230c565b6007546001600160a01b03163314611472576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6127108111156114bd576040805162461bcd60e51b81526020600482015260116024820152700e4cae6cae4ecca40dad2dc407c40dac2f607b1b604482015290519081900360640190fd5b600c55565b600e5460ff1681565b60006108ac612749565b6007546001600160a01b0316331461151d576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b03811661156f576040805162461bcd60e51b815260206004820152601460248201527361646d696e203d207a65726f206164647265737360601b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b031660009081526020819052604090205490565b60006108ac6123a7565b6009546001600160a01b03163314611602576040805162461bcd60e51b815260206004820152600a6024820152692174696d65206c6f636b60b01b604482015290519081900360640190fd5b6001600160a01b03811661165d576040805162461bcd60e51b815260206004820152601860248201527f74696d65206c6f636b203d207a65726f20616464726573730000000000000000604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6007546001600160a01b031633146116c7576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b038116611722576040805162461bcd60e51b815260206004820152601960248201527f636f6e74726f6c6c6572203d207a65726f206164647265737300000000000000604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561093e5780601f106109135761010080835404028352916020019161093e565b6000806117b061230c565b905060006117bc6123a7565b90506117c9848383612410565b949350505050565b600f6020526000908152604090205460ff1681565b60006108ac6127b2565b600061095c6117fd611f98565b846109fa85604051806060016040528060258152602001612dd06025913960016000611827611f98565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61221b16565b600a546001600160a01b031681565b600061095c61187a611f98565b84846120b4565b6007546001600160a01b031633146118c9576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6101f4811115611915576040805162461bcd60e51b81526020600482015260126024820152710776974686472617720666565203e206361760741b604482015290519081900360640190fd5b600d55565b600e5460ff161561195b576040805162461bcd60e51b81526020600482015260066024820152651c185d5cd95960d21b604482015290519081900360640190fd5b600260065414156119b3576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600655333214806119d55750336000908152600f602052604090205460ff165b611a13576040805162461bcd60e51b815260206004820152600a602482015269085dda1a5d195b1a5cdd60b21b604482015290519081900360640190fd5b60008111611a55576040805162461bcd60e51b815260206004820152600a6024820152690616d6f756e74203d20360b41b604482015290519081900360640190fd5b6000611a5f611f77565b90506000611a6b610966565b9050600081611a7b575082611a9e565b611a9b83611a8f868563ffffffff6125dd16565b9063ffffffff6127fe16565b90505b611aa83382612840565b611ae36001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec71633308763ffffffff61293c16565b505060016006555050565b6007546001600160a01b03163314611b36576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b6001600160a01b038116611b8b576040805162461bcd60e51b81526020600482015260176024820152767374726174656779203d207a65726f206164647265737360481b604482015290519081900360640190fd5b6001600160a01b0381166000818152600b6020908152604091829020805460ff19169055815192835290517f7d3e35e217272b8400fec8397b08eb8c60c4db9ae834af14ac0fc9c0bb914a8f9281900390910190a150565b6007546001600160a01b03163314611c2b576040805162461bcd60e51b815260206004820152600660248201526510b0b236b4b760d11b604482015290519081900360640190fd5b600e805460ff1916911515919091179055565b6009546001600160a01b031681565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600a546001600160a01b0316611ccf576040805162461bcd60e51b81526020600482015260176024820152767374726174656779203d207a65726f206164647265737360481b604482015290519081900360640190fd5b600e5460ff1615611d10576040805162461bcd60e51b81526020600482015260066024820152651c185d5cd95960d21b604482015290519081900360640190fd5b6007546001600160a01b0316331480611d3357506008546001600160a01b031633145b611d72576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6000611d7c6127b2565b905060008111611dc3576040805162461bcd60e51b815260206004820152600d60248201526c0617661696c61626c65203d203609c1b604482015290519081900360640190fd5b600a54611dfe906001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7811691166000612636565b600a54611e38906001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec78116911683612636565b600a546040805163b6b55f2560e01b81526004810184905290516001600160a01b039092169163b6b55f259160248082019260009290919082900301818387803b158015611e8557600080fd5b505af1158015611e99573d6000803e3d6000fd5b5050600a5461089f92506001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781169250166000612636565b600d5481565b6008546001600160a01b031681565b6007546001600160a01b031681565b7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611f7290849061299c565b505050565b60006108ac611f84612749565b611f8c61230c565b9063ffffffff6122b216565b3390565b6001600160a01b038316611fe15760405162461bcd60e51b8152600401808060200182810382526024815260200180612d4c6024913960400191505060405180910390fd5b6001600160a01b0382166120265760405162461bcd60e51b8152600401808060200182810382526022815260200180612c756022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60006127106120a7600c5461209b611f77565b9063ffffffff6125dd16565b816120ae57fe5b04905090565b6001600160a01b0383166120f95760405162461bcd60e51b8152600401808060200182810382526025815260200180612d276025913960400191505060405180910390fd5b6001600160a01b03821661213e5760405162461bcd60e51b8152600401808060200182810382526023815260200180612c306023913960400191505060405180910390fd5b612149838383611f72565b61218c81604051806060016040528060268152602001612c97602691396001600160a01b038616600090815260208190526040902054919063ffffffff61221b16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546121c1908263ffffffff6122b216565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156122aa5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561226f578181015183820152602001612257565b50505050905090810190601f16801561229c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610a03576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec716916370a0823191602480820192602092909190829003018186803b15801561237657600080fd5b505afa15801561238a573d6000803e3d6000fd5b505050506040513d60208110156123a057600080fd5b5051905090565b600a546000906001600160a01b03166123c2575060006108af565b600a60009054906101000a90046001600160a01b03166001600160a01b03166301e1d1146040518163ffffffff1660e01b815260040160206040518083038186803b15801561237657600080fd5b60008061241b612749565b905060008184111561243e57612437858363ffffffff6122b216565b9050612451565b61244e858563ffffffff6122b216565b90505b600061245b610966565b905080156124865780612474888463ffffffff6125dd16565b8161247b57fe5b049350505050610a03565b5060009695505050505050565b6001600160a01b0382166124d85760405162461bcd60e51b8152600401808060200182810382526021815260200180612d066021913960400191505060405180910390fd5b6124e482600083611f72565b61252781604051806060016040528060228152602001612c53602291396001600160a01b038516600090815260208190526040902054919063ffffffff61221b16565b6001600160a01b038316600090815260208190526040902055600254612553908263ffffffff61259b16565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610a0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061221b565b6000826125ec57506000610960565b828202828482816125f957fe5b0414610a035760405162461bcd60e51b8152600401808060200182810382526021815260200180612cbd6021913960400191505060405180910390fd5b8015806126bc575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561268e57600080fd5b505afa1580156126a2573d6000803e3d6000fd5b505050506040513d60208110156126b857600080fd5b5051155b6126f75760405162461bcd60e51b8152600401808060200182810382526036815260200180612d9a6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052611f7290849061299c565b600a546000906001600160a01b0316612764575060006108af565b600a60009054906101000a90046001600160a01b03166001600160a01b031663fc7b9c186040518163ffffffff1660e01b815260040160206040518083038186803b15801561237657600080fd5b600a546000906001600160a01b03166127cd575060006108af565b60006127d761230c565b905060006127e3612088565b90508082116127f7576000925050506108af565b9003905090565b6000610a0383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a4d565b6001600160a01b03821661289b576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6128a760008383611f72565b6002546128ba908263ffffffff6122b216565b6002556001600160a01b0382166000908152602081905260409020546128e6908263ffffffff6122b216565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261299690859061299c565b50505050565b60606129f1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612ab29092919063ffffffff16565b805190915015611f7257808060200190516020811015612a1057600080fd5b5051611f725760405162461bcd60e51b815260040180806020018281038252602a815260200180612d70602a913960400191505060405180910390fd5b60008183612a9c5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561226f578181015183820152602001612257565b506000838581612aa857fe5b0495945050505050565b60606117c984846000856060612ac785612c29565b612b18576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612b575780518252601f199092019160209182019101612b38565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612bb9576040519150601f19603f3d011682016040523d82523d6000602084013e612bbe565b606091505b50915091508115612bd25791506117c99050565b805115612be25780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561226f578181015183820152602001612257565b3b15159056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212200b32d90beed6a4d69867c4fed9b3bfeee3722d8f8bc1c8785ee16d66aee59ac864736f6c634300060b0033

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

00000000000000000000000013195fa27de3fc1b5adcfb9b005989157600efcc00000000000000000000000086d10751b18f3fe331c146546868a07224a8598b000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

-----Decoded View---------------
Arg [0] : _controller (address): 0x13195FA27De3FC1b5AdcFB9b005989157600EFCC
Arg [1] : _timeLock (address): 0x86d10751B18F3fE331C146546868a07224A8598B
Arg [2] : _token (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000013195fa27de3fc1b5adcfb9b005989157600efcc
Arg [1] : 00000000000000000000000086d10751b18f3fe331c146546868a07224a8598b
Arg [2] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

Unagii is a non-custodial yield platform providing easy access to optimized DeFi and Staking yields on autopilot.

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.