Contract 0xd78b188541c95e883b1fae17e1c4221895269b19

Contract Overview

Balance:
0 AVAX

AVAX Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x766041dcc048ead6eb9b898b759fe6a4ffcf6ea57d33bf4d1857efc5c6288d36Compound228447442022-11-26 0:22:5918 hrs 45 mins ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xc059c4d03ba7b92576a189a52030da7b2fb135c8104e98c4a7861dd7fde2f75bCompound228029552022-11-25 0:22:591 day 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0x1ba40b102492bc26b7b94728394b891b92903cfae2fb436a79431448f8eb0511Compound227610932022-11-24 0:23:002 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xb853b80cb253ab96ca5457e237c97233e6fa1dd4ea848c18dd85f7ba8977f019Compound227190122022-11-23 0:22:593 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02197706527.5
0x7f68926ed2d535b6b83d4b759c97d146424403a21c802c7c8ebc4eb5fb3ca125Deposit226825562022-11-22 3:36:034 days 15 hrs ago0x9cd34e3bf21413017b47327bb6c399fe1c4c464d IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.008352188 26
0xb55323dd63abf92691f3c35d5e55447e2910e580778cc0897fd795f91d5307c9Compound226769712022-11-22 0:23:004 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02197706527.5
0x0de494411e66020602e801b3cd0c9b94e161c191a73062a7346d9c64a12d39efDeposit226518922022-11-21 10:11:025 days 8 hrs ago0x9cd34e3bf21413017b47327bb6c399fe1c4c464d IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.008796788 26
0xb84755061faf54845d97f033b6190a2e3dcf9e5052c47ecabfb0e0656a9e1be5Compound226346282022-11-21 0:22:595 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xce8cc64d3b5210f974c3015acf817883d4b640af3d9f6fb72ecb0cf807a3c28dCompound225933092022-11-20 0:23:006 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xf4d4b8b53da48254cfca57dab729cd6c0204d720255c5f9699dd83bf09016685Compound225523192022-11-19 0:22:597 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0x7c0c50553d004fa37509ec51d101bed56126897c783ab6261e24be965c0d8cf9Compound225111362022-11-18 0:23:008 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xd7648c1e56f50d52d41fd3e4014a23d8ad3ebf4fc1e5cfd2fbadf05b91f7987cCompound224698202022-11-17 0:23:009 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xbc9f3fd5063e101877fd7fc89d29c38272c31dd422ca5121a12c565525f4f59bCompound224286102022-11-16 0:22:5910 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0x7c6d2821613fffe91f4369001be620e1674754644dccc274d8b41ce7510e135aCompound223871482022-11-15 0:23:0011 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0x3067cee2abdeed0dca9f0c7b73ab488ed8e31c17b7ae2f9857a6555bc511e605Compound223451262022-11-14 0:22:5912 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xe4042835f131ebcfc6deed64f6b75b01af51726139da3e1a91826c669d09d6f2Compound223051292022-11-13 1:30:5413 days 17 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0x60145623a08238d908b5aaac64828d6d0ba9f0342014ac2c419cd41f09723db6Compound223034042022-11-13 0:30:5613 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.0089784227.5
0xd055df130b177c61783b16d05cdb1676c62a1b8c45f4d765e50f47ee4ca8ccd2Compound222633052022-11-12 1:30:5514 days 17 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0x0618799561dd8c94c88df0b06bbedd71787f503cbc55cf110ad189f5a5e3a5a1Compound222615792022-11-12 0:30:5514 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.0089784227.5
0xbd6b6ad717861fba997fa96e5c22915160eab82cc64cea8dd54bc277eaa7b25aCompound222210882022-11-11 1:30:5515 days 17 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xde97f795736b158819b078b1cdabe8bdc7a95166e00bf61128b4e3e7507a2ddaCompound222193282022-11-11 0:30:5515 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.0089784227.5
0xe34390561d4d73b56dfb5483188f13514a7e895c2e156c8a595cf9eea1a46e1eCompound221781792022-11-10 1:30:5516 days 17 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0x79d84d286c756d491f29f835d6dd8a27377d6e7ce1aeba4debafeb0b4b9b318fCompound221763782022-11-10 0:30:5616 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.0089784227.5
0xd3cb78d73035ebaa947a39d495fa66e1b5b59894f3ad09f7bc5e3b32f4e107a4Compound221348352022-11-09 1:30:5317 days 17 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.02257238527.5
0xb24d75a1c385730d98e24aadd27b2a532fdc32c5c3e88c1720cf9c018ed75d2dCompound221330462022-11-09 0:30:5617 days 18 hrs ago0x2d837135f67385c7af021ccadc373a312f85bbd6 IN  0xd78b188541c95e883b1fae17e1c4221895269b190 AVAX0.0089784227.5
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x766041dcc048ead6eb9b898b759fe6a4ffcf6ea57d33bf4d1857efc5c6288d36228447442022-11-26 0:22:5918 hrs 45 mins ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.095763457882715028 AVAX
0x766041dcc048ead6eb9b898b759fe6a4ffcf6ea57d33bf4d1857efc5c6288d36228447442022-11-26 0:22:5918 hrs 45 mins ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.095763457882715028 AVAX
0xc059c4d03ba7b92576a189a52030da7b2fb135c8104e98c4a7861dd7fde2f75b228029552022-11-25 0:22:591 day 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.097397381960416728 AVAX
0xc059c4d03ba7b92576a189a52030da7b2fb135c8104e98c4a7861dd7fde2f75b228029552022-11-25 0:22:591 day 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.097397381960416728 AVAX
0x1ba40b102492bc26b7b94728394b891b92903cfae2fb436a79431448f8eb0511227610932022-11-24 0:23:002 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.098667555719362684 AVAX
0x1ba40b102492bc26b7b94728394b891b92903cfae2fb436a79431448f8eb0511227610932022-11-24 0:23:002 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.098667555719362684 AVAX
0xb853b80cb253ab96ca5457e237c97233e6fa1dd4ea848c18dd85f7ba8977f019227190122022-11-23 0:22:593 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.096931657742685613 AVAX
0xb853b80cb253ab96ca5457e237c97233e6fa1dd4ea848c18dd85f7ba8977f019227190122022-11-23 0:22:593 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.085541637266188727 AVAX
0xb853b80cb253ab96ca5457e237c97233e6fa1dd4ea848c18dd85f7ba8977f019227190122022-11-23 0:22:593 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.011390020476496886 AVAX
0xb55323dd63abf92691f3c35d5e55447e2910e580778cc0897fd795f91d5307c9226769712022-11-22 0:23:004 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.084684171194767118 AVAX
0xb55323dd63abf92691f3c35d5e55447e2910e580778cc0897fd795f91d5307c9226769712022-11-22 0:23:004 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.050306088449066819 AVAX
0xb55323dd63abf92691f3c35d5e55447e2910e580778cc0897fd795f91d5307c9226769712022-11-22 0:23:004 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.034378082745700299 AVAX
0xb84755061faf54845d97f033b6190a2e3dcf9e5052c47ecabfb0e0656a9e1be5226346282022-11-21 0:22:595 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.083964128519875059 AVAX
0xb84755061faf54845d97f033b6190a2e3dcf9e5052c47ecabfb0e0656a9e1be5226346282022-11-21 0:22:595 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.083964128519875059 AVAX
0xce8cc64d3b5210f974c3015acf817883d4b640af3d9f6fb72ecb0cf807a3c28d225933092022-11-20 0:23:006 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.083743963683841273 AVAX
0xce8cc64d3b5210f974c3015acf817883d4b640af3d9f6fb72ecb0cf807a3c28d225933092022-11-20 0:23:006 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.083743963683841273 AVAX
0xf4d4b8b53da48254cfca57dab729cd6c0204d720255c5f9699dd83bf09016685225523192022-11-19 0:22:597 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.082414376553489519 AVAX
0xf4d4b8b53da48254cfca57dab729cd6c0204d720255c5f9699dd83bf09016685225523192022-11-19 0:22:597 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.082414376553489519 AVAX
0x7c0c50553d004fa37509ec51d101bed56126897c783ab6261e24be965c0d8cf9225111362022-11-18 0:23:008 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.08657767746913504 AVAX
0x7c0c50553d004fa37509ec51d101bed56126897c783ab6261e24be965c0d8cf9225111362022-11-18 0:23:008 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.08657767746913504 AVAX
0xd7648c1e56f50d52d41fd3e4014a23d8ad3ebf4fc1e5cfd2fbadf05b91f7987c224698202022-11-17 0:23:009 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.086660096866204965 AVAX
0xd7648c1e56f50d52d41fd3e4014a23d8ad3ebf4fc1e5cfd2fbadf05b91f7987c224698202022-11-17 0:23:009 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.086660096866204965 AVAX
0xbc9f3fd5063e101877fd7fc89d29c38272c31dd422ca5121a12c565525f4f59b224286102022-11-16 0:22:5910 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.085973252163599559 AVAX
0xbc9f3fd5063e101877fd7fc89d29c38272c31dd422ca5121a12c565525f4f59b224286102022-11-16 0:22:5910 days 18 hrs ago Benqi Finance: Comptroller 0xd78b188541c95e883b1fae17e1c4221895269b190.085973252163599559 AVAX
0x7c6d2821613fffe91f4369001be620e1674754644dccc274d8b41ce7510e135a223871482022-11-15 0:23:0011 days 18 hrs ago 0xd78b188541c95e883b1fae17e1c4221895269b19 Wrapped AVAX0.086548982035171889 AVAX
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
lendingQiErc20

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 24 : lendingQiErc20.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.7.0;
import "../superQiToken/superQiErc20.sol";
import "../lendingSuperToken.sol";
// lendingQiErc20 is a combination of super benqi ERC20 token and lending pool.
//
// This contract will benefit from mining income and loan interest income.
contract lendingQiErc20 is superQiErc20,lendingSuperToken {
    using SafeMath for uint256;
    constructor(address multiSignature,address origin0,address origin1,address _stakeToken,
    address payable _swapHelper,address payable _feePool,address leverageFactory,uint256 _assetFloor)
        superQiErc20(multiSignature,origin0,origin1,_stakeToken,_swapHelper,_feePool) 
        lendingSuperToken(leverageFactory,_assetFloor) {
        setTokenInfo("Lending ","L");
    }
    function getTotalAssets() internal virtual override view returns (uint256){
        return getAvailableBalance().add(totalAssetAmount());
    }
}

File 2 of 24 : ISwapHelper.sol
/**
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright (C) 2020 defrost Protocol
 */
pragma solidity >=0.7.0 <0.8.0;
interface ISwapHelper {
    function WAVAX() external view returns (address);
    function swapExactTokens(
        address token0,
        address token1,
        uint256 amountIn,
        uint256 amountOutMin,
        address to
    ) external payable returns (uint256 amountOut);
    function swapExactTokens_oracle(
        address token0,
        address token1,
        uint256 amountIn,
        uint256 slipRate,
        address to
    ) external payable returns (uint256 amountOut);
    function swapToken_exactOut(address token0,address token1,uint256 amountMaxIn,uint256 amountOut,address to) external returns (uint256);
    function swapToken_exactOut_oracle(address token0,address token1,uint256 amountOut,uint256 slipRate,address to) external returns (uint256);
    function getAmountIn(address token0,address token1,uint256 amountOut)external view returns (uint256);
    function getAmountOut(address token0,address token1,uint256 amountIn)external view returns (uint256);
}

File 3 of 24 : superTokenInterface.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.7.0 <0.8.0;
import "../modules/SafeMath.sol";
import "../modules/IERC20.sol";
import "../interfaces/IWAVAX.sol";
import "../swapHelper/ISwapHelper.sol";
import "../modules/safeErc20.sol";
import "../modules/ERC20.sol";
// superTokenInterface is the coolest vault in town. You come in with some token, and leave with more! The longer you stay, the more token you get.
//
// This contract handles swapping to and from superTokenInterface.
abstract contract superTokenInterface is ERC20{
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;
    uint256 constant calDecimals = 1e18;
    IERC20 public asset;
    ISwapHelper public swapHelper;
    IWAVAX public WAVAX;
    uint256 public slipRate = 98e16;

    address payable public feePool;
        struct rewardInfo {
        uint8 rewardType;
        bool bClosed;
        address rewardToken;
        uint256 sellLimit;
    }
    uint64[3] public feeRate;
    uint256 internal constant compoundFeeID = 0;
    uint256 internal constant enterFeeID = 1;
    uint256 internal constant flashFeeID = 2;
    /**
     * @dev `sender` has exchanged `assets` for `shares`, and transferred those `shares` to `receiver`.
     */
    event Deposit(address indexed sender, address indexed receiver, uint256 assets, uint256 shares);

    /**
     * @dev `sender` has exchanged `shares` for `assets`, and transferred those `assets` to `receiver`.
     */
    event Withdraw(address indexed sender, address indexed receiver, uint256 assets, uint256 shares);
    event LendTo(address indexed sender,address indexed account,uint256 amount);
    event RepayFrom(address indexed sender,address indexed account,uint256 amount);
    event SetReward(address indexed sender, uint256 index,uint8 _reward,bool _bClosed,address _rewardToken,uint256 _sellLimit);
    function onDeposit(address account,uint256 _amount,uint64 _fee)internal virtual returns(uint256);
    function onWithdraw(address account,uint256 _amount)internal virtual returns(uint256);
    function getAvailableBalance() internal virtual view returns (uint256);
    function onCompound() internal virtual;
    function getTotalAssets() internal virtual view returns (uint256);
    function getMidText()internal virtual returns(string memory,string memory);
    receive() external payable {
        // React to receiving ether
    }
    function setTokenInfo(string memory _prefixName,string memory _prefixSympol)internal{
        (string memory midName,string memory midSymbol) = getMidText();
        string memory tokenName_ = string(abi.encodePacked(_prefixName,midName,asset.name()));
        string memory symble_ = string(abi.encodePacked(_prefixSympol,midSymbol,asset.symbol()));
        setErc20Info(tokenName_,symble_,asset.decimals());
    }
    function availableBalance() external view returns (uint256){
        return getAvailableBalance();
    }
    function swapOnDex(address token,uint256 sellLimit)internal{
        uint256 balance = (token != address(0)) ? IERC20(token).balanceOf(address(this)) : address(this).balance;
        if (balance < sellLimit){
            return;
        }
        swapTokensOnDex(token,address(asset),balance);
    }
    function swapTokensOnDex(address token0,address token1,uint256 balance)internal{
        if(token0 == token1){
            return;
        }
        if (token0 == address(0)){
            WAVAX.deposit{value: balance}();
            token0 = address(WAVAX);
            if(token1 == address(WAVAX)){
                 return;
            }
        }else if(token0 == address(WAVAX) && token1 == address(0)){
            WAVAX.withdraw(balance);
            return;
        }
        approveRewardToken(token0);
        swapHelper.swapExactTokens_oracle(token0,token1,balance,slipRate,address(this));
    }
    function _safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, 'ETH_TRANSFER_FAILED');
    }
    modifier notZeroAddress(address inputAddress) {
        require(inputAddress != address(0), "superToken : Zero Address");
        _;
    }
    function approveRewardToken(address token)internal {
        if(token != address(0) && IERC20(token).allowance(address(this), address(swapHelper)) == 0){
            SafeERC20.safeApprove(IERC20(token), address(swapHelper), uint(-1));
        }
    }
    function _setReward(rewardInfo[] storage rewardInfos,uint256 index,uint8 _reward,bool _bClosed,address _rewardToken,uint256 _sellLimit) internal virtual{
        if(index <rewardInfos.length){
            rewardInfo storage info = rewardInfos[index];
            info.rewardType = _reward;
            info.bClosed = _bClosed;
            info.rewardToken = _rewardToken;
            info.sellLimit = _sellLimit;
        }else{
            rewardInfos.push(rewardInfo(_reward,_bClosed,_rewardToken,_sellLimit));
        }
        emit SetReward(msg.sender,index,_reward,_bClosed,_rewardToken,_sellLimit);
    }
}

File 4 of 24 : superQiTokenImpl.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.7.0 <0.8.0;
import "../../interfaces/ICToken.sol";
import "../../interfaces/IBenqiCompound.sol";
import "../../modules/safeErc20.sol";
import "../superTokenInterface.sol";
// superToken is the coolest vault in town. You come in with some token, and leave with more! The longer you stay, the more token you get.
//
// This contract handles swapping to and from superToken.
abstract contract superQiTokenImpl is superTokenInterface{
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    IBenqiCompound public compounder;
    rewardInfo[] public benqiRewardInfos;
    IERC20 public qiToken;
    constructor(address _lendingToken){
        qiToken = IERC20(_lendingToken);
        compounder = IBenqiCompound(ICErc20(address(qiToken)).comptroller());
        setBenqiRewardToken(0,0,false,0x8729438EB15e2C8B576fCc6AeCdA6A148776C0F5,1e17);//qi
        setBenqiRewardToken(1,1,false,address(0),1e15);//avax
    }
    function getAvailableBalance() internal virtual override view returns (uint256){
        return _getTotalAssets();
    }
    function getTotalAssets() internal virtual override view returns (uint256){
        return _getTotalAssets();
    }
    function _getTotalAssets() internal view returns (uint256){
        uint256 exchangeRate = ICErc20(address(qiToken)).exchangeRateStored();
        return exchangeRate.mul(qiToken.balanceOf(address(this)))/calDecimals;
    }
    function setBenqiRewardToken(uint256 index,uint8 _reward,bool _bClosed,address _rewardToken,uint256 _sellLimit)internal { 
        require(_rewardToken != address(qiToken), "reward token error!");
        _setReward(benqiRewardInfos,index,_reward,_bClosed,_rewardToken,_sellLimit);
    }
    function claimRewards() internal {
        uint nLen = benqiRewardInfos.length;
        for (uint i=0;i<nLen;i++){
            rewardInfo memory info = benqiRewardInfos[i];
            if(info.bClosed){
                return;
            }
            address[] memory qiTokens = new address[](1); 
            qiTokens[0] = address(qiToken);
            compounder.claimReward(info.rewardType,address(this),qiTokens);
            swapOnDex(info.rewardToken,info.sellLimit);
        }
    }
    function getMidText()internal virtual override returns(string memory,string memory){
        return ("Benqi ","qi");
    }
}

File 5 of 24 : superQiErc20Impl.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.7.0 <0.8.0;

import "./superQiTokenImpl.sol";

//
// This contract handles swapping to and from superQiErc20
abstract contract superQiErc20Impl is superQiTokenImpl {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    // Define the qiToken token contract
    constructor(address _lendingToken) superQiTokenImpl(_lendingToken){
        asset = IERC20(ICErc20(address(qiToken)).underlying());
        SafeERC20.safeApprove(asset, address(qiToken), uint(-1));
    }
    function onDeposit(address account,uint256 _amount,uint64 _fee)internal virtual override returns(uint256){
        asset.safeTransferFrom(account, address(this), _amount);
        return qiSupply(_fee);
    }
    function onWithdraw(address account,uint256 _amount)internal virtual override returns(uint256){
        uint256 success = ICErc20(address(qiToken)).redeemUnderlying(_amount);
        require(success == 0, "benqi redeem error");
        asset.safeTransfer(account, _amount);
        return _amount;
    }
    function qiWithdraw()internal{
        uint256 success = ICErc20(address(qiToken)).redeem(qiToken.balanceOf(address(this)));
        require(success == 0, "benqi redeem error");
    }
    function qiSupply(uint256 _fee) internal returns (uint256){
        uint256 balance = asset.balanceOf(address(this));
        if (balance>0){
            uint256 fee = balance.mul(_fee)/calDecimals;
            if (fee > 0){
                asset.safeTransfer(feePool,fee);
            }
            balance = balance.sub(fee);
            ICErc20(address(qiToken)).mint(balance);
            return balance;
        }
        return 0;
    }
    function onCompound() internal virtual override{
        claimRewards();
        qiSupply(feeRate[compoundFeeID]);
    }
}

File 6 of 24 : superQiErc20.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.7.0;
import "../superQiTokenImpl/superQiErc20Impl.sol";
import "../baseSuperToken.sol";
// lendingAaveErc20 is a combination of super aave ERC20 token and lending pool.
//
// This contract will benefit from mining income and loan interest income.
contract superQiErc20 is baseSuperToken,superQiErc20Impl {
    constructor(address multiSignature,address origin0,address origin1,address _stakeToken,
    address payable _swapHelper,address payable _feePool)
        baseSuperToken(multiSignature,origin0,origin1,_swapHelper,_feePool) superQiErc20Impl(_stakeToken) {
        setTokenInfo("Super ","S");
    }
    function setReward(uint256 index,uint8 _reward,bool _bClosed,address _rewardToken,uint256 _sellLimit)  external onlyOrigin {
        setBenqiRewardToken(index,_reward,_bClosed,_rewardToken,_sellLimit);
    }
}

File 7 of 24 : lendingSuperToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.7.0 <0.8.0;

import "./baseSuperToken.sol";
import "../modules/IERC20.sol";
import "../modules/SafeMath.sol";
import "../modules/safeErc20.sol";
import "../interestEngine/interestLinearEngineHash.sol";
import "./superTokenInterface.sol";
// superToken is the coolest vault in town. You come in with some token, and leave with more! The longer you stay, the more token you get.
//
// This contract handles swapping to and from superToken.
abstract contract lendingSuperToken is superTokenInterface,interestLinearEngineHash{
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    uint256 public interestFee = 5e14;
    address public immutable ownerLeverageFactory;
        // --- Auth ---
    mapping (address => uint256) public authorizedAccounts;
    event Borrow(address indexed sender,bytes32 indexed account,address indexed token,uint256 reply);
    event Repay(address indexed sender,bytes32 indexed account,address indexed token,uint256 amount);
    event SetInterestFee(address indexed sender,uint256 interestFee);
    event AddAuthorization(address account);
    event RemoveAuthorization(address account);
    event SetPoolLimitation(address indexed sender,uint256 assetCeiling,uint256 assetFloor);
    constructor(address leverageFactory,uint256 _assetFloor){
//        authorizedAccounts[leverageFactory] = 1;
        ownerLeverageFactory = leverageFactory;
        assetCeiling = uint(-1);
        assetFloor = _assetFloor;
        _setInterestInfo(23148148148148148148,1,1e30,1e27);
    } 
    function setPoolLimitation(uint256 _assetCeiling,uint256 _assetFloor)external isFactory{
        assetCeiling = _assetCeiling;
        assetFloor = _assetFloor;
        emit SetPoolLimitation(msg.sender,_assetCeiling,_assetFloor);
    }
    /**
     * @notice Add auth to an account
     * @param account Account to add auth to
     */
    function addAuthorization(address account) external isFactory notZeroAddress(account) {
        authorizedAccounts[account] = 1;
        emit AddAuthorization(account);
    }
    /**
     * @notice Remove auth from an account
     * @param account Account to remove auth from
     */
    function removeAuthorization(address account) external isFactory notZeroAddress(account) {
        authorizedAccounts[account] = 0;
        emit RemoveAuthorization(account);
    }
    /**
    * @notice Checks whether msg.sender can call an authed function
    **/
    modifier isAuthorized {
        require(authorizedAccounts[msg.sender] == 1, "leverageSuperToken : account is not authorized");
        _;
    }
    modifier isFactory {
        require(msg.sender == ownerLeverageFactory,"sender is not owner factory");
        _;
    }
    function setInterestFee(uint256 _interestFee) external isFactory {
        require(_interestFee<=5e17,"input interest rate is too large");
        interestFee = _interestFee;
        emit SetInterestFee(msg.sender,_interestFee);
    }
    function setInterestRate(int256 _interestRate,uint256 rateInterval)external isFactory{
        _setInterestInfo(_interestRate,rateInterval,1e30,1e27);
    }
    function totalLoan()external view returns(uint256){
        return totalAssetAmount();
    }
    function loan(bytes32 account) external view returns(uint256){
        return getAssetBalance(account);
    }
    function borrowLimit()external view returns (uint256){
        return getAvailableBalance();
    }
    function borrow(bytes32 account,uint256 amount) external isAuthorized {
        addAsset(account,amount);
        onWithdraw(msg.sender,amount);
        emit Borrow(msg.sender,account, address(asset),amount);
    }
    function repay(bytes32 account,uint256 amount) external payable isAuthorized {
        if (amount == uint(-1)){
            amount = getAssetBalance(account);
        }
        uint256 _repayDebt = subAsset(account,amount);
        if(amount>_repayDebt){
            uint256 fee = amount.sub(_repayDebt).mul(interestFee)/calDecimals;
            if (fee>0){
                asset.safeTransferFrom(msg.sender, feePool, fee);
            }
            amount = amount.sub(fee);
        }
        onDeposit(msg.sender,amount,0);
        emit Repay(msg.sender,account,address(asset),amount);
    }

}

File 8 of 24 : baseSuperToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.7.0 <0.8.0;

import "./superTokenInterface.sol";
import "../modules/IERC20.sol";
import "../modules/safeErc20.sol";
import "../modules/proxyOwner.sol";
import "../interfaces/IERC3156FlashBorrower.sol";
import "../modules/ReentrancyGuard.sol";
import "../modules/timeLockSetting.sol";
// superToken is the coolest vault in town. You come in with some token, and leave with more! The longer you stay, the more token you get.
//
// This contract handles swapping to and from superToken.
abstract contract baseSuperToken is timeLockSetting,superTokenInterface,proxyOwner,ReentrancyGuard{
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    bytes32 private constant _RETURN_VALUE = keccak256("ERC3156FlashBorrower.onFlashLoan");
    uint256 public latestCompoundTime;

    event Compound(address indexed sender);
    event FlashLoan(address indexed sender,address indexed receiver,address indexed token,uint256 amount);
    event SetFeePoolAddress(address indexed sender,address _feePool);
    event SetSlipRate(address indexed sender,uint256 _slipRate);
    event SetFeeRate(address indexed sender,uint256 index,uint256 _feeRate);
    // Define the baseSuperToken token contract
    constructor(address multiSignature,address origin0,address origin1,
        address payable _swapHelper,address payable _feePool)
        proxyOwner(multiSignature,origin0,origin1) {
        feePool = _feePool;
        swapHelper = ISwapHelper(_swapHelper);
        WAVAX = IWAVAX(swapHelper.WAVAX());
        feeRate[compoundFeeID] = 2e17;
        feeRate[enterFeeID] = 0;
        feeRate[flashFeeID] = 1e14;
    }
    function getRate()external view returns(uint256){
        // Gets the amount of superToken in existence
        uint256 totalShares = totalSupply();
        // Calculates the amount of stakeToken the superToken is worth
        if (totalShares>0){
            return getTotalAssets().mul(calDecimals)/totalShares;
        }
        return calDecimals;
    }
    // Enter the bar. Pay some stakeTokens. Earn some shares.
    // Locks stakeToken and mints superToken
    function deposit(uint256 _amount, address receiver) external returns (uint256){
        uint256 amount = _deposit(msg.sender,_amount,receiver);
        emit Deposit(msg.sender,receiver,_amount,amount);
        return amount;
    }
    // Burns _share from owner and sends exactly _value of asset tokens to receiver.
    function withdraw(uint256 _value,address receiver,address owner) external returns (uint256) {
        uint256 _share = convertToShares(_value);
        _withdraw(_value,_share,receiver,owner);
        emit Withdraw(msg.sender,receiver,_value,_share);
        return _share;
    }

    // Burns exactly shares from owner and sends assets of asset tokens to receiver.
    function redeem(uint256 shares,address receiver,address owner) external returns (uint256) {
        uint256 _value = convertToAssets(shares);
        _withdraw(_value,shares,receiver,owner);
        emit Withdraw(msg.sender,receiver,_value,shares);
        return _value;
    }
    //The amount of shares that the Vault would exchange for the amount of assets provided, in an ideal scenario where all the conditions are met.
    function convertToShares(uint256 _assetNum) public view returns(uint256){
        return _assetNum.mul(totalSupply())/getTotalAssets();
    }
    //The amount of assets that the Vault would exchange for the amount of shares provided, in an ideal scenario where all the conditions are met.
    function convertToAssets(uint256 _shareNum) public view returns(uint256){
        return _shareNum.mul(getTotalAssets())/totalSupply();
    }
    function _withdraw(uint256 _assetNum,uint256 _shareNum,address receiver,address owner) internal {
        require(msg.sender == owner,"owner must be msg.sender!");
        require(_shareNum>0,"super token burn 0!");
        _burn(msg.sender, _shareNum);
        _assetNum = onWithdraw(receiver, _assetNum);
    }
    function _deposit(address from,uint256 _amount, address receiver) internal returns (uint256){
        // Gets the amount of stakeToken locked in the contract
        uint256 totaStake = getTotalAssets();
        // Gets the amount of superToken in existence
        uint256 totalShares = totalSupply();
        _amount = onDeposit(from,_amount,feeRate[enterFeeID]);
        // If no superToken exists, mint it 1:1 to the amount put in
        if (totalShares == 0 || totaStake == 0) {
            _mint(receiver, _amount);
            return _amount;
        }
        // Calculate and mint the amount of superToken the stakeToken is worth. The ratio will change overtime, as superToken is burned/minted and stakeToken deposited + gained from fees / withdrawn.
        else {
            uint256 what = _amount.mul(totalShares)/totaStake;
            require(what>0,"super token mint 0!");
            _mint(receiver, what);
            return what;
        }
    }
    function depositETH(address receiver)external payable AVAXUnderlying nonReentrant returns(uint256){
        WAVAX.deposit{value: msg.value}();
        uint256 amount = _deposit(address(this),msg.value,receiver);
        emit Deposit(msg.sender,receiver,msg.value,amount);
        return amount;
    }
    function withdrawETH(uint256 _value,address receiver,address owner) external AVAXUnderlying nonReentrant returns (uint256) {
        uint256 _share = convertToShares(_value);
        _withdraw(_value,_share,address(this),owner);
        WAVAX.withdraw(_value);
        _safeTransferETH(receiver, _value);
        emit Withdraw(msg.sender,receiver,_value,_share);
        return _share;
    }
    function redeemETH(uint256 shares,address receiver,address owner) external AVAXUnderlying nonReentrant returns (uint256) {
        uint256 _value = convertToAssets(shares);
        _withdraw(_value,shares,address(this),owner);
        WAVAX.withdraw(_value);
        _safeTransferETH(receiver, _value);
        emit Withdraw(msg.sender,receiver,_value,shares);
        return _value;
    }
    function totalAssets()external view returns(uint256){
        return getTotalAssets();
    }
    function compound() external {
        latestCompoundTime = block.timestamp;
        onCompound();
        emit Compound(msg.sender);
    }
    function setFeePoolAddress(address payable feeAddress)external onlyOrigin notZeroAddress(feeAddress){
        feePool = feeAddress;
        emit SetFeePoolAddress(msg.sender,feeAddress);
    }
    function setSlipRate(uint256 _slipRate) external onlyOrigin{
        require(_slipRate < 1e18,"slipRate out of range!");
        slipRate = _slipRate;
        emit SetSlipRate(msg.sender,_slipRate);
    }
    function setFeeRate(uint256 index,uint64 _feeRate) external onlyOrigin{
        require(_feeRate < 5e17,"feeRate out of range!");
        feeRate[index] = _feeRate;
        emit SetFeeRate(msg.sender,index,_feeRate);
    }
    
    function setSwapHelper(address _swapHelper) external onlyOrigin notZeroAddress(_swapHelper) {
        require(_swapHelper != address(swapHelper),"SwapHelper set error!");
        _set(1,uint256(_swapHelper));
    }
    function acceptSwapHelper() external onlyOrigin {
        swapHelper = ISwapHelper(address(_accept(1)));
    }

    function maxFlashLoan(address token) external view returns (uint256){
        require(token == address(asset),"flash borrow token Error!");
        return getAvailableBalance();
    }
    function flashFee(address token, uint256 amount) public view virtual returns (uint256) {
        // silence warning about unused variable without the addition of bytecode.
        require(token == address(asset),"flash borrow token Error!");
        return amount.mul(feeRate[flashFeeID])/calDecimals;
    }
    modifier AVAXUnderlying() {
        require(address(asset) == address(WAVAX), "Not WAVAX super token");
        _;
    }
    function flashLoan(
        IERC3156FlashBorrower receiver,
        address token,
        uint256 amount,
        bytes calldata data
    ) external virtual returns (bool) {
        require(token == address(asset),"flash borrow token Error!");
        uint256 fee = flashFee(token, amount);
        onWithdraw(address(receiver),amount);
        require(
            receiver.onFlashLoan(msg.sender, token, amount, fee, data) == _RETURN_VALUE,
            "invalid return value"
        );
        onDeposit(address(receiver),amount + fee,0);
        emit FlashLoan(msg.sender,address(receiver),token,amount);
        return true;
    }
}

File 9 of 24 : timeLockSetting.sol
/**
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright (C) 2020 defrost Protocol
 */
pragma solidity >=0.7.0 <0.8.0;
abstract contract timeLockSetting{
    struct settingInfo {
        uint256 info;
        uint256 acceptTime;
    }
    mapping(uint256=>settingInfo) public settingMap;
    uint256 public constant timeSpan = 2 days;

    event SetValue(address indexed from,uint256 indexed key, uint256 value,uint256 acceptTime);
    event AcceptValue(address indexed from,uint256 indexed key, uint256 value);
    function _set(uint256 key, uint256 _value)internal{
        settingMap[key] = settingInfo(_value,block.timestamp+timeSpan);
        emit SetValue(msg.sender,key,_value,block.timestamp+timeSpan);
    }
    function _remove(uint256 key)internal{
        settingMap[key] = settingInfo(0,0);
        emit SetValue(msg.sender,key,0,0);
    }
    function _accept(uint256 key)internal returns(uint256){
        require(settingMap[key].acceptTime>0 && settingMap[key].acceptTime < block.timestamp , "timeLock error!");
        emit AcceptValue(msg.sender,key,settingMap[key].info);
        return settingMap[key].info;
    }
}

File 10 of 24 : safeErc20.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.0 <0.8.0;

import "./IERC20.sol";
import "../modules/SafeMath.sol";
import "../modules/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 {
        if (address(this) == to){
            return;
        }
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        if (from == to){
            return;
        }
        _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);
        _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 11 of 24 : proxyOwner.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.0 <0.8.0;

/**
 * @title  proxyOwner Contract

 */
import "./multiSignatureClient.sol";
contract proxyOwner is multiSignatureClient{
    bytes32 private constant proxyOwnerPosition  = keccak256("org.defrost.Owner.storage");
    bytes32 private constant proxyOriginPosition0  = keccak256("org.defrost.Origin.storage.0");
    bytes32 private constant proxyOriginPosition1  = keccak256("org.defrost.Origin.storage.1");
    uint256 private constant oncePosition  = uint256(keccak256("org.defrost.Once.storage"));
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event OriginTransferred(address indexed previousOrigin, address indexed newOrigin);
    constructor(address multiSignature,address origin0,address origin1) multiSignatureClient(multiSignature) {
        require(multiSignature != address(0) &&
        origin0 != address(0)&&
        origin1 != address(0),"proxyOwner : input zero address");
        _setProxyOwner(msg.sender);
        _setProxyOrigin(address(0),origin0);
        _setProxyOrigin(address(0),origin1);
    }
    /**
     * @dev Allows the current owner to transfer ownership
     * @param _newOwner The address to transfer ownership to
     */

    function transferOwnership(address _newOwner) external onlyOwner
    {
        _setProxyOwner(_newOwner);
    }
    function _setProxyOwner(address _newOwner) internal 
    {
        emit OwnershipTransferred(owner(),_newOwner);
        bytes32 position = proxyOwnerPosition;
        assembly {
            sstore(position, _newOwner)
        }
    }
    function owner() public view returns (address _owner) {
        bytes32 position = proxyOwnerPosition;
        assembly {
            _owner := sload(position)
        }
    }
    /**
    * @dev Throws if called by any account other than the owner.
    */
    modifier onlyOwner() {
        require (isOwner(),"proxyOwner: caller must be the proxy owner and a contract and not expired");
        _;
    }
    function transferOrigin(address _oldOrigin,address _newOrigin) external onlyOrigin
    {
        _setProxyOrigin(_oldOrigin,_newOrigin);
    }
    function _setProxyOrigin(address _oldOrigin,address _newOrigin) internal 
    {
        emit OriginTransferred(_oldOrigin,_newOrigin);
        (address _origin0,address _origin1) = txOrigin();
        if (_origin0 == _oldOrigin){
            bytes32 position = proxyOriginPosition0;
            assembly {
                sstore(position, _newOrigin)
            }
        }else if(_origin1 == _oldOrigin){
            bytes32 position = proxyOriginPosition1;
            assembly {
                sstore(position, _newOrigin)
            }            
        }else{
            require(false,"OriginTransferred : old origin is illegal address!");
        }
    }
    function txOrigin() public view returns (address _origin0,address _origin1) {
        bytes32 position0 = proxyOriginPosition0;
        bytes32 position1 = proxyOriginPosition1;
        assembly {
            _origin0 := sload(position0)
            _origin1 := sload(position1)
        }
    }
    modifier originOnce() {
        require (isOrigin(),"proxyOwner: caller is not the tx origin!");
        uint256 key = oncePosition+uint32(msg.sig);
        require (getValue(key)==0, "proxyOwner : This function must be invoked only once!");
        saveValue(key,1);
        _;
    }
    function isOrigin() public view returns (bool){
        (address _origin0,address _origin1) = txOrigin();
        return  msg.sender == _origin0 || msg.sender == _origin1;
    }
    function isOwner() public view returns (bool) {
        return msg.sender == owner() && isContract(msg.sender);
    }
    /**
    * @dev Throws if called by any account other than the owner.
    */
    modifier onlyOrigin() {
        require (isOrigin(),"proxyOwner: caller is not the tx origin!");
        checkMultiSignature();
        _;
    }
    modifier OwnerOrOrigin(){
        if (isOwner()){
        }else if(isOrigin()){
            checkMultiSignature();
        }else{
            require(false,"proxyOwner: caller is not owner or origin");
        }
        _;
    }
    
    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;
    }
}

File 12 of 24 : multiSignatureClient.sol
/**
 * SPDX-License-Identifier: GPL-3.0-or-later
 * defrost
 * Copyright (C) 2020 defrost Protocol
 */
pragma solidity >=0.7.0 <0.8.0;

interface IMultiSignature{
    function getValidSignature(bytes32 msghash,uint256 lastIndex) external view returns(uint256);
}
//Multisignature  wallet client.
//The contract that inherits this contract needs to cooperate with the multiSignature contract for multi-signature
contract multiSignatureClient{
    uint256 private constant multiSignaturePositon = uint256(keccak256("org.defrost.multiSignature.storage"));
    /**
     * @param multiSignature multiSignature contract address
    */
    constructor(address multiSignature) {
        require(multiSignature != address(0),"multiSignatureClient : Multiple signature contract address is zero!");
        saveValue(multiSignaturePositon,uint256(multiSignature));
    }    
    function getMultiSignatureAddress()public view returns (address){
        return address(getValue(multiSignaturePositon));
    }
    modifier validCall(){
        checkMultiSignature();
        _;
    }
    function checkMultiSignature() internal {
        uint256 value;
        assembly {
            value := callvalue()
        }
        bytes32 msgHash = keccak256(abi.encodePacked(msg.sender, address(this),value,msg.data));
        address multiSign = getMultiSignatureAddress();
        uint256 index = getValue(uint256(msgHash));
        uint256 newIndex = IMultiSignature(multiSign).getValidSignature(msgHash,index);
        require(newIndex > index, "multiSignatureClient : This tx is not aprroved");
        saveValue(uint256(msgHash),newIndex);
    }
    function saveValue(uint256 position,uint256 value) internal 
    {
        assembly {
            sstore(position, value)
        }
    }
    function getValue(uint256 position) internal view returns (uint256 value) {
        assembly {
            value := sload(position)
        }
    }
}

File 13 of 24 : SignedSafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/SignedMath.sol)

pragma solidity >=0.7.0 <0.8.0;
/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SignedSafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SignedSafeMath {
    /**
     * @dev Returns the multiplication of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(int256 a, int256 b) internal pure returns (int256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two signed integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(int256 a, int256 b) internal pure returns (int256) {
        return a / b;
    }

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

    /**
     * @dev Returns the addition of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(int256 a, int256 b) internal pure returns (int256) {
        return a + b;
    }
}

File 14 of 24 : SafeMath.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.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, 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.
     *
     * _Available since v2.4.0._
     */
    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.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        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.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
    uint256 constant internal calDecimal = 1e18; 
    function mulPrice(uint256 value,uint256[2] memory prices,uint8 id)internal pure returns(uint256){
        return id == 0 ? div(mul(mul(prices[1],value),calDecimal),prices[0]) :
            div(mul(mul(prices[0],value),calDecimal),prices[1]);
    }
    function divPrice(uint256 value,uint256[2] memory prices,uint8 id)internal pure returns(uint256){
        return id == 0 ? div(div(mul(prices[0],value),calDecimal),prices[1]) :
            div(div(mul(prices[1],value),calDecimal),prices[0]);
    }
}

File 15 of 24 : ReentrancyGuard.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.0 <0.8.0;
abstract contract ReentrancyGuard {

  /**
   * @dev We use a single lock for the whole contract.
   */
  bool private reentrancyLock = false;
  /**
   * @dev Prevents a contract from calling itself, directly or indirectly.
   * @notice If you mark a function `nonReentrant`, you should also
   * mark it `external`. Calling one nonReentrant function from
   * another is not supported. Instead, you can implement a
   * `private` function doing the actual work, and a `external`
   * wrapper marked as `nonReentrant`.
   */
  modifier nonReentrant() {
    require(!reentrancyLock);
    reentrancyLock = true;
    _;
    reentrancyLock = false;
  }

}

File 16 of 24 : IERC20.sol
/**
 * SPDX-License-Identifier: GPL-3.0-or-later
 * defrost
 * Copyright (C) 2020 defrost Protocol
 */
pragma solidity >=0.7.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
interface IERC20 {
    function decimals() external view returns (uint8);
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    /**
     * @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);

      /**
     * EXTERNAL FUNCTION
     *
     * @dev change token name
     * @param _name token name
     * @param _symbol token symbol
     *
     */
    function changeTokenName(string calldata _name, string calldata _symbol)external;

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed sender, 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 17 of 24 : ERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// OpenZeppelin Contracts v4.4.0 (token/ERC20/ERC20.sol)

pragma solidity >=0.7.0 <0.8.0;


contract ERC20{
    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 Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed sender, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor() {
    }
    function setErc20Info(string memory name_, string memory symbol_,uint8 decimals_) internal{
        _name = name_;
        _symbol = symbol_;
        _decimals = decimals_;
    }
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() external 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 this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() external view returns (uint8) {
        return _decimals;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) external view 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) external returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

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

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) external returns (bool) {
        _approve(msg.sender, 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
    ) external returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][msg.sender];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, msg.sender, currentAllowance - amount);
        return true;
    }

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

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

        return true;
    }

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

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

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

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

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

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

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

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal {
        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);
    }

}

File 18 of 24 : Address.sol
// SPDX-License-Identifier: GPL-3.0-or-later

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 19 of 24 : IWAVAX.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.7.0;
import "../modules/IERC20.sol";
interface IWAVAX is IERC20 {
    /**
     * @dev returns the address of the aToken's underlying asset
     */
    // solhint-disable-next-line func-name-mixedcase
    function deposit() external payable;
    function withdraw(uint wad) external;
}

File 20 of 24 : IERC3156FlashBorrower.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156FlashBorrower.sol)

pragma solidity >=0.7.0 <0.8.0;

/**
 * @dev Interface of the ERC3156 FlashBorrower, as defined in
 * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
 *
 * _Available since v4.1._
 */
interface IERC3156FlashBorrower {
    /**
     * @dev Receive a flash loan.
     * @param initiator The initiator of the loan.
     * @param token The loan currency.
     * @param amount The amount of tokens lent.
     * @param fee The additional amount of tokens to repay.
     * @param data Arbitrary data structure, intended to contain user-defined parameters.
     * @return The keccak256 hash of "IERC3156FlashBorrower.onFlashLoan"
     */
    function onFlashLoan(
        address initiator,
        address token,
        uint256 amount,
        uint256 fee,
        bytes calldata data
    ) external returns (bytes32);
}

File 21 of 24 : ICToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.0 <0.8.0;
interface ICErc20{
    function exchangeRateStored() external view returns (uint);
    function underlying() external view returns (address);
    function mint(uint mintAmount) external returns (uint);
    function comptroller() external view returns (address);
    function redeem(uint redeemAmount) external returns (uint);
    function redeemUnderlying(uint redeemAmount) external returns (uint);
}
interface ICEther{
    function exchangeRateStored() external view returns (uint);
    function mint() external payable;
    function comptroller() external view returns (address);
    function redeem(uint redeemAmount) external returns (uint);
    function redeemUnderlying(uint redeemAmount) external returns (uint);
}

File 22 of 24 : IBenqiCompound.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.0 <0.8.0;
interface IBenqiCompound {
    function claimReward(uint8 rewardType, address payable holder, address[] memory qiTokens) external;
}

File 23 of 24 : interestLinearEngineHash.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.0 <0.8.0;
import "./baseInterestEngineHash.sol";
import "../modules/SignedSafeMath.sol";
/**
 * @title linear interest engine.
 * @dev calculate interest on assets,linear interest rate.
 *
 */
contract interestLinearEngineHash is baseInterestEngineHash{
    using SignedSafeMath for int256;
    using SafeMath for uint256;
    function calAccumulatedRate(uint256 baseRate,uint256 timeSpan,
        int256 _interestRate,uint256 _interestInterval)internal override pure returns (uint256){
        int256 newRate = _interestRate.mul(int256(timeSpan/_interestInterval));
        if (newRate>=0){
            return baseRate.add(uint256(newRate));
        }else{
            return baseRate.sub(uint256(-newRate));
        }
    }
}

File 24 of 24 : baseInterestEngineHash.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.7.0 <0.8.0;
import "../modules/SafeMath.sol";
/**
 * @title interest engine.
 * @dev Calculate interest on asset.
 *
 */
abstract contract baseInterestEngineHash{
    using SafeMath for uint256;

    //Special decimals for calculation
    uint256 constant internal rayDecimals = 1e27;
    uint256 constant internal InterestDecimals = 1e36;
    uint256 internal totalAsset;
    // Maximum amount of debt that can be generated with this collateral type
    uint256 public assetCeiling;       // [rad]
    // Minimum amount of debt that must be generated by a SAFE using this collateral
    uint256 public assetFloor;         // [rad]
    //interest rate
    int256 internal interestRate;
    uint256 internal interestInterval = 3600;
    struct assetInfo{
        uint256 originAsset;
        uint256 baseAsset;
    }
    // asset balance
    mapping(bytes32=>assetInfo) public assetInfoMap;

    // latest time to settlement
    uint256 internal latestSettleTime;
    // Accumulate interest rate.
    uint256 internal accumulatedRate;

    event SetInterestInfo(address indexed sender,int256 _interestRate,uint256 _interestInterval);
    event AddAsset(bytes32 indexed recieptor,uint256 amount);
    event SubAsset(bytes32 indexed account,uint256 amount,uint256 subOrigin);
    /**
     * @dev retrieve Interest informations.
     * @return distributed Interest rate and distributed time interval.
     */
    function getInterestInfo()external view returns(int256,uint256){
        return (interestRate,interestInterval);
    }

    /**
     * @dev Set mineCoin mine info, only foundation owner can invoked.
     * @param _interestRate mineCoin distributed amount
     * @param _interestInterval mineCoin distributied time interval
     */
    function _setInterestInfo(int256 _interestRate,uint256 _interestInterval,uint256 maxRate,uint256 minRate)internal {
        if (accumulatedRate == 0){
            accumulatedRate = rayDecimals;
        }
        require(_interestRate<=1e27 && _interestRate>=-1e27,"input interest rate is too large");
        require(_interestInterval>0,"input mine Interval must larger than zero");
        uint256 newLimit = calAccumulatedRate(rayDecimals,31536000,_interestRate,_interestInterval);
        require(newLimit<=maxRate && newLimit>=minRate,"input interest rate is out of range");
        _interestSettlement();
        interestRate = _interestRate;
        interestInterval = _interestInterval;
        emit SetInterestInfo(msg.sender,_interestRate,_interestInterval);
    }
    function totalAssetAmount()internal virtual view returns(uint256){
        return calInterestAmount(totalAsset,newAccumulatedRate());
    }
    function getAssetBalance(bytes32 account)internal virtual view returns(uint256){
        return calInterestAmount(assetInfoMap[account].baseAsset,newAccumulatedRate());
    }
    /**
     * @dev mint mineCoin to account when account add collateral to collateral pool, only manager contract can modify database.
     * @param account user's account
     * @param amount the mine shared amount
     */
    function addAsset(bytes32 account,uint256 amount) internal {
        assetInfoMap[account].originAsset = assetInfoMap[account].originAsset.add(amount);
        uint256 _currentRate = newAccumulatedRate();
        mintAsset(account,calBaseAmount(amount,_currentRate));
        require(calInterestAmount(assetInfoMap[account].baseAsset,_currentRate)+1 >= assetFloor, "Debt is below the limit");
        require(calInterestAmount(totalAsset,_currentRate) <= assetCeiling, "vault debt is overflow");
        emit AddAsset(account,amount);
    }
    /**
     * @dev repay user's debt and taxes.
     * @param amount repay amount.
     */
    function subAsset(bytes32 account,uint256 amount)internal returns(uint256) {
        uint256 originBalance = assetInfoMap[account].originAsset;
        uint256 _currentRate = newAccumulatedRate();
        uint256 assetAndInterest = calInterestAmount(assetInfoMap[account].baseAsset,_currentRate);
        
        uint256 _subAsset;
        if(assetAndInterest == amount){
            _subAsset = originBalance;
            assetInfoMap[account].originAsset = 0;
            burnAsset(account,assetInfoMap[account].baseAsset);
        }else if(assetAndInterest > amount){
            _subAsset = originBalance.mul(amount)/assetAndInterest;
            burnAsset(account,calBaseAmount(amount,_currentRate));
            require(calInterestAmount(assetInfoMap[account].baseAsset,_currentRate)+1 >= assetFloor, "Debt is below the limit");
            assetInfoMap[account].originAsset = originBalance.sub(_subAsset);
        }else{
            require(false,"overflow asset balance");
        }
        emit SubAsset(account,amount,_subAsset);
        return _subAsset;
    }
    //Accumulate interest rate when the insterest Rate is changed.
    function _interestSettlement()internal{
        uint256 _interestInterval = interestInterval;
        if (_interestInterval>0){
            accumulatedRate = newAccumulatedRate();
            latestSettleTime = currentTime()/_interestInterval*_interestInterval;
        }else{
            latestSettleTime = currentTime();
        }
    }
    //Calculate current accumulated interest
    function newAccumulatedRate()internal view returns (uint256){
        return calAccumulatedRate(accumulatedRate,currentTime().sub(latestSettleTime),interestRate,interestInterval);
    }
    //Calculate accumulated interest function
    function calAccumulatedRate(uint256 baseRate,uint256 timeSpan,
        int256 _interestRate,uint256 _interestInterval)internal virtual pure returns (uint256);
    function currentTime() internal virtual view returns (uint256){
        return block.timestamp;
    }
    function calBaseAmount(uint256 amount, uint256 _interestRate) internal pure returns(uint256){
        return amount.mul(InterestDecimals)/_interestRate;
    }
    function calInterestAmount(uint256 amount, uint256 _interestRate) internal pure returns(uint256){
        return amount.mul(_interestRate)/InterestDecimals;
    }
    function mintAsset(bytes32 account,uint256 amount)internal{
        assetInfoMap[account].baseAsset = assetInfoMap[account].baseAsset.add(amount);
        totalAsset = totalAsset.add(amount);
    }
    function burnAsset(bytes32 account,uint256 amount) internal{
        assetInfoMap[account].baseAsset = assetInfoMap[account].baseAsset.sub(amount);
        totalAsset = totalAsset.sub(amount);
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"multiSignature","type":"address"},{"internalType":"address","name":"origin0","type":"address"},{"internalType":"address","name":"origin1","type":"address"},{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"address payable","name":"_swapHelper","type":"address"},{"internalType":"address payable","name":"_feePool","type":"address"},{"internalType":"address","name":"leverageFactory","type":"address"},{"internalType":"uint256","name":"_assetFloor","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"key","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"AcceptValue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"recieptor","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"AddAuthorization","type":"event"},{"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":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"bytes32","name":"account","type":"bytes32"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"reply","type":"uint256"}],"name":"Borrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"Compound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FlashLoan","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LendTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOrigin","type":"address"},{"indexed":true,"internalType":"address","name":"newOrigin","type":"address"}],"name":"OriginTransferred","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":"RemoveAuthorization","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"bytes32","name":"account","type":"bytes32"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Repay","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RepayFrom","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"_feePool","type":"address"}],"name":"SetFeePoolAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_feeRate","type":"uint256"}],"name":"SetFeeRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"interestFee","type":"uint256"}],"name":"SetInterestFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"int256","name":"_interestRate","type":"int256"},{"indexed":false,"internalType":"uint256","name":"_interestInterval","type":"uint256"}],"name":"SetInterestInfo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"assetCeiling","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetFloor","type":"uint256"}],"name":"SetPoolLimitation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"_reward","type":"uint8"},{"indexed":false,"internalType":"bool","name":"_bClosed","type":"bool"},{"indexed":false,"internalType":"address","name":"_rewardToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_sellLimit","type":"uint256"}],"name":"SetReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_slipRate","type":"uint256"}],"name":"SetSlipRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"key","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"acceptTime","type":"uint256"}],"name":"SetValue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"account","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"subOrigin","type":"uint256"}],"name":"SubAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"WAVAX","outputs":[{"internalType":"contract IWAVAX","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptSwapHelper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addAuthorization","outputs":[],"stateMutability":"nonpayable","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":[],"name":"asset","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetCeiling","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetFloor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"assetInfoMap","outputs":[{"internalType":"uint256","name":"originAsset","type":"uint256"},{"internalType":"uint256","name":"baseAsset","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorizedAccounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableBalance","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"benqiRewardInfos","outputs":[{"internalType":"uint8","name":"rewardType","type":"uint8"},{"internalType":"bool","name":"bClosed","type":"bool"},{"internalType":"address","name":"rewardToken","type":"address"},{"internalType":"uint256","name":"sellLimit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"account","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"borrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"borrowLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"compound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"compounder","outputs":[{"internalType":"contract IBenqiCompound","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shareNum","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assetNum","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"depositETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feePool","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"feeRate","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"flashFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC3156FlashBorrower","name":"receiver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashLoan","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getInterestInfo","outputs":[{"internalType":"int256","name":"","type":"int256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMultiSignatureAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","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":"interestFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOrigin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestCompoundTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"account","type":"bytes32"}],"name":"loan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"maxFlashLoan","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":"owner","outputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerLeverageFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"qiToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeemETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"account","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"repay","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"feeAddress","type":"address"}],"name":"setFeePoolAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint64","name":"_feeRate","type":"uint64"}],"name":"setFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_interestFee","type":"uint256"}],"name":"setInterestFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"_interestRate","type":"int256"},{"internalType":"uint256","name":"rateInterval","type":"uint256"}],"name":"setInterestRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assetCeiling","type":"uint256"},{"internalType":"uint256","name":"_assetFloor","type":"uint256"}],"name":"setPoolLimitation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint8","name":"_reward","type":"uint8"},{"internalType":"bool","name":"_bClosed","type":"bool"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_sellLimit","type":"uint256"}],"name":"setReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slipRate","type":"uint256"}],"name":"setSlipRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapHelper","type":"address"}],"name":"setSwapHelper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"settingMap","outputs":[{"internalType":"uint256","name":"info","type":"uint256"},{"internalType":"uint256","name":"acceptTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slipRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapHelper","outputs":[{"internalType":"contract ISwapHelper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeSpan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLoan","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":"_oldOrigin","type":"address"},{"internalType":"address","name":"_newOrigin","type":"address"}],"name":"transferOrigin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"txOrigin","outputs":[{"internalType":"address","name":"_origin0","type":"address"},{"internalType":"address","name":"_origin1","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdrawETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052670d99a8cec7e20000600955600c805460ff19169055610e106015556601c6bf526340006019553480156200003857600080fd5b50604051620068633803806200686383398181016040526101008110156200005f57600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e090970151959694959394929391929091818189898989898982808787878686848484826001600160a01b038116620000ec5760405162461bcd60e51b81526004018080602001828103825260438152602001806200676e6043913960600191505060405180910390fd5b620001217f860a69b4e688133bace199665ed9e08fba224f0ea3198771160e97c111c09e4c6001600160a01b03831662000560565b506001600160a01b038316158015906200014357506001600160a01b03821615155b80156200015857506001600160a01b03811615155b620001aa576040805162461bcd60e51b815260206004820152601f60248201527f70726f78794f776e6572203a20696e707574207a65726f206164647265737300604482015290519081900360640190fd5b620001b53362000564565b620001c2600083620005c0565b620001cf600082620005c0565b5050600a80546001600160a01b038085166001600160a01b0319928316179092556007805486841692169190911790819055604080516339d94ae160e11b815290519190921692506373b295c291600480820192602092909190829003018186803b1580156200023e57600080fd5b505afa15801562000253573d6000803e3d6000fd5b505050506040513d60208110156200026a57600080fd5b5051600880546001600160a01b039283166001600160a01b031991821617909155600b80546001600160401b0319166702c68af0bb14000017600160401b600160c01b03191664016bcc41e9608e1b17905560108054909116888316179081905560408051635fe3b56760e01b81529051919092169650635fe3b5679550600480830195506020945090925090829003018186803b1580156200030c57600080fd5b505afa15801562000321573d6000803e3d6000fd5b505050506040513d60208110156200033857600080fd5b5051600e80546001600160a01b0319166001600160a01b039092169190911790556200038560008080738729438eb15e2c8b576fcc6aecda6a148776c0f567016345785d8a0000620006b7565b6200039d60018060008066038d7ea4c68000620006b7565b50601060009054906101000a90046001600160a01b03166001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b158015620003ed57600080fd5b505afa15801562000402573d6000803e3d6000fd5b505050506040513d60208110156200041957600080fd5b505160068054610100600160a81b0319166101006001600160a01b03938416810291909117918290556010546200046793919092048116911660001962000733602090811b62002a3a17901c565b50620004b160405180604001604052806006815260200165029bab832b9160d51b815250604051806040016040528060018152602001605360f81b8152506200085760201b60201c565b5050506001600160601b0319606086901b166080525050600019601255506013819055620005056801413ebe18ba7c97b460016c0c9f2c9cd04674edea400000006b033b2e3c9fd0803ce800000062000d89565b5050620005526040518060400160405280600881526020016702632b73234b733960c51b815250604051806040016040528060018152602001601360fa1b8152506200085760201b60201c565b5050505050505050620016ec565b9055565b6001600160a01b0381166200057862000f24565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600080516020620067b183398151915255565b806001600160a01b0316826001600160a01b03167f6b0ba40b63fe0a4e591f25c6d723a40b532ff7cf536f3ce5abc7f6fb9969418060405160405180910390a36000806200060d62000f38565b91509150836001600160a01b0316826001600160a01b0316141562000645576000805160206200672b833981519152839055620006b1565b836001600160a01b0316816001600160a01b031614156200067957600080516020620066e2833981519152839055620006b1565b60405162461bcd60e51b8152600401808060200182810382526032815260200180620068316032913960400191505060405180910390fd5b50505050565b6010546001600160a01b03838116911614156200071b576040805162461bcd60e51b815260206004820152601360248201527f72657761726420746f6b656e206572726f722100000000000000000000000000604482015290519081900360640190fd5b6200072c600f868686868662000f5e565b5050505050565b801580620007bd575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156200078d57600080fd5b505afa158015620007a2573d6000803e3d6000fd5b505050506040513d6020811015620007b957600080fd5b5051155b620007fa5760405162461bcd60e51b8152600401808060200182810382526036815260200180620067fb6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b1790915262000852918591620010c516565b505050565b6060806200086462001181565b9150915060608483600660019054906101000a90046001600160a01b03166001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015620008bb57600080fd5b505afa158015620008d0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015620008fa57600080fd5b81019080805160405193929190846401000000008211156200091b57600080fd5b9083019060208201858111156200093157600080fd5b82516401000000008111828201881017156200094c57600080fd5b82525081516020918201929091019080838360005b838110156200097b57818101518382015260200162000961565b50505050905090810190601f168015620009a95780820380516001836020036101000a031916815260200191505b506040525050506040516020018084805190602001908083835b60208310620009e45780518252601f199092019160209182019101620009c3565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b6020831062000a2e5780518252601f19909201916020918201910162000a0d565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b6020831062000a785780518252601f19909201916020918201910162000a57565b6001836020036101000a0380198251168184511680821785525050505050509050019350505050604051602081830303815290604052905060608483600660019054906101000a90046001600160a01b03166001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801562000b0357600080fd5b505afa15801562000b18573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101562000b4257600080fd5b810190808051604051939291908464010000000082111562000b6357600080fd5b90830190602082018581111562000b7957600080fd5b825164010000000081118282018810171562000b9457600080fd5b82525081516020918201929091019080838360005b8381101562000bc357818101518382015260200162000ba9565b50505050905090810190601f16801562000bf15780820380516001836020036101000a031916815260200191505b506040525050506040516020018084805190602001908083835b6020831062000c2c5780518252601f19909201916020918201910162000c0b565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b6020831062000c765780518252601f19909201916020918201910162000c55565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b6020831062000cc05780518252601f19909201916020918201910162000c9f565b6001836020036101000a0380198251168184511680821785525050505050509050019350505050604051602081830303815290604052905062000d818282600660019054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801562000d4d57600080fd5b505afa15801562000d62573d6000803e3d6000fd5b505050506040513d602081101562000d7957600080fd5b5051620011ba565b505050505050565b60185462000da2576b033b2e3c9fd0803ce80000006018555b6b033b2e3c9fd0803ce8000000841315801562000dcc57506b033b2e3c9fd0803ce7ffffff198412155b62000e1e576040805162461bcd60e51b815260206004820181905260248201527f696e70757420696e746572657374207261746520697320746f6f206c61726765604482015290519081900360640190fd5b6000831162000e5f5760405162461bcd60e51b8152600401808060200182810382526029815260200180620067026029913960400191505060405180910390fd5b600062000e7f6b033b2e3c9fd0803ce80000006301e133808787620011fe565b905082811115801562000e925750818110155b62000ecf5760405162461bcd60e51b81526004018080602001828103825260238152602001806200674b6023913960400191505060405180910390fd5b62000ed962001278565b601485905560158490556040805186815260208101869052815133927f0f500f3dbe96e6587ed063a0647f6517b05678af70d52d227918ebd729f621e5928290030190a25050505050565b600080516020620067b18339815191525490565b6000805160206200672b83398151915254600080516020620066e2833981519152549091565b855485101562000fca57600086868154811062000f7757fe5b60009182526020909120600290910201805460ff191660ff87161761ff001916610100861515021762010000600160b01b031916620100006001600160a01b038616021781556001018290555062001061565b6040805160808101825260ff808716825285151560208084019182526001600160a01b03808816958501958652606085018781528c5460018181018f5560008f81529490942096516002909102909601805494519751909216620100000262010000600160b01b03199715156101000261ff00199790961660ff199095169490941795909516939093179490941617815590519101555b6040805186815260ff86166020820152841515818301526001600160a01b038416606082015260808101839052905133917fc9ed0cc3bedda8d5f6d31c3b9351ce17b1478ca1d10281ce8e5e958cb38cc219919081900360a00190a2505050505050565b606062001121826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620012bf60201b62002b52179092919060201c565b80519091501562000852578080602001905160208110156200114257600080fd5b5051620008525760405162461bcd60e51b815260040180806020018281038252602a815260200180620067d1602a913960400191505060405180910390fd5b604080518082018252600681526502132b738b4960d51b60208083019190915282518084019093526002835261716960f01b9083015291565b8251620011cf90600490602086019062001640565b508151620011e590600590602085019062001640565b506006805460ff191660ff929092169190911790555050565b600080620012258386816200120f57fe5b0485620012da60201b62002b691790919060201c565b90506000811262001253576200124a8187620012de60201b62002b6d1790919060201c565b91505062001270565b6200124a81600003876200133960201b62002bc71790919060201c565b949350505050565b6015548015620012ae576200128c62001383565b60185580806200129b620013c8565b81620012a357fe5b0402601755620012bc565b620012b8620013c8565b6017555b50565b6060620012d08484600085620013cc565b90505b9392505050565b0290565b600082820183811015620012d3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000620012d383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506200153460201b60201c565b6000620013c3601854620013b7601754620013a3620013c860201b60201c565b6200133960201b62002bc71790919060201c565b601454601554620011fe565b905090565b4290565b6060824710156200140f5760405162461bcd60e51b8152600401808060200182810382526026815260200180620066bc6026913960400191505060405180910390fd5b6200141a85620015cf565b6200146c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310620014ad5780518252601f1990920191602091820191016200148c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811462001511576040519150601f19603f3d011682016040523d82523d6000602084013e62001516565b606091505b50909250905062001529828286620015d5565b979650505050505050565b60008184841115620015c75760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200158b57818101518382015260200162001571565b50505050905090810190601f168015620015b95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b3b151590565b60608315620015e6575081620012d3565b825115620015f75782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156200158b57818101518382015260200162001571565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620016785760008555620016c3565b82601f106200169357805160ff1916838001178555620016c3565b82800160010185558215620016c3579182015b82811115620016c3578251825591602001919060010190620016a6565b50620016d1929150620016d5565b5090565b5b80821115620016d15760008155600101620016d6565b60805160601c614f99620017236000398061143252806114c652806117b75280611eef5280612074528061279c5250614f996000f3fe6080604052600436106103f25760003560e01c80637c93ec3011610208578063ba08765211610118578063dd637627116100ab578063f2fde38b1161007a578063f2fde38b14610f0e578063f69e204614610f41578063f6c1da1a14610f56578063f96757d114610f91578063fa2cc3c014610fd5576103f9565b8063dd63762714610eba578063e551d11d14610c71578063ea7846fc14610ee4578063f0eb3af714610ef9576103f9565b8063d94969ad116100e7578063d94969ad14610de3578063d9d98ce414610e16578063db1b255814610e4f578063dd62ed3e14610e7f576103f9565b8063ba08765214610d30578063c6e6f59214610d71578063d5bf219f14610d9b578063d73cd47f14610db0576103f9565b8063a457c2d71161019b578063ae2e933b1161016a578063ae2e933b14610c86578063b22a8ffb14610c9b578063b2df3dd514610cc5578063b40643a914610cda578063b460af9414610cef576103f9565b8063a457c2d714610bea578063a75df49814610c23578063a9059cbb14610c38578063ab2f0e5114610c71576103f9565b806394f3f81d116101d757806394f3f81d14610b2857806395d89b4114610b5b57806397c86edf14610b7057806399acbcdc14610bc0576103f9565b80637c93ec3014610aa05780637df059fa14610ad05780638da5cb5b14610afe5780638f32d59b14610b13576103f9565b80633fe54e9c11610303578063638c7e17116102965780636e553f65116102655780636e553f65146109ae57806370a08231146109e757806373b295c214610a1a57806376123a9414610a2f578063776b4d0114610a44576103f9565b8063638c7e1714610902578063679aefce1461091757806367da598e1461092c5780636b6f51331461096d576103f9565b80635b56d6f5116102d25780635b56d6f5146107f35780635cffe9de1461081d578063613255ab146108ba57806362f7ef6b146108ed576103f9565b80633fe54e9c14610748578063453b1a8b14610782578063462e4cda1461079757806358d1fb3f146107ac576103f9565b806323b872dd1161038657806333fd64341161035557806333fd64341461068257806335b28153146106b257806338887729146106e557806338d52e0f146106fa578063395093511461070f576103f9565b806323b872dd146105bb57806324ba5884146105fe5780632d2da80614610631578063313ce56714610657576103f9565b806308a294cd116103c257806308a294cd146104fe578063095ea7b3146105285780630fc6a11c1461057557806318160ddd146105a6576103f9565b8062f989ad146103fe57806301e1d1141461042357806306fdde031461044a57806307a2d13a146104d4576103f9565b366103f957005b600080fd5b6104216004803603604081101561041457600080fd5b5080359060200135610fea565b005b34801561042f57600080fd5b5061043861112d565b60408051918252519081900360200190f35b34801561045657600080fd5b5061045f61113d565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610499578181015183820152602001610481565b50505050905090810190601f1680156104c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104e057600080fd5b50610438600480360360208110156104f757600080fd5b50356111d3565b34801561050a57600080fd5b506104386004803603602081101561052157600080fd5b50356111ff565b34801561053457600080fd5b506105616004803603604081101561054b57600080fd5b506001600160a01b038135169060200135611210565b604080519115158252519081900360200190f35b34801561058157600080fd5b5061058a611226565b604080516001600160a01b039092168252519081900360200190f35b3480156105b257600080fd5b50610438611235565b3480156105c757600080fd5b50610561600480360360608110156105de57600080fd5b506001600160a01b0381358116916020810135909116906040013561123b565b34801561060a57600080fd5b506104386004803603602081101561062157600080fd5b50356001600160a01b03166112c5565b6104386004803603602081101561064757600080fd5b50356001600160a01b03166112d7565b34801561066357600080fd5b5061066c61141e565b6040805160ff9092168252519081900360200190f35b34801561068e57600080fd5b50610421600480360360408110156106a557600080fd5b5080359060200135611427565b3480156106be57600080fd5b50610421600480360360208110156106d557600080fd5b50356001600160a01b03166114bb565b3480156106f157600080fd5b506104386115d3565b34801561070657600080fd5b5061058a6115d9565b34801561071b57600080fd5b506105616004803603604081101561073257600080fd5b506001600160a01b0381351690602001356115ed565b34801561075457600080fd5b506104216004803603604081101561076b57600080fd5b508035906020013567ffffffffffffffff16611620565b34801561078e57600080fd5b5061043861175f565b3480156107a357600080fd5b5061058a611769565b3480156107b857600080fd5b506107d6600480360360208110156107cf57600080fd5b5035611778565b6040805167ffffffffffffffff9092168252519081900360200190f35b3480156107ff57600080fd5b506104216004803603602081101561081657600080fd5b50356117ac565b34801561082957600080fd5b506105616004803603608081101561084057600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561087b57600080fd5b82018360208201111561088d57600080fd5b803590602001918460018302840111640100000000831117156108af57600080fd5b5090925090506118b2565b3480156108c657600080fd5b50610438600480360360208110156108dd57600080fd5b50356001600160a01b0316611adc565b3480156108f957600080fd5b50610438611b4a565b34801561090e57600080fd5b5061058a611b50565b34801561092357600080fd5b50610438611b7b565b34801561093857600080fd5b506104386004803603606081101561094f57600080fd5b508035906001600160a01b0360208201358116916040013516611bc2565b34801561097957600080fd5b506104386004803603606081101561099057600080fd5b508035906001600160a01b0360208201358116916040013516611d14565b3480156109ba57600080fd5b50610438600480360360408110156109d157600080fd5b50803590602001356001600160a01b0316611e66565b3480156109f357600080fd5b5061043860048036036020811015610a0a57600080fd5b50356001600160a01b0316611ec3565b348015610a2657600080fd5b5061058a611ede565b348015610a3b57600080fd5b5061058a611eed565b348015610a5057600080fd5b50610a6e60048036036020811015610a6757600080fd5b5035611f11565b6040805160ff909516855292151560208501526001600160a01b03909116838301526060830152519081900360800190f35b348015610aac57600080fd5b5061042160048036036040811015610ac357600080fd5b5080359060200135611f5a565b348015610adc57600080fd5b50610ae561200c565b6040805192835260208301919091528051918290030190f35b348015610b0a57600080fd5b5061058a612016565b348015610b1f57600080fd5b5061056161203b565b348015610b3457600080fd5b5061042160048036036020811015610b4b57600080fd5b50356001600160a01b0316612069565b348015610b6757600080fd5b5061045f612180565b348015610b7c57600080fd5b50610421600480360360a0811015610b9357600080fd5b5080359060ff6020820135169060408101351515906001600160a01b0360608201351690608001356121e1565b348015610bcc57600080fd5b50610ae560048036036020811015610be357600080fd5b5035612240565b348015610bf657600080fd5b5061056160048036036040811015610c0d57600080fd5b506001600160a01b038135169060200135612259565b348015610c2f57600080fd5b506104386122d3565b348015610c4457600080fd5b5061056160048036036040811015610c5b57600080fd5b506001600160a01b0381351690602001356122d9565b348015610c7d57600080fd5b506104386122e6565b348015610c9257600080fd5b5061058a6122f0565b348015610ca757600080fd5b5061042160048036036020811015610cbe57600080fd5b50356122ff565b348015610cd157600080fd5b506104386123dd565b348015610ce657600080fd5b506105616123e3565b348015610cfb57600080fd5b5061043860048036036060811015610d1257600080fd5b508035906001600160a01b036020820135811691604001351661241b565b348015610d3c57600080fd5b5061043860048036036060811015610d5357600080fd5b508035906001600160a01b0360208201358116916040013516612473565b348015610d7d57600080fd5b5061043860048036036020811015610d9457600080fd5b50356124cb565b348015610da757600080fd5b506104386124e0565b348015610dbc57600080fd5b5061042160048036036020811015610dd357600080fd5b50356001600160a01b03166124e6565b348015610def57600080fd5b5061042160048036036020811015610e0657600080fd5b50356001600160a01b03166125f8565b348015610e2257600080fd5b5061043860048036036040811015610e3957600080fd5b506001600160a01b0381351690602001356126f3565b348015610e5b57600080fd5b5061042160048036036040811015610e7257600080fd5b5080359060200135612791565b348015610e8b57600080fd5b5061043860048036036040811015610ea257600080fd5b506001600160a01b0381358116916020013516612844565b348015610ec657600080fd5b50610ae560048036036020811015610edd57600080fd5b503561286f565b348015610ef057600080fd5b50610421612888565b348015610f0557600080fd5b506104386128ff565b348015610f1a57600080fd5b5061042160048036036020811015610f3157600080fd5b50356001600160a01b0316612906565b348015610f4d57600080fd5b50610421612955565b348015610f6257600080fd5b5061042160048036036040811015610f7957600080fd5b506001600160a01b038135811691602001351661298e565b348015610f9d57600080fd5b50610fa66129e3565b60405180836001600160a01b03168152602001826001600160a01b031681526020019250505060405180910390f35b348015610fe157600080fd5b5061058a612a2b565b336000908152601a60205260409020546001146110385760405162461bcd60e51b815260040180806020018281038252602e815260200180614c55602e913960400191505060405180910390fd5b60001981141561104e5761104b82612c09565b90505b600061105a8383612c2c565b9050808211156110d0576000670de0b6b3a764000061108e6019546110888587612bc790919063ffffffff16565b90612ddf565b8161109557fe5b04905080156110c257600a546006546110c2916001600160a01b0361010090920482169133911684612e38565b6110cc8382612bc7565b9250505b6110dc33836000612eb7565b506006546040805184815290516101009092046001600160a01b031691859133917fc18e2e2d9e965c965f2bb98580ed02c64947a2c0e47e1185827542d6624e6a97916020908290030190a4505050565b6000611137612eea565b90505b90565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156111c95780601f1061119e576101008083540402835291602001916111c9565b820191906000526020600020905b8154815290600101906020018083116111ac57829003601f168201915b5050505050905090565b60006111dd611235565b6111ef6111e8612eea565b8490612ddf565b816111f657fe5b0490505b919050565b600061120a82612c09565b92915050565b600061121d338484612f05565b50600192915050565b6007546001600160a01b031681565b60035490565b6000611248848484612ff1565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156112ab5760405162461bcd60e51b8152600401808060200182810382526028815260200180614db06028913960400191505060405180910390fd5b6112b88533858403612f05565b60019150505b9392505050565b601a6020526000908152604090205481565b6008546006546000916001600160a01b03908116610100909204161461133c576040805162461bcd60e51b81526020600482015260156024820152742737ba102ba0ab20ac1039bab832b9103a37b5b2b760591b604482015290519081900360640190fd5b600c5460ff161561134c57600080fd5b600c805460ff1916600117905560085460408051630d0e30db60e41b815290516001600160a01b039092169163d0e30db0913491600480830192600092919082900301818588803b1580156113a057600080fd5b505af11580156113b4573d6000803e3d6000fd5b505050505060006113c630348561313e565b604080513481526020810183905281519293506001600160a01b0386169233927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7928290030190a3600c805460ff1916905592915050565b60065460ff1690565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611492576040805162461bcd60e51b815260206004820152601b6024820152600080516020614eea833981519152604482015290519081900360640190fd5b6114b782826c0c9f2c9cd04674edea400000006b033b2e3c9fd0803ce800000061321a565b5050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611526576040805162461bcd60e51b815260206004820152601b6024820152600080516020614eea833981519152604482015290519081900360640190fd5b806001600160a01b03811661157e576040805162461bcd60e51b81526020600482015260196024820152787375706572546f6b656e203a205a65726f204164647265737360381b604482015290519081900360640190fd5b6001600160a01b0382166000818152601a602090815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a15050565b60125481565b60065461010090046001600160a01b031681565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161121d9185908501612f05565b6116286123e3565b6116635760405162461bcd60e51b8152600401808060200182810382526028815260200180614f3c6028913960400191505060405180910390fd5b61166b6133a9565b6706f05b59d3b200008167ffffffffffffffff16106116c9576040805162461bcd60e51b815260206004820152601560248201527466656552617465206f7574206f662072616e67652160581b604482015290519081900360640190fd5b80600b83600381106116d757fe5b600491828204019190066008026101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550336001600160a01b03167f01966264837f30071d13307f1bd9f0abedc184e4362bcdc86afa5c8a221f98a98383604051808381526020018267ffffffffffffffff1681526020019250505060405180910390a25050565b60006111376134f0565b6010546001600160a01b031681565b600b816003811061178857600080fd5b60049182820401919006600802915054906101000a900467ffffffffffffffff1681565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611817576040805162461bcd60e51b815260206004820152601b6024820152600080516020614eea833981519152604482015290519081900360640190fd5b6706f05b59d3b20000811115611874576040805162461bcd60e51b815260206004820181905260248201527f696e70757420696e746572657374207261746520697320746f6f206c61726765604482015290519081900360640190fd5b601981905560408051828152905133917ff617f2d5074a1ae20fd2a1a0831410e50b2ce9b16ac77dd53d5698341f13609e919081900360200190a250565b6006546000906001600160a01b038681166101009092041614611918576040805162461bcd60e51b8152602060048201526019602482015278666c61736820626f72726f7720746f6b656e204572726f722160381b604482015290519081900360640190fd5b600061192486866126f3565b90506119308786613500565b507f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9876001600160a01b03166323e30c8b338989868a8a6040518763ffffffff1660e01b815260040180876001600160a01b03168152602001866001600160a01b03168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050975050505050505050602060405180830381600087803b1580156119f657600080fd5b505af1158015611a0a573d6000803e3d6000fd5b505050506040513d6020811015611a2057600080fd5b505114611a6b576040805162461bcd60e51b8152602060048201526014602482015273696e76616c69642072657475726e2076616c756560601b604482015290519081900360640190fd5b611a79878287016000612eb7565b50856001600160a01b0316876001600160a01b0316336001600160a01b03167f5a9eeaf8949838813289046091e8ea8a9196a2265ac24841464a2d27026a8549886040518082815260200191505060405180910390a45060019695505050505050565b6006546000906001600160a01b038381166101009092041614611b42576040805162461bcd60e51b8152602060048201526019602482015278666c61736820626f72726f7720746f6b656e204572726f722160381b604482015290519081900360640190fd5b61120a6135ec565b60095481565b60006111377f860a69b4e688133bace199665ed9e08fba224f0ea3198771160e97c111c09e4c6135f6565b600080611b86611235565b90508015611bb35780611ba3670de0b6b3a7640000611088612eea565b81611baa57fe5b0491505061113a565b670de0b6b3a764000091505090565b6008546006546000916001600160a01b039081166101009092041614611c27576040805162461bcd60e51b81526020600482015260156024820152742737ba102ba0ab20ac1039bab832b9103a37b5b2b760591b604482015290519081900360640190fd5b600c5460ff1615611c3757600080fd5b600c805460ff191660011790556000611c4f856124cb565b9050611c5d858230866135fa565b60085460408051632e1a7d4d60e01b81526004810188905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b158015611caa57600080fd5b505af1158015611cbe573d6000803e3d6000fd5b50505050611ccc84866136b6565b604080518681526020810183905281516001600160a01b038716923392600080516020614d6f833981519152929081900390910190a3600c805460ff19169055949350505050565b6008546006546000916001600160a01b039081166101009092041614611d79576040805162461bcd60e51b81526020600482015260156024820152742737ba102ba0ab20ac1039bab832b9103a37b5b2b760591b604482015290519081900360640190fd5b600c5460ff1615611d8957600080fd5b600c805460ff191660011790556000611da1856111d3565b9050611daf818630866135fa565b60085460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b158015611dfc57600080fd5b505af1158015611e10573d6000803e3d6000fd5b50505050611e1e84826136b6565b604080518281526020810187905281516001600160a01b038716923392600080516020614d6f833981519152929081900390910190a3600c805460ff19169055949350505050565b600080611e7433858561313e565b604080518681526020810183905281519293506001600160a01b0386169233927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7928290030190a39392505050565b6001600160a01b031660009081526001602052604090205490565b6008546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b600f8181548110611f2157600080fd5b60009182526020909120600290910201805460019091015460ff8083169350610100830416916201000090046001600160a01b03169084565b336000908152601a6020526040902054600114611fa85760405162461bcd60e51b815260040180806020018281038252602e815260200180614c55602e913960400191505060405180910390fd5b611fb282826137b5565b611fbc3382613500565b506006546040805183815290516101009092046001600160a01b031691849133917f32913ee632eaed1f89dc2c5c9453156e480e6965f0590adc5a373080700042e8916020908290030190a45050565b6014546015549091565b7f1221c3ca8a23c3a74a18c944c7b23b29e262f9cd12de4c345744293e8adf4ba75490565b6000612045612016565b6001600160a01b0316336001600160a01b0316148015611137575061113733613902565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146120d4576040805162461bcd60e51b815260206004820152601b6024820152600080516020614eea833981519152604482015290519081900360640190fd5b806001600160a01b03811661212c576040805162461bcd60e51b81526020600482015260196024820152787375706572546f6b656e203a205a65726f204164647265737360381b604482015290519081900360640190fd5b6001600160a01b0382166000818152601a6020908152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a15050565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156111c95780601f1061119e576101008083540402835291602001916111c9565b6121e96123e3565b6122245760405162461bcd60e51b8152600401808060200182810382526028815260200180614f3c6028913960400191505060405180910390fd5b61222c6133a9565b6122398585858585613908565b5050505050565b6000602081905290815260409020805460019091015482565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156122bc5760405162461bcd60e51b8152600401808060200182810382526025815260200180614ec56025913960400191505060405180910390fd5b6122c93385858403612f05565b5060019392505050565b60195481565b600061121d338484612ff1565b60006111376135ec565b600a546001600160a01b031681565b6123076123e3565b6123425760405162461bcd60e51b8152600401808060200182810382526028815260200180614f3c6028913960400191505060405180910390fd5b61234a6133a9565b670de0b6b3a7640000811061239f576040805162461bcd60e51b8152602060048201526016602482015275736c697052617465206f7574206f662072616e67652160501b604482015290519081900360640190fd5b600981905560408051828152905133917f35ca6ad09ac0fa0744e2b856c92f3844ed78e24b972c93c417891d5bfa512a60919081900360200190a250565b600d5481565b60008060006123f06129e3565b9092509050336001600160a01b03831614806124145750336001600160a01b038216145b9250505090565b600080612427856124cb565b9050612435858286866135fa565b604080518681526020810183905281516001600160a01b038716923392600080516020614d6f833981519152929081900390910190a3949350505050565b60008061247f856111d3565b905061248d818686866135fa565b604080518281526020810187905281516001600160a01b038716923392600080516020614d6f833981519152929081900390910190a3949350505050565b60006124d5612eea565b6111ef6111e8611235565b60135481565b6124ee6123e3565b6125295760405162461bcd60e51b8152600401808060200182810382526028815260200180614f3c6028913960400191505060405180910390fd5b6125316133a9565b806001600160a01b038116612589576040805162461bcd60e51b81526020600482015260196024820152787375706572546f6b656e203a205a65726f204164647265737360381b604482015290519081900360640190fd5b6007546001600160a01b03838116911614156125e4576040805162461bcd60e51b81526020600482015260156024820152745377617048656c70657220736574206572726f722160581b604482015290519081900360640190fd5b6114b76001836001600160a01b0316613970565b6126006123e3565b61263b5760405162461bcd60e51b8152600401808060200182810382526028815260200180614f3c6028913960400191505060405180910390fd5b6126436133a9565b806001600160a01b03811661269b576040805162461bcd60e51b81526020600482015260196024820152787375706572546f6b656e203a205a65726f204164647265737360381b604482015290519081900360640190fd5b600a80546001600160a01b0384166001600160a01b03199091168117909155604080519182525133917f120ec17136aa7b279af12e8fea5a8e3ef6d422f449550263bfe434adc1790472919081900360200190a25050565b6006546000906001600160a01b038481166101009092041614612759576040805162461bcd60e51b8152602060048201526019602482015278666c61736820626f72726f7720746f6b656e204572726f722160381b604482015290519081900360640190fd5b600b54670de0b6b3a764000090612782908490600160801b900467ffffffffffffffff16612ddf565b8161278957fe5b049392505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146127fc576040805162461bcd60e51b815260206004820152601b6024820152600080516020614eea833981519152604482015290519081900360640190fd5b601282905560138190556040805183815260208101839052815133927f5c9726097f209da31e46fba2c7517134e7977a6e369fd153a00a17f481b971dc928290030190a25050565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6016602052600090815260409020805460019091015482565b6128906123e3565b6128cb5760405162461bcd60e51b8152600401808060200182810382526028815260200180614f3c6028913960400191505060405180910390fd5b6128d36133a9565b6128dd60016139e1565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6202a30081565b61290e61203b565b6129495760405162461bcd60e51b8152600401808060200182810382526049815260200180614ca96049913960600191505060405180910390fd5b61295281613aac565b50565b42600d55612961613b17565b60405133907fda323bd96658b18a6ce813e824305dc61760462bad6aaf52c65aebb8c8c9faa190600090a2565b6129966123e3565b6129d15760405162461bcd60e51b8152600401808060200182810382526028815260200180614f3c6028913960400191505060405180910390fd5b6129d96133a9565b6114b78282613b35565b7fee9b9820fda27ccc82feea30836537c02da450e0ad29802ab27eb365a487b2ec547f818a65c6406db960713d1d26b13346eae9aaa5d405f0581dbb44b0b4e3c82cac549091565b600e546001600160a01b031681565b801580612ac0575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015612a9257600080fd5b505afa158015612aa6573d6000803e3d6000fd5b505050506040513d6020811015612abc57600080fd5b5051155b612afb5760405162461bcd60e51b8152600401808060200182810382526036815260200180614e8f6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052612b4d908490613c41565b505050565b6060612b618484600085613cf2565b949350505050565b0290565b6000828201838110156112be576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006112be83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613e4e565b60008181526016602052604081206001015461120a90612c27613ee5565b613f0c565b60008281526016602052604081205481612c44613ee5565b60008681526016602052604081206001015491925090612c649083613f0c565b9050600085821415612c9857506000868152601660205260408120908155600101548390612c93908890613f28565b612d9b565b85821115612d555781612cab8588612ddf565b81612cb257fe5b049050612cc887612cc38886613f6a565b613f28565b601354600088815260166020526040902060010154612ce79085613f0c565b6001011015612d37576040805162461bcd60e51b81526020600482015260176024820152761119589d081a5cc818995b1bddc81d1a19481b1a5b5a5d604a1b604482015290519081900360640190fd5b612d418482612bc7565b600088815260166020526040902055612d9b565b6040805162461bcd60e51b81526020600482015260166024820152756f766572666c6f772061737365742062616c616e636560501b604482015290519081900360640190fd5b6040805187815260208101839052815189927fbb6b6f8b3095bca289e82cc7dafe3fd5e8aac8e37abb95777c56434a5c557240928290030190a29695505050505050565b600082612dee5750600061120a565b82820282848281612dfb57fe5b04146112be5760405162461bcd60e51b8152600401808060200182810382526021815260200180614d8f6021913960400191505060405180910390fd5b816001600160a01b0316836001600160a01b03161415612e5757612eb1565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612eb1908590613c41565b50505050565b600654600090612ed79061010090046001600160a01b0316853086612e38565b612b618267ffffffffffffffff16613f86565b6000611137612ef76134f0565b612eff6135ec565b90612b6d565b6001600160a01b038316612f4a5760405162461bcd60e51b8152600401808060200182810382526024815260200180614e1e6024913960400191505060405180910390fd5b6001600160a01b038216612f8f5760405162461bcd60e51b8152600401808060200182810382526022815260200180614c336022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166130365760405162461bcd60e51b8152600401808060200182810382526025815260200180614df96025913960400191505060405180910390fd5b6001600160a01b03821661307b5760405162461bcd60e51b8152600401808060200182810382526023815260200180614bee6023913960400191505060405180910390fd5b6001600160a01b038316600090815260016020526040902054818110156130d35760405162461bcd60e51b8152600401808060200182810382526026815260200180614c836026913960400191505060405180910390fd5b6001600160a01b0380851660008181526001602090815260408083208787039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a350505050565b600080613149612eea565b90506000613155611235565b600b5490915061317e908790879068010000000000000000900467ffffffffffffffff16612eb7565b945080158061318b575081155b156131a45761319a8486614100565b84925050506112be565b6000826131b18784612ddf565b816131b857fe5b04905060008111613206576040805162461bcd60e51b8152602060048201526013602482015272737570657220746f6b656e206d696e7420302160681b604482015290519081900360640190fd5b6132108582614100565b92506112be915050565b601854613232576b033b2e3c9fd0803ce80000006018555b6b033b2e3c9fd0803ce8000000841315801561325b57506b033b2e3c9fd0803ce7ffffff198412155b6132ac576040805162461bcd60e51b815260206004820181905260248201527f696e70757420696e746572657374207261746520697320746f6f206c61726765604482015290519081900360640190fd5b600083116132eb5760405162461bcd60e51b8152600401808060200182810382526029815260200180614d466029913960400191505060405180910390fd5b60006133096b033b2e3c9fd0803ce80000006301e1338087876141ba565b905082811115801561331b5750818110155b6133565760405162461bcd60e51b8152600401808060200182810382526023815260200180614e426023913960400191505060405180910390fd5b61335e6141fc565b601485905560158490556040805186815260208101869052815133927f0f500f3dbe96e6587ed063a0647f6517b05678af70d52d227918ebd729f621e5928290030190a25050505050565b6000349050600033308360003660405160200180866001600160a01b031660601b8152601401856001600160a01b031660601b81526014018481526020018383808284378083019250505095505050505050604051602081830303815290604052805190602001209050600061341d611b50565b9050600061342a836135f6565b90506000826001600160a01b0316631ebaa16685846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561347a57600080fd5b505afa15801561348e573d6000803e3d6000fd5b505050506040513d60208110156134a457600080fd5b505190508181116134e65760405162461bcd60e51b815260040180806020018281038252602e815260200180614cf2602e913960400191505060405180910390fd5b6122398482614239565b6000611137601154612c27613ee5565b6010546040805163852a12e360e01b815260048101849052905160009283926001600160a01b039091169163852a12e39160248082019260209290919082900301818787803b15801561355257600080fd5b505af1158015613566573d6000803e3d6000fd5b505050506040513d602081101561357c57600080fd5b5051905080156135c8576040805162461bcd60e51b81526020600482015260126024820152713132b738b4903932b232b2b69032b93937b960711b604482015290519081900360640190fd5b6006546135e49061010090046001600160a01b0316858561423d565b509092915050565b60006111376142a5565b5490565b336001600160a01b03821614613657576040805162461bcd60e51b815260206004820152601960248201527f6f776e6572206d757374206265206d73672e73656e6465722100000000000000604482015290519081900360640190fd5b600083116136a2576040805162461bcd60e51b8152602060048201526013602482015272737570657220746f6b656e206275726e20302160681b604482015290519081900360640190fd5b6136ac33846143bc565b6122398285613500565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106137025780518252601f1990920191602091820191016136e3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613764576040519150601f19603f3d011682016040523d82523d6000602084013e613769565b606091505b5050905080612b4d576040805162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b6000828152601660205260409020546137ce9082612b6d565b6000838152601660205260408120919091556137e8613ee5565b90506137fd836137f88484613f6a565b6144bc565b60135460008481526016602052604090206001015461381c9083613f0c565b600101101561386c576040805162461bcd60e51b81526020600482015260176024820152761119589d081a5cc818995b1bddc81d1a19481b1a5b5a5d604a1b604482015290519081900360640190fd5b60125461387b60115483613f0c565b11156138c7576040805162461bcd60e51b81526020600482015260166024820152757661756c742064656274206973206f766572666c6f7760501b604482015290519081900360640190fd5b60408051838152905184917f233d86cf9a9bb9718be3666362dae489a473c087e71309a89b3c332aa9396cc7919081900360200190a2505050565b3b151590565b6010546001600160a01b0383811691161415613961576040805162461bcd60e51b815260206004820152601360248201527272657761726420746f6b656e206572726f722160681b604482015290519081900360640190fd5b612239600f86868686866144f7565b604080518082018252828152426202a300016020808301828152600087815280835285902093518455516001909301929092558251848152918201528151849233927f2c1b385e78ceb09de9c183a6220662a6e44904084a14571535d932a884268ff0929081900390910190a35050565b60008181526020819052604081206001015415801590613a11575060008281526020819052604090206001015442115b613a54576040805162461bcd60e51b815260206004820152600f60248201526e74696d654c6f636b206572726f722160881b604482015290519081900360640190fd5b600082815260208181526040918290205482519081529151849233927f2465472cec82b6013379a0524de85e311f4aef412d61245ee1b032bf85cfd1df92918290030190a35060009081526020819052604090205490565b806001600160a01b0316613abe612016565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a37f1221c3ca8a23c3a74a18c944c7b23b29e262f9cd12de4c345744293e8adf4ba755565b613b1f61465b565b600b546129529067ffffffffffffffff16613f86565b806001600160a01b0316826001600160a01b03167f6b0ba40b63fe0a4e591f25c6d723a40b532ff7cf536f3ce5abc7f6fb9969418060405160405180910390a3600080613b806129e3565b91509150836001600160a01b0316826001600160a01b03161415613bc7577fee9b9820fda27ccc82feea30836537c02da450e0ad29802ab27eb365a487b2ec839055612eb1565b836001600160a01b0316816001600160a01b03161415613c0a577f818a65c6406db960713d1d26b13346eae9aaa5d405f0581dbb44b0b4e3c82cac839055612eb1565b60405162461bcd60e51b8152600401808060200182810382526032815260200180614f0a6032913960400191505060405180910390fd5b6060613c96826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612b529092919063ffffffff16565b805190915015612b4d57808060200190516020811015613cb557600080fd5b5051612b4d5760405162461bcd60e51b815260040180806020018281038252602a815260200180614e65602a913960400191505060405180910390fd5b606082471015613d335760405162461bcd60e51b8152600401808060200182810382526026815260200180614d206026913960400191505060405180910390fd5b613d3c85613902565b613d8d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310613dcc5780518252601f199092019160209182019101613dad565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613e2e576040519150601f19603f3d011682016040523d82523d6000602084013e613e33565b606091505b5091509150613e43828286614808565b979650505050505050565b60008184841115613edd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613ea2578181015183820152602001613e8a565b50505050905090810190601f168015613ecf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000611137601854613f01601754613efb61486e565b90612bc7565b6014546015546141ba565b60006ec097ce7bc90715b34b9f10000000006127828484612ddf565b600082815260166020526040902060010154613f449082612bc7565b600083815260166020526040902060010155601154613f639082612bc7565b6011555050565b600081612782846ec097ce7bc90715b34b9f1000000000612ddf565b600080600660019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015613feb57600080fd5b505afa158015613fff573d6000803e3d6000fd5b505050506040513d602081101561401557600080fd5b5051905080156140f7576000670de0b6b3a76400006140348386612ddf565b8161403b57fe5b049050801561406657600a54600654614066916001600160a01b03610100909204821691168361423d565b6140708282612bc7565b6010546040805163140e25ad60e31b81526004810184905290519294506001600160a01b039091169163a0712d68916024808201926020929091908290030181600087803b1580156140c157600080fd5b505af11580156140d5573d6000803e3d6000fd5b505050506040513d60208110156140eb57600080fd5b509192506111fa915050565b50600092915050565b6001600160a01b03821661415b576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b60038054820190556001600160a01b0382166000818152600160209081526040808320805486019055805185815290517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35050565b6000806141d28386816141c957fe5b86919004612b69565b9050600081126141ee576141e68682612b6d565b915050612b61565b6141e6866000839003612bc7565b601554801561422b5761420d613ee5565b601855808061421a61486e565b8161422157fe5b0402601755612952565b61423361486e565b60175550565b9055565b306001600160a01b038316141561425357612b4d565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612b4d908490613c41565b600080601060009054906101000a90046001600160a01b03166001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b1580156142f657600080fd5b505afa15801561430a573d6000803e3d6000fd5b505050506040513d602081101561432057600080fd5b5051601054604080516370a0823160e01b81523060048201529051929350670de0b6b3a7640000926143ae926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561437b57600080fd5b505afa15801561438f573d6000803e3d6000fd5b505050506040513d60208110156143a557600080fd5b50518390612ddf565b816143b557fe5b0491505090565b6001600160a01b0382166144015760405162461bcd60e51b8152600401808060200182810382526021815260200180614dd86021913960400191505060405180910390fd5b6001600160a01b038216600090815260016020526040902054818110156144595760405162461bcd60e51b8152600401808060200182810382526022815260200180614c116022913960400191505060405180910390fd5b6001600160a01b03831660008181526001602090815260408083208686039055600380548790039055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3505050565b6000828152601660205260409020600101546144d89082612b6d565b600083815260166020526040902060010155601154613f639082612b6d565b855485101561456057600086868154811061450e57fe5b60009182526020909120600290910201805460ff191660ff87161761ff001916610100861515021762010000600160b01b031916620100006001600160a01b03861602178155600101829055506145f7565b6040805160808101825260ff808716825285151560208084019182526001600160a01b03808816958501958652606085018781528c5460018181018f5560008f81529490942096516002909102909601805494519751909216620100000262010000600160b01b03199715156101000261ff00199790961660ff199095169490941795909516939093179490941617815590519101555b6040805186815260ff86166020820152841515818301526001600160a01b038416606082015260808101839052905133917fc9ed0cc3bedda8d5f6d31c3b9351ce17b1478ca1d10281ce8e5e958cb38cc219919081900360a00190a2505050505050565b600f5460005b818110156114b757614671614bc6565b600f828154811061467e57fe5b6000918252602091829020604080516080810182526002909302909101805460ff8082168552610100820416158015958501959095526001600160a01b0362010000909104169183019190915260010154606082015291506146e257505050614806565b60408051600180825281830190925260609160208083019080368337505060105482519293506001600160a01b03169183915060009061471e57fe5b6001600160a01b03928316602091820292909201810191909152600e548451604051633a22995760e11b815260ff8216600482019081523060248301819052606060448401908152885160648501528851959097169663744532ae969495919489949192608490920191858201910280838360005b838110156147ab578181015183820152602001614793565b50505050905001945050505050600060405180830381600087803b1580156147d257600080fd5b505af11580156147e6573d6000803e3d6000fd5b505050506147fc82604001518360600151614872565b5050600101614661565b565b606083156148175750816112be565b8251156148275782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315613ea2578181015183820152602001613e8a565b4290565b60006001600160a01b03831661488857476148fb565b604080516370a0823160e01b815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b1580156148ce57600080fd5b505afa1580156148e2573d6000803e3d6000fd5b505050506040513d60208110156148f857600080fd5b50515b90508181101561490b57506114b7565b600654612b4d90849061010090046001600160a01b031683816001600160a01b0316836001600160a01b0316141561494257612b4d565b6001600160a01b0383166149de57600860009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156149a057600080fd5b505af11580156149b4573d6000803e3d6000fd5b50506008546001600160a01b039081169650851686141592506149d991505057612b4d565b614a71565b6008546001600160a01b038481169116148015614a0257506001600160a01b038216155b15614a715760085460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b158015614a5457600080fd5b505af1158015614a68573d6000803e3d6000fd5b50505050612b4d565b614a7a83614b13565b6007546009546040805163070c856d60e31b81526001600160a01b0387811660048301528681166024830152604482018690526064820193909352306084820152905191909216916338642b689160a48083019260209291908290030181600087803b158015614ae957600080fd5b505af1158015614afd573d6000803e3d6000fd5b505050506040513d602081101561223957600080fd5b6001600160a01b03811615801590614ba7575060075460408051636eb1769f60e11b81523060048201526001600160a01b03928316602482015290519183169163dd62ed3e91604480820192602092909190829003018186803b158015614b7957600080fd5b505afa158015614b8d573d6000803e3d6000fd5b505050506040513d6020811015614ba357600080fd5b5051155b15612952576007546129529082906001600160a01b0316600019612a3a565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f20616464726573736c657665726167655375706572546f6b656e203a206163636f756e74206973206e6f7420617574686f72697a656445524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636570726f78794f776e65723a2063616c6c6572206d757374206265207468652070726f7879206f776e657220616e64206120636f6e747261637420616e64206e6f7420657870697265646d756c74695369676e6174757265436c69656e74203a2054686973207478206973206e6f7420617072726f766564416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c696e707574206d696e6520496e74657276616c206d757374206c6172676572207468616e207a65726ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373696e70757420696e7465726573742072617465206973206f7574206f662072616e67655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f73656e646572206973206e6f74206f776e657220666163746f727900000000004f726967696e5472616e73666572726564203a206f6c64206f726967696e20697320696c6c6567616c20616464726573732170726f78794f776e65723a2063616c6c6572206973206e6f7420746865207478206f726967696e21a26469706673582212204d62735d765fb40144540878b1bd123953a794d86dddfa9dc1016196f8e855eb64736f6c63430007050033416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c818a65c6406db960713d1d26b13346eae9aaa5d405f0581dbb44b0b4e3c82cac696e707574206d696e6520496e74657276616c206d757374206c6172676572207468616e207a65726fee9b9820fda27ccc82feea30836537c02da450e0ad29802ab27eb365a487b2ec696e70757420696e7465726573742072617465206973206f7574206f662072616e67656d756c74695369676e6174757265436c69656e74203a204d756c7469706c65207369676e617475726520636f6e74726163742061646472657373206973207a65726f211221c3ca8a23c3a74a18c944c7b23b29e262f9cd12de4c345744293e8adf4ba75361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e63654f726967696e5472616e73666572726564203a206f6c64206f726967696e20697320696c6c6567616c2061646472657373210000000000000000000000007f08ba62fadaf3b4b70a8ddc22b3c63669bddeb20000000000000000000000003cd5854fe3a13707b7882d8290d3cae793a7751a000000000000000000000000b18de9512ac891b926c6b5d6838433ac5e52818b00000000000000000000000089a415b3d20098e6a6c8f7a59001c67bd31298210000000000000000000000004bfb821ec7571e044ab2d10dc7f1b4b0ff405b1c000000000000000000000000e3ba2a705af632b9b6456b4d9058b02e45993864000000000000000000000000dc8c63dfc31325aea8cb37ecec1a760bbb5b43e7000000000000000000000000000000000000000000000000016345785d8a0000

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

0000000000000000000000007f08ba62fadaf3b4b70a8ddc22b3c63669bddeb20000000000000000000000003cd5854fe3a13707b7882d8290d3cae793a7751a000000000000000000000000b18de9512ac891b926c6b5d6838433ac5e52818b00000000000000000000000089a415b3d20098e6a6c8f7a59001c67bd31298210000000000000000000000004bfb821ec7571e044ab2d10dc7f1b4b0ff405b1c000000000000000000000000e3ba2a705af632b9b6456b4d9058b02e45993864000000000000000000000000dc8c63dfc31325aea8cb37ecec1a760bbb5b43e7000000000000000000000000000000000000000000000000016345785d8a0000

-----Decoded View---------------
Arg [0] : multiSignature (address): 0x7f08ba62fadaf3b4b70a8ddc22b3c63669bddeb2
Arg [1] : origin0 (address): 0x3cd5854fe3a13707b7882d8290d3cae793a7751a
Arg [2] : origin1 (address): 0xb18de9512ac891b926c6b5d6838433ac5e52818b
Arg [3] : _stakeToken (address): 0x89a415b3d20098e6a6c8f7a59001c67bd3129821
Arg [4] : _swapHelper (address): 0x4bfb821ec7571e044ab2d10dc7f1b4b0ff405b1c
Arg [5] : _feePool (address): 0xe3ba2a705af632b9b6456b4d9058b02e45993864
Arg [6] : leverageFactory (address): 0xdc8c63dfc31325aea8cb37ecec1a760bbb5b43e7
Arg [7] : _assetFloor (uint256): 100000000000000000

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000007f08ba62fadaf3b4b70a8ddc22b3c63669bddeb2
Arg [1] : 0000000000000000000000003cd5854fe3a13707b7882d8290d3cae793a7751a
Arg [2] : 000000000000000000000000b18de9512ac891b926c6b5d6838433ac5e52818b
Arg [3] : 00000000000000000000000089a415b3d20098e6a6c8f7a59001c67bd3129821
Arg [4] : 0000000000000000000000004bfb821ec7571e044ab2d10dc7f1b4b0ff405b1c
Arg [5] : 000000000000000000000000e3ba2a705af632b9b6456b4d9058b02e45993864
Arg [6] : 000000000000000000000000dc8c63dfc31325aea8cb37ecec1a760bbb5b43e7
Arg [7] : 000000000000000000000000000000000000000000000000016345785d8a0000


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