Contract 0xDFdefD74fc5d1603E237392409898E70B41CA78e

 
Txn Hash
Block
From
To
Value [Txn Fee]
0x7f682be23fb3e5e6a7e746a47c96b5e75e22a24fecf0baee33382e2d45cf84f983035082021-06-15 0:01:054 hrs 2 mins ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x86c72a5651c1fbfe331f10976f5b2b1f231c15ddea863593771f97e2147a0f1b82964352021-06-14 18:01:0710 hrs 2 mins ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x86cce44b501b0cbb156dadff4c87bb0f90a0fb73c4b48808aa2ab431d363af4582892792021-06-14 12:01:1116 hrs 2 mins ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xb5028467e962c42cc58abaa526ebc7f7ab2b739a3a9710ac2d6ee91e9bc5bcfd82831642021-06-14 6:51:5321 hrs 11 mins ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02540399
0x692bd36574c5705a556fc5e89a59007a54fa42083f4e3cbe9c78120f08643e1e82821762021-06-14 6:01:0622 hrs 2 mins ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xcf069f73bdd07f04e9fbf4cfd4d7a5b97cf779485524ba38998e2d62b52510a482767662021-06-14 1:26:341 day 2 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x0aac52a6e6b226f12769bb44da9301355ae9c4b6b7152e5fcc2e2acc616570f082107762021-06-11 18:01:103 days 10 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x2913822c7b4d6ede2b01b93dbeea24e7a8370fb8f07aa87a3fc265347e6f64a582036072021-06-11 12:01:123 days 16 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xa116cede9d7b962d05f2d7008cf8ebd5db7515843a1fa7635a585237c67f4e6781964202021-06-11 6:01:053 days 22 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xb78057c75c3898bffe7a505544e4676e374198e50268028515963c7e3de42a3181892362021-06-11 0:01:074 days 4 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x43e00931f68edee7e8d78e7099aca69a8e81f4b755e450d38a540eec07b0aa5381820722021-06-10 18:01:144 days 10 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xb25e597a69c6d7afb010f5bdc1b38c0efc849da7a08f1ab254e042ef61d48c6e81749292021-06-10 12:01:134 days 16 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x56dacba4eb1d79f44f8f005a95f974af2d3382c0ad73558213d525ccd42dd7f681677452021-06-10 6:01:094 days 22 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xb50bde21fe8f217ea09c63cfe27c0e45e1895205e447a14948702224219a18a781605612021-06-10 0:01:065 days 4 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x184d363298ccef0c3c10c9d83ab548473b7487f4a70f5fff147860d1d5f66f9b81533972021-06-09 18:01:205 days 10 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x4a908ed037abbad1c803dcf773caf997d71c81ecbb70c9dc68cebb05ac94bb6a81462402021-06-09 12:02:105 days 16 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x226982e46f8be4c42283863a5283de7af30c906dff2d119f8cfd84722548a4a781390392021-06-09 6:01:125 days 22 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xdbcd342d6b437749f5efbb5f2abffbef2e5ec5b7c6d905a8dd91138bf305755281318702021-06-09 0:01:126 days 4 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0xff2798c5f357aa49c888e62d12b35fdace5465cb6241c554235fa78eea2d445181246882021-06-08 18:01:096 days 10 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x221d4e59da6b9cd1d1228f6be3121abc4fd4793e5d85d384a4cb869fb079362381174972021-06-08 12:01:106 days 16 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x09a04d84f180d2f9839a9a41be971840403e89e34106444258c9880616846be481103022021-06-08 6:01:086 days 22 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x24ab690ac9ae1217cbc0c7360d8e46ed7075c28408a04d5c4b1a50925bc3f85981031222021-06-08 0:01:057 days 4 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x7a1bdc411708fbfa7cbf49d2b7a04e71546e1991780773d9dfa1ea98978c871380959402021-06-07 18:01:107 days 10 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x27bb918c8d5649ecb59124f96d28279e62d0ae8d796f640bcf3e9c62094baefb80887632021-06-07 12:01:137 days 16 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
0x4744f25cd0e8bc91e373571a92f1d209fc8a629464f992652e34ee2f28eeb82680852602021-06-07 9:06:047 days 18 hrs ago0x52ac8f594d88915843359fa419b0df382b7a57ce IN  0xdfdefd74fc5d1603e237392409898e70b41ca78e0 BNB0.02542465
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StrategyVenusV2

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at BscScan.com on 2021-04-21
*/

// File: @openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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;
    }
}

// File: @openzeppelin/contracts/access/Ownable.sol



pragma solidity >=0.6.0 <0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

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

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

// File: @openzeppelin/contracts/utils/ReentrancyGuard.sol



pragma solidity >=0.6.0 <0.8.0;

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

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

    uint256 private _status;

    constructor () 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: @openzeppelin/contracts/utils/Pausable.sol



pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// File: contracts/earnV2/strategies/Strategy.sol

pragma solidity 0.6.12;




abstract contract Strategy is Ownable, ReentrancyGuard, Pausable {
    address public govAddress;

    uint256 public lastEarnBlock;
    
    uint256 public buyBackRate = 800;
    uint256 public constant buyBackRateMax = 10000;
    uint256 public constant buyBackRateUL = 800;
    address public constant buyBackAddress =
    0x000000000000000000000000000000000000dEaD;

    uint256 public withdrawFeeNumer = 0;
    uint256 public withdrawFeeDenom = 100;
}

// File: contracts/earnV2/strategies/venus/StrategyVenusV2Storage.sol

pragma solidity 0.6.12;



abstract contract StrategyVenusV2Storage is Strategy {
    bool public wantIsWBNB = false;
    address public wantAddress;
    address public vTokenAddress;
    address[] public venusMarkets;
    address public uniRouterAddress;

    address public constant wbnbAddress =
    0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;
    address public constant venusAddress =
    0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63;
    address public constant earnedAddress = venusAddress;
    address public constant venusDistributionAddress =
    0xfD36E2c2a6789Db23113685031d7F16329158384;

    address public BELTAddress;


    address[] public venusToWantPath;
    address[] public venusToBELTPath;

    uint256 public borrowRate = 585;
    uint256 public borrowDepth = 0;
    uint256 public constant BORROW_RATE_MAX = 595;
    uint256 public constant BORROW_RATE_MAX_HARD = 599;
    uint256 public constant BORROW_DEPTH_MAX = 6;

    uint256 public supplyBal = 0;
    uint256 public borrowBal = 0;
    uint256 public supplyBalTargeted = 0;
    uint256 public supplyBalMin = 0;

    // address public bnbHelper;
}

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol



pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

// File: contracts/earnV2/defi/venus.sol

pragma solidity 0.6.12;


interface IVenusDistribution {
    function claimVenus(address holder) external;

    function enterMarkets(address[] memory _vtokens) external;

    function exitMarket(address _vtoken) external;

    function getAssetsIn(address account)
        external
        view
        returns (address[] memory);

    function getAccountLiquidity(address account)
        external
        view
        returns (
            uint256,
            uint256,
            uint256
        );
}

interface IVBNB {
    function mint() external payable;

    function redeem(uint256 redeemTokens) external returns (uint256);

    function redeemUnderlying(uint256 redeemAmount) external returns (uint256);

    function borrow(uint256 borrowAmount) external returns (uint256);

    function repayBorrow() external payable;

    function balanceOfUnderlying(address owner) external returns (uint256);

    function borrowBalanceCurrent(address account) external returns (uint256);
}

interface IVToken is IERC20 {
    function underlying() external returns (address);

    function mint(uint256 mintAmount) external returns (uint256);

    function redeem(uint256 redeemTokens) external returns (uint256);

    function redeemUnderlying(uint256 redeemAmount) external returns (uint256);

    function borrow(uint256 borrowAmount) external returns (uint256);

    function repayBorrow(uint256 repayAmount) external returns (uint256);

    function balanceOfUnderlying(address owner) external returns (uint256);

    function borrowBalanceCurrent(address account) external returns (uint256);
}

// File: contracts/earnV2/defi/pancake.sol

pragma solidity 0.6.12;

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

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

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

}

interface IPancakeRouter02 is IPancakeRouter01 {

}

// File: @openzeppelin/contracts/math/SafeMath.sol



pragma solidity >=0.6.0 <0.8.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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        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) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        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, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

// File: @openzeppelin/contracts/utils/Address.sol



pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

// File: @openzeppelin/contracts/token/ERC20/SafeERC20.sol



pragma solidity >=0.6.0 <0.8.0;




/**
 * @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: @openzeppelin/contracts/proxy/Proxy.sol



pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 { revert(0, returndatasize()) }
            default { return(0, returndatasize()) }
        }
    }

    /**
     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback () external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive () external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overriden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {
    }
}

// File: @openzeppelin/contracts/proxy/UpgradeableProxy.sol



pragma solidity >=0.6.0 <0.8.0;



/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 *
 * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see
 * {TransparentUpgradeableProxy}.
 */
contract UpgradeableProxy is Proxy {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
     * function call, and allows initializating the storage of the proxy like a Solidity constructor.
     */
    constructor(address _logic, bytes memory _data) public payable {
        assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
        _setImplementation(_logic);
        if(_data.length > 0) {
            Address.functionDelegateCall(_logic, _data);
        }
    }

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Returns the current implementation address.
     */
    function _implementation() internal view virtual override returns (address impl) {
        bytes32 slot = _IMPLEMENTATION_SLOT;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            impl := sload(slot)
        }
    }

    /**
     * @dev Upgrades the proxy to a new implementation.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal virtual {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "UpgradeableProxy: new implementation is not a contract");

        bytes32 slot = _IMPLEMENTATION_SLOT;

        // solhint-disable-next-line no-inline-assembly
        assembly {
            sstore(slot, newImplementation)
        }
    }
}

// File: @openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol



pragma solidity >=0.6.0 <0.8.0;


/**
 * @dev This contract implements a proxy that is upgradeable by an admin.
 *
 * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector
 * clashing], which can potentially be used in an attack, this contract uses the
 * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
 * things that go hand in hand:
 *
 * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
 * that call matches one of the admin functions exposed by the proxy itself.
 * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the
 * implementation. If the admin tries to call a function on the implementation it will fail with an error that says
 * "admin cannot fallback to proxy target".
 *
 * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing
 * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due
 * to sudden errors when trying to call a function from the proxy implementation.
 *
 * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,
 * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.
 */
contract TransparentUpgradeableProxy is UpgradeableProxy {
    /**
     * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
     * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.
     */
    constructor(address _logic, address admin_, bytes memory _data) public payable UpgradeableProxy(_logic, _data) {
        assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
        _setAdmin(admin_);
    }

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.
     */
    modifier ifAdmin() {
        if (msg.sender == _admin()) {
            _;
        } else {
            _fallback();
        }
    }

    /**
     * @dev Returns the current admin.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function admin() external ifAdmin returns (address admin_) {
        admin_ = _admin();
    }

    /**
     * @dev Returns the current implementation.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
     */
    function implementation() external ifAdmin returns (address implementation_) {
        implementation_ = _implementation();
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.
     */
    function changeAdmin(address newAdmin) external virtual ifAdmin {
        require(newAdmin != address(0), "TransparentUpgradeableProxy: new admin is the zero address");
        emit AdminChanged(_admin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev Upgrade the implementation of the proxy.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.
     */
    function upgradeTo(address newImplementation) external virtual ifAdmin {
        _upgradeTo(newImplementation);
    }

    /**
     * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified
     * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the
     * proxied contract.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.
     */
    function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {
        _upgradeTo(newImplementation);
        Address.functionDelegateCall(newImplementation, data);
    }

    /**
     * @dev Returns the current admin.
     */
    function _admin() internal view virtual returns (address adm) {
        bytes32 slot = _ADMIN_SLOT;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            adm := sload(slot)
        }
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        bytes32 slot = _ADMIN_SLOT;

        // solhint-disable-next-line no-inline-assembly
        assembly {
            sstore(slot, newAdmin)
        }
    }

    /**
     * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.
     */
    function _beforeFallback() internal virtual override {
        require(msg.sender != _admin(), "TransparentUpgradeableProxy: admin cannot fallback to proxy target");
        super._beforeFallback();
    }
}

// File: contracts/earnV2/strategies/venus/StrategyVenusV2.sol

pragma solidity 0.6.12;








contract StrategyVenusV2 is StrategyVenusV2Storage, TransparentUpgradeableProxy {
    using SafeERC20 for IERC20;

    constructor(
        address _BELTAddress,
        address _wantAddress,
        address _vTokenAddress,
        address _uniRouterAddress,

        address[] memory _venusToWantPath,
        address[] memory _venusToBELTPath,
        address _logic,
        address admin_,
        bytes memory _data
    ) public TransparentUpgradeableProxy(_logic, admin_, _data) {
        govAddress = msg.sender;
        BELTAddress = _BELTAddress;
        wantAddress = _wantAddress;

        if (wantAddress == wbnbAddress) {
            wantIsWBNB = true;
        }

        venusToWantPath = _venusToWantPath;
        venusToBELTPath = _venusToBELTPath;

        vTokenAddress = _vTokenAddress;
        venusMarkets = [vTokenAddress];
        uniRouterAddress = _uniRouterAddress;

        borrowDepth = 0;

        withdrawFeeNumer = 5;
        withdrawFeeDenom = 10000;

        IERC20(venusAddress).safeApprove(uniRouterAddress, uint256(-1));
        IERC20(wantAddress).safeApprove(uniRouterAddress, uint256(-1));
        if (!wantIsWBNB) {
            IERC20(wantAddress).safeApprove(vTokenAddress, uint256(-1));
        }

        IVenusDistribution(venusDistributionAddress).enterMarkets(venusMarkets);
    }
    
    // receive() override external payable {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_BELTAddress","type":"address"},{"internalType":"address","name":"_wantAddress","type":"address"},{"internalType":"address","name":"_vTokenAddress","type":"address"},{"internalType":"address","name":"_uniRouterAddress","type":"address"},{"internalType":"address[]","name":"_venusToWantPath","type":"address[]"},{"internalType":"address[]","name":"_venusToBELTPath","type":"address[]"},{"internalType":"address","name":"_logic","type":"address"},{"internalType":"address","name":"admin_","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"BELTAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BORROW_DEPTH_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BORROW_RATE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BORROW_RATE_MAX_HARD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"admin_","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"borrowBal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrowDepth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrowRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyBackAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyBackRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyBackRateMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyBackRateUL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"changeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"earnedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"govAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"implementation_","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastEarnBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supplyBal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supplyBalMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supplyBalTargeted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniRouterAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"vTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"venusAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"venusDistributionAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"venusMarkets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"venusToBELTPath","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"venusToWantPath","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wantAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wantIsWBNB","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wbnbAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFeeDenom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFeeNumer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526103206004556000600581905560646006556007805460ff19169055610249600e55600f8190556010819055601181905560128190556013553480156200004a57600080fd5b50604051620021723803806200217283398181016040526101208110156200007157600080fd5b8151602083015160408085015160608601516080870180519351959794969295919491939282019284640100000000821115620000ad57600080fd5b908301906020820185811115620000c357600080fd5b8251866020820283011164010000000082111715620000e157600080fd5b82525081516020918201928201910280838360005b8381101562000110578181015183820152602001620000f6565b50505050905001604052602001805160405193929190846401000000008211156200013a57600080fd5b9083019060208201858111156200015057600080fd5b82518660208202830111640100000000821117156200016e57600080fd5b82525081516020918201928201910280838360005b838110156200019d57818101518382015260200162000183565b505050509190910160408181526020840151908401516060909401805191969495929493509084640100000000821115620001d757600080fd5b908301906020820185811115620001ed57600080fd5b82516401000000008111828201881017156200020857600080fd5b82525081516020918201929091019080838360005b83811015620002375781810151838201526020016200021d565b50505050905090810190601f168015620002655780820380516001836020036101000a031916815260200191505b506040525050508282828281600062000283620005a060201b60201c565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180556002805460ff19169055620002e682620005a4565b80511562000307576200030582826200061b60201b62000bb21760201c565b505b50620003109050565b6200031b826200064a565b505060028054610100338102610100600160a81b031992831617909255600b80546001600160a01b038e81166001600160a01b031990921691909117909155600780548d83168502931692909217918290559190041673bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c141590506200039d576007805460ff191660011790555b8451620003b290600c90602088019062000b8d565b508351620003c890600d90602087019062000b8d565b50600880546001600160a01b0319166001600160a01b0389811691909117918290556040805160208101909152911681526200040990600990600162000b8d565b50600a80546001600160a01b0319166001600160a01b0388811691909117918290556000600f55600580556127106006556200046b9173cf6bb5389c92bdda8a3747ddb454cb7a64626c6391166000196200066e602090811b62000bde17901c565b600a546007546200049d916001600160a01b03610100909204821691166000196200066e602090811b62000bde17901c565b60075460ff16620004da57600854600754620004da916001600160a01b03610100909204821691166000196200066e602090811b62000bde17901c565b604051631853304760e31b8152602060048201908152600980546024840181905273fd36e2c2a6789db23113685031d7f163291583849363c29982389391829160440190849080156200055757602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000538575b505092505050600060405180830381600087803b1580156200057857600080fd5b505af11580156200058d573d6000803e3d6000fd5b5050505050505050505050505062000c18565b3390565b620005ba816200079260201b62000cf11760201c565b620005f75760405162461bcd60e51b8152600401808060200182810382526036815260200180620020b66036913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b60606200064383836040518060600160405280602781526020016200208f6027913962000798565b9392505050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b801580620006f8575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015620006c857600080fd5b505afa158015620006dd573d6000803e3d6000fd5b505050506040513d6020811015620006f457600080fd5b5051155b620007355760405162461bcd60e51b81526004018080602001828103825260368152602001806200213c6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200078d918591620008a616565b505050565b3b151590565b6060620007a58462000792565b620007e25760405162461bcd60e51b8152600401808060200182810382526026815260200180620020ec6026913960400191505060405180910390fd5b60006060856001600160a01b0316856040518082805190602001908083835b60208310620008225780518252601f19909201916020918201910162000801565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811462000884576040519150601f19603f3d011682016040523d82523d6000602084013e62000889565b606091505b5090925090506200089c82828662000962565b9695505050505050565b606062000902826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031662000a0c60201b62000cf7179092919060201c565b8051909150156200078d578080602001905160208110156200092357600080fd5b50516200078d5760405162461bcd60e51b815260040180806020018281038252602a81526020018062002112602a913960400191505060405180910390fd5b606083156200097357508162000643565b825115620009845782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620009d0578181015183820152602001620009b6565b50505050905090810190601f168015620009fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b606062000a1d848460008562000a25565b949350505050565b60608247101562000a685760405162461bcd60e51b8152600401808060200182810382526026815260200180620020696026913960400191505060405180910390fd5b62000a738562000792565b62000ac5576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831062000b065780518252601f19909201916020918201910162000ae5565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811462000b6a576040519150601f19603f3d011682016040523d82523d6000602084013e62000b6f565b606091505b50909250905062000b8282828662000962565b979650505050505050565b82805482825590600052602060002090810192821562000be5579160200282015b8281111562000be557825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000bae565b5062000bf392915062000bf7565b5090565b5b8082111562000bf35780546001600160a01b031916815560010162000bf8565b6114418062000c286000396000f3fe6080604052600436106102295760003560e01c8063772b1af711610123578063b3545c01116100ab578063e71984741161006f578063e7198474146103de578063e7a036791461061d578063f151dd7014610632578063f2fde38b14610647578063f851a4401461067a57610238565b8063b3545c011461059f578063b4896ecc146105b4578063c914b437146105c9578063cd8ab2e8146105de578063e045a9a51461060857610238565b80638f283970116100f25780638f28397014610518578063976843171461054b5780639e6b2ded14610560578063a430204414610575578063aced9a801461058a57610238565b8063772b1af7146104af578063783478ad146104d95780637cd3431a146104ee5780638da5cb5b1461050357610238565b80634d9f7bb2116101b1578063624e260f11610175578063624e260f1461043157806363fe3e3a14610446578063693a090b1461045b578063706cac3514610470578063715018a61461049a57610238565b80634d9f7bb2146103495780634f1ef2861461035e57806356496262146103de5780635c60da1b146103f35780635c975abb1461040857610238565b8063178a8d07116101f8578063178a8d07146102a65780632792bd57146102bb5780633659cfe6146102ec578063412dfe491461031f57806346008a071461033457610238565b806304c5f1f414610240578063054483a2146102675780630fa4e01e1461027c57806314b5f8d11461029157610238565b366102385761023661068f565b005b61023661068f565b34801561024c57600080fd5b506102556106a9565b60408051918252519081900360200190f35b34801561027357600080fd5b506102556106af565b34801561028857600080fd5b506102556106b5565b34801561029d57600080fd5b506102556106bb565b3480156102b257600080fd5b506102556106c1565b3480156102c757600080fd5b506102d06106c7565b604080516001600160a01b039092168252519081900360200190f35b3480156102f857600080fd5b506102366004803603602081101561030f57600080fd5b50356001600160a01b03166106d6565b34801561032b57600080fd5b506102d0610710565b34801561034057600080fd5b506102d0610728565b34801561035557600080fd5b5061025561073c565b6102366004803603604081101561037457600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561039f57600080fd5b8201836020820111156103b157600080fd5b803590602001918460018302840111640100000000831117156103d357600080fd5b509092509050610742565b3480156103ea57600080fd5b506102d06107bf565b3480156103ff57600080fd5b506102d06107d7565b34801561041457600080fd5b5061041d610814565b604080519115158252519081900360200190f35b34801561043d57600080fd5b5061025561081d565b34801561045257600080fd5b506102d0610823565b34801561046757600080fd5b506102d061083b565b34801561047c57600080fd5b506102d06004803603602081101561049357600080fd5b503561084a565b3480156104a657600080fd5b50610236610871565b3480156104bb57600080fd5b506102d0600480360360208110156104d257600080fd5b503561092f565b3480156104e557600080fd5b506102d061093c565b3480156104fa57600080fd5b5061041d610942565b34801561050f57600080fd5b506102d061094b565b34801561052457600080fd5b506102366004803603602081101561053b57600080fd5b50356001600160a01b031661095a565b34801561055757600080fd5b50610255610a14565b34801561056c57600080fd5b50610255610a1a565b34801561058157600080fd5b50610255610a20565b34801561059657600080fd5b50610255610a26565b3480156105ab57600080fd5b50610255610a2c565b3480156105c057600080fd5b50610255610a32565b3480156105d557600080fd5b50610255610a37565b3480156105ea57600080fd5b506102d06004803603602081101561060157600080fd5b5035610a3d565b34801561061457600080fd5b506102d0610a4a565b34801561062957600080fd5b506102d0610a59565b34801561063e57600080fd5b50610255610a6d565b34801561065357600080fd5b506102366004803603602081101561066a57600080fd5b50356001600160a01b0316610a73565b34801561068657600080fd5b506102d0610b87565b610697610d0e565b6106a76106a2610d6e565b610d93565b565b60055481565b60065481565b60035481565b60135481565b60045481565b6008546001600160a01b031681565b6106de610db7565b6001600160a01b0316336001600160a01b031614156107055761070081610ddc565b61070d565b61070d61068f565b50565b73fd36e2c2a6789db23113685031d7f1632915838481565b60025461010090046001600160a01b031681565b61271081565b61074a610db7565b6001600160a01b0316336001600160a01b031614156107b25761076c83610ddc565b6107ac8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610bb292505050565b506107ba565b6107ba61068f565b505050565b73cf6bb5389c92bdda8a3747ddb454cb7a64626c6381565b60006107e1610db7565b6001600160a01b0316336001600160a01b0316141561080957610802610d6e565b9050610811565b61081161068f565b90565b60025460ff1690565b61025381565b73bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81565b600a546001600160a01b031681565b6009818154811061085757fe5b6000918252602090912001546001600160a01b0316905081565b610879610e1c565b6001600160a01b031661088a61094b565b6001600160a01b0316146108e5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d818154811061085757fe5b61dead81565b60075460ff1681565b6000546001600160a01b031690565b610962610db7565b6001600160a01b0316336001600160a01b03161415610705576001600160a01b0381166109c05760405162461bcd60e51b815260040180806020018281038252603a8152602001806112ad603a913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6109e9610db7565b604080516001600160a01b03928316815291841660208301528051918290030190a161070081610e20565b600f5481565b61025781565b60125481565b60115481565b61032081565b600681565b600e5481565b600c818154811061085757fe5b600b546001600160a01b031681565b60075461010090046001600160a01b031681565b60105481565b610a7b610e1c565b6001600160a01b0316610a8c61094b565b6001600160a01b031614610ae7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610b2c5760405162461bcd60e51b81526004018080602001828103825260268152602001806112616026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610b91610db7565b6001600160a01b0316336001600160a01b0316141561080957610802610db7565b6060610bd783836040518060600160405280602781526020016112e760279139610e44565b9392505050565b801580610c64575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015610c3657600080fd5b505afa158015610c4a573d6000803e3d6000fd5b505050506040513d6020811015610c6057600080fd5b5051155b610c9f5760405162461bcd60e51b81526004018080602001828103825260368152602001806113946036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526107ba908490610f47565b3b151590565b6060610d068484600085610ff8565b949350505050565b610d16610db7565b6001600160a01b0316336001600160a01b03161415610d665760405162461bcd60e51b81526004018080602001828103825260428152602001806113ca6042913960600191505060405180910390fd5b6106a76106a7565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610db2573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610de581611154565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b3390565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6060610e4f84610cf1565b610e8a5760405162461bcd60e51b81526004018080602001828103825260268152602001806113446026913960400191505060405180910390fd5b60006060856001600160a01b0316856040518082805190602001908083835b60208310610ec85780518252601f199092019160209182019101610ea9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610f28576040519150601f19603f3d011682016040523d82523d6000602084013e610f2d565b606091505b5091509150610f3d8282866111bc565b9695505050505050565b6060610f9c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610cf79092919063ffffffff16565b8051909150156107ba57808060200190516020811015610fbb57600080fd5b50516107ba5760405162461bcd60e51b815260040180806020018281038252602a81526020018061136a602a913960400191505060405180910390fd5b6060824710156110395760405162461bcd60e51b81526004018080602001828103825260268152602001806112876026913960400191505060405180910390fd5b61104285610cf1565b611093576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106110d25780518252601f1990920191602091820191016110b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611134576040519150601f19603f3d011682016040523d82523d6000602084013e611139565b606091505b50915091506111498282866111bc565b979650505050505050565b61115d81610cf1565b6111985760405162461bcd60e51b815260040180806020018281038252603681526020018061130e6036913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156111cb575081610bd7565b8251156111db5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561122557818101518382015260200161120d565b50505050905090810190601f1680156112525780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5472616e73706172656e745570677261646561626c6550726f78793a206e65772061646d696e20697320746865207a65726f2061646472657373416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65645570677261646561626c6550726f78793a206e657720696d706c656d656e746174696f6e206973206e6f74206120636f6e7472616374416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e63655472616e73706172656e745570677261646561626c6550726f78793a2061646d696e2063616e6e6f742066616c6c6261636b20746f2070726f787920746172676574a2646970667358221220071853d5c243d92abaa1ba00e1385f9531008651ab3dc145f8f4f1e1578f14b164736f6c634300060c0033416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65645570677261646561626c6550726f78793a206e657720696d706c656d656e746174696f6e206973206e6f74206120636f6e7472616374416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000000000e0e514c71282b6f4e823703a39374cf58dc3ea4f0000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c000000000000000000000000882c173bc7ff3b7786ca16dfed3dfffb9ee7847b00000000000000000000000005ff2b0db69458a0750badebc4f9e13add608c7f000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000009a3d7ca3619c251fc92ab7a3610e615a09aba7cd0000000000000000000000009eec9655f514822fbe494ae2ea1be7cf80be1c9300000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cf6bb5389c92bdda8a3747ddb454cb7a64626c63000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cf6bb5389c92bdda8a3747ddb454cb7a64626c63000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000e0e514c71282b6f4e823703a39374cf58dc3ea4f0000000000000000000000000000000000000000000000000000000000000000

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

000000000000000000000000e0e514c71282b6f4e823703a39374cf58dc3ea4f0000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c000000000000000000000000882c173bc7ff3b7786ca16dfed3dfffb9ee7847b00000000000000000000000005ff2b0db69458a0750badebc4f9e13add608c7f000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000009a3d7ca3619c251fc92ab7a3610e615a09aba7cd0000000000000000000000009eec9655f514822fbe494ae2ea1be7cf80be1c9300000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cf6bb5389c92bdda8a3747ddb454cb7a64626c63000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cf6bb5389c92bdda8a3747ddb454cb7a64626c63000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000e0e514c71282b6f4e823703a39374cf58dc3ea4f0000000000000000000000000000000000000000000000000000000000000000

-----Encoded View---------------
18 Constructor Arguments found :
Arg [0] : 000000000000000000000000e0e514c71282b6f4e823703a39374cf58dc3ea4f
Arg [1] : 0000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c
Arg [2] : 000000000000000000000000882c173bc7ff3b7786ca16dfed3dfffb9ee7847b
Arg [3] : 00000000000000000000000005ff2b0db69458a0750badebc4f9e13add608c7f
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [5] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [6] : 0000000000000000000000009a3d7ca3619c251fc92ab7a3610e615a09aba7cd
Arg [7] : 0000000000000000000000009eec9655f514822fbe494ae2ea1be7cf80be1c93
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [10] : 000000000000000000000000cf6bb5389c92bdda8a3747ddb454cb7a64626c63
Arg [11] : 000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c
Arg [12] : 0000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [14] : 000000000000000000000000cf6bb5389c92bdda8a3747ddb454cb7a64626c63
Arg [15] : 000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c
Arg [16] : 000000000000000000000000e0e514c71282b6f4e823703a39374cf58dc3ea4f
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000000


Deployed ByteCode Sourcemap

47555:1424:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37874:11;:9;:11::i;:::-;47555:1424;;37642:11;:9;:11::i;8791:35::-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;8833:37;;;;;;;;;;;;;:::i;8511:28::-;;;;;;;;;;;;;:::i;10041:31::-;;;;;;;;;;;;;:::i;8552:32::-;;;;;;;;;;;;;:::i;9112:28::-;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;9112:28:0;;;;;;;;;;;;;;45789:119;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;45789:119:0;-1:-1:-1;;;;;45789:119:0;;:::i;9467:98::-;;;;;;;;;;;;;:::i;8477:25::-;;;;;;;;;;;;;:::i;8591:46::-;;;;;;;;;;;;;:::i;46293:219::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;46293:219:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;46293:219:0;;-1:-1:-1;46293:219:0;-1:-1:-1;46293:219:0;:::i;9315:86::-;;;;;;;;;;;;;:::i;45023:131::-;;;;;;;;;;;;;:::i;7133:86::-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;9766:45;;;;;;;;;;;;;:::i;9223:85::-;;;;;;;;;;;;;:::i;9183:31::-;;;;;;;;;;;;;:::i;9147:29::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9147:29:0;;:::i;2783:148::-;;;;;;;;;;;;;:::i;9650:32::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9650:32:0;;:::i;8694:88::-;;;;;;;;;;;;;:::i;9042:30::-;;;;;;;;;;;;;:::i;2132:87::-;;;;;;;;;;;;;:::i;45368:254::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;45368:254:0;-1:-1:-1;;;;;45368:254:0;;:::i;9729:30::-;;;;;;;;;;;;;:::i;9818:50::-;;;;;;;;;;;;;:::i;9998:36::-;;;;;;;;;;;;;:::i;9963:28::-;;;;;;;;;;;;;:::i;8644:43::-;;;;;;;;;;;;;:::i;9875:44::-;;;;;;;;;;;;;:::i;9691:31::-;;;;;;;;;;;;;:::i;9611:32::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9611:32:0;;:::i;9574:26::-;;;;;;;;;;;;;:::i;9079:::-;;;;;;;;;;;;;:::i;9928:28::-;;;;;;;;;;;;;:::i;3086:244::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3086:244:0;-1:-1:-1;;;;;3086:244:0;;:::i;44457:95::-;;;;;;;;;;;;;:::i;37278:113::-;37327:17;:15;:17::i;:::-;37355:28;37365:17;:15;:17::i;:::-;37355:9;:28::i;:::-;37278:113::o;8791:35::-;;;;:::o;8833:37::-;;;;:::o;8511:28::-;;;;:::o;10041:31::-;;;;:::o;8552:32::-;;;;:::o;9112:28::-;;;-1:-1:-1;;;;;9112:28:0;;:::o;45789:119::-;43915:8;:6;:8::i;:::-;-1:-1:-1;;;;;43901:22:0;:10;-1:-1:-1;;;;;43901:22:0;;43897:100;;;45871:29:::1;45882:17;45871:10;:29::i;:::-;43897:100:::0;;;43974:11;:9;:11::i;:::-;45789:119;:::o;9467:98::-;9523:42;9467:98;:::o;8477:25::-;;;;;;-1:-1:-1;;;;;8477:25:0;;:::o;8591:46::-;8632:5;8591:46;:::o;46293:219::-;43915:8;:6;:8::i;:::-;-1:-1:-1;;;;;43901:22:0;:10;-1:-1:-1;;;;;43901:22:0;;43897:100;;;46411:29:::1;46422:17;46411:10;:29::i;:::-;46451:53;46480:17;46499:4;;46451:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;46451:28:0::1;::::0;-1:-1:-1;;;46451:53:0:i:1;:::-;;43897:100:::0;;;43974:11;:9;:11::i;:::-;46293:219;;;:::o;9315:86::-;9359:42;9315:86;:::o;45023:131::-;45075:23;43915:8;:6;:8::i;:::-;-1:-1:-1;;;;;43901:22:0;:10;-1:-1:-1;;;;;43901:22:0;;43897:100;;;45129:17:::1;:15;:17::i;:::-;45111:35;;43897:100:::0;;;43974:11;:9;:11::i;:::-;45023:131;:::o;7133:86::-;7204:7;;;;7133:86;:::o;9766:45::-;9808:3;9766:45;:::o;9223:85::-;9266:42;9223:85;:::o;9183:31::-;;;-1:-1:-1;;;;;9183:31:0;;:::o;9147:29::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9147:29:0;;-1:-1:-1;9147:29:0;:::o;2783:148::-;2363:12;:10;:12::i;:::-;-1:-1:-1;;;;;2352:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;2352:23:0;;2344:68;;;;;-1:-1:-1;;;2344:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2890:1:::1;2874:6:::0;;2853:40:::1;::::0;-1:-1:-1;;;;;2874:6:0;;::::1;::::0;2853:40:::1;::::0;2890:1;;2853:40:::1;2921:1;2904:19:::0;;-1:-1:-1;;;;;;2904:19:0::1;::::0;;2783:148::o;9650:32::-;;;;;;;;;;8694:88;8740:42;8694:88;:::o;9042:30::-;;;;;;:::o;2132:87::-;2178:7;2205:6;-1:-1:-1;;;;;2205:6:0;2132:87;:::o;45368:254::-;43915:8;:6;:8::i;:::-;-1:-1:-1;;;;;43901:22:0;:10;-1:-1:-1;;;;;43901:22:0;;43897:100;;;-1:-1:-1;;;;;45451:22:0;::::1;45443:93;;;;-1:-1:-1::0;;;45443:93:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;45552:32;45565:8;:6;:8::i;:::-;45552:32;::::0;;-1:-1:-1;;;;;45552:32:0;;::::1;::::0;;;;::::1;;::::0;::::1;::::0;;;;;;;;;::::1;45595:19;45605:8;45595:9;:19::i;9729:30::-:0;;;;:::o;9818:50::-;9865:3;9818:50;:::o;9998:36::-;;;;:::o;9963:28::-;;;;:::o;8644:43::-;8684:3;8644:43;:::o;9875:44::-;9918:1;9875:44;:::o;9691:31::-;;;;:::o;9611:32::-;;;;;;;;;;9574:26;;;-1:-1:-1;;;;;9574:26:0;;:::o;9079:::-;;;;;;-1:-1:-1;;;;;9079:26:0;;:::o;9928:28::-;;;;:::o;3086:244::-;2363:12;:10;:12::i;:::-;-1:-1:-1;;;;;2352:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;2352:23:0;;2344:68;;;;;-1:-1:-1;;;2344:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3175:22:0;::::1;3167:73;;;;-1:-1:-1::0;;;3167:73:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3277:6;::::0;;3256:38:::1;::::0;-1:-1:-1;;;;;3256:38:0;;::::1;::::0;3277:6;::::1;::::0;3256:38:::1;::::0;::::1;3305:6;:17:::0;;-1:-1:-1;;;;;;3305:17:0::1;-1:-1:-1::0;;;;;3305:17:0;;;::::1;::::0;;;::::1;::::0;;3086:244::o;44457:95::-;44500:14;43915:8;:6;:8::i;:::-;-1:-1:-1;;;;;43901:22:0;:10;-1:-1:-1;;;;;43901:22:0;;43897:100;;;44536:8:::1;:6;:8::i;29626:200::-:0;29709:12;29741:77;29762:6;29770:4;29741:77;;;;;;;;;;;;;;;;;:20;:77::i;:::-;29734:84;29626:200;-1:-1:-1;;;29626:200:0:o;32525:622::-;32895:10;;;32894:62;;-1:-1:-1;32911:39:0;;;-1:-1:-1;;;32911:39:0;;32935:4;32911:39;;;;-1:-1:-1;;;;;32911:39:0;;;;;;;;;:15;;;;;;:39;;;;;;;;;;;;;;;:15;:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;32911:39:0;:44;32894:62;32886:152;;;;-1:-1:-1;;;32886:152:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;33076:62;;;-1:-1:-1;;;;;33076:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;33076:62:0;-1:-1:-1;;;33076:62:0;;;33049:90;;33069:5;;33049:19;:90::i;23941:422::-;24308:20;24347:8;;;23941:422::o;26859:195::-;26962:12;26994:52;27016:6;27024:4;27030:1;27033:12;26994:21;:52::i;:::-;26987:59;26859:195;-1:-1:-1;;;;26859:195:0:o;47234:207::-;47320:8;:6;:8::i;:::-;-1:-1:-1;;;;;47306:22:0;:10;-1:-1:-1;;;;;47306:22:0;;;47298:101;;;;-1:-1:-1;;;47298:101:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;47410:23;:21;:23::i;40138:256::-;39988:66;40365:11;;40342:45::o;35871:915::-;36271:14;36268:1;36265;36252:34;36489:1;36486;36470:14;36467:1;36451:14;36444:5;36431:60;36568:16;36565:1;36562;36547:38;36608:6;36677:38;;;;36749:16;36746:1;36739:27;36677:38;36696:16;36693:1;36686:27;46578:227;43654:66;46776:11;;46754:44::o;40520:163::-;40595:37;40614:17;40595:18;:37::i;:::-;40648:27;;-1:-1:-1;;;;;40648:27:0;;;;;;;;40520:163;:::o;667:106::-;755:10;667:106;:::o;46892:216::-;43654:66;47068:22;47053:48::o;30020:423::-;30131:12;30164:18;30175:6;30164:10;:18::i;:::-;30156:69;;;;-1:-1:-1;;;30156:69:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30299:12;30313:23;30340:6;-1:-1:-1;;;;;30340:19:0;30360:4;30340:25;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;30340:25:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30298:67;;;;30383:52;30401:7;30410:10;30422:12;30383:17;:52::i;:::-;30376:59;30020:423;-1:-1:-1;;;;;;30020:423:0:o;34171:761::-;34595:23;34621:69;34649:4;34621:69;;;;;;;;;;;;;;;;;34629:5;-1:-1:-1;;;;;34621:27:0;;;:69;;;;;:::i;:::-;34705:17;;34595:95;;-1:-1:-1;34705:21:0;34701:224;;34847:10;34836:30;;;;;;;;;;;;;;;-1:-1:-1;34836:30:0;34828:85;;;;-1:-1:-1;;;34828:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27911:530;28038:12;28096:5;28071:21;:30;;28063:81;;;;-1:-1:-1;;;28063:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;28163:18;28174:6;28163:10;:18::i;:::-;28155:60;;;;;-1:-1:-1;;;28155:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;28289:12;28303:23;28330:6;-1:-1:-1;;;;;28330:11:0;28350:5;28358:4;28330:33;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;28330:33:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;28288:75;;;;28381:52;28399:7;28408:10;28420:12;28381:17;:52::i;:::-;28374:59;27911:530;-1:-1:-1;;;;;;;27911:530:0:o;40779:369::-;40861:37;40880:17;40861:18;:37::i;:::-;40853:104;;;;-1:-1:-1;;;40853:104:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;39988:66;41099:31;41084:57::o;30451:742::-;30566:12;30595:7;30591:595;;;-1:-1:-1;30626:10:0;30619:17;;30591:595;30740:17;;:21;30736:439;;31003:10;30997:17;31064:15;31051:10;31047:2;31043:19;31036:44;30951:148;31146:12;31139:20;;-1:-1:-1;;;31139:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Swarm Source

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