ETH Price: $2,627.29 (+1.02%)
Gas: 1 Gwei

Token

Puffer ETH Restaking Fund I (3x Points) (dpufETH)
 

Overview

Max Total Supply

41,795.633558068824473782 dpufETH

Holders

31

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Filtered by Token Holder
sayanacharya.eth
Balance
24.899999999999999751 dpufETH

Value
$0.00
0xd9dc149dc49cbaf05b42351df79ff05aaa6b64fb
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xE353eb0f...DCe631a78
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
ConfigurableRightsPool

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 20 runs

Other Settings:
default evmVersion
File 1 of 16 : ConfigurableRightsPool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
// Needed to handle structures externally
pragma experimental ABIEncoderV2;

import "./PCToken.sol";
import "../utils/DesynReentrancyGuard.sol";
import "../utils/DesynOwnable.sol";
import "../interfaces/IBFactory.sol";
import {RightsManager} from "../libraries/RightsManager.sol";
import "../libraries/SmartPoolManager.sol";
import "../libraries/SafeApprove.sol";
import "./WhiteToken.sol";
import "../libraries/SafeERC20.sol";
import '../libraries/Address.sol';

/**
 * @author Desyn Labs
 * @title Smart Pool with customizable features
 * @notice PCToken is the "Desyn Smart Pool" token (transferred upon finalization)
 * @dev Rights are defined as follows (index values into the array)
 * Note that functions called on bPool and bFactory may look like internal calls,
 *   but since they are contracts accessed through an interface, they are really external.
 * To make this explicit, we could write "IBPool(address(bPool)).function()" everywhere,
 *   instead of "bPool.function()".
 */
contract ConfigurableRightsPool is PCToken, DesynOwnable, DesynReentrancyGuard, WhiteToken {
    using DesynSafeMath for uint;
    using SafeERC20 for IERC20;
    using Address for address;

    // State variables
    IBFactory public bFactory;
    IBPool public bPool;

    // Struct holding the rights configuration
    RightsManager.Rights public rights;

    SmartPoolManager.Status public etfStatus;
    SmartPoolManager.Fund beginFund;
    SmartPoolManager.Fund endFund;

    // Store the list of tokens in the pool, and balances
    // NOTE that the token list is *only* used to store the pool tokens between
    //   construction and createPool - thereafter, use the underlying BPool's list
    //   (avoids synchronization issues)
    address[] private _initialTokens;
    uint[] private _initialBalances;
    uint[] private _initialWeights;

    // Whitelist of LPs (if configured)
    mapping(address => bool) private _liquidityProviderWhitelist;

    uint public constant CLAIM_PERIOD = 30 days;
    address public vaultAddress;

    bool hasSetWhiteTokens;
    bool initBool;
    bool public isCompletedCollect;
    bool public hasSetBeginFund;
    bool public hasSetEndFund;
    bool public hasClaimManageFee;

    SmartPoolManager.Etypes public etype;

    // Event declarations
    // Anonymous logger event - can only be filtered by contract address
    event LogCall(bytes4 indexed sig, address indexed caller, bytes data) anonymous;
    event LogJoin(address indexed caller, address indexed tokenIn, uint tokenAmountIn);
    event LogExit(address indexed caller, address indexed tokenOut, uint tokenAmountOut);
    event SizeChanged(address indexed caller, string indexed sizeType, uint oldSize, uint newSize);
    event PoolTokenInit(address indexed caller, address pool, address initToken, uint initTokenTotal, uint initShare);
    event SetManagerFee(uint indexed managerFee, uint indexed issueFee, uint indexed redeemFee, uint perfermanceFee);

    // Modifiers
    modifier logs() {
        emit LogCall(msg.sig, msg.sender, msg.data);
        _;
    }

    // Mark functions that require delegation to the underlying Pool
    modifier needsBPool() {
        require(address(bPool) != address(0), "ERR_NOT_CREATED");
        _;
    }

    modifier notPaused() {
        require(!bFactory.isPaused(), "!paused");
        _;
    }
 
    constructor(string memory tokenSymbol, string memory tokenName) public PCToken(tokenSymbol, tokenName) {}

    /**
     * @notice Construct a new Configurable Rights Pool (wrapper around BPool)
     * @dev _initialTokens are only used for temporary storage between construction
     *      and create pool, and should not be used thereafter! _initialTokens is destroyed in
     *      createPool to prevent this is kept in sync (defensively), but
     *      should never be used except in this constructor and createPool()
     * @param factoryAddress - the BPoolFactory used to create the underlying pool
     * @param poolParams - struct containing pool parameters
     * @param rightsStruct - Set of permissions we are assigning to this smart pool
     */

    function init(
        address factoryAddress,
        SmartPoolManager.PoolParams memory poolParams,
        RightsManager.Rights memory rightsStruct
    ) public {
        SmartPoolManager.initRequire(
            poolParams.managerFee,
            poolParams.issueFee,
            poolParams.redeemFee,
            poolParams.perfermanceFee,
            poolParams.tokenBalances.length,
            poolParams.tokenWeights.length,
            poolParams.constituentTokens.length,
            initBool
        );
        initBool = true;
        rights = rightsStruct;
        _initialTokens = poolParams.constituentTokens;
        _initialBalances = poolParams.tokenBalances;
        _initialWeights = poolParams.tokenWeights;

        etfStatus = SmartPoolManager.Status({
            collectPeriod: 0,
            collectEndTime: 0,
            closurePeriod: 0,
            closureEndTime: 0,
            upperCap: DesynConstants.MAX_UINT,
            floorCap: 0,
            managerFee: poolParams.managerFee,
            redeemFee: poolParams.redeemFee,
            issueFee: poolParams.issueFee,
            perfermanceFee: poolParams.perfermanceFee,
            startClaimFeeTime: block.timestamp
        });

        etype = poolParams.etype;

        bFactory = IBFactory(factoryAddress);
        vaultAddress = bFactory.getVault();
        emit SetManagerFee(etfStatus.managerFee, etfStatus.issueFee, etfStatus.redeemFee, etfStatus.perfermanceFee);
    }

    /**
     * @notice Set the cap (max # of pool tokens)
     * @dev _bspCap defaults in the constructor to unlimited
     *      Can set to 0 (or anywhere below the current supply), to halt new investment
     *      Prevent setting it before creating a pool, since createPool sets to intialSupply
     *      (it does this to avoid an unlimited cap window between construction and createPool)
     *      Therefore setting it before then has no effect, so should not be allowed
     * @param newCap - new value of the cap
     */
    function setCap(uint newCap) external logs lock needsBPool onlyOwner {
        require(etype == SmartPoolManager.Etypes.OPENED, "ERR_MUST_OPEN_ETF");
        emit SizeChanged(msg.sender, "UPPER", etfStatus.upperCap, newCap);
        etfStatus.upperCap = newCap;
    }

    function execute(
        address _target,
        uint _value,
        bytes calldata _data,
        bool isUnderlying
    ) external logs lock needsBPool returns (bytes memory _returnValue) {
        require(bFactory.getModuleStatus(address(this), msg.sender), 'MODULE IS NOT REGISTER');
        if (isUnderlying) {
        _returnValue = bPool.execute(_target, _value, _data);
        } else {
        _returnValue = _target.functionCallWithValue(_data, _value);
        }
    }

    function couldClaimManagerFee() public view returns(bool state,uint timePoint ,uint timeElapsed){
        bool isCloseETF = etype == SmartPoolManager.Etypes.CLOSED;
        timePoint = block.timestamp;
        if(isCloseETF && timePoint > etfStatus.closureEndTime) timePoint = etfStatus.closureEndTime;
        timeElapsed = DesynSafeMath.bsub(timePoint, etfStatus.startClaimFeeTime);
        if(timeElapsed >= CLAIM_PERIOD) state = true;
        if(isCloseETF && !isCompletedCollect) state = false;
    }

    function claimManagerFee() public virtual logs lock onlyAdmin needsBPool {
        _claimManagerFee();
    }

    function _claimManagerFee() internal {
        (bool state, uint timePoint ,uint timeElapsed) = couldClaimManagerFee();
        if(state){
            address[] memory poolTokens = bPool.getCurrentTokens();
            uint[] memory tokensAmount = SmartPoolManager.handleClaim(
                IConfigurableRightsPool(address(this)),
                bPool,
                poolTokens,
                etfStatus.managerFee,
                timeElapsed,
                CLAIM_PERIOD
            );
            IVault(vaultAddress).depositManagerToken(poolTokens, tokensAmount);
            etfStatus.startClaimFeeTime = timePoint;
        }
    }

    /**
     * @notice Create a new Smart Pool
     * @dev Delegates to internal function
     * @param initialSupply starting token balance
     * @param closurePeriod the etf closure period
     */
    function createPool(
        address creator,
        uint initialSupply,
        uint collectPeriod,
        SmartPoolManager.Period closurePeriod,
        SmartPoolManager.PoolTokenRange memory tokenRange
    ) external virtual onlyOwner logs lock notPaused {
        if (etype == SmartPoolManager.Etypes.CLOSED) {
            SmartPoolManager.createPoolHandle(collectPeriod, etfStatus.upperCap, initialSupply);

            uint oldCap = etfStatus.upperCap;
            uint oldFloor = etfStatus.floorCap;
            etfStatus.upperCap = initialSupply.bmul(tokenRange.bspCap).bdiv(_initialBalances[0]);
            etfStatus.floorCap = initialSupply.bmul(tokenRange.bspFloor).bdiv(_initialBalances[0]);
            emit PoolTokenInit(creator, address(this),_initialTokens[0], _initialBalances[0], initialSupply);
            emit SizeChanged(creator, "UPPER", oldCap, etfStatus.upperCap);
            emit SizeChanged(creator, "FLOOR", oldFloor, etfStatus.floorCap);

            uint period;
            uint collectEndTime = block.timestamp + collectPeriod;
            if (closurePeriod == SmartPoolManager.Period.DAY90) {
                period = 90 days;
            } else if (closurePeriod == SmartPoolManager.Period.DAY1) {
                period = 1 days;
            } else if (closurePeriod == SmartPoolManager.Period.DAY3) {
                period = 3 days;
            } else if (closurePeriod == SmartPoolManager.Period.DAY7) {
                period = 7 days;
            } else if (closurePeriod == SmartPoolManager.Period.DAY14) {
                period = 14 days;
            } else if (closurePeriod == SmartPoolManager.Period.DAY30) {
                period = 30 days;
            } else if (closurePeriod == SmartPoolManager.Period.DAY180) {
                period = 180 days;
            } else {
                period = 360 days;
            }
            uint closureEndTime = collectEndTime + period;

            etfStatus.collectPeriod = collectPeriod;
            etfStatus.collectEndTime = collectEndTime;
            etfStatus.closurePeriod = period;
            etfStatus.closureEndTime = closureEndTime;

            IUserVault(bFactory.getUserVault()).recordTokenInfo(creator, creator, _initialTokens, _initialBalances);
        }

        createPoolInternal(initialSupply);
    }

    /**
     * @notice Join a pool
     * @dev Emits a LogJoin event (for each token)
     *      bPool is a contract interface; function calls on it are external
     * @param poolAmountOut - number of pool tokens to receive
     * @param maxAmountsIn - Max amount of asset tokens to spend
     */
    function joinPool(
        uint poolAmountOut,
        uint[] calldata maxAmountsIn,
        address kol,
        address user
    ) external logs lock needsBPool notPaused {
        SmartPoolManager.joinPoolHandle(rights.canWhitelistLPs, canProvideLiquidity(user), etype == SmartPoolManager.Etypes.CLOSED, etfStatus.collectEndTime);
        
        if(rights.canTokenWhiteLists) {
            require(_initWhiteTokenState(),"ERR_SHOULD_SET_WHITETOKEN");
        }
        // Delegate to library to save space

        // Library computes actualAmountsIn, and does many validations
        // Cannot call the push/pull/min from an external library for
        // any of these pool functions. Since msg.sender can be anybody,
        // they must be internal
        uint[] memory actualAmountsIn = SmartPoolManager.joinPool(IConfigurableRightsPool(address(this)), bPool, poolAmountOut, maxAmountsIn, etfStatus.issueFee);

        // After createPool, token list is maintained in the underlying BPool
        address[] memory poolTokens = bPool.getCurrentTokens();
        uint[] memory issueFeesReceived = new uint[](poolTokens.length);

        uint _actualIssueFee = etfStatus.issueFee;
        if (etype == SmartPoolManager.Etypes.CLOSED) {
            IUserVault(bFactory.getUserVault()).recordTokenInfo(kol, user, poolTokens, actualAmountsIn);
            if (!isCompletedCollect) {
                _actualIssueFee = 0;
            }
        }

        for (uint i = 0; i < poolTokens.length; i++) {
            uint issueFeeReceived = SmartPoolManager.handleTransferInTokens(
                IConfigurableRightsPool(address(this)),
                bPool,
                poolTokens[i],
                actualAmountsIn[i],
                _actualIssueFee
            );

            emit LogJoin(user, poolTokens[i], actualAmountsIn[i]);
            issueFeesReceived[i] = issueFeeReceived;
        }

        if (_actualIssueFee != 0) {
            IVault(vaultAddress).depositIssueRedeemPToken(poolTokens, issueFeesReceived, issueFeesReceived, false);
        }
        _mintPoolShare(poolAmountOut);
        _pushPoolShare(user, poolAmountOut);

        // checkout the state that elose ETF collect completed and claime fee.
        bool isCompletedMoment = etype == SmartPoolManager.Etypes.CLOSED && varTotalSupply >= etfStatus.floorCap && !isCompletedCollect;
        if (isCompletedMoment) {
            isCompletedCollect = true;
            SmartPoolManager.handleFeeClaim(
                IConfigurableRightsPool(address(this)), bPool,
                poolTokens,
                etfStatus.issueFee,
                false
            );
        }
    }

    /**
     * @notice Exit a pool - redeem pool tokens for underlying assets
     * @dev Emits a LogExit event for each token
     *      bPool is a contract interface; function calls on it are external
     * @param poolAmountIn - amount of pool tokens to redeem
     * @param minAmountsOut - minimum amount of asset tokens to receive
     */
    function exitPool(uint poolAmountIn, uint[] calldata minAmountsOut, address user) external logs lock needsBPool notPaused {
        uint actualPoolAmountIn;
        bool isCloseEtfCollectEndWithFailure;

        uint _actualRedeemFee = etfStatus.redeemFee;
        if(etype == SmartPoolManager.Etypes.CLOSED){
            isCloseEtfCollectEndWithFailure = !isCompletedCollect && block.timestamp >= etfStatus.collectEndTime;
            if(!isCloseEtfCollectEndWithFailure){
                if(!hasClaimManageFee) {
                    _claimManagerFee();
                    hasClaimManageFee = true;
                }
                if(hasSetBeginFund && !hasSetEndFund) snapshotEndAssets();
            }
            if(isCloseEtfCollectEndWithFailure) _actualRedeemFee = 0;
        }

        actualPoolAmountIn = SmartPoolManager.exitPoolHandleB(
            IConfigurableRightsPool(address(this)),
            etype == SmartPoolManager.Etypes.CLOSED,
            isCompletedCollect,
            etfStatus.closureEndTime,
            etfStatus.collectEndTime,
            poolAmountIn
        );
        // Library computes actualAmountsOut, and does many validations
        uint[] memory actualAmountsOut = SmartPoolManager.exitPool(IConfigurableRightsPool(address(this)), bPool, actualPoolAmountIn, minAmountsOut);
        _pullPoolShare(msg.sender, actualPoolAmountIn);
        _burnPoolShare(actualPoolAmountIn);

        // After createPool, token list is maintained in the underlying BPool
        address[] memory poolTokens = bPool.getCurrentTokens();

        uint[] memory redeemFeesReceived = new uint[](poolTokens.length);
        for (uint i = 0; i < poolTokens.length; i++) {
            (, uint finalAmountOut, uint redeemFeeReceived) = SmartPoolManager.exitPoolHandleA(
                IConfigurableRightsPool(address(this)),
                bPool,
                poolTokens[i],
                actualAmountsOut[i],
                _actualRedeemFee
            );
            redeemFeesReceived[i] = redeemFeeReceived;

            emit LogExit(user, poolTokens[i], finalAmountOut);
        }

        if (_actualRedeemFee != 0) {
            IVault(vaultAddress).depositIssueRedeemPToken(poolTokens, redeemFeesReceived, redeemFeesReceived, true);
        }
    }

    /**
     * @notice Add to the whitelist of liquidity providers (if enabled)
     * @param provider - address of the liquidity provider
     */
    function whitelistLiquidityProvider(address provider) external onlyOwner lock logs {
        SmartPoolManager.WhitelistHandle(rights.canWhitelistLPs, true, provider);
        _liquidityProviderWhitelist[provider] = true;
    }

    /**
     * @notice Remove from the whitelist of liquidity providers (if enabled)
     * @param provider - address of the liquidity provider
     */
    function removeWhitelistedLiquidityProvider(address provider) external onlyOwner lock logs {
        SmartPoolManager.WhitelistHandle(rights.canWhitelistLPs, _liquidityProviderWhitelist[provider], provider);
        _liquidityProviderWhitelist[provider] = false;
    }

    /**
     * @notice Check if an address is a liquidity provider
     * @dev If the whitelist feature is not enabled, anyone can provide liquidity (assuming finalized)
     * @return boolean value indicating whether the address can join a pool
     */
    function canProvideLiquidity(address provider) public view returns (bool) {
        if (rights.canWhitelistLPs) {
            return _liquidityProviderWhitelist[provider] || provider == getController() ;
        } else {
            // Probably don't strictly need this (could just return true)
            // But the null address can't provide funds
            return provider != address(0);
        }
    }

    /**
     * @notice Getter for specific permissions
     * @dev value of the enum is just the 0-based index in the enumeration
     * @return token boolean true if we have the given permission
     */
    function hasPermission(RightsManager.Permissions permission) external view virtual returns (bool) {
        return RightsManager.hasPermission(rights, permission);
    }

    /**
     * @notice Getter for the RightsManager contract
     * @dev Convenience function to get the address of the RightsManager library (so clients can check version)
     * @return address of the RightsManager library
     */
    function getRightsManagerVersion() external pure returns (address) {
        return address(RightsManager);
    }

    /**
     * @notice Getter for the DesynSafeMath contract
     * @dev Convenience function to get the address of the DesynSafeMath library (so clients can check version)
     * @return address of the DesynSafeMath library
     */
    function getDesynSafeMathVersion() external pure returns (address) {
        return address(DesynSafeMath);
    }

    /**
     * @notice Getter for the SmartPoolManager contract
     * @dev Convenience function to get the address of the SmartPoolManager library (so clients can check version)
     * @return address of the SmartPoolManager library
     */
    function getSmartPoolManagerVersion() external pure returns (address) {
        return address(SmartPoolManager);
    }

    // "Public" versions that can safely be called from SmartPoolManager
    // Allows only the contract itself to call them (not the controller or any external account)

    function mintPoolShareFromLib(uint amount) public {
        require(msg.sender == address(this), "ERR_NOT_CONTROLLER");

        _mint(amount);
    }

    function pushPoolShareFromLib(address to, uint amount) public {
        require(msg.sender == address(this), "ERR_NOT_CONTROLLER");

        _push(to, amount);
    }

    function pullPoolShareFromLib(address from, uint amount) public {
        require(msg.sender == address(this), "ERR_NOT_CONTROLLER");

        _pull(from, amount);
    }

    function burnPoolShareFromLib(uint amount) public {
        require(msg.sender == address(this), "ERR_NOT_CONTROLLER");

        _burn(amount);
    }

    /**
     * @notice Create a new Smart Pool
     * @dev Initialize the swap fee to the value provided in the CRP constructor
     * @param initialSupply starting token balance
     */
    function createPoolInternal(uint initialSupply) internal {
        require(address(bPool) == address(0), "ERR_IS_CREATED");

        // To the extent possible, modify state variables before calling functions
        _mintPoolShare(initialSupply);
        _pushPoolShare(msg.sender, initialSupply);

        // Deploy new BPool (bFactory and bPool are interfaces; all calls are external)
        bPool = bFactory.newLiquidityPool();
        // EXIT_FEE must always be zero, or ConfigurableRightsPool._pushUnderlying will fail
        SmartPoolManager.createPoolInternalHandle(bPool, initialSupply);
        for (uint i = 0; i < _initialTokens.length; i++) {
            address t = _initialTokens[i];
            uint bal = _initialBalances[i];
            uint denorm = _initialWeights[i];

            _verifyWhiteToken(t);
            IERC20(t).safeTransferFrom(msg.sender, address(this), bal);
            IERC20(t).safeApprove(address(bPool), 0);
            IERC20(t).safeApprove(address(bPool), DesynConstants.MAX_UINT);

            bPool.bind(t, bal, denorm);
        }

        while (_initialTokens.length > 0) {
            // Modifying state variable after external calls here,
            // but not essential, so not dangerous
            _initialTokens.pop();
        }
    }

    function addTokenToWhitelist(uint[] memory sort, address[] memory token) external onlyOwner {
        require(rights.canTokenWhiteLists && !hasSetWhiteTokens, "ERR_NO_RIGHTS");
        require(sort.length == token.length, "ERR_SORT_TOKEN_MISMATCH");
        for (uint i = 0; i < token.length; i++) {
            bool inRange = bFactory.isTokenWhitelistedForVerify(sort[i], token[i]);
            require(inRange, "TOKEN_MUST_IN_WHITE_LISTS");
            _addTokenToWhitelist(sort[i], token[i]);
        }
        hasSetWhiteTokens = true;
    }

    function _verifyWhiteToken(address token) public view {
        require(bFactory.isTokenWhitelistedForVerify(token), "ERR_NOT_WHITE_TOKEN");

        if (hasSetWhiteTokens) {
            require(_queryIsTokenWhitelisted(token), "ERR_NOT_WHITE_TOKEN");
        }
    }

    // Rebind BPool and pull tokens from address
    // bPool is a contract interface; function calls on it are external
    function _pullUnderlying(
        address erc20,
        address from,
        uint amount
    ) internal needsBPool {
        // Gets current Balance of token i, Bi, and weight of token i, Wi, from BPool.
        uint tokenBalance = bPool.getBalance(erc20);
        uint tokenWeight = bPool.getDenormalizedWeight(erc20);

        IERC20(erc20).safeTransferFrom(from, address(this), amount);
        bPool.rebind(erc20, DesynSafeMath.badd(tokenBalance, amount), tokenWeight);
    }

    // Rebind BPool and push tokens to address
    // bPool is a contract interface; function calls on it are external
    function _pushUnderlying(
        address erc20,
        address to,
        uint amount
    ) internal needsBPool {
        // Gets current Balance of token i, Bi, and weight of token i, Wi, from BPool.
        uint tokenBalance = bPool.getBalance(erc20);
        uint tokenWeight = bPool.getDenormalizedWeight(erc20);
        bPool.rebind(erc20, DesynSafeMath.bsub(tokenBalance, amount), tokenWeight);

        IERC20(erc20).safeTransfer(to, amount);
    }

    // Wrappers around corresponding core functions

    function _mint(uint amount) internal override {
        super._mint(amount);
        require(varTotalSupply <= etfStatus.upperCap, "ERR_CAP_LIMIT_REACHED");
    }

    function _mintPoolShare(uint amount) internal {
        _mint(amount);
    }

    function _pushPoolShare(address to, uint amount) internal {
        _push(to, amount);
    }

    function _pullPoolShare(address from, uint amount) internal {
        _pull(from, amount);
    }

    function _burnPoolShare(uint amount) internal {
        _burn(amount);
    }

    // ================ SnapshotAssets ================

    function snapshotBeginAssets() external logs {
        uint nowTime = block.timestamp;
        require(!hasSetBeginFund && isCompletedCollect && etype == SmartPoolManager.Etypes.CLOSED && nowTime <= (etfStatus.collectEndTime + 3 days) , "ERR_CONDITIONS_NOT_MET");

        bool inT1 = nowTime <= (etfStatus.collectEndTime + 1 days);
        if(inT1) require(adminList[msg.sender] || msg.sender == _owner, "onlyAdmin");

        beginFund = snapshotAssets();
        hasSetBeginFund = true;

        if(nowTime < etfStatus.collectEndTime) etfStatus.collectEndTime = block.timestamp;
    }

    function beginFundAssets() external view returns(SmartPoolManager.Fund memory){
        return beginFund;
    }

    function endFundAssets() external view returns(SmartPoolManager.Fund memory){
        return endFund;
    }

    function snapshotEndAssets() public logs {
        uint nowTime = block.timestamp;
        require(!hasSetEndFund && hasSetBeginFund && etype == SmartPoolManager.Etypes.CLOSED && nowTime >= etfStatus.closureEndTime, "ERR_CONDITIONS_NOT_MET");

        bool inT1 = (etfStatus.closureEndTime + 1 days) >= nowTime;
        if(inT1) require(adminList[msg.sender] || msg.sender == _owner, "onlyAdmin");

        endFund = snapshotAssets();

        uint preShareValueEnd = endFund.fundAmount.bdiv(endFund.etfAmount);
        uint preShareValueBegin = beginFund.fundAmount.bdiv(beginFund.etfAmount);
      
        if(preShareValueEnd > preShareValueBegin){
            uint perfermanceRatio = etfStatus.perfermanceFee.bmul(preShareValueEnd-preShareValueBegin).bdiv(preShareValueEnd);
            // claim perfomance reward 
            SmartPoolManager.handleFeeClaim(
                    IConfigurableRightsPool(address(this)), bPool,
                    bPool.getCurrentTokens(),
                    perfermanceRatio,
                    true);
        }

        hasSetEndFund = true;
    }

    function snapshotAssets() public returns(SmartPoolManager.Fund memory){
        SmartPoolManager.Fund memory tempFund;
        tempFund.etfAmount = varTotalSupply;

        (tempFund.tokens, tempFund.tokensAmount) = _getPoolTokensInfo();
        tempFund.fundAmount = Oracles(bFactory.getOracleAddress()).getAllPrice(tempFund.tokens, tempFund.tokensAmount);
        tempFund.snapshotTime = block.timestamp;
        return tempFund;
    }

    function _getPoolTokensInfo() internal view returns (address[] memory, uint[] memory) {
        address[] memory tokens = bPool.getCurrentTokens();
        uint[] memory totalBalances = new uint[](tokens.length);
        for(uint i; i < tokens.length ;i++) {
            totalBalances[i] = bPool.getBalance(tokens[i]);
        }
        return (tokens,totalBalances);
    }
}

File 2 of 16 : DesynReentrancyGuard.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

/**
 * @author Desyn Labs (and OpenZeppelin)
 * @title Protect against reentrant calls (and also selectively protect view functions)
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {_lock_} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `_lock_` guard, functions marked as
 * `_lock_` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `_lock_` entry
 * points to them.
 *
 * Also adds a _lockview_ modifier, which doesn't create a lock, but fails
 *   if another _lock_ call is in progress
 */
contract DesynReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

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

    uint private _status;

    constructor() internal {
        _status = _NOT_ENTERED;
    }

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

        // Any calls to _lock_ after this point will fail
        _status = _ENTERED;
        _;
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Also add a modifier that doesn't create a lock, but protects functions that
     *      should not be called while a _lock_ function is running
     */
    modifier viewlock() {
        require(_status != _ENTERED, "ERR_REENTRY_VIEW");
        _;
    }
}

File 3 of 16 : IBFactory.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

interface IBPool {
    function rebind(
        address token,
        uint balance,
        uint denorm
    ) external;

    function execute(
        address _target,
        uint _value,
        bytes calldata _data
    ) external returns (bytes memory _returnValue);

    function bind(
        address token,
        uint balance,
        uint denorm
    ) external;

    function unbind(address token) external;

    function unbindPure(address token) external;

    function isBound(address token) external view returns (bool);

    function getBalance(address token) external view returns (uint);

    function totalSupply() external view returns (uint);

    function isPublicSwap() external view returns (bool);

    function getDenormalizedWeight(address token) external view returns (uint);

    function getTotalDenormalizedWeight() external view returns (uint);

    function EXIT_FEE() external view returns (uint);

    function getCurrentTokens() external view returns (address[] memory tokens);

    function setController(address owner) external;
}

interface IBFactory {
    function newLiquidityPool() external returns (IBPool);

    function setBLabs(address b) external;

    function collect(IBPool pool) external;

    function isBPool(address b) external view returns (bool);

    function getBLabs() external view returns (address);

    function getVault() external view returns (address);

    function getUserVault() external view returns (address);

    function getVaultAddress() external view returns (address);

    function getOracleAddress() external view returns (address);

    function isTokenWhitelistedForVerify(uint sort, address token) external view returns (bool);

    function isTokenWhitelistedForVerify(address token) external view returns (bool);

    function getModuleStatus(address etf, address module) external view returns (bool);

    function isPaused() external view returns (bool);
}

interface IVault {
    function depositManagerToken(address[] calldata poolTokens, uint[] calldata tokensAmount) external;

    function depositIssueRedeemPToken(
        address[] calldata poolTokens,
        uint[] calldata tokensAmount,
        uint[] calldata tokensAmountP,
        bool isPerfermance
    ) external;

    function managerClaim(address pool) external;

    function getManagerClaimBool(address pool) external view returns (bool);
}

interface IUserVault {
    function recordTokenInfo(
        address kol,
        address user,
        address[] calldata poolTokens,
        uint[] calldata tokensAmount
    ) external;
}

interface Oracles {
    function getPrice(address tokenAddress) external returns (uint price);

    function getAllPrice(address[] calldata poolTokens, uint[] calldata tokensAmount) external returns (uint);
}

File 4 of 16 : RightsManager.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

// Needed to handle structures externally
pragma experimental ABIEncoderV2;

/**
 * @author Desyn Labs
 * @title Manage Configurable Rights for the smart pool
 *                         by default, it is off on initialization and can only be turned on
 *      canWhitelistLPs - can limit liquidity providers to a given set of addresses
 *      canChangeCap - can change the BSP cap (max # of pool tokens)
 *      canChangeFloor - can change the BSP floor for Closure ETF (min # of pool tokens)
 */
library RightsManager {
    // Type declarations

    enum Permissions {
        WHITELIST_LPS,
        TOKEN_WHITELISTS
    }

    struct Rights {
        bool canWhitelistLPs;
        bool canTokenWhiteLists;
    }

    // State variables (can only be constants in a library)
    bool public constant DEFAULT_CAN_WHITELIST_LPS = false;
    bool public constant DEFAULT_CAN_TOKEN_WHITELISTS = false;

    // bool public constant DEFAULT_CAN_CHANGE_CAP = false;
    // bool public constant DEFAULT_CAN_CHANGE_FLOOR = false;

    // Functions

    /**
     * @notice create a struct from an array (or return defaults)
     * @dev If you pass an empty array, it will construct it using the defaults
     * @param a - array input
     * @return Rights struct
     */
    function constructRights(bool[] calldata a) external pure returns (Rights memory) {
        if (a.length < 2) {
            return
                Rights(
                    DEFAULT_CAN_WHITELIST_LPS,
                    DEFAULT_CAN_TOKEN_WHITELISTS
                );
        } else {
            // return Rights(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
            return Rights(a[0], a[1]);
        }
    }

    /**
     * @notice Convert rights struct to an array (e.g., for events, GUI)
     * @dev avoids multiple calls to hasPermission
     * @param rights - the rights struct to convert
     * @return boolean array containing the rights settings
     */
    function convertRights(Rights calldata rights) external pure returns (bool[] memory) {
        bool[] memory result = new bool[](2);

        result[0] = rights.canWhitelistLPs;
        result[1] = rights.canTokenWhiteLists;

        return result;
    }

    // Though it is actually simple, the number of branches triggers code-complexity
    /* solhint-disable code-complexity */

    /**
     * @notice Externally check permissions using the Enum
     * @param self - Rights struct containing the permissions
     * @param permission - The permission to check
     * @return Boolean true if it has the permission
     */
    function hasPermission(Rights calldata self, Permissions permission) external pure returns (bool) {
        if (Permissions.WHITELIST_LPS == permission) {
            return self.canWhitelistLPs;
        } else if (Permissions.TOKEN_WHITELISTS == permission) {
            return self.canTokenWhiteLists;
        }
    }

    /* solhint-enable code-complexity */
}

File 5 of 16 : PCToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

// Imports

import "../libraries/DesynSafeMath.sol";
import "../interfaces/IERC20.sol";

// Contracts

/* solhint-disable func-order */

/**
 * @author Desyn Labs
 * @title Highly opinionated token implementation
 */
contract PCToken is IERC20 {
    using DesynSafeMath for uint;

    // State variables
    string public constant NAME = "Desyn Smart Pool";
    uint8 public constant DECIMALS = 18;

    // No leading underscore per naming convention (non-private)
    // Cannot call totalSupply (name conflict)
    // solhint-disable-next-line private-vars-leading-underscore
    uint internal varTotalSupply;

    mapping(address => uint) private _balance;
    mapping(address => mapping(address => uint)) private _allowance;

    string private _symbol;
    string private _name;

    // Event declarations

    // See definitions above; must be redeclared to be emitted from this contract
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    // Function declarations

    /**
     * @notice Base token constructor
     * @param tokenSymbol - the token symbol
     */
    constructor(string memory tokenSymbol, string memory tokenName) public {
        _symbol = tokenSymbol;
        _name = tokenName;
    }

    // External functions

    /**
     * @notice Getter for allowance: amount spender will be allowed to spend on behalf of owner
     * @param owner - owner of the tokens
     * @param spender - entity allowed to spend the tokens
     * @return uint - remaining amount spender is allowed to transfer
     */
    function allowance(address owner, address spender) external view override returns (uint) {
        return _allowance[owner][spender];
    }

    /**
     * @notice Getter for current account balance
     * @param account - address we're checking the balance of
     * @return uint - token balance in the account
     */
    function balanceOf(address account) external view override returns (uint) {
        return _balance[account];
    }

    /**
     * @notice Approve owner (sender) to spend a certain amount
     * @dev emits an Approval event
     * @param spender - entity the owner (sender) is approving to spend his tokens
     * @param amount - number of tokens being approved
     * @return bool - result of the approval (will always be true if it doesn't revert)
     */
    function approve(address spender, uint amount) external override returns (bool) {
        /* In addition to the increase/decreaseApproval functions, could
           avoid the "approval race condition" by only allowing calls to approve
           when the current approval amount is 0
        
           require(_allowance[msg.sender][spender] == 0, "ERR_RACE_CONDITION");

           Some token contracts (e.g., KNC), already revert if you call approve 
           on a non-zero allocation. To deal with these, we use the SafeApprove library
           and safeApprove function when adding tokens to the pool.
        */

        _allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    /**
     * @notice Increase the amount the spender is allowed to spend on behalf of the owner (sender)
     * @dev emits an Approval event
     * @param spender - entity the owner (sender) is approving to spend his tokens
     * @param amount - number of tokens being approved
     * @return bool - result of the approval (will always be true if it doesn't revert)
     */
    function increaseApproval(address spender, uint amount) external returns (bool) {
        _allowance[msg.sender][spender] = DesynSafeMath.badd(_allowance[msg.sender][spender], amount);

        emit Approval(msg.sender, spender, _allowance[msg.sender][spender]);

        return true;
    }

    /**
     * @notice Decrease the amount the spender is allowed to spend on behalf of the owner (sender)
     * @dev emits an Approval event
     * @dev If you try to decrease it below the current limit, it's just set to zero (not an error)
     * @param spender - entity the owner (sender) is approving to spend his tokens
     * @param amount - number of tokens being approved
     * @return bool - result of the approval (will always be true if it doesn't revert)
     */
    function decreaseApproval(address spender, uint amount) external returns (bool) {
        uint oldValue = _allowance[msg.sender][spender];
        // Gas optimization - if amount == oldValue (or is larger), set to zero immediately
        if (amount >= oldValue) {
            _allowance[msg.sender][spender] = 0;
        } else {
            _allowance[msg.sender][spender] = DesynSafeMath.bsub(oldValue, amount);
        }

        emit Approval(msg.sender, spender, _allowance[msg.sender][spender]);

        return true;
    }

    /**
     * @notice Transfer the given amount from sender (caller) to recipient
     * @dev _move emits a Transfer event if successful
     * @param recipient - entity receiving the tokens
     * @param amount - number of tokens being transferred
     * @return bool - result of the transfer (will always be true if it doesn't revert)
     */
    function transfer(address recipient, uint amount) external override returns (bool) {
        require(recipient != address(0), "ERR_ZERO_ADDRESS");

        _move(msg.sender, recipient, amount);

        return true;
    }

    /**
     * @notice Transfer the given amount from sender to recipient
     * @dev _move emits a Transfer event if successful; may also emit an Approval event
     * @param sender - entity sending the tokens (must be caller or allowed to spend on behalf of caller)
     * @param recipient - recipient of the tokens
     * @param amount - number of tokens being transferred
     * @return bool - result of the transfer (will always be true if it doesn't revert)
     */
    function transferFrom(
        address sender,
        address recipient,
        uint amount
    ) external override returns (bool) {
        require(recipient != address(0), "ERR_ZERO_ADDRESS");
        require(msg.sender == sender || amount <= _allowance[sender][msg.sender], "ERR_PCTOKEN_BAD_CALLER");

        _move(sender, recipient, amount);

        // memoize for gas optimization
        uint oldAllowance = _allowance[sender][msg.sender];

        // If the sender is not the caller, adjust the allowance by the amount transferred
        if (msg.sender != sender && oldAllowance != uint(-1)) {
            _allowance[sender][msg.sender] = DesynSafeMath.bsub(oldAllowance, amount);

            emit Approval(sender, msg.sender, _allowance[sender][msg.sender]);
        }

        return true;
    }

    // public functions

    /**
     * @notice Getter for the total supply
     * @dev declared external for gas optimization
     * @return uint - total number of tokens in existence
     */
    function totalSupply() external view override returns (uint) {
        return varTotalSupply;
    }

    // Public functions

    /**
     * @dev Returns the name of the token.
     *      We allow the user to set this name (as well as the symbol).
     *      Alternatives are 1) A fixed string (original design)
     *                       2) A fixed string plus the user-defined symbol
     *                          return string(abi.encodePacked(NAME, "-", _symbol));
     */
    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 override returns (string memory) {
        return _symbol;
    }

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

    // internal functions

    // Mint an amount of new tokens, and add them to the balance (and total supply)
    // Emit a transfer amount from the null address to this contract
    function _mint(uint amount) internal virtual {
        _balance[address(this)] = DesynSafeMath.badd(_balance[address(this)], amount);
        varTotalSupply = DesynSafeMath.badd(varTotalSupply, amount);

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

    // Burn an amount of new tokens, and subtract them from the balance (and total supply)
    // Emit a transfer amount from this contract to the null address
    function _burn(uint amount) internal virtual {
        // Can't burn more than we have
        // Remove require for gas optimization - bsub will revert on underflow
        // require(_balance[address(this)] >= amount, "ERR_INSUFFICIENT_BAL");

        _balance[address(this)] = DesynSafeMath.bsub(_balance[address(this)], amount);
        varTotalSupply = DesynSafeMath.bsub(varTotalSupply, amount);

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

    // Transfer tokens from sender to recipient
    // Adjust balances, and emit a Transfer event
    function _move(
        address sender,
        address recipient,
        uint amount
    ) internal virtual {
        // Can't send more than sender has
        // Remove require for gas optimization - bsub will revert on underflow
        // require(_balance[sender] >= amount, "ERR_INSUFFICIENT_BAL");

        _balance[sender] = DesynSafeMath.bsub(_balance[sender], amount);
        _balance[recipient] = DesynSafeMath.badd(_balance[recipient], amount);

        emit Transfer(sender, recipient, amount);
    }

    // Transfer from this contract to recipient
    // Emits a transfer event if successful
    function _push(address recipient, uint amount) internal {
        _move(address(this), recipient, amount);
    }

    // Transfer from recipient to this contract
    // Emits a transfer event if successful
    function _pull(address sender, uint amount) internal {
        _move(sender, address(this), amount);
    }
}

File 6 of 16 : DesynOwnable.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract DesynOwnable {
    // State variables
    mapping(address => bool) public adminList;
    uint public allOwnerPercentage = 10000;

    address _owner;
    address[] owners;
    uint[] ownerPercentage;
    bool initialized;
    // Event declarations

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event AddAdmin(address indexed newAdmin, uint indexed amount);
    event RemoveAdmin(address indexed oldAdmin, uint indexed amount);

    // Modifiers

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == msg.sender, "ERR_NOT_CONTROLLER");
        _;
    }

    modifier onlyAdmin() {
        require(adminList[msg.sender] || msg.sender == _owner, "onlyAdmin");
        _;
    }

    // Function declarations

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() internal {
        _owner = msg.sender;
    }

    function initHandle(address[] memory _owners, uint[] memory _ownerPercentage) external {
        require(_owners.length == _ownerPercentage.length, "ownerP");
        require(!initialized, "initialized!");
        
        _addAdmin(_owners);

        owners = _owners;
        ownerPercentage = _ownerPercentage;

        initialized = true;
        _ownerPercentageChecker();
    }

    function setManagersInfo(address[] memory _owners, uint[] memory _ownerPercentage) external onlyOwner {
        _beforeControllerChange();
        _clearAdmin();
        _addAdmin(_owners);
        owners = _owners;
        ownerPercentage = _ownerPercentage;
        _ownerPercentageChecker();
    }

    function _ownerPercentageChecker() internal view {
        uint totalPercentage;
        for (uint i; i < ownerPercentage.length; i++) {
            totalPercentage+=ownerPercentage[i];
        } 
        require(totalPercentage == 10000, "ERR_ILLEGAL_PERCENTAGE"); 
    }

    function _addAdmin(address[] memory admins) internal {
        bool hasOwner;
        for (uint i; i < admins.length; i++) {
            adminList[admins[i]] = true;
            if(admins[i] == _owner) hasOwner = true;
        } 

        if(initialized) require(hasOwner, "ERR_NEW_ADMINS_HAS_NO_OWNER");    
    }

    function _clearAdmin() internal {
        for(uint i; i < owners.length; i++) {
            delete adminList[owners[i]];
        }
    }

    /**
     * @notice Transfers ownership of the contract to a new account (`newOwner`).
     *         Can only be called by the current owner
     * @dev external for gas optimization
     * @param newOwner - address of new owner
     */
    function setController(address newOwner) external onlyOwner {
        _beforeControllerChange();
        require(newOwner != address(0), "ERR_ZERO_ADDRESS");

        emit OwnershipTransferred(_owner, newOwner);

        for (uint i;i < owners.length; i++) {
            if (owners[i] == _owner) {
                owners[i] = newOwner;
            }
        }

        adminList[_owner] = false;
        adminList[newOwner] = true;
        _owner = newOwner;
    }

    // @dev Returns list of owners.
    // @return List of owner addresses.
    function getOwners() external view returns (address[] memory) {
        return owners;
    }

    // @dev Returns list of owners.
    // @return List of owner addresses.
    function getOwnerPercentage() external view returns (uint[] memory) {
        return ownerPercentage;
    }

    /**
     * @notice Returns the address of the current owner
     * @dev external for gas optimization
     * @return address - of the owner (AKA controller)
     */
    function getController() public view returns (address) {
        return _owner;
    }

    function _beforeControllerChange() internal virtual {}
}

File 7 of 16 : SmartPoolManager.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

// Needed to pass in structs
pragma experimental ABIEncoderV2;

// Imports

import "../interfaces/IERC20.sol";
import "../interfaces/IConfigurableRightsPool.sol";
import "../interfaces/IBFactory.sol"; // unused
import "./DesynSafeMath.sol";
import "./SafeMath.sol";
// import "./SafeApprove.sol";
import "../libraries/SafeERC20.sol";

/**
 * @author Desyn Labs
 * @title Factor out the weight updates
 */
library SmartPoolManager {
    // using SafeApprove for IERC20;
    using DesynSafeMath for uint;
    using SafeMath for uint;
    using SafeERC20 for IERC20;

    //kol pool params
    struct levelParams {
        uint level;
        uint ratio;
    }

    struct feeParams {
        levelParams firstLevel;
        levelParams secondLevel;
        levelParams thirdLevel;
        levelParams fourLevel;
    }
    
    struct KolPoolParams {
        feeParams managerFee;
        feeParams issueFee;
        feeParams redeemFee;
        feeParams perfermanceFee;
    }

    // Type declarations
    enum Etypes {
        OPENED,
        CLOSED
    }

    enum Period {
        DAY90,
        DAY180,
        DAY360,
        DAY1,
        DAY3,
        DAY7,
        DAY14,
        DAY30
    }

    struct Fund {
        uint etfAmount;
        uint fundAmount;
        uint snapshotTime;
        address[] tokens;
        uint[] tokensAmount;
    }

    // updateWeight and pokeWeights are unavoidably long
    /* solhint-disable function-max-lines */
    struct Status {
        uint collectPeriod;
        uint collectEndTime;
        uint closurePeriod;
        uint closureEndTime;
        uint upperCap;
        uint floorCap;
        uint managerFee;
        uint redeemFee;
        uint issueFee;
        uint perfermanceFee;
        uint startClaimFeeTime;
    }

    struct PoolParams {
        // Desyn Pool Token (representing shares of the pool)
        string poolTokenSymbol;
        string poolTokenName;
        // Tokens inside the Pool
        address[] constituentTokens;
        uint[] tokenBalances;
        uint[] tokenWeights;
        uint managerFee;
        uint redeemFee;
        uint issueFee;
        uint perfermanceFee;
        Etypes etype;
    }

    struct PoolTokenRange {
        uint bspFloor;
        uint bspCap;
    }

    function initRequire(
        uint managerFee,
        uint issueFee,
        uint redeemFee,
        uint perfermanceFee,
        uint tokenBalancesLength,
        uint tokenWeightsLength,
        uint constituentTokensLength,
        bool initBool
    ) external pure {
        // We don't have a pool yet; check now or it will fail later (in order of likelihood to fail)
        // (and be unrecoverable if they don't have permission set to change it)
        // Most likely to fail, so check first
        require(!initBool, "Init fail");
        require(managerFee >= DesynConstants.MANAGER_MIN_FEE, "ERR_INVALID_MANAGER_FEE");
        require(managerFee <= DesynConstants.MANAGER_MAX_FEE, "ERR_INVALID_MANAGER_FEE");
        require(issueFee >= DesynConstants.ISSUE_MIN_FEE, "ERR_INVALID_ISSUE_MIN_FEE");
        require(issueFee <= DesynConstants.ISSUE_MAX_FEE, "ERR_INVALID_ISSUE_MAX_FEE");
        require(redeemFee >= DesynConstants.REDEEM_MIN_FEE, "ERR_INVALID_REDEEM_MIN_FEE");
        require(redeemFee <= DesynConstants.REDEEM_MAX_FEE, "ERR_INVALID_REDEEM_MAX_FEE");
        require(perfermanceFee >= DesynConstants.PERFERMANCE_MIN_FEE, "ERR_INVALID_PERFERMANCE_MIN_FEE");
        require(perfermanceFee <= DesynConstants.PERFERMANCE_MAX_FEE, "ERR_INVALID_PERFERMANCE_MAX_FEE");

        // Arrays must be parallel
        require(tokenBalancesLength == constituentTokensLength, "ERR_START_BALANCES_MISMATCH");
        require(tokenWeightsLength == constituentTokensLength, "ERR_START_WEIGHTS_MISMATCH");
        // Cannot have too many or too few - technically redundant, since BPool.bind() would fail later
        // But if we don't check now, we could have a useless contract with no way to create a pool

        require(constituentTokensLength >= DesynConstants.MIN_ASSET_LIMIT, "ERR_TOO_FEW_TOKENS");
        require(constituentTokensLength <= DesynConstants.MAX_ASSET_LIMIT, "ERR_TOO_MANY_TOKENS");
        // There are further possible checks (e.g., if they use the same token twice), but
        // we can let bind() catch things like that (i.e., not things that might reasonably work)
    }

    /**
     * @notice Non ERC20-conforming tokens are problematic; don't allow them in pools
     * @dev Will revert if invalid
     * @param token - The prospective token to verify
     */
    function verifyTokenCompliance(address token) external {
        verifyTokenComplianceInternal(token);
    }

    /**
     * @notice Non ERC20-conforming tokens are problematic; don't allow them in pools
     * @dev Will revert if invalid - overloaded to save space in the main contract
     * @param tokens - The prospective tokens to verify
     */
    function verifyTokenCompliance(address[] calldata tokens) external {
        for (uint i = 0; i < tokens.length; i++) {
            verifyTokenComplianceInternal(tokens[i]);
        }
    }

    function createPoolInternalHandle(IBPool bPool, uint initialSupply) external view {
        require(initialSupply >= DesynConstants.MIN_POOL_SUPPLY, "ERR_INIT_SUPPLY_MIN");
        require(initialSupply <= DesynConstants.MAX_POOL_SUPPLY, "ERR_INIT_SUPPLY_MAX");
        require(bPool.EXIT_FEE() == 0, "ERR_NONZERO_EXIT_FEE");
        // EXIT_FEE must always be zero, or ConfigurableRightsPool._pushUnderlying will fail
        require(DesynConstants.EXIT_FEE == 0, "ERR_NONZERO_EXIT_FEE");
    }

    function createPoolHandle(
        uint collectPeriod,
        uint upperCap,
        uint initialSupply
    ) external pure {
        require(collectPeriod <= DesynConstants.MAX_COLLECT_PERIOD, "ERR_EXCEEDS_FUND_RAISING_PERIOD");
        require(upperCap >= initialSupply, "ERR_CAP_BIGGER_THAN_INITSUPPLY");
    }

    function exitPoolHandleA(
        IConfigurableRightsPool self,
        IBPool bPool,
        address poolToken,
        uint _tokenAmountOut,
        uint redeemFee
    )
        external
        returns (
            uint redeemAndPerformanceFeeReceived,
            uint finalAmountOut,
            uint redeemFeeReceived
        )
    {
        // redeem fee
        redeemFeeReceived = DesynSafeMath.bmul(_tokenAmountOut, redeemFee);

        // performance fee
        uint performanceFeeReceived = 0;
        
        // redeem fee and performance fee
        redeemAndPerformanceFeeReceived = DesynSafeMath.badd(performanceFeeReceived, redeemFeeReceived);

        // final amount the user got
        finalAmountOut = DesynSafeMath.bsub(_tokenAmountOut, redeemAndPerformanceFeeReceived);

        _pushUnderlying(bPool, poolToken, msg.sender, finalAmountOut);

        if (redeemFee != 0) {
            _pushUnderlying(bPool, poolToken, address(this), redeemAndPerformanceFeeReceived);
            IERC20(poolToken).safeApprove(self.vaultAddress(), 0);
            IERC20(poolToken).safeApprove(self.vaultAddress(), redeemAndPerformanceFeeReceived);
        }
    }

    function exitPoolHandleB(
        IConfigurableRightsPool self,
        bool bools,
        bool isCompletedCollect,
        uint closureEndTime,
        uint collectEndTime,
        // uint _etfAmount,
        // uint _fundAmount,
        uint poolAmountIn
    ) external view returns (uint actualPoolAmountIn) {
        actualPoolAmountIn = poolAmountIn;
        if (bools) {
            bool isCloseEtfCollectEndWithFailure = isCompletedCollect == false && block.timestamp >= collectEndTime;
            bool isCloseEtfClosureEnd = block.timestamp >= closureEndTime;
            require(isCloseEtfCollectEndWithFailure || isCloseEtfClosureEnd, "ERR_CLOSURE_TIME_NOT_ARRIVED!");

            actualPoolAmountIn = self.balanceOf(msg.sender);
        }
        // fundAmount = _fundAmount;
        // etfAmount = _etfAmount;
    }

    function joinPoolHandle(
        bool canWhitelistLPs,
        bool isList,
        bool bools,
        uint collectEndTime
    ) external view {
        require(!canWhitelistLPs || isList, "ERR_NOT_ON_WHITELIST");

        if (bools) {
            require(block.timestamp <= collectEndTime, "ERR_COLLECT_PERIOD_FINISHED!");
        }
    }

    /**
     * @notice Join a pool
     * @param self - ConfigurableRightsPool instance calling the library
     * @param bPool - Core BPool the CRP is wrapping
     * @param poolAmountOut - number of pool tokens to receive
     * @param maxAmountsIn - Max amount of asset tokens to spend
     * @return actualAmountsIn - calculated values of the tokens to pull in
     */
    function joinPool(
        IConfigurableRightsPool self,
        IBPool bPool,
        uint poolAmountOut,
        uint[] calldata maxAmountsIn,
        uint issueFee
    ) external view returns (uint[] memory actualAmountsIn) {
        address[] memory tokens = bPool.getCurrentTokens();

        require(maxAmountsIn.length == tokens.length, "ERR_AMOUNTS_MISMATCH");

        uint poolTotal = self.totalSupply();
        // Subtract  1 to ensure any rounding errors favor the pool
        uint ratio = DesynSafeMath.bdiv(poolAmountOut, DesynSafeMath.bsub(poolTotal, 1));

        require(ratio != 0, "ERR_MATH_APPROX");

        // We know the length of the array; initialize it, and fill it below
        // Cannot do "push" in memory
        actualAmountsIn = new uint[](tokens.length);

        // This loop contains external calls
        // External calls are to math libraries or the underlying pool, so low risk
        uint issueFeeRate = issueFee.bmul(1000);
        for (uint i = 0; i < tokens.length; i++) {
            address t = tokens[i];
            uint bal = bPool.getBalance(t);
            // Add 1 to ensure any rounding errors favor the pool
            uint base = bal.badd(1).bmul(poolAmountOut * uint(1000));
            uint tokenAmountIn = base.bdiv(poolTotal.bsub(1) * (uint(1000).bsub(issueFeeRate)));

            require(tokenAmountIn != 0, "ERR_MATH_APPROX");
            require(tokenAmountIn <= maxAmountsIn[i], "ERR_LIMIT_IN");

            actualAmountsIn[i] = tokenAmountIn;
        }
    }

    /**
     * @notice Exit a pool - redeem pool tokens for underlying assets
     * @param self - ConfigurableRightsPool instance calling the library
     * @param bPool - Core BPool the CRP is wrapping
     * @param poolAmountIn - amount of pool tokens to redeem
     * @param minAmountsOut - minimum amount of asset tokens to receive
     * @return actualAmountsOut - calculated amounts of each token to pull
     */
    function exitPool(
        IConfigurableRightsPool self,
        IBPool bPool,
        uint poolAmountIn,
        uint[] calldata minAmountsOut
    ) external view returns (uint[] memory actualAmountsOut) {
        address[] memory tokens = bPool.getCurrentTokens();

        require(minAmountsOut.length == tokens.length, "ERR_AMOUNTS_MISMATCH");

        uint poolTotal = self.totalSupply();

        uint ratio = DesynSafeMath.bdiv(poolAmountIn, DesynSafeMath.badd(poolTotal, 1));

        require(ratio != 0, "ERR_MATH_APPROX");

        actualAmountsOut = new uint[](tokens.length);

        // This loop contains external calls
        // External calls are to math libraries or the underlying pool, so low risk
        for (uint i = 0; i < tokens.length; i++) {
            address t = tokens[i];
            uint bal = bPool.getBalance(t);
            // Subtract 1 to ensure any rounding errors favor the pool
            uint tokenAmountOut = DesynSafeMath.bmul(ratio, DesynSafeMath.bsub(bal, 1));

            require(tokenAmountOut != 0, "ERR_MATH_APPROX");
            require(tokenAmountOut >= minAmountsOut[i], "ERR_LIMIT_OUT");

            actualAmountsOut[i] = tokenAmountOut;
        }
    }

    // Internal functions
    // Check for zero transfer, and make sure it returns true to returnValue
    function verifyTokenComplianceInternal(address token) internal {
        IERC20(token).safeTransfer(msg.sender, 0);
    }

    function handleTransferInTokens(
        IConfigurableRightsPool self,
        IBPool bPool,
        address poolToken,
        uint actualAmountIn,
        uint _actualIssueFee
    ) external returns (uint issueFeeReceived) {
        issueFeeReceived = DesynSafeMath.bmul(actualAmountIn, _actualIssueFee);
        uint amount = DesynSafeMath.bsub(actualAmountIn, issueFeeReceived);

        _pullUnderlying(bPool, poolToken, msg.sender, amount);

        if (_actualIssueFee != 0) {
            IERC20(poolToken).safeTransferFrom(msg.sender, address(this), issueFeeReceived);
            IERC20(poolToken).safeApprove(self.vaultAddress(), 0);
            IERC20(poolToken).safeApprove(self.vaultAddress(), issueFeeReceived);
        }
    }

    function handleClaim(
        IConfigurableRightsPool self,
        IBPool bPool,
        address[] calldata poolTokens,
        uint managerFee,
        uint timeElapsed,
        uint claimPeriod
    ) external returns (uint[] memory) {
        uint[] memory tokensAmount = new uint[](poolTokens.length);
        
        for (uint i = 0; i < poolTokens.length; i++) {
            address t = poolTokens[i];
            uint tokenBalance = bPool.getBalance(t);
            uint tokenAmountOut = tokenBalance.bmul(managerFee).mul(timeElapsed).div(claimPeriod).div(12);    
            _pushUnderlying(bPool, t, address(this), tokenAmountOut);
            IERC20(t).safeApprove(self.vaultAddress(), 0);
            IERC20(t).safeApprove(self.vaultAddress(), tokenAmountOut);
            tokensAmount[i] = tokenAmountOut;
        }
        
        return tokensAmount;
    }

    function handleFeeClaim(
        IConfigurableRightsPool self,
        IBPool bPool,
        address[] calldata poolTokens,
        uint feeRatio,
        bool isPerfermance
    ) external {
        if (feeRatio != 0) {
            uint[] memory tokensAmount = new uint[](poolTokens.length);

            for (uint i = 0; i < poolTokens.length; i++) {
                address t = poolTokens[i];
                uint currentAmount = bPool.getBalance(t);
                uint currentAmountFee = DesynSafeMath.bmul(currentAmount, feeRatio);

                _pushUnderlying(bPool, t, address(this), currentAmountFee);
                tokensAmount[i] = currentAmountFee;
                IERC20(t).safeApprove(self.vaultAddress(), 0);
                IERC20(t).safeApprove(self.vaultAddress(), currentAmountFee);
            }

            if(isPerfermance) {
                IVault(self.vaultAddress()).depositIssueRedeemPToken(poolTokens, tokensAmount, new uint[](poolTokens.length), isPerfermance);
            } else {
                IVault(self.vaultAddress()).depositIssueRedeemPToken(poolTokens, tokensAmount, tokensAmount, isPerfermance);
            }
            
        }
    }

    function WhitelistHandle(
        bool bool1,
        bool bool2,
        address adr
    ) external pure {
        require(bool1, "ERR_CANNOT_WHITELIST_LPS");
        require(bool2, "ERR_LP_NOT_WHITELISTED");
        require(adr != address(0), "ERR_INVALID_ADDRESS");
    }

    function _pullUnderlying(
        IBPool bPool,
        address erc20,
        address from,
        uint amount
    ) internal {
        uint tokenBalance = bPool.getBalance(erc20);
        uint tokenWeight = bPool.getDenormalizedWeight(erc20);

        IERC20(erc20).safeTransferFrom(from, address(this), amount);
        bPool.rebind(erc20, DesynSafeMath.badd(tokenBalance, amount), tokenWeight);
    }

    function _pushUnderlying(
        IBPool bPool,
        address erc20,
        address to,
        uint amount
    ) internal {
        uint tokenBalance = bPool.getBalance(erc20);
        uint tokenWeight = bPool.getDenormalizedWeight(erc20);
        bPool.rebind(erc20, DesynSafeMath.bsub(tokenBalance, amount), tokenWeight);
        IERC20(erc20).safeTransfer(to, amount);
    }
}

File 8 of 16 : Address.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;

/**
 * @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) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            codehash := extcodehash(account)
        }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @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, uint amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    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,
        uint 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,
        uint value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

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

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

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

File 9 of 16 : SafeApprove.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

// Imports

import "../interfaces/IERC20.sol";

// Libraries

/**
 * @author PieDAO (ported to Desyn Labs)
 * @title SafeApprove - set approval for tokens that require 0 prior approval
 * @dev Perhaps to address the known ERC20 race condition issue
 *      See https://github.com/crytic/not-so-smart-contracts/tree/master/race_condition
 *      Some tokens - notably KNC - only allow approvals to be increased from 0
 */
library SafeApprove {
    /**
     * @notice handle approvals of tokens that require approving from a base of 0
     * @param token - the token we're approving
     * @param spender - entity the owner (sender) is approving to spend his tokens
     * @param amount - number of tokens being approved
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint amount
    ) internal returns (bool) {
        uint currentAllowance = token.allowance(address(this), spender);

        // Do nothing if allowance is already set to this value
        if (currentAllowance == amount) {
            return true;
        }

        // If approval is not zero reset it to zero first
        if (currentAllowance != 0) {
            token.approve(spender, 0);
        }

        // do the actual approval
        return token.approve(spender, amount);
    }
}

File 10 of 16 : WhiteToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

contract WhiteToken {
    // add token log
    event LOG_WHITELIST(address indexed spender, uint indexed sort, address indexed caller, address token);
    // del token log
    event LOG_DEL_WHITELIST(address indexed spender, uint indexed sort, address indexed caller, address token);

    // record the number of whitelists.
    uint private _whiteTokenCount;
    // token address => is white token.
    mapping(address => bool) private _isTokenWhitelisted;
    // Multi level white token.
    // type => token address => is white token.
    mapping(uint => mapping(address => bool)) private _tokenWhitelistedInfo;

    function _queryIsTokenWhitelisted(address token) internal view returns (bool) {
        return _isTokenWhitelisted[token];
    }

    // for factory to verify
    function _isTokenWhitelistedForVerify(uint sort, address token) internal view returns (bool) {
        return _tokenWhitelistedInfo[sort][token];
    }

    // add sort token
    function _addTokenToWhitelist(uint sort, address token) internal {
        require(token != address(0), "ERR_INVALID_TOKEN_ADDRESS");
        require(_queryIsTokenWhitelisted(token) == false, "ERR_HAS_BEEN_ADDED_WHITE");

        _tokenWhitelistedInfo[sort][token] = true;
        _isTokenWhitelisted[token] = true;
        _whiteTokenCount++;

        emit LOG_WHITELIST(address(this), sort, msg.sender, token);
    }

    // remove sort token
    function _removeTokenFromWhitelist(uint sort, address token) internal {
        require(_queryIsTokenWhitelisted(token) == true, "ERR_NOT_WHITE_TOKEN");

        require(_tokenWhitelistedInfo[sort][token], "ERR_SORT_NOT_MATCHED");

        _tokenWhitelistedInfo[sort][token] = false;
        _isTokenWhitelisted[token] = false;
        _whiteTokenCount--;
        emit LOG_DEL_WHITELIST(address(this), sort, msg.sender, token);
    }

    // already has init
    function _initWhiteTokenState() internal view returns (bool) {
        return _whiteTokenCount == 0 ?  false : true;
    }
}

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

pragma solidity 0.6.12;

import {IERC20} from "../interfaces/IERC20.sol";
import {SafeMath} from "./SafeMath.sol";
import {Address} from "./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 uint;
    using Address for address;

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

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

    function safeApprove(
        IERC20 token,
        address spender,
        uint value
    ) internal {
        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 callOptionalReturn(IERC20 token, bytes memory data) private {
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "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 12 of 16 : IERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

// Interface declarations

/* solhint-disable func-order */

interface IERC20 {
    // 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, uint value);

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

    // Returns the amount of tokens in existence
    function totalSupply() external view returns (uint);

    // Returns the amount of tokens owned by account
    function balanceOf(address account) external view returns (uint);

    // Returns the decimals of tokens
    function decimals() external view returns (uint8);

    function symbol() external view returns (string memory);

    // 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 (uint);

    // Sets amount as the allowance of spender over the caller’s tokens
    // Returns a boolean value indicating whether the operation succeeded
    // Emits an Approval event.
    function approve(address spender, uint amount) external returns (bool);

    // 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, uint amount) external returns (bool);

    // 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,
        uint amount
    ) external returns (bool);
}

File 13 of 16 : DesynSafeMath.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

// Imports

import "./DesynConstants.sol";

/**
 * @author Desyn Labs
 * @title SafeMath - wrap Solidity operators to prevent underflow/overflow
 * @dev badd and bsub are basically identical to OpenZeppelin SafeMath; mul/div have extra checks
 */
library DesynSafeMath {
    /**
     * @notice Safe addition
     * @param a - first operand
     * @param b - second operand
     * @dev if we are adding b to a, the resulting sum must be greater than a
     * @return - sum of operands; throws if overflow
     */
    function badd(uint a, uint b) internal pure returns (uint) {
        uint c = a + b;
        require(c >= a, "ERR_ADD_OVERFLOW");
        return c;
    }

    /**
     * @notice Safe unsigned subtraction
     * @param a - first operand
     * @param b - second operand
     * @dev Do a signed subtraction, and check that it produces a positive value
     *      (i.e., a - b is valid if b <= a)
     * @return - a - b; throws if underflow
     */
    function bsub(uint a, uint b) internal pure returns (uint) {
        (uint c, bool negativeResult) = bsubSign(a, b);
        require(!negativeResult, "ERR_SUB_UNDERFLOW");
        return c;
    }

    /**
     * @notice Safe signed subtraction
     * @param a - first operand
     * @param b - second operand
     * @dev Do a signed subtraction
     * @return - difference between a and b, and a flag indicating a negative result
     *           (i.e., a - b if a is greater than or equal to b; otherwise b - a)
     */
    function bsubSign(uint a, uint b) internal pure returns (uint, bool) {
        if (b <= a) {
            return (a - b, false);
        } else {
            return (b - a, true);
        }
    }

    /**
     * @notice Safe multiplication
     * @param a - first operand
     * @param b - second operand
     * @dev Multiply safely (and efficiently), rounding down
     * @return - product of operands; throws if overflow or rounding error
     */
    function bmul(uint a, uint b) internal pure returns (uint) {
        // Gas optimization (see github.com/OpenZeppelin/openzeppelin-contracts/pull/522)
        if (a == 0) {
            return 0;
        }

        // Standard overflow check: a/a*b=b
        uint c0 = a * b;
        require(c0 / a == b, "ERR_MUL_OVERFLOW");

        // Round to 0 if x*y < BONE/2?
        uint c1 = c0 + (DesynConstants.BONE / 2);
        require(c1 >= c0, "ERR_MUL_OVERFLOW");
        uint c2 = c1 / DesynConstants.BONE;
        return c2;
    }

    /**
     * @notice Safe division
     * @param dividend - first operand
     * @param divisor - second operand
     * @dev Divide safely (and efficiently), rounding down
     * @return - quotient; throws if overflow or rounding error
     */
    function bdiv(uint dividend, uint divisor) internal pure returns (uint) {
        require(divisor != 0, "ERR_DIV_ZERO");

        // Gas optimization
        if (dividend == 0) {
            return 0;
        }

        uint c0 = dividend * DesynConstants.BONE;
        require(c0 / dividend == DesynConstants.BONE, "ERR_DIV_INTERNAL"); // bmul overflow

        uint c1 = c0 + (divisor / 2);
        require(c1 >= c0, "ERR_DIV_INTERNAL"); //  badd require

        uint c2 = c1 / divisor;
        return c2;
    }

    /**
     * @notice Safe unsigned integer modulo
     * @dev Returns the remainder of dividing two unsigned integers.
     *      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).
     *
     * @param dividend - first operand
     * @param divisor - second operand -- cannot be zero
     * @return - quotient; throws if overflow or rounding error
     */
    function bmod(uint dividend, uint divisor) internal pure returns (uint) {
        require(divisor != 0, "ERR_MODULO_BY_ZERO");

        return dividend % divisor;
    }

    /**
     * @notice Safe unsigned integer max
     * @dev Returns the greater of the two input values
     *
     * @param a - first operand
     * @param b - second operand
     * @return - the maximum of a and b
     */
    function bmax(uint a, uint b) internal pure returns (uint) {
        return a >= b ? a : b;
    }

    /**
     * @notice Safe unsigned integer min
     * @dev returns b, if b < a; otherwise returns a
     *
     * @param a - first operand
     * @param b - second operand
     * @return - the lesser of the two input values
     */
    function bmin(uint a, uint b) internal pure returns (uint) {
        return a < b ? a : b;
    }

    /**
     * @notice Safe unsigned integer average
     * @dev Guard against (a+b) overflow by dividing each operand separately
     *
     * @param a - first operand
     * @param b - second operand
     * @return - the average of the two values
     */
    function baverage(uint a, uint b) internal pure returns (uint) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);
    }

    /**
     * @notice Babylonian square root implementation
     * @dev (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
     * @param y - operand
     * @return z - the square root result
     */
    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
}

File 14 of 16 : DesynConstants.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

/**
 * @author Desyn Labs
 * @title Put all the constants in one place
 */

library DesynConstants {
    // State variables (must be constant in a library)

    // where numeric 1 = 10 ** 18
    uint public constant BONE = 10**18;
    uint public constant MIN_WEIGHT = BONE;
    uint public constant MAX_WEIGHT = BONE * 50;
    uint public constant MAX_TOTAL_WEIGHT = BONE * 50;
    uint public constant MIN_BALANCE = 0;
    uint public constant MAX_BALANCE = BONE * 10**12;
    uint public constant MIN_POOL_SUPPLY = BONE * 100;
    uint public constant MAX_POOL_SUPPLY = BONE * 10**9;
    uint public constant MIN_FEE = BONE / 10**6;
    uint public constant MAX_FEE = BONE / 10;
    //Fee Set
    uint public constant MANAGER_MIN_FEE = 0;
    uint public constant MANAGER_MAX_FEE = BONE / 10;
    uint public constant ISSUE_MIN_FEE = 0;
    uint public constant ISSUE_MAX_FEE = BONE / 10;
    uint public constant REDEEM_MIN_FEE = 0;
    uint public constant REDEEM_MAX_FEE = BONE / 10;
    uint public constant PERFERMANCE_MIN_FEE = 0;
    uint public constant PERFERMANCE_MAX_FEE = BONE / 2;
    // EXIT_FEE must always be zero, or ConfigurableRightsPool._pushUnderlying will fail
    uint public constant EXIT_FEE = 0;
    uint public constant MAX_IN_RATIO = BONE / 2;
    uint public constant MAX_OUT_RATIO = (BONE / 3) + 1 wei;
    // Must match BConst.MIN_BOUND_TOKENS and BConst.MAX_BOUND_TOKENS
    uint public constant MIN_ASSET_LIMIT = 1;
    uint public constant MAX_ASSET_LIMIT = 16;
    uint public constant MAX_UINT = uint(-1);
    uint public constant MAX_COLLECT_PERIOD = 60 days;
}

File 15 of 16 : IConfigurableRightsPool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

// Interface declarations

// Introduce to avoid circularity (otherwise, the CRP and SmartPoolManager include each other)
// Removing circularity allows flattener tools to work, which enables Etherscan verification
interface IConfigurableRightsPool {
    function mintPoolShareFromLib(uint amount) external;

    function pushPoolShareFromLib(address to, uint amount) external;

    function pullPoolShareFromLib(address from, uint amount) external;

    function burnPoolShareFromLib(uint amount) external;

    function balanceOf(address account) external view returns (uint);

    function totalSupply() external view returns (uint);

    function adminList(address) external view returns (bool);

    function getController() external view returns (address);

    function vaultAddress() external view returns (address);
}

File 16 of 16 : SafeMath.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;

/**
 * @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(uint a, uint b) internal pure returns (uint) {
        uint 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(uint a, uint b) internal pure returns (uint) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

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

        uint 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(uint a, uint b) internal pure returns (uint) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(
        uint a,
        uint b,
        string memory errorMessage
    ) internal pure returns (uint) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint 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(uint a, uint b) internal pure returns (uint) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 20
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {
    "contracts/libraries/DesynSafeMath.sol": {
      "DesynSafeMath": "0xe91c89d7cc74b49579ac3a5ba68974bda8c3f547"
    },
    "contracts/libraries/RightsManager.sol": {
      "RightsManager": "0x495e73a680cd943020f18911e50c1fe5991cb770"
    },
    "contracts/libraries/SmartPoolManager.sol": {
      "SmartPoolManager": "0xce720c194b9fd6b196259807d579bbd2f53e39d8"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"string","name":"tokenName","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddAdmin","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":"spender","type":"address"},{"indexed":true,"internalType":"uint256","name":"sort","type":"uint256"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"LOG_DEL_WHITELIST","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":true,"internalType":"uint256","name":"sort","type":"uint256"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"LOG_WHITELIST","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"internalType":"bytes4","name":"sig","type":"bytes4"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"LogCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmountOut","type":"uint256"}],"name":"LogExit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmountIn","type":"uint256"}],"name":"LogJoin","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":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"address","name":"initToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"initTokenTotal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"initShare","type":"uint256"}],"name":"PoolTokenInit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RemoveAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"managerFee","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"issueFee","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"redeemFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"perfermanceFee","type":"uint256"}],"name":"SetManagerFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"string","name":"sizeType","type":"string"},{"indexed":false,"internalType":"uint256","name":"oldSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newSize","type":"uint256"}],"name":"SizeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"CLAIM_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"_verifyWhiteToken","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"sort","type":"uint256[]"},{"internalType":"address[]","name":"token","type":"address[]"}],"name":"addTokenToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"adminList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allOwnerPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bFactory","outputs":[{"internalType":"contract IBFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bPool","outputs":[{"internalType":"contract IBPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beginFundAssets","outputs":[{"components":[{"internalType":"uint256","name":"etfAmount","type":"uint256"},{"internalType":"uint256","name":"fundAmount","type":"uint256"},{"internalType":"uint256","name":"snapshotTime","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokensAmount","type":"uint256[]"}],"internalType":"struct SmartPoolManager.Fund","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnPoolShareFromLib","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"}],"name":"canProvideLiquidity","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimManagerFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"couldClaimManagerFee","outputs":[{"internalType":"bool","name":"state","type":"bool"},{"internalType":"uint256","name":"timePoint","type":"uint256"},{"internalType":"uint256","name":"timeElapsed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"collectPeriod","type":"uint256"},{"internalType":"enum SmartPoolManager.Period","name":"closurePeriod","type":"uint8"},{"components":[{"internalType":"uint256","name":"bspFloor","type":"uint256"},{"internalType":"uint256","name":"bspCap","type":"uint256"}],"internalType":"struct SmartPoolManager.PoolTokenRange","name":"tokenRange","type":"tuple"}],"name":"createPool","outputs":[],"stateMutability":"nonpayable","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":"amount","type":"uint256"}],"name":"decreaseApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endFundAssets","outputs":[{"components":[{"internalType":"uint256","name":"etfAmount","type":"uint256"},{"internalType":"uint256","name":"fundAmount","type":"uint256"},{"internalType":"uint256","name":"snapshotTime","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokensAmount","type":"uint256[]"}],"internalType":"struct SmartPoolManager.Fund","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"etfStatus","outputs":[{"internalType":"uint256","name":"collectPeriod","type":"uint256"},{"internalType":"uint256","name":"collectEndTime","type":"uint256"},{"internalType":"uint256","name":"closurePeriod","type":"uint256"},{"internalType":"uint256","name":"closureEndTime","type":"uint256"},{"internalType":"uint256","name":"upperCap","type":"uint256"},{"internalType":"uint256","name":"floorCap","type":"uint256"},{"internalType":"uint256","name":"managerFee","type":"uint256"},{"internalType":"uint256","name":"redeemFee","type":"uint256"},{"internalType":"uint256","name":"issueFee","type":"uint256"},{"internalType":"uint256","name":"perfermanceFee","type":"uint256"},{"internalType":"uint256","name":"startClaimFeeTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"etype","outputs":[{"internalType":"enum SmartPoolManager.Etypes","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bool","name":"isUnderlying","type":"bool"}],"name":"execute","outputs":[{"internalType":"bytes","name":"_returnValue","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolAmountIn","type":"uint256"},{"internalType":"uint256[]","name":"minAmountsOut","type":"uint256[]"},{"internalType":"address","name":"user","type":"address"}],"name":"exitPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDesynSafeMathVersion","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getOwnerPercentage","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRightsManagerVersion","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getSmartPoolManagerVersion","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"hasClaimManageFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum RightsManager.Permissions","name":"permission","type":"uint8"}],"name":"hasPermission","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasSetBeginFund","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasSetEndFund","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"increaseApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"factoryAddress","type":"address"},{"components":[{"internalType":"string","name":"poolTokenSymbol","type":"string"},{"internalType":"string","name":"poolTokenName","type":"string"},{"internalType":"address[]","name":"constituentTokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenBalances","type":"uint256[]"},{"internalType":"uint256[]","name":"tokenWeights","type":"uint256[]"},{"internalType":"uint256","name":"managerFee","type":"uint256"},{"internalType":"uint256","name":"redeemFee","type":"uint256"},{"internalType":"uint256","name":"issueFee","type":"uint256"},{"internalType":"uint256","name":"perfermanceFee","type":"uint256"},{"internalType":"enum SmartPoolManager.Etypes","name":"etype","type":"uint8"}],"internalType":"struct SmartPoolManager.PoolParams","name":"poolParams","type":"tuple"},{"components":[{"internalType":"bool","name":"canWhitelistLPs","type":"bool"},{"internalType":"bool","name":"canTokenWhiteLists","type":"bool"}],"internalType":"struct RightsManager.Rights","name":"rightsStruct","type":"tuple"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256[]","name":"_ownerPercentage","type":"uint256[]"}],"name":"initHandle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isCompletedCollect","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolAmountOut","type":"uint256"},{"internalType":"uint256[]","name":"maxAmountsIn","type":"uint256[]"},{"internalType":"address","name":"kol","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"joinPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintPoolShareFromLib","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"pullPoolShareFromLib","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"pushPoolShareFromLib","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"}],"name":"removeWhitelistedLiquidityProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rights","outputs":[{"internalType":"bool","name":"canWhitelistLPs","type":"bool"},{"internalType":"bool","name":"canTokenWhiteLists","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCap","type":"uint256"}],"name":"setCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256[]","name":"_ownerPercentage","type":"uint256[]"}],"name":"setManagersInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snapshotAssets","outputs":[{"components":[{"internalType":"uint256","name":"etfAmount","type":"uint256"},{"internalType":"uint256","name":"fundAmount","type":"uint256"},{"internalType":"uint256","name":"snapshotTime","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokensAmount","type":"uint256[]"}],"internalType":"struct SmartPoolManager.Fund","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snapshotBeginAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snapshotEndAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"vaultAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"}],"name":"whitelistLiquidityProvider","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526127106006553480156200001757600080fd5b5060405162006192380380620061928339810160408190526200003a91620001ce565b815182908290620000539060039060208501906200008b565b508051620000699060049060208401906200008b565b5050600780546001600160a01b0319163317905550506001600b555062000235565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000ce57805160ff1916838001178555620000fe565b82800160010185558215620000fe579182015b82811115620000fe578251825591602001919060010190620000e1565b506200010c92915062000110565b5090565b5b808211156200010c576000815560010162000111565b600082601f83011262000138578081fd5b81516001600160401b03808211156200014f578283fd5b6040516020601f8401601f191682018101838111838210171562000171578586fd5b806040525081945083825286818588010111156200018e57600080fd5b600092505b83831015620001b2578583018101518284018201529182019162000193565b83831115620001c45760008185840101525b5050505092915050565b60008060408385031215620001e1578182fd5b82516001600160401b0380821115620001f8578384fd5b620002068683870162000127565b935060208501519150808211156200021c578283fd5b506200022b8582860162000127565b9150509250929050565b615f4d80620002456000396000f3fe608060405234801561001057600080fd5b50600436106102ae5760003560e01c806373a9855c1161016e57806373a9855c146104b257806374983a0d146104c7578063806c6f87146104cf5780638cf3b3d5146104e257806390ca071b146104ea57806392eefe9b146104fd57806395c5736d1461051057806395d89b411461052757806396a2db021461052f578063980e8db6146105375780639d829c2b1461054d578063a0e67e2b14610555578063a3f4df7e1461056a578063a6c245c414610572578063a9059cbb14610585578063b36b4fa014610598578063b64ef17b146105ab578063c83a1c2d146105b3578063c9735f23146105c6578063d29986c1146105d9578063d2fed42e146105e1578063d73dd623146105e9578063dd62ed3e146105fc578063e2762d4b1461060f578063eff4955714610622578063f054fbc014610635578063f329a8c714610648578063f3b0857214610650578063f605bebf14610658576102ae565b806306fdde03146102b3578063095dcccc146102d1578063095ea7b3146102e65780630a165940146103065780630a6d3d961461031b5780631296548f1461032e57806316131388146103365780631748c0881461033e57806318160ddd1461035357806321241dfe14610368578063220eb7601461037057806323b872dd1461038357806327304dfd14610396578063276990f6146103a95780632e0f2625146103bc5780633018205f146103d1578063309a042c146103d9578063313ce567146103ee57806337c6f4d9146103f65780633ef1447914610409578063430bf08a1461041c57806343774a6b1461042457806347786d371461042c5780634ba578821461043f5780635468d6d71461045257806355c32a231461045a578063661884631461046d57806370a08231146104805780637228c87b14610493575b600080fd5b6102bb610660565b6040516102c89190615462565b60405180910390f35b6102e46102df366004614b28565b6106f6565b005b6102f96102f4366004614b28565b61072c565b6040516102c891906153d9565b61030e610785565b6040516102c89190615150565b6102e4610329366004614f11565b610794565b6102e4610d9a565b6102f9610f18565b610346610f28565b6040516102c89190615c46565b61035b61100f565b6040516102c89190615cd0565b61035b611015565b6102e461037e366004614ee1565b61101c565b6102f9610391366004614988565b611047565b6102f96103a4366004614918565b61116f565b6102e46103b7366004614f6d565b611184565b6103c46118e9565b6040516102c89190615d9a565b61030e6118ee565b6103e16118fd565b6040516102c891906153c6565b6103c4611954565b6102f9610404366004614ec5565b611959565b6102e4610417366004614d07565b6119ee565b61030e611a78565b6102e4611a87565b6102e461043a366004614ee1565b611d3c565b6102e461044d366004614ee1565b611e71565b6102f9611e99565b6102e4610468366004614b28565b611ea9565b6102f961047b366004614b28565b611ed2565b61035b61048e366004614918565b611fac565b61049b611fc7565b6040516102c89b9a99989796959493929190615d4c565b6104ba611feb565b6040516102c891906155e6565b61030e611ffb565b6102f96104dd366004614918565b612013565b610346612079565b6102e46104f83660046149c8565b61215c565b6102e461050b366004614918565b612449565b6105186125b7565b6040516102c893929190615436565b6102bb61263c565b61034661269d565b61053f6127d8565b6040516102c89291906153e4565b61030e6127ea565b61055d612802565b6040516102c89190615341565b6102bb612863565b6102e4610580366004614dea565b61288f565b6102f9610593366004614b28565b612a40565b6102bb6105a6366004614b53565b612a7c565b61030e612c9b565b6102e46105c1366004614918565b612caa565b6102e46105d4366004614918565b612dbf565b61035b612e92565b6102e4612e98565b6102f96105f7366004614b28565b612f75565b61035b61060a366004614950565b612fe9565b6102e461061d366004614918565b613014565b6102e4610630366004614bf1565b613142565b6102e4610643366004614d07565b613676565b6102f96136e9565b61030e6136f9565b6102f9613711565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106ec5780601f106106c1576101008083540402835291602001916106ec565b820191906000526020600020905b8154815290600101906020018083116106cf57829003601f168201915b5050505050905090565b33301461071e5760405162461bcd60e51b81526004016107159061561c565b60405180910390fd5b6107288282613721565b5050565b3360008181526002602090815260408083206001600160a01b03871680855292528083208590555191929091600080516020615ef883398151915290610773908690615cd0565b60405180910390a35060015b92915050565b600f546001600160a01b031681565b336001600160a01b03166000356001600160e01b0319166001600160e01b0319166000366040516107c692919061544e565b60405180910390a26002600b5414156107f15760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b031661081e5760405162461bcd60e51b8152600401610715906157cd565b600f60009054906101000a90046001600160a01b03166001600160a01b031663b187bd266040518163ffffffff1660e01b815260040160206040518083038186803b15801561086c57600080fd5b505afa158015610880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a49190614e40565b156108c15760405162461bcd60e51b81526004016107159061583e565b60195460009081906001602b54600160d01b900460ff1660018111156108e357fe5b141561097357602b54600160b01b900460ff1615801561090557506013544210155b91508161096957602b54600160c81b900460ff166109395761092561372c565b602b805460ff60c81b1916600160c81b1790555b602b54600160b81b900460ff16801561095c5750602b54600160c01b900460ff16155b1561096957610969611a87565b8115610973575060005b73ce720c194b9fd6b196259807d579bbd2f53e39d8637f717d85306001602b54600160d01b900460ff1660018111156109a857fe5b602b5460155460135460405160e088901b6001600160e01b03191681526109e596959490941493600160b01b90930460ff16928f90600401615475565b60206040518083038186803b1580156109fd57600080fd5b505af4158015610a11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a359190614ef9565b60105460405163151c70f960e21b815291945060609173ce720c194b9fd6b196259807d579bbd2f53e39d891635471c3e491610a879130916001600160a01b039091169089908d908d9060040161556b565b60006040518083038186803b158015610a9f57600080fd5b505af4158015610ab3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610adb9190810190614d67565b9050610ae73385611ec8565b610af08461103b565b6010546040805163cc77828d60e01b815290516060926001600160a01b03169163cc77828d916004808301926000929190829003018186803b158015610b3557600080fd5b505afa158015610b49573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b719190810190614c6f565b9050606081516001600160401b0381118015610b8c57600080fd5b50604051908082528060200260200182016040528015610bb6578160200160208202803683370190505b50905060005b8251811015610d185760008073ce720c194b9fd6b196259807d579bbd2f53e39d8632c948f6f30601060009054906101000a90046001600160a01b0316888781518110610c0557fe5b60200260200101518a8881518110610c1957fe5b60200260200101518c6040518663ffffffff1660e01b8152600401610c429594939291906154a8565b60606040518083038186803b158015610c5a57600080fd5b505af4158015610c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c929190614fd0565b925092505080848481518110610ca457fe5b602002602001018181525050848381518110610cbc57fe5b60200260200101516001600160a01b03168a6001600160a01b03167fc62fc35ac75e3bff532648e2859a3e1694002cfa357614ae8e034df7f83db5e984604051610d069190615cd0565b60405180910390a35050600101610bbc565b508315610d8957602b54604051631483d99d60e01b81526001600160a01b0390911690631483d99d90610d5690859085908190600190600401615379565b600060405180830381600087803b158015610d7057600080fd5b505af1158015610d84573d6000803e3d6000fd5b505050505b50506001600b555050505050505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051610dcc92919061544e565b60405180910390a2602b544290600160b81b900460ff16158015610df95750602b54600160b01b900460ff165b8015610e1c57506001602b54600160d01b900460ff166001811115610e1a57fe5b145b8015610e2f57506013546203f480018111155b610e4b5760405162461bcd60e51b815260040161071590615b2b565b60135462015180018111801590610ea0573360009081526005602052604090205460ff1680610e8457506007546001600160a01b031633145b610ea05760405162461bcd60e51b8152600401610715906155f9565b610ea861269d565b8051601d908155602080830151601e556040830151601f5560608301518051610ed49291820190614657565b5060808201518051610ef09160048401916020909101906146bc565b5050602b805460ff60b81b1916600160b81b1790555060135482101561072857426013555050565b602b54600160c01b900460ff1681565b610f30614703565b6040805160a081018252601d80548252601e54602080840191909152601f54838501528054845181830281018301909552808552929391926060850192919082820182828015610fa957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f8b575b505050505081526020016004820180548060200260200160405190810160405280929190818152602001828054801561100157602002820191906000526020600020905b815481526020019060010190808311610fed575b505050505081525050905090565b60005490565b62278d0081565b33301461103b5760405162461bcd60e51b81526004016107159061561c565b611044816138e2565b50565b60006001600160a01b03831661106f5760405162461bcd60e51b81526004016107159061572a565b336001600160a01b03851614806110a957506001600160a01b03841660009081526002602090815260408083203384529091529020548211155b6110c55760405162461bcd60e51b81526004016107159061598f565b6110d084848461394a565b6001600160a01b038416600081815260026020908152604080832033808552925290912054911480159061110657506000198114155b156111645761111581846139e9565b6001600160a01b03861660008181526002602090815260408083203380855292529182902084905590519092600080516020615ef88339815191529161115b9190615cd0565b60405180910390a35b506001949350505050565b60056020526000908152604090205460ff1681565b336001600160a01b03166000356001600160e01b0319166001600160e01b0319166000366040516111b692919061544e565b60405180910390a26002600b5414156111e15760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b031661120e5760405162461bcd60e51b8152600401610715906157cd565b600f60009054906101000a90046001600160a01b03166001600160a01b031663b187bd266040518163ffffffff1660e01b815260040160206040518083038186803b15801561125c57600080fd5b505afa158015611270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112949190614e40565b156112b15760405162461bcd60e51b81526004016107159061583e565b60115473ce720c194b9fd6b196259807d579bbd2f53e39d89063dba4989a9060ff166112dc84612013565b6001602b54600160d01b900460ff1660018111156112f657fe5b146012600101546040518563ffffffff1660e01b815260040161131c9493929190615417565b60006040518083038186803b15801561133457600080fd5b505af4158015611348573d6000803e3d6000fd5b5050601154610100900460ff16159150611382905057611366613a22565b6113825760405162461bcd60e51b815260040161071590615b5b565b601054601a5460405163b78e0bc960e01b815260609273ce720c194b9fd6b196259807d579bbd2f53e39d89263b78e0bc9926113d59230926001600160a01b03909116918c918c918c919060040161559f565b60006040518083038186803b1580156113ed57600080fd5b505af4158015611401573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114299190810190614d67565b90506060601060009054906101000a90046001600160a01b03166001600160a01b031663cc77828d6040518163ffffffff1660e01b815260040160006040518083038186803b15801561147b57600080fd5b505afa15801561148f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114b79190810190614c6f565b9050606081516001600160401b03811180156114d257600080fd5b506040519080825280602002602001820160405280156114fc578160200160208202803683370190505b50601a549091506001602b54600160d01b900460ff16600181111561151d57fe5b141561162357600f60009054906101000a90046001600160a01b03166001600160a01b031663703a9ec96040518163ffffffff1660e01b815260040160206040518083038186803b15801561157157600080fd5b505afa158015611585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a99190614934565b6001600160a01b031663d7256c70878786886040518563ffffffff1660e01b81526004016115da949392919061517e565b600060405180830381600087803b1580156115f457600080fd5b505af1158015611608573d6000803e3d6000fd5b5050602b54600160b01b900460ff1691506116239050575060005b60005b835181101561178f57600073ce720c194b9fd6b196259807d579bbd2f53e39d863d378778c30601060009054906101000a90046001600160a01b031688868151811061166e57fe5b60200260200101518a878151811061168257fe5b6020026020010151886040518663ffffffff1660e01b81526004016116ab9594939291906154a8565b60206040518083038186803b1580156116c357600080fd5b505af41580156116d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fb9190614ef9565b905084828151811061170957fe5b60200260200101516001600160a01b0316876001600160a01b03167fea39e3b35c5cd8937999ed5f7fbab30acd562a931fc4a887fed2a47c3074aa7288858151811061175157fe5b60200260200101516040516117669190615cd0565b60405180910390a38084838151811061177b57fe5b602090810291909101015250600101611626565b50801561180057602b54604051631483d99d60e01b81526001600160a01b0390911690631483d99d906117cd90869086908190600090600401615379565b600060405180830381600087803b1580156117e757600080fd5b505af11580156117fb573d6000803e3d6000fd5b505050505b61180989611e90565b611813858a61071e565b60006001602b54600160d01b900460ff16600181111561182f57fe5b148015611840575060175460005410155b80156118565750602b54600160b01b900460ff16155b90508015610d8957602b805460ff60b01b1916600160b01b179055601054601a54604051637547433160e11b815273ce720c194b9fd6b196259807d579bbd2f53e39d89263ea8e8662926118bd9230926001600160a01b0316918a916000906004016154dc565b60006040518083038186803b1580156118d557600080fd5b505af4158015610d84573d6000803e3d6000fd5b601281565b6007546001600160a01b031690565b606060098054806020026020016040519081016040528092919081815260200182805480156106ec57602002820191906000526020600020905b815481526020019060010190808311611937575050505050905090565b601290565b6040516322c1aa2560e11b815260009073495e73a680cd943020f18911e50c1fe5991cb77090634583544a90611996906011908690600401615c9d565b60206040518083038186803b1580156119ae57600080fd5b505af41580156119c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e69190614e40565b90505b919050565b8051825114611a0f5760405162461bcd60e51b81526004016107159061581e565b600a5460ff1615611a325760405162461bcd60e51b81526004016107159061566f565b611a3b82613a3d565b8151611a4e906008906020850190614657565b508051611a629060099060208401906146bc565b50600a805460ff19166001179055610728613af3565b602b546001600160a01b031681565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051611ab992919061544e565b60405180910390a2602b544290600160c01b900460ff16158015611ae65750602b54600160b81b900460ff165b8015611b0957506001602b54600160d01b900460ff166001811115611b0757fe5b145b8015611b1757506015548110155b611b335760405162461bcd60e51b815260040161071590615b2b565b60155462015180018111801590611b88573360009081526005602052604090205460ff1680611b6c57506007546001600160a01b031633145b611b885760405162461bcd60e51b8152600401610715906155f9565b611b9061269d565b80516022908155602080830151602355604083015160245560608301518051611bbd926025920190614657565b5060808201518051611bd99160048401916020909101906146bc565b505060225460235460009250611bee91613b49565b601d54601e54919250600091611c0391613b49565b905080821115611d2357601b54600090611c2b908490611c2590858303613be5565b90613b49565b6010546040805163cc77828d60e01b8152905192935073ce720c194b9fd6b196259807d579bbd2f53e39d89263ea8e86629230926001600160a01b0390911691829163cc77828d916004808301926000929190829003018186803b158015611c9257600080fd5b505afa158015611ca6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611cce9190810190614c6f565b8560016040518663ffffffff1660e01b8152600401611cf19594939291906154dc565b60006040518083038186803b158015611d0957600080fd5b505af4158015611d1d573d6000803e3d6000fd5b50505050505b5050602b805460ff60c01b1916600160c01b1790555050565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051611d6e92919061544e565b60405180910390a26002600b541415611d995760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b0316611dc65760405162461bcd60e51b8152600401610715906157cd565b6007546001600160a01b03163314611df05760405162461bcd60e51b81526004016107159061561c565b6000602b54600160d01b900460ff166001811115611e0a57fe5b14611e275760405162461bcd60e51b815260040161071590615be4565b604051611e339061512e565b60405190819003812060165490913391600080516020615e8f83398151915291611e5f91908690615cf0565b60405180910390a36016556001600b55565b333014611e905760405162461bcd60e51b81526004016107159061561c565b61104481613c5b565b602b54600160b01b900460ff1681565b333014611ec85760405162461bcd60e51b81526004016107159061561c565b6107288282613c88565b3360009081526002602090815260408083206001600160a01b0386168452909152812054808310611f26573360009081526002602090815260408083206001600160a01b0388168452909152812055611f55565b611f3081846139e9565b3360009081526002602090815260408083206001600160a01b03891684529091529020555b3360008181526002602090815260408083206001600160a01b038916808552925291829020549151909291600080516020615ef883398151915291611f9a9190615cd0565b60405180910390a35060019392505050565b6001600160a01b031660009081526001602052604090205490565b601254601354601454601554601654601754601854601954601a54601b54601c548b565b602b54600160d01b900460ff1681565b73495e73a680cd943020f18911e50c1fe5991cb77090565b60115460009060ff1615612067576001600160a01b0382166000908152602a602052604090205460ff1680612060575061204b6118ee565b6001600160a01b0316826001600160a01b0316145b90506119e9565b506001600160a01b03811615156119e9565b612081614703565b6040805160a081018252602280548252602354602080840191909152602454838501526025805485518184028101840190965280865293949293606086019392830182828015610fa9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610f8b5750505050508152602001600482018054806020026020016040519081016040528092919081815260200182805480156110015760200282019190600052602060002090815481526020019060010190808311610fed57505050505081525050905090565b73ce720c194b9fd6b196259807d579bbd2f53e39d86344e3696f8360a001518460e001518560c00151866101000151876060015151886080015151896040015151602b60159054906101000a900460ff166040518963ffffffff1660e01b81526004016121d0989796959493929190615d14565b60006040518083038186803b1580156121e857600080fd5b505af41580156121fc573d6000803e3d6000fd5b5050602b805460ff60a81b1916600160a81b179055505080516011805460208085015115156101000261ff001994151560ff19909316929092179390931617905560408301518051612252926027920190614657565b506060820151805161226c916028916020909101906146bc565b5060808201518051612286916029916020909101906146bc565b506040805161016081018252600080825260208201819052918101829052606081018290526000196080820181905260a080830184905285015160c080840182905286015160e0808501829052870151610100808601829052880151610120808701829052426101409097018790526012889055601388905560148890556015889055601695909555601796909655601892909255601955601a55601b92909255601c55820151602b805460ff60d01b1916600160d01b83600181111561234957fe5b0217905550600f80546001600160a01b0319166001600160a01b038581169190911791829055604080516311b2515f60e31b815290519290911691638d928af891600480820192602092909190829003018186803b1580156123aa57600080fd5b505afa1580156123be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e29190614934565b602b80546001600160a01b0319166001600160a01b0392909216919091179055601954601a54601854601b546040517f3d6667963e842e2b5ff1d4feab2c9b92f17c9003592e2ad229952eeb9a293fd09161243c91615cd0565b60405180910390a4505050565b6007546001600160a01b031633146124735760405162461bcd60e51b81526004016107159061561c565b61247b613c93565b6001600160a01b0381166124a15760405162461bcd60e51b81526004016107159061572a565b6007546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360005b60085481101561256557600754600880546001600160a01b03909216918390811061250557fe5b6000918252602090912001546001600160a01b0316141561255d57816008828154811061252e57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b6001016124de565b50600780546001600160a01b03908116600090815260056020526040808220805460ff1990811690915594909216808252919020805490931660011790925580546001600160a01b0319169091179055565b60008080806001602b54600160d01b900460ff1660018111156125d657fe5b1490504292508080156125ea575060155483115b156125f55760155492505b612604836012600a01546139e9565b915062278d00821061261557600193505b80801561262c5750602b54600160b01b900460ff16155b1561263657600093505b50909192565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106ec5780601f106106c1576101008083540402835291602001916106ec565b6126a5614703565b6126ad614703565b60005481526126ba613c95565b60808301526060820152600f546040805163b18b78dd60e01b815290516001600160a01b039092169163b18b78dd91600480820192602092909190829003018186803b15801561270957600080fd5b505afa15801561271d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127419190614934565b6001600160a01b031663422b66f4826060015183608001516040518363ffffffff1660e01b8152600401612776929190615354565b602060405180830381600087803b15801561279057600080fd5b505af11580156127a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c89190614ef9565b6020820152426040820152905090565b60115460ff8082169161010090041682565b73ce720c194b9fd6b196259807d579bbd2f53e39d890565b606060088054806020026020016040519081016040528092919081815260200182805480156106ec57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161283c575050505050905090565b6040518060400160405280601081526020016f11195cde5b8814db585c9d08141bdbdb60821b81525081565b6007546001600160a01b031633146128b95760405162461bcd60e51b81526004016107159061561c565b601154610100900460ff1680156128da5750602b54600160a01b900460ff16155b6128f65760405162461bcd60e51b815260040161071590615648565b80518251146129175760405162461bcd60e51b8152600401610715906159f6565b60005b8151811015612a2857600f5483516000916001600160a01b031690638f49f44d9086908590811061294757fe5b602002602001015185858151811061295b57fe5b60200260200101516040518363ffffffff1660e01b8152600401612980929190615cd9565b60206040518083038186803b15801561299857600080fd5b505afa1580156129ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d09190614e40565b9050806129ef5760405162461bcd60e51b815260040161071590615754565b612a1f8483815181106129fe57fe5b6020026020010151848481518110612a1257fe5b6020026020010151613e38565b5060010161291a565b5050602b805460ff60a01b1916600160a01b17905550565b60006001600160a01b038316612a685760405162461bcd60e51b81526004016107159061572a565b612a7333848461394a565b50600192915050565b6060336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051612ab092919061544e565b60405180910390a26002600b541415612adb5760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b0316612b085760405162461bcd60e51b8152600401610715906157cd565b600f546040516338f0d24560e01b81526001600160a01b03909116906338f0d24590612b3a9030903390600401615164565b60206040518083038186803b158015612b5257600080fd5b505afa158015612b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8a9190614e40565b612ba65760405162461bcd60e51b8152600401610715906156c5565b8115612c3f57601054604051635b0e93fb60e11b81526001600160a01b039091169063b61d27f690612be29089908990899089906004016152ee565b600060405180830381600087803b158015612bfc57600080fd5b505af1158015612c10573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c389190810190614e5c565b9050612c8d565b612c8a84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050506001600160a01b03891691905087613f12565b90505b6001600b5595945050505050565b6010546001600160a01b031681565b6007546001600160a01b03163314612cd45760405162461bcd60e51b81526004016107159061561c565b6002600b541415612cf75760405162461bcd60e51b815260040161071590615889565b6002600b556040513390600080356001600160e01b03191691612d1c9190369061544e565b60405180910390a2601154604051630d3aa47160e41b815273ce720c194b9fd6b196259807d579bbd2f53e39d89163d3aa471091612d659160ff169060019086906004016153f6565b60006040518083038186803b158015612d7d57600080fd5b505af4158015612d91573d6000803e3d6000fd5b505050506001600160a01b03166000908152602a60205260409020805460ff19166001908117909155600b55565b600f5460405163db7ca46b60e01b81526001600160a01b039091169063db7ca46b90612def908490600401615150565b60206040518083038186803b158015612e0757600080fd5b505afa158015612e1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e3f9190614e40565b612e5b5760405162461bcd60e51b8152600401610715906158ae565b602b54600160a01b900460ff161561104457612e7681613f40565b6110445760405162461bcd60e51b8152600401610715906158ae565b60065481565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051612eca92919061544e565b60405180910390a26002600b541415612ef55760405162461bcd60e51b815260040161071590615889565b6002600b553360009081526005602052604090205460ff1680612f2257506007546001600160a01b031633145b612f3e5760405162461bcd60e51b8152600401610715906155f9565b6010546001600160a01b0316612f665760405162461bcd60e51b8152600401610715906157cd565b612f6e61372c565b6001600b55565b3360009081526002602090815260408083206001600160a01b0386168452909152812054612fa39083613f5e565b3360008181526002602090815260408083206001600160a01b03891680855292529182902084905590519092600080516020615ef8833981519152916107739190615cd0565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6007546001600160a01b0316331461303e5760405162461bcd60e51b81526004016107159061561c565b6002600b5414156130615760405162461bcd60e51b815260040161071590615889565b6002600b556040513390600080356001600160e01b031916916130869190369061544e565b60405180910390a26011546001600160a01b0382166000908152602a602052604090819020549051630d3aa47160e41b815273ce720c194b9fd6b196259807d579bbd2f53e39d89263d3aa4710926130ec9260ff928316929091169086906004016153f6565b60006040518083038186803b15801561310457600080fd5b505af4158015613118573d6000803e3d6000fd5b505050506001600160a01b03166000908152602a60205260409020805460ff191690556001600b55565b6007546001600160a01b0316331461316c5760405162461bcd60e51b81526004016107159061561c565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405161319e92919061544e565b60405180910390a26002600b5414156131c95760405162461bcd60e51b815260040161071590615889565b6002600b55600f54604080516358c3de9360e11b815290516001600160a01b039092169163b187bd2691600480820192602092909190829003018186803b15801561321357600080fd5b505afa158015613227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324b9190614e40565b156132685760405162461bcd60e51b81526004016107159061583e565b6001602b54600160d01b900460ff16600181111561328257fe5b141561366157601654604051633e9fc0bd60e01b815273ce720c194b9fd6b196259807d579bbd2f53e39d891633e9fc0bd916132c49187918990600401615cfe565b60006040518083038186803b1580156132dc57600080fd5b505af41580156132f0573d6000803e3d6000fd5b5050601654601754602880549294509092506133319160009061330f57fe5b9060005260206000200154611c25856020015189613be590919063ffffffff16565b6016556028805461335f919060009061334657fe5b6000918252602090912001548451611c25908990613be5565b601260050181905550866001600160a01b03167f8e15e99837ccd5505c7306f1c665c90b4710600100e4720421a8b2c3e86f4ff43060276000815481106133a257fe5b6000918252602082200154602880546001600160a01b039092169290916133c557fe5b90600052602060002001548a6040516133e194939291906152ac565b60405180910390a26040516133f59061512e565b6040518091039020876001600160a01b0316600080516020615e8f8339815191528460126004015460405161342b929190615cf0565b60405180910390a360405161343f9061513f565b6040518091039020876001600160a01b0316600080516020615e8f83398151915283601260050154604051613475929190615cf0565b60405180910390a360004286018186600781111561348f57fe5b14156134a0576276a7009150613562565b60038660078111156134ae57fe5b14156134bf57620151809150613562565b60048660078111156134cd57fe5b14156134de576203f4809150613562565b60058660078111156134ec57fe5b14156134fd5762093a809150613562565b600686600781111561350b57fe5b141561351c57621275009150613562565b600786600781111561352a57fe5b141561353b5762278d009150613562565b600186600781111561354957fe5b141561355a5762ed4e009150613562565b6301da9c0091505b6012879055601381905560148290558082016015819055600f546040805163703a9ec960e01b815290516001600160a01b039092169163703a9ec991600480820192602092909190829003018186803b1580156135be57600080fd5b505afa1580156135d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f69190614934565b6001600160a01b031663d7256c708b8c602760286040518563ffffffff1660e01b815260040161362994939291906151c7565b600060405180830381600087803b15801561364357600080fd5b505af1158015613657573d6000803e3d6000fd5b5050505050505050505b61366a84613f8a565b50506001600b55505050565b6007546001600160a01b031633146136a05760405162461bcd60e51b81526004016107159061561c565b6136a8613c93565b6136b0614248565b6136b982613a3d565b81516136cc906008906020850190614657565b5080516136e09060099060208401906146bc565b50610728613af3565b602b54600160b81b900460ff1681565b73e91c89d7cc74b49579ac3a5ba68974bda8c3f54790565b602b54600160c81b900460ff1681565b61072830838361394a565b60008060006137396125b7565b92509250925082156138dd576010546040805163cc77828d60e01b815290516060926001600160a01b03169163cc77828d916004808301926000929190829003018186803b15801561378a57600080fd5b505afa15801561379e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526137c69190810190614c6f565b601054601854604051631abc9a6960e11b815292935060609273ce720c194b9fd6b196259807d579bbd2f53e39d89263357934d29261381c9230926001600160a01b03169188918a9062278d0090600401615521565b60006040518083038186803b15801561383457600080fd5b505af4158015613848573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526138709190810190614d67565b602b54604051630bac7b8160e01b81529192506001600160a01b031690630bac7b81906138a39085908590600401615354565b600060405180830381600087803b1580156138bd57600080fd5b505af11580156138d1573d6000803e3d6000fd5b505050601c8590555050505b505050565b306000908152600160205260409020546138fc90826139e9565b306000908152600160205260408120919091555461391a90826139e9565b60009081556040513090600080516020615ed88339815191529061393f908590615cd0565b60405180910390a350565b6001600160a01b03831660009081526001602052604090205461396d90826139e9565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461399c9082613f5e565b6001600160a01b038084166000818152600160205260409081902093909355915190851690600080516020615ed8833981519152906139dc908590615cd0565b60405180910390a3505050565b60008060006139f8858561429a565b915091508015613a1a5760405162461bcd60e51b815260040161071590615a8c565b509392505050565b6000600c54600014613a35576001613a38565b60005b905090565b6000805b8251811015613aca57600160056000858481518110613a5c57fe5b6020908102919091018101516001600160a01b03908116835290820192909252604001600020805460ff1916921515929092179091556007548451911690849083908110613aa657fe5b60200260200101516001600160a01b03161415613ac257600191505b600101613a41565b50600a5460ff161561072857806107285760405162461bcd60e51b8152600401610715906158db565b6000805b600954811015613b275760098181548110613b0e57fe5b6000918252602090912001549190910190600101613af7565b5080612710146110445760405162461bcd60e51b815260040161071590615695565b600081613b685760405162461bcd60e51b81526004016107159061593a565b82613b755750600061077f565b670de0b6b3a764000083810290848281613b8b57fe5b0414613ba95760405162461bcd60e51b81526004016107159061585f565b60028304810181811015613bcf5760405162461bcd60e51b81526004016107159061585f565b6000848281613bda57fe5b049695505050505050565b600082613bf45750600061077f565b82820282848281613c0157fe5b0414613c1f5760405162461bcd60e51b815260040161071590615910565b6706f05b59d3b20000810181811015613c4a5760405162461bcd60e51b815260040161071590615910565b6000670de0b6b3a764000082613bda565b613c64816142bf565b60165460005411156110445760405162461bcd60e51b815260040161071590615960565b61072882308361394a565b565b6060806060601060009054906101000a90046001600160a01b03166001600160a01b031663cc77828d6040518163ffffffff1660e01b815260040160006040518083038186803b158015613ce857600080fd5b505afa158015613cfc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613d249190810190614c6f565b9050606081516001600160401b0381118015613d3f57600080fd5b50604051908082528060200260200182016040528015613d69578160200160208202803683370190505b50905060005b8251811015613e2e5760105483516001600160a01b039091169063f8b2cb4f90859084908110613d9b57fe5b60200260200101516040518263ffffffff1660e01b8152600401613dbf9190615150565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190614ef9565b828281518110613e1b57fe5b6020908102919091010152600101613d6f565b5090925090509091565b6001600160a01b038116613e5e5760405162461bcd60e51b815260040161071590615a27565b613e6781613f40565b15613e845760405162461bcd60e51b815260040161071590615a5a565b6000828152600e602090815260408083206001600160a01b038516845282528083208054600160ff199182168117909255600d9093529281902080549092168317909155600c8054909201909155513390839030907f5ab6a0d7af8e86f78c34acea4f8aff1be027227ce1bc29e03f57f39b788f4b0490613f06908690615150565b60405180910390a45050565b6060613f38848484604051806060016040528060298152602001615eaf6029913961431d565b949350505050565b6001600160a01b03166000908152600d602052604090205460ff1690565b600082820183811015613f835760405162461bcd60e51b815260040161071590615ab7565b9392505050565b6010546001600160a01b031615613fb35760405162461bcd60e51b8152600401610715906157f6565b613fbc81611e90565b613fc6338261071e565b600f60009054906101000a90046001600160a01b03166001600160a01b03166391cefde46040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561401657600080fd5b505af115801561402a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061404e9190614934565b601080546001600160a01b0319166001600160a01b03928316179081905560405163d03f2a0f60e01b815273ce720c194b9fd6b196259807d579bbd2f53e39d89263d03f2a0f926140a69291169085906004016152d5565b60006040518083038186803b1580156140be57600080fd5b505af41580156140d2573d6000803e3d6000fd5b5050505060005b60275481101561420c576000602782815481106140f257fe5b6000918252602082200154602880546001600160a01b039092169350908490811061411957fe5b9060005260206000200154905060006029848154811061413557fe5b9060005260206000200154905061414b83612dbf565b6141606001600160a01b038416333085614354565b60105461417b906001600160a01b03858116911660006143b2565b601054614197906001600160a01b0385811691166000196143b2565b601054604051631c9c3ca760e31b81526001600160a01b039091169063e4e1e538906141cb90869086908690600401615320565b600060405180830381600087803b1580156141e557600080fd5b505af11580156141f9573d6000803e3d6000fd5b5050600190950194506140d99350505050565b505b6027541561104457602780548061422157fe5b600082815260209020810160001990810180546001600160a01b031916905501905561420e565b60005b60085481101561104457600560006008838154811061426657fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020805460ff1916905560010161424b565b6000808383116142b057505080820360006142b8565b505081810360015b9250929050565b306000908152600160205260409020546142d99082613f5e565b30600090815260016020526040812091909155546142f79082613f5e565b6000908155604051309190600080516020615ed88339815191529061393f908590615cd0565b60608247101561433f5760405162461bcd60e51b815260040161071590615787565b61434b85858585614475565b95945050505050565b6143ac846323b872dd60e01b85858560405160240161437593929190615288565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614539565b50505050565b80158061443a5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e906143e89030908690600401615164565b60206040518083038186803b15801561440057600080fd5b505afa158015614414573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144389190614ef9565b155b6144565760405162461bcd60e51b815260040161071590615b8e565b6138dd8363095ea7b360e01b84846040516024016143759291906152d5565b60606144808561461e565b61449c5760405162461bcd60e51b8152600401610715906159bf565b60006060866001600160a01b031685876040516144b99190615112565b60006040518083038185875af1925050503d80600081146144f6576040519150601f19603f3d011682016040523d82523d6000602084013e6144fb565b606091505b5091509150811561450f579150613f389050565b80511561451f5780518082602001fd5b8360405162461bcd60e51b81526004016107159190615462565b61454b826001600160a01b031661461e565b6145675760405162461bcd60e51b815260040161071590615c0f565b60006060836001600160a01b0316836040516145839190615112565b6000604051808303816000865af19150503d80600081146145c0576040519150601f19603f3d011682016040523d82523d6000602084013e6145c5565b606091505b5091509150816145e75760405162461bcd60e51b8152600401610715906156f5565b8051156143ac57808060200190518101906146029190614e40565b6143ac5760405162461bcd60e51b815260040161071590615ae1565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590613f38575050151592915050565b8280548282559060005260206000209081019282156146ac579160200282015b828111156146ac57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614677565b506146b8929150614732565b5090565b8280548282559060005260206000209081019282156146f7579160200282015b828111156146f75782518255916020019190600101906146dc565b506146b8929150614751565b6040518060a0016040528060008152602001600081526020016000815260200160608152602001606081525090565b5b808211156146b85780546001600160a01b0319168155600101614733565b5b808211156146b85760008155600101614752565b600082601f830112614776578081fd5b813561478961478482615dce565b615da8565b8181529150602080830190848101818402860182018710156147aa57600080fd5b60005b848110156147d25781356147c081615e5e565b845292820192908201906001016147ad565b505050505092915050565b60008083601f8401126147ee578182fd5b5081356001600160401b03811115614804578182fd5b60208301915083602080830285010111156142b857600080fd5b600082601f83011261482e578081fd5b813561483c61478482615dce565b81815291506020808301908481018184028601820187101561485d57600080fd5b60005b848110156147d257813584529282019290820190600101614860565b803561077f81615e81565b600082601f830112614897578081fd5b81356148a561478482615ded565b91508082528360208285010111156148bc57600080fd5b8060208401602084013760009082016020015292915050565b6000604082840312156148e6578081fd5b6148f06040615da8565b905081356148fd81615e73565b8152602082013561490d81615e73565b602082015292915050565b600060208284031215614929578081fd5b8135613f8381615e5e565b600060208284031215614945578081fd5b8151613f8381615e5e565b60008060408385031215614962578081fd5b823561496d81615e5e565b9150602083013561497d81615e5e565b809150509250929050565b60008060006060848603121561499c578081fd5b83356149a781615e5e565b925060208401356149b781615e5e565b929592945050506040919091013590565b6000806000608084860312156149dc578081fd5b83356149e781615e5e565b925060208401356001600160401b0380821115614a02578283fd5b8186019150610140808389031215614a18578384fd5b614a2181615da8565b9050823582811115614a31578485fd5b614a3d89828601614887565b825250602083013582811115614a51578485fd5b614a5d89828601614887565b602083015250604083013582811115614a74578485fd5b614a8089828601614766565b604083015250606083013582811115614a97578485fd5b614aa38982860161481e565b606083015250608083013582811115614aba578485fd5b614ac68982860161481e565b60808301525060a083013560a082015260c083013560c082015260e083013560e0820152610100915081830135828201526101209150614b088883850161487c565b82820152809450505050614b1f85604086016148d5565b90509250925092565b60008060408385031215614b3a578182fd5b8235614b4581615e5e565b946020939093013593505050565b600080600080600060808688031215614b6a578283fd5b8535614b7581615e5e565b94506020860135935060408601356001600160401b0380821115614b97578485fd5b818801915088601f830112614baa578485fd5b813581811115614bb8578586fd5b896020828501011115614bc9578586fd5b6020830195508094505050506060860135614be381615e73565b809150509295509295909350565b600080600080600085870360c0811215614c09578384fd5b8635614c1481615e5e565b95506020870135945060408701359350606087013560088110614c35578283fd5b92506040607f1982011215614c48578182fd5b50614c536040615da8565b6080870135815260a09096013560208701525092959194509290565b60006020808385031215614c81578182fd5b82516001600160401b03811115614c96578283fd5b8301601f81018513614ca6578283fd5b8051614cb461478482615dce565b8181528381019083850185840285018601891015614cd0578687fd5b8694505b83851015614cfb578051614ce781615e5e565b835260019490940193918501918501614cd4565b50979650505050505050565b60008060408385031215614d19578182fd5b82356001600160401b0380821115614d2f578384fd5b614d3b86838701614766565b93506020850135915080821115614d50578283fd5b50614d5d8582860161481e565b9150509250929050565b60006020808385031215614d79578182fd5b82516001600160401b03811115614d8e578283fd5b8301601f81018513614d9e578283fd5b8051614dac61478482615dce565b8181528381019083850185840285018601891015614dc8578687fd5b8694505b83851015614cfb578051835260019490940193918501918501614dcc565b60008060408385031215614dfc578182fd5b82356001600160401b0380821115614e12578384fd5b614e1e8683870161481e565b93506020850135915080821115614e33578283fd5b50614d5d85828601614766565b600060208284031215614e51578081fd5b8151613f8381615e73565b600060208284031215614e6d578081fd5b81516001600160401b03811115614e82578182fd5b8201601f81018413614e92578182fd5b8051614ea061478482615ded565b818152856020838501011115614eb4578384fd5b61434b826020830160208601615e28565b600060208284031215614ed6578081fd5b8135613f8381615e81565b600060208284031215614ef2578081fd5b5035919050565b600060208284031215614f0a578081fd5b5051919050565b60008060008060608587031215614f26578182fd5b8435935060208501356001600160401b03811115614f42578283fd5b614f4e878288016147dd565b9094509250506040850135614f6281615e5e565b939692955090935050565b600080600080600060808688031215614f84578283fd5b8535945060208601356001600160401b03811115614fa0578384fd5b614fac888289016147dd565b9095509350506040860135614fc081615e5e565b91506060860135614be381615e5e565b600080600060608486031215614fe4578081fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0316815260200190565b815260200190565b6000815180845260208085019450808401835b8381101561504e5781516001600160a01b031687529582019590820190600101615029565b509495945050505050565b81835260006001600160fb1b03831115615071578081fd5b6020830280836020870137939093016020019283525090919050565b6000815180845260208085019450808401835b8381101561504e578151875295820195908201906001016150a0565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b600081518084526150fe816020860160208601615e28565b601f01601f19169290920160200192915050565b60008251615124818460208701615e28565b9190910192915050565b642aa82822a960d91b815260050190565b64232627a7a960d91b815260050190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b038581168252841660208201526080604082018190526000906151aa90830185615016565b82810360608401526151bc818561508d565b979650505050505050565b6001600160a01b03858116825284166020820152608060408201819052835460009183019081906151f88183615cd0565b915061520387615e10565b9250835b81811015615231576152228361521d8654615e1c565b614ffd565b60019485019490935001615207565b50508381036060850152809150845461524a8183615cd0565b925061525586615e10565b9150835b8181101561527a5761526c84845461500e565b935060019283019201615259565b509198975050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b0386168252846020830152606060408301526153166060830184866150bc565b9695505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b600060208252613f836020830184615016565b6000604082526153676040830185615016565b828103602084015261434b818561508d565b60006080825261538c6080830187615016565b828103602084015261539e818761508d565b905082810360408401526153b2818661508d565b915050821515606083015295945050505050565b600060208252613f83602083018461508d565b901515815260200190565b91151582521515602082015260400190565b921515835290151560208301526001600160a01b0316604082015260600190565b9315158452911515602084015215156040830152606082015260800190565b92151583526020830191909152604082015260600190565b600060208252613f386020830184866150bc565b600060208252613f8360208301846150e6565b6001600160a01b03969096168652931515602086015291151560408501526060840152608083015260a082015260c00190565b6001600160a01b03958616815293851660208501529190931660408301526060820192909252608081019190915260a00190565b6001600160a01b0386811682528516602082015260a06040820181905260009061550890830186615016565b6060830194909452509015156080909101529392505050565b6001600160a01b0387811682528616602082015260c06040820181905260009061554d90830187615016565b606083019590955250608081019290925260a0909101529392505050565b6001600160a01b03868116825285166020820152604081018490526080606082018190526000906151bc9083018486615059565b6001600160a01b038781168252861660208201526040810185905260a0606082018190526000906155d39083018587615059565b9050826080830152979650505050505050565b602081016155f383615e54565b91905290565b60208082526009908201526837b7363ca0b236b4b760b91b604082015260600190565b60208082526012908201527122a9292fa727aa2fa1a7a72a2927a62622a960711b604082015260600190565b6020808252600d908201526c4552525f4e4f5f52494748545360981b604082015260600190565b6020808252600c908201526b696e697469616c697a65642160a01b604082015260600190565b6020808252601690820152754552525f494c4c4547414c5f50455243454e5441474560501b604082015260600190565b60208082526016908201527526a7a22aa6229024a9902727aa102922a3a4a9aa22a960511b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b60208082526010908201526f4552525f5a45524f5f4144445245535360801b604082015260600190565b602080825260199082015278544f4b454e5f4d5553545f494e5f57484954455f4c4953545360381b604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252600f908201526e11549497d393d517d0d49150551151608a1b604082015260600190565b6020808252600e908201526d11549497d254d7d0d4915055115160921b604082015260600190565b60208082526006908201526506f776e6572560d41b604082015260600190565b602080825260079082015266085c185d5cd95960ca1b604082015260600190565b60208082526010908201526f11549497d1125597d25395115493905360821b604082015260600190565b6020808252600b908201526a4552525f5245454e54525960a81b604082015260600190565b60208082526013908201527222a9292fa727aa2faba424aa22afaa27a5a2a760691b604082015260600190565b6020808252601b908201527a22a9292fa722abafa0a226a4a729afa420a9afa727afa7aba722a960291b604082015260600190565b60208082526010908201526f4552525f4d554c5f4f564552464c4f5760801b604082015260600190565b6020808252600c908201526b4552525f4449565f5a45524f60a01b604082015260600190565b60208082526015908201527411549497d0d05417d31253525517d4915050d21151605a1b604082015260600190565b60208082526016908201527522a9292fa821aa27a5a2a72fa120a22fa1a0a62622a960511b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526017908201527608aa4a4bea69ea4a8bea89e968a9cbe9a92a69a82a8869604b1b604082015260600190565b6020808252601990820152784552525f494e56414c49445f544f4b454e5f4144445245535360381b604082015260600190565b6020808252601890820152774552525f4841535f4245454e5f41444445445f574849544560401b604082015260600190565b6020808252601190820152704552525f5355425f554e444552464c4f5760781b604082015260600190565b60208082526010908201526f4552525f4144445f4f564552464c4f5760801b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526016908201527511549497d0d3d39112551253d394d7d393d517d3515560521b604082015260600190565b60208082526019908201527822a9292fa9a427aaa6222fa9a2aa2faba424aa22aa27a5a2a760391b604082015260600190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b60208082526011908201527022a9292fa6aaa9aa2fa7a822a72fa2aa2360791b604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b600060208252825160208301526020830151604083015260408301516060830152606083015160a06080840152615c8060c0840182615016565b90506080840151601f198483030160a085015261434b828261508d565b825460ff8082161515835260089190911c161515602082015260608101615cc383615e54565b8260408301529392505050565b90815260200190565b9182526001600160a01b0316602082015260400190565b918252602082015260400190565b9283526020830191909152604082015260600190565b978852602088019690965260408701949094526060860192909252608085015260a084015260c0830152151560e08201526101000190565b9a8b5260208b019990995260408a01979097526060890195909552608088019390935260a087019190915260c086015260e08501526101008401526101208301526101408201526101600190565b60ff91909116815260200190565b6040518181016001600160401b0381118282101715615dc657600080fd5b604052919050565b60006001600160401b03821115615de3578081fd5b5060209081020190565b60006001600160401b03821115615e02578081fd5b50601f01601f191660200190565b60009081526020902090565b6001600160a01b031690565b60005b83811015615e43578181015183820152602001615e2b565b838111156143ac5750506000910152565b6002811061104457fe5b6001600160a01b038116811461104457600080fd5b801515811461104457600080fd5b6002811061104457600080fdfecc86385c52bf4aeaa8583735b29e4a0abc0c5489fae93dbaef02bd838c2d297d416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220417b0e50b96f81c4f0b504b01dfb2ef2afea9c4b01e5273f5bfb44dc16f3ce4b64736f6c634300060c00330000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000056f53544254000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e446563656e7472616c697a65642053686f72742d7465726d2055532074726561737572792062696c6c2066756e64000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102ae5760003560e01c806373a9855c1161016e57806373a9855c146104b257806374983a0d146104c7578063806c6f87146104cf5780638cf3b3d5146104e257806390ca071b146104ea57806392eefe9b146104fd57806395c5736d1461051057806395d89b411461052757806396a2db021461052f578063980e8db6146105375780639d829c2b1461054d578063a0e67e2b14610555578063a3f4df7e1461056a578063a6c245c414610572578063a9059cbb14610585578063b36b4fa014610598578063b64ef17b146105ab578063c83a1c2d146105b3578063c9735f23146105c6578063d29986c1146105d9578063d2fed42e146105e1578063d73dd623146105e9578063dd62ed3e146105fc578063e2762d4b1461060f578063eff4955714610622578063f054fbc014610635578063f329a8c714610648578063f3b0857214610650578063f605bebf14610658576102ae565b806306fdde03146102b3578063095dcccc146102d1578063095ea7b3146102e65780630a165940146103065780630a6d3d961461031b5780631296548f1461032e57806316131388146103365780631748c0881461033e57806318160ddd1461035357806321241dfe14610368578063220eb7601461037057806323b872dd1461038357806327304dfd14610396578063276990f6146103a95780632e0f2625146103bc5780633018205f146103d1578063309a042c146103d9578063313ce567146103ee57806337c6f4d9146103f65780633ef1447914610409578063430bf08a1461041c57806343774a6b1461042457806347786d371461042c5780634ba578821461043f5780635468d6d71461045257806355c32a231461045a578063661884631461046d57806370a08231146104805780637228c87b14610493575b600080fd5b6102bb610660565b6040516102c89190615462565b60405180910390f35b6102e46102df366004614b28565b6106f6565b005b6102f96102f4366004614b28565b61072c565b6040516102c891906153d9565b61030e610785565b6040516102c89190615150565b6102e4610329366004614f11565b610794565b6102e4610d9a565b6102f9610f18565b610346610f28565b6040516102c89190615c46565b61035b61100f565b6040516102c89190615cd0565b61035b611015565b6102e461037e366004614ee1565b61101c565b6102f9610391366004614988565b611047565b6102f96103a4366004614918565b61116f565b6102e46103b7366004614f6d565b611184565b6103c46118e9565b6040516102c89190615d9a565b61030e6118ee565b6103e16118fd565b6040516102c891906153c6565b6103c4611954565b6102f9610404366004614ec5565b611959565b6102e4610417366004614d07565b6119ee565b61030e611a78565b6102e4611a87565b6102e461043a366004614ee1565b611d3c565b6102e461044d366004614ee1565b611e71565b6102f9611e99565b6102e4610468366004614b28565b611ea9565b6102f961047b366004614b28565b611ed2565b61035b61048e366004614918565b611fac565b61049b611fc7565b6040516102c89b9a99989796959493929190615d4c565b6104ba611feb565b6040516102c891906155e6565b61030e611ffb565b6102f96104dd366004614918565b612013565b610346612079565b6102e46104f83660046149c8565b61215c565b6102e461050b366004614918565b612449565b6105186125b7565b6040516102c893929190615436565b6102bb61263c565b61034661269d565b61053f6127d8565b6040516102c89291906153e4565b61030e6127ea565b61055d612802565b6040516102c89190615341565b6102bb612863565b6102e4610580366004614dea565b61288f565b6102f9610593366004614b28565b612a40565b6102bb6105a6366004614b53565b612a7c565b61030e612c9b565b6102e46105c1366004614918565b612caa565b6102e46105d4366004614918565b612dbf565b61035b612e92565b6102e4612e98565b6102f96105f7366004614b28565b612f75565b61035b61060a366004614950565b612fe9565b6102e461061d366004614918565b613014565b6102e4610630366004614bf1565b613142565b6102e4610643366004614d07565b613676565b6102f96136e9565b61030e6136f9565b6102f9613711565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106ec5780601f106106c1576101008083540402835291602001916106ec565b820191906000526020600020905b8154815290600101906020018083116106cf57829003601f168201915b5050505050905090565b33301461071e5760405162461bcd60e51b81526004016107159061561c565b60405180910390fd5b6107288282613721565b5050565b3360008181526002602090815260408083206001600160a01b03871680855292528083208590555191929091600080516020615ef883398151915290610773908690615cd0565b60405180910390a35060015b92915050565b600f546001600160a01b031681565b336001600160a01b03166000356001600160e01b0319166001600160e01b0319166000366040516107c692919061544e565b60405180910390a26002600b5414156107f15760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b031661081e5760405162461bcd60e51b8152600401610715906157cd565b600f60009054906101000a90046001600160a01b03166001600160a01b031663b187bd266040518163ffffffff1660e01b815260040160206040518083038186803b15801561086c57600080fd5b505afa158015610880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a49190614e40565b156108c15760405162461bcd60e51b81526004016107159061583e565b60195460009081906001602b54600160d01b900460ff1660018111156108e357fe5b141561097357602b54600160b01b900460ff1615801561090557506013544210155b91508161096957602b54600160c81b900460ff166109395761092561372c565b602b805460ff60c81b1916600160c81b1790555b602b54600160b81b900460ff16801561095c5750602b54600160c01b900460ff16155b1561096957610969611a87565b8115610973575060005b73ce720c194b9fd6b196259807d579bbd2f53e39d8637f717d85306001602b54600160d01b900460ff1660018111156109a857fe5b602b5460155460135460405160e088901b6001600160e01b03191681526109e596959490941493600160b01b90930460ff16928f90600401615475565b60206040518083038186803b1580156109fd57600080fd5b505af4158015610a11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a359190614ef9565b60105460405163151c70f960e21b815291945060609173ce720c194b9fd6b196259807d579bbd2f53e39d891635471c3e491610a879130916001600160a01b039091169089908d908d9060040161556b565b60006040518083038186803b158015610a9f57600080fd5b505af4158015610ab3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610adb9190810190614d67565b9050610ae73385611ec8565b610af08461103b565b6010546040805163cc77828d60e01b815290516060926001600160a01b03169163cc77828d916004808301926000929190829003018186803b158015610b3557600080fd5b505afa158015610b49573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b719190810190614c6f565b9050606081516001600160401b0381118015610b8c57600080fd5b50604051908082528060200260200182016040528015610bb6578160200160208202803683370190505b50905060005b8251811015610d185760008073ce720c194b9fd6b196259807d579bbd2f53e39d8632c948f6f30601060009054906101000a90046001600160a01b0316888781518110610c0557fe5b60200260200101518a8881518110610c1957fe5b60200260200101518c6040518663ffffffff1660e01b8152600401610c429594939291906154a8565b60606040518083038186803b158015610c5a57600080fd5b505af4158015610c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c929190614fd0565b925092505080848481518110610ca457fe5b602002602001018181525050848381518110610cbc57fe5b60200260200101516001600160a01b03168a6001600160a01b03167fc62fc35ac75e3bff532648e2859a3e1694002cfa357614ae8e034df7f83db5e984604051610d069190615cd0565b60405180910390a35050600101610bbc565b508315610d8957602b54604051631483d99d60e01b81526001600160a01b0390911690631483d99d90610d5690859085908190600190600401615379565b600060405180830381600087803b158015610d7057600080fd5b505af1158015610d84573d6000803e3d6000fd5b505050505b50506001600b555050505050505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051610dcc92919061544e565b60405180910390a2602b544290600160b81b900460ff16158015610df95750602b54600160b01b900460ff165b8015610e1c57506001602b54600160d01b900460ff166001811115610e1a57fe5b145b8015610e2f57506013546203f480018111155b610e4b5760405162461bcd60e51b815260040161071590615b2b565b60135462015180018111801590610ea0573360009081526005602052604090205460ff1680610e8457506007546001600160a01b031633145b610ea05760405162461bcd60e51b8152600401610715906155f9565b610ea861269d565b8051601d908155602080830151601e556040830151601f5560608301518051610ed49291820190614657565b5060808201518051610ef09160048401916020909101906146bc565b5050602b805460ff60b81b1916600160b81b1790555060135482101561072857426013555050565b602b54600160c01b900460ff1681565b610f30614703565b6040805160a081018252601d80548252601e54602080840191909152601f54838501528054845181830281018301909552808552929391926060850192919082820182828015610fa957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f8b575b505050505081526020016004820180548060200260200160405190810160405280929190818152602001828054801561100157602002820191906000526020600020905b815481526020019060010190808311610fed575b505050505081525050905090565b60005490565b62278d0081565b33301461103b5760405162461bcd60e51b81526004016107159061561c565b611044816138e2565b50565b60006001600160a01b03831661106f5760405162461bcd60e51b81526004016107159061572a565b336001600160a01b03851614806110a957506001600160a01b03841660009081526002602090815260408083203384529091529020548211155b6110c55760405162461bcd60e51b81526004016107159061598f565b6110d084848461394a565b6001600160a01b038416600081815260026020908152604080832033808552925290912054911480159061110657506000198114155b156111645761111581846139e9565b6001600160a01b03861660008181526002602090815260408083203380855292529182902084905590519092600080516020615ef88339815191529161115b9190615cd0565b60405180910390a35b506001949350505050565b60056020526000908152604090205460ff1681565b336001600160a01b03166000356001600160e01b0319166001600160e01b0319166000366040516111b692919061544e565b60405180910390a26002600b5414156111e15760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b031661120e5760405162461bcd60e51b8152600401610715906157cd565b600f60009054906101000a90046001600160a01b03166001600160a01b031663b187bd266040518163ffffffff1660e01b815260040160206040518083038186803b15801561125c57600080fd5b505afa158015611270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112949190614e40565b156112b15760405162461bcd60e51b81526004016107159061583e565b60115473ce720c194b9fd6b196259807d579bbd2f53e39d89063dba4989a9060ff166112dc84612013565b6001602b54600160d01b900460ff1660018111156112f657fe5b146012600101546040518563ffffffff1660e01b815260040161131c9493929190615417565b60006040518083038186803b15801561133457600080fd5b505af4158015611348573d6000803e3d6000fd5b5050601154610100900460ff16159150611382905057611366613a22565b6113825760405162461bcd60e51b815260040161071590615b5b565b601054601a5460405163b78e0bc960e01b815260609273ce720c194b9fd6b196259807d579bbd2f53e39d89263b78e0bc9926113d59230926001600160a01b03909116918c918c918c919060040161559f565b60006040518083038186803b1580156113ed57600080fd5b505af4158015611401573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114299190810190614d67565b90506060601060009054906101000a90046001600160a01b03166001600160a01b031663cc77828d6040518163ffffffff1660e01b815260040160006040518083038186803b15801561147b57600080fd5b505afa15801561148f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114b79190810190614c6f565b9050606081516001600160401b03811180156114d257600080fd5b506040519080825280602002602001820160405280156114fc578160200160208202803683370190505b50601a549091506001602b54600160d01b900460ff16600181111561151d57fe5b141561162357600f60009054906101000a90046001600160a01b03166001600160a01b031663703a9ec96040518163ffffffff1660e01b815260040160206040518083038186803b15801561157157600080fd5b505afa158015611585573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a99190614934565b6001600160a01b031663d7256c70878786886040518563ffffffff1660e01b81526004016115da949392919061517e565b600060405180830381600087803b1580156115f457600080fd5b505af1158015611608573d6000803e3d6000fd5b5050602b54600160b01b900460ff1691506116239050575060005b60005b835181101561178f57600073ce720c194b9fd6b196259807d579bbd2f53e39d863d378778c30601060009054906101000a90046001600160a01b031688868151811061166e57fe5b60200260200101518a878151811061168257fe5b6020026020010151886040518663ffffffff1660e01b81526004016116ab9594939291906154a8565b60206040518083038186803b1580156116c357600080fd5b505af41580156116d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fb9190614ef9565b905084828151811061170957fe5b60200260200101516001600160a01b0316876001600160a01b03167fea39e3b35c5cd8937999ed5f7fbab30acd562a931fc4a887fed2a47c3074aa7288858151811061175157fe5b60200260200101516040516117669190615cd0565b60405180910390a38084838151811061177b57fe5b602090810291909101015250600101611626565b50801561180057602b54604051631483d99d60e01b81526001600160a01b0390911690631483d99d906117cd90869086908190600090600401615379565b600060405180830381600087803b1580156117e757600080fd5b505af11580156117fb573d6000803e3d6000fd5b505050505b61180989611e90565b611813858a61071e565b60006001602b54600160d01b900460ff16600181111561182f57fe5b148015611840575060175460005410155b80156118565750602b54600160b01b900460ff16155b90508015610d8957602b805460ff60b01b1916600160b01b179055601054601a54604051637547433160e11b815273ce720c194b9fd6b196259807d579bbd2f53e39d89263ea8e8662926118bd9230926001600160a01b0316918a916000906004016154dc565b60006040518083038186803b1580156118d557600080fd5b505af4158015610d84573d6000803e3d6000fd5b601281565b6007546001600160a01b031690565b606060098054806020026020016040519081016040528092919081815260200182805480156106ec57602002820191906000526020600020905b815481526020019060010190808311611937575050505050905090565b601290565b6040516322c1aa2560e11b815260009073495e73a680cd943020f18911e50c1fe5991cb77090634583544a90611996906011908690600401615c9d565b60206040518083038186803b1580156119ae57600080fd5b505af41580156119c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e69190614e40565b90505b919050565b8051825114611a0f5760405162461bcd60e51b81526004016107159061581e565b600a5460ff1615611a325760405162461bcd60e51b81526004016107159061566f565b611a3b82613a3d565b8151611a4e906008906020850190614657565b508051611a629060099060208401906146bc565b50600a805460ff19166001179055610728613af3565b602b546001600160a01b031681565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051611ab992919061544e565b60405180910390a2602b544290600160c01b900460ff16158015611ae65750602b54600160b81b900460ff165b8015611b0957506001602b54600160d01b900460ff166001811115611b0757fe5b145b8015611b1757506015548110155b611b335760405162461bcd60e51b815260040161071590615b2b565b60155462015180018111801590611b88573360009081526005602052604090205460ff1680611b6c57506007546001600160a01b031633145b611b885760405162461bcd60e51b8152600401610715906155f9565b611b9061269d565b80516022908155602080830151602355604083015160245560608301518051611bbd926025920190614657565b5060808201518051611bd99160048401916020909101906146bc565b505060225460235460009250611bee91613b49565b601d54601e54919250600091611c0391613b49565b905080821115611d2357601b54600090611c2b908490611c2590858303613be5565b90613b49565b6010546040805163cc77828d60e01b8152905192935073ce720c194b9fd6b196259807d579bbd2f53e39d89263ea8e86629230926001600160a01b0390911691829163cc77828d916004808301926000929190829003018186803b158015611c9257600080fd5b505afa158015611ca6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611cce9190810190614c6f565b8560016040518663ffffffff1660e01b8152600401611cf19594939291906154dc565b60006040518083038186803b158015611d0957600080fd5b505af4158015611d1d573d6000803e3d6000fd5b50505050505b5050602b805460ff60c01b1916600160c01b1790555050565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051611d6e92919061544e565b60405180910390a26002600b541415611d995760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b0316611dc65760405162461bcd60e51b8152600401610715906157cd565b6007546001600160a01b03163314611df05760405162461bcd60e51b81526004016107159061561c565b6000602b54600160d01b900460ff166001811115611e0a57fe5b14611e275760405162461bcd60e51b815260040161071590615be4565b604051611e339061512e565b60405190819003812060165490913391600080516020615e8f83398151915291611e5f91908690615cf0565b60405180910390a36016556001600b55565b333014611e905760405162461bcd60e51b81526004016107159061561c565b61104481613c5b565b602b54600160b01b900460ff1681565b333014611ec85760405162461bcd60e51b81526004016107159061561c565b6107288282613c88565b3360009081526002602090815260408083206001600160a01b0386168452909152812054808310611f26573360009081526002602090815260408083206001600160a01b0388168452909152812055611f55565b611f3081846139e9565b3360009081526002602090815260408083206001600160a01b03891684529091529020555b3360008181526002602090815260408083206001600160a01b038916808552925291829020549151909291600080516020615ef883398151915291611f9a9190615cd0565b60405180910390a35060019392505050565b6001600160a01b031660009081526001602052604090205490565b601254601354601454601554601654601754601854601954601a54601b54601c548b565b602b54600160d01b900460ff1681565b73495e73a680cd943020f18911e50c1fe5991cb77090565b60115460009060ff1615612067576001600160a01b0382166000908152602a602052604090205460ff1680612060575061204b6118ee565b6001600160a01b0316826001600160a01b0316145b90506119e9565b506001600160a01b03811615156119e9565b612081614703565b6040805160a081018252602280548252602354602080840191909152602454838501526025805485518184028101840190965280865293949293606086019392830182828015610fa9576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610f8b5750505050508152602001600482018054806020026020016040519081016040528092919081815260200182805480156110015760200282019190600052602060002090815481526020019060010190808311610fed57505050505081525050905090565b73ce720c194b9fd6b196259807d579bbd2f53e39d86344e3696f8360a001518460e001518560c00151866101000151876060015151886080015151896040015151602b60159054906101000a900460ff166040518963ffffffff1660e01b81526004016121d0989796959493929190615d14565b60006040518083038186803b1580156121e857600080fd5b505af41580156121fc573d6000803e3d6000fd5b5050602b805460ff60a81b1916600160a81b179055505080516011805460208085015115156101000261ff001994151560ff19909316929092179390931617905560408301518051612252926027920190614657565b506060820151805161226c916028916020909101906146bc565b5060808201518051612286916029916020909101906146bc565b506040805161016081018252600080825260208201819052918101829052606081018290526000196080820181905260a080830184905285015160c080840182905286015160e0808501829052870151610100808601829052880151610120808701829052426101409097018790526012889055601388905560148890556015889055601695909555601796909655601892909255601955601a55601b92909255601c55820151602b805460ff60d01b1916600160d01b83600181111561234957fe5b0217905550600f80546001600160a01b0319166001600160a01b038581169190911791829055604080516311b2515f60e31b815290519290911691638d928af891600480820192602092909190829003018186803b1580156123aa57600080fd5b505afa1580156123be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e29190614934565b602b80546001600160a01b0319166001600160a01b0392909216919091179055601954601a54601854601b546040517f3d6667963e842e2b5ff1d4feab2c9b92f17c9003592e2ad229952eeb9a293fd09161243c91615cd0565b60405180910390a4505050565b6007546001600160a01b031633146124735760405162461bcd60e51b81526004016107159061561c565b61247b613c93565b6001600160a01b0381166124a15760405162461bcd60e51b81526004016107159061572a565b6007546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360005b60085481101561256557600754600880546001600160a01b03909216918390811061250557fe5b6000918252602090912001546001600160a01b0316141561255d57816008828154811061252e57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b6001016124de565b50600780546001600160a01b03908116600090815260056020526040808220805460ff1990811690915594909216808252919020805490931660011790925580546001600160a01b0319169091179055565b60008080806001602b54600160d01b900460ff1660018111156125d657fe5b1490504292508080156125ea575060155483115b156125f55760155492505b612604836012600a01546139e9565b915062278d00821061261557600193505b80801561262c5750602b54600160b01b900460ff16155b1561263657600093505b50909192565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106ec5780601f106106c1576101008083540402835291602001916106ec565b6126a5614703565b6126ad614703565b60005481526126ba613c95565b60808301526060820152600f546040805163b18b78dd60e01b815290516001600160a01b039092169163b18b78dd91600480820192602092909190829003018186803b15801561270957600080fd5b505afa15801561271d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127419190614934565b6001600160a01b031663422b66f4826060015183608001516040518363ffffffff1660e01b8152600401612776929190615354565b602060405180830381600087803b15801561279057600080fd5b505af11580156127a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c89190614ef9565b6020820152426040820152905090565b60115460ff8082169161010090041682565b73ce720c194b9fd6b196259807d579bbd2f53e39d890565b606060088054806020026020016040519081016040528092919081815260200182805480156106ec57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161283c575050505050905090565b6040518060400160405280601081526020016f11195cde5b8814db585c9d08141bdbdb60821b81525081565b6007546001600160a01b031633146128b95760405162461bcd60e51b81526004016107159061561c565b601154610100900460ff1680156128da5750602b54600160a01b900460ff16155b6128f65760405162461bcd60e51b815260040161071590615648565b80518251146129175760405162461bcd60e51b8152600401610715906159f6565b60005b8151811015612a2857600f5483516000916001600160a01b031690638f49f44d9086908590811061294757fe5b602002602001015185858151811061295b57fe5b60200260200101516040518363ffffffff1660e01b8152600401612980929190615cd9565b60206040518083038186803b15801561299857600080fd5b505afa1580156129ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d09190614e40565b9050806129ef5760405162461bcd60e51b815260040161071590615754565b612a1f8483815181106129fe57fe5b6020026020010151848481518110612a1257fe5b6020026020010151613e38565b5060010161291a565b5050602b805460ff60a01b1916600160a01b17905550565b60006001600160a01b038316612a685760405162461bcd60e51b81526004016107159061572a565b612a7333848461394a565b50600192915050565b6060336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051612ab092919061544e565b60405180910390a26002600b541415612adb5760405162461bcd60e51b815260040161071590615889565b6002600b556010546001600160a01b0316612b085760405162461bcd60e51b8152600401610715906157cd565b600f546040516338f0d24560e01b81526001600160a01b03909116906338f0d24590612b3a9030903390600401615164565b60206040518083038186803b158015612b5257600080fd5b505afa158015612b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8a9190614e40565b612ba65760405162461bcd60e51b8152600401610715906156c5565b8115612c3f57601054604051635b0e93fb60e11b81526001600160a01b039091169063b61d27f690612be29089908990899089906004016152ee565b600060405180830381600087803b158015612bfc57600080fd5b505af1158015612c10573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c389190810190614e5c565b9050612c8d565b612c8a84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050506001600160a01b03891691905087613f12565b90505b6001600b5595945050505050565b6010546001600160a01b031681565b6007546001600160a01b03163314612cd45760405162461bcd60e51b81526004016107159061561c565b6002600b541415612cf75760405162461bcd60e51b815260040161071590615889565b6002600b556040513390600080356001600160e01b03191691612d1c9190369061544e565b60405180910390a2601154604051630d3aa47160e41b815273ce720c194b9fd6b196259807d579bbd2f53e39d89163d3aa471091612d659160ff169060019086906004016153f6565b60006040518083038186803b158015612d7d57600080fd5b505af4158015612d91573d6000803e3d6000fd5b505050506001600160a01b03166000908152602a60205260409020805460ff19166001908117909155600b55565b600f5460405163db7ca46b60e01b81526001600160a01b039091169063db7ca46b90612def908490600401615150565b60206040518083038186803b158015612e0757600080fd5b505afa158015612e1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e3f9190614e40565b612e5b5760405162461bcd60e51b8152600401610715906158ae565b602b54600160a01b900460ff161561104457612e7681613f40565b6110445760405162461bcd60e51b8152600401610715906158ae565b60065481565b336001600160a01b03166000356001600160e01b0319166001600160e01b031916600036604051612eca92919061544e565b60405180910390a26002600b541415612ef55760405162461bcd60e51b815260040161071590615889565b6002600b553360009081526005602052604090205460ff1680612f2257506007546001600160a01b031633145b612f3e5760405162461bcd60e51b8152600401610715906155f9565b6010546001600160a01b0316612f665760405162461bcd60e51b8152600401610715906157cd565b612f6e61372c565b6001600b55565b3360009081526002602090815260408083206001600160a01b0386168452909152812054612fa39083613f5e565b3360008181526002602090815260408083206001600160a01b03891680855292529182902084905590519092600080516020615ef8833981519152916107739190615cd0565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6007546001600160a01b0316331461303e5760405162461bcd60e51b81526004016107159061561c565b6002600b5414156130615760405162461bcd60e51b815260040161071590615889565b6002600b556040513390600080356001600160e01b031916916130869190369061544e565b60405180910390a26011546001600160a01b0382166000908152602a602052604090819020549051630d3aa47160e41b815273ce720c194b9fd6b196259807d579bbd2f53e39d89263d3aa4710926130ec9260ff928316929091169086906004016153f6565b60006040518083038186803b15801561310457600080fd5b505af4158015613118573d6000803e3d6000fd5b505050506001600160a01b03166000908152602a60205260409020805460ff191690556001600b55565b6007546001600160a01b0316331461316c5760405162461bcd60e51b81526004016107159061561c565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405161319e92919061544e565b60405180910390a26002600b5414156131c95760405162461bcd60e51b815260040161071590615889565b6002600b55600f54604080516358c3de9360e11b815290516001600160a01b039092169163b187bd2691600480820192602092909190829003018186803b15801561321357600080fd5b505afa158015613227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324b9190614e40565b156132685760405162461bcd60e51b81526004016107159061583e565b6001602b54600160d01b900460ff16600181111561328257fe5b141561366157601654604051633e9fc0bd60e01b815273ce720c194b9fd6b196259807d579bbd2f53e39d891633e9fc0bd916132c49187918990600401615cfe565b60006040518083038186803b1580156132dc57600080fd5b505af41580156132f0573d6000803e3d6000fd5b5050601654601754602880549294509092506133319160009061330f57fe5b9060005260206000200154611c25856020015189613be590919063ffffffff16565b6016556028805461335f919060009061334657fe5b6000918252602090912001548451611c25908990613be5565b601260050181905550866001600160a01b03167f8e15e99837ccd5505c7306f1c665c90b4710600100e4720421a8b2c3e86f4ff43060276000815481106133a257fe5b6000918252602082200154602880546001600160a01b039092169290916133c557fe5b90600052602060002001548a6040516133e194939291906152ac565b60405180910390a26040516133f59061512e565b6040518091039020876001600160a01b0316600080516020615e8f8339815191528460126004015460405161342b929190615cf0565b60405180910390a360405161343f9061513f565b6040518091039020876001600160a01b0316600080516020615e8f83398151915283601260050154604051613475929190615cf0565b60405180910390a360004286018186600781111561348f57fe5b14156134a0576276a7009150613562565b60038660078111156134ae57fe5b14156134bf57620151809150613562565b60048660078111156134cd57fe5b14156134de576203f4809150613562565b60058660078111156134ec57fe5b14156134fd5762093a809150613562565b600686600781111561350b57fe5b141561351c57621275009150613562565b600786600781111561352a57fe5b141561353b5762278d009150613562565b600186600781111561354957fe5b141561355a5762ed4e009150613562565b6301da9c0091505b6012879055601381905560148290558082016015819055600f546040805163703a9ec960e01b815290516001600160a01b039092169163703a9ec991600480820192602092909190829003018186803b1580156135be57600080fd5b505afa1580156135d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f69190614934565b6001600160a01b031663d7256c708b8c602760286040518563ffffffff1660e01b815260040161362994939291906151c7565b600060405180830381600087803b15801561364357600080fd5b505af1158015613657573d6000803e3d6000fd5b5050505050505050505b61366a84613f8a565b50506001600b55505050565b6007546001600160a01b031633146136a05760405162461bcd60e51b81526004016107159061561c565b6136a8613c93565b6136b0614248565b6136b982613a3d565b81516136cc906008906020850190614657565b5080516136e09060099060208401906146bc565b50610728613af3565b602b54600160b81b900460ff1681565b73e91c89d7cc74b49579ac3a5ba68974bda8c3f54790565b602b54600160c81b900460ff1681565b61072830838361394a565b60008060006137396125b7565b92509250925082156138dd576010546040805163cc77828d60e01b815290516060926001600160a01b03169163cc77828d916004808301926000929190829003018186803b15801561378a57600080fd5b505afa15801561379e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526137c69190810190614c6f565b601054601854604051631abc9a6960e11b815292935060609273ce720c194b9fd6b196259807d579bbd2f53e39d89263357934d29261381c9230926001600160a01b03169188918a9062278d0090600401615521565b60006040518083038186803b15801561383457600080fd5b505af4158015613848573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526138709190810190614d67565b602b54604051630bac7b8160e01b81529192506001600160a01b031690630bac7b81906138a39085908590600401615354565b600060405180830381600087803b1580156138bd57600080fd5b505af11580156138d1573d6000803e3d6000fd5b505050601c8590555050505b505050565b306000908152600160205260409020546138fc90826139e9565b306000908152600160205260408120919091555461391a90826139e9565b60009081556040513090600080516020615ed88339815191529061393f908590615cd0565b60405180910390a350565b6001600160a01b03831660009081526001602052604090205461396d90826139e9565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461399c9082613f5e565b6001600160a01b038084166000818152600160205260409081902093909355915190851690600080516020615ed8833981519152906139dc908590615cd0565b60405180910390a3505050565b60008060006139f8858561429a565b915091508015613a1a5760405162461bcd60e51b815260040161071590615a8c565b509392505050565b6000600c54600014613a35576001613a38565b60005b905090565b6000805b8251811015613aca57600160056000858481518110613a5c57fe5b6020908102919091018101516001600160a01b03908116835290820192909252604001600020805460ff1916921515929092179091556007548451911690849083908110613aa657fe5b60200260200101516001600160a01b03161415613ac257600191505b600101613a41565b50600a5460ff161561072857806107285760405162461bcd60e51b8152600401610715906158db565b6000805b600954811015613b275760098181548110613b0e57fe5b6000918252602090912001549190910190600101613af7565b5080612710146110445760405162461bcd60e51b815260040161071590615695565b600081613b685760405162461bcd60e51b81526004016107159061593a565b82613b755750600061077f565b670de0b6b3a764000083810290848281613b8b57fe5b0414613ba95760405162461bcd60e51b81526004016107159061585f565b60028304810181811015613bcf5760405162461bcd60e51b81526004016107159061585f565b6000848281613bda57fe5b049695505050505050565b600082613bf45750600061077f565b82820282848281613c0157fe5b0414613c1f5760405162461bcd60e51b815260040161071590615910565b6706f05b59d3b20000810181811015613c4a5760405162461bcd60e51b815260040161071590615910565b6000670de0b6b3a764000082613bda565b613c64816142bf565b60165460005411156110445760405162461bcd60e51b815260040161071590615960565b61072882308361394a565b565b6060806060601060009054906101000a90046001600160a01b03166001600160a01b031663cc77828d6040518163ffffffff1660e01b815260040160006040518083038186803b158015613ce857600080fd5b505afa158015613cfc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613d249190810190614c6f565b9050606081516001600160401b0381118015613d3f57600080fd5b50604051908082528060200260200182016040528015613d69578160200160208202803683370190505b50905060005b8251811015613e2e5760105483516001600160a01b039091169063f8b2cb4f90859084908110613d9b57fe5b60200260200101516040518263ffffffff1660e01b8152600401613dbf9190615150565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190614ef9565b828281518110613e1b57fe5b6020908102919091010152600101613d6f565b5090925090509091565b6001600160a01b038116613e5e5760405162461bcd60e51b815260040161071590615a27565b613e6781613f40565b15613e845760405162461bcd60e51b815260040161071590615a5a565b6000828152600e602090815260408083206001600160a01b038516845282528083208054600160ff199182168117909255600d9093529281902080549092168317909155600c8054909201909155513390839030907f5ab6a0d7af8e86f78c34acea4f8aff1be027227ce1bc29e03f57f39b788f4b0490613f06908690615150565b60405180910390a45050565b6060613f38848484604051806060016040528060298152602001615eaf6029913961431d565b949350505050565b6001600160a01b03166000908152600d602052604090205460ff1690565b600082820183811015613f835760405162461bcd60e51b815260040161071590615ab7565b9392505050565b6010546001600160a01b031615613fb35760405162461bcd60e51b8152600401610715906157f6565b613fbc81611e90565b613fc6338261071e565b600f60009054906101000a90046001600160a01b03166001600160a01b03166391cefde46040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561401657600080fd5b505af115801561402a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061404e9190614934565b601080546001600160a01b0319166001600160a01b03928316179081905560405163d03f2a0f60e01b815273ce720c194b9fd6b196259807d579bbd2f53e39d89263d03f2a0f926140a69291169085906004016152d5565b60006040518083038186803b1580156140be57600080fd5b505af41580156140d2573d6000803e3d6000fd5b5050505060005b60275481101561420c576000602782815481106140f257fe5b6000918252602082200154602880546001600160a01b039092169350908490811061411957fe5b9060005260206000200154905060006029848154811061413557fe5b9060005260206000200154905061414b83612dbf565b6141606001600160a01b038416333085614354565b60105461417b906001600160a01b03858116911660006143b2565b601054614197906001600160a01b0385811691166000196143b2565b601054604051631c9c3ca760e31b81526001600160a01b039091169063e4e1e538906141cb90869086908690600401615320565b600060405180830381600087803b1580156141e557600080fd5b505af11580156141f9573d6000803e3d6000fd5b5050600190950194506140d99350505050565b505b6027541561104457602780548061422157fe5b600082815260209020810160001990810180546001600160a01b031916905501905561420e565b60005b60085481101561104457600560006008838154811061426657fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020805460ff1916905560010161424b565b6000808383116142b057505080820360006142b8565b505081810360015b9250929050565b306000908152600160205260409020546142d99082613f5e565b30600090815260016020526040812091909155546142f79082613f5e565b6000908155604051309190600080516020615ed88339815191529061393f908590615cd0565b60608247101561433f5760405162461bcd60e51b815260040161071590615787565b61434b85858585614475565b95945050505050565b6143ac846323b872dd60e01b85858560405160240161437593929190615288565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614539565b50505050565b80158061443a5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e906143e89030908690600401615164565b60206040518083038186803b15801561440057600080fd5b505afa158015614414573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144389190614ef9565b155b6144565760405162461bcd60e51b815260040161071590615b8e565b6138dd8363095ea7b360e01b84846040516024016143759291906152d5565b60606144808561461e565b61449c5760405162461bcd60e51b8152600401610715906159bf565b60006060866001600160a01b031685876040516144b99190615112565b60006040518083038185875af1925050503d80600081146144f6576040519150601f19603f3d011682016040523d82523d6000602084013e6144fb565b606091505b5091509150811561450f579150613f389050565b80511561451f5780518082602001fd5b8360405162461bcd60e51b81526004016107159190615462565b61454b826001600160a01b031661461e565b6145675760405162461bcd60e51b815260040161071590615c0f565b60006060836001600160a01b0316836040516145839190615112565b6000604051808303816000865af19150503d80600081146145c0576040519150601f19603f3d011682016040523d82523d6000602084013e6145c5565b606091505b5091509150816145e75760405162461bcd60e51b8152600401610715906156f5565b8051156143ac57808060200190518101906146029190614e40565b6143ac5760405162461bcd60e51b815260040161071590615ae1565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590613f38575050151592915050565b8280548282559060005260206000209081019282156146ac579160200282015b828111156146ac57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614677565b506146b8929150614732565b5090565b8280548282559060005260206000209081019282156146f7579160200282015b828111156146f75782518255916020019190600101906146dc565b506146b8929150614751565b6040518060a0016040528060008152602001600081526020016000815260200160608152602001606081525090565b5b808211156146b85780546001600160a01b0319168155600101614733565b5b808211156146b85760008155600101614752565b600082601f830112614776578081fd5b813561478961478482615dce565b615da8565b8181529150602080830190848101818402860182018710156147aa57600080fd5b60005b848110156147d25781356147c081615e5e565b845292820192908201906001016147ad565b505050505092915050565b60008083601f8401126147ee578182fd5b5081356001600160401b03811115614804578182fd5b60208301915083602080830285010111156142b857600080fd5b600082601f83011261482e578081fd5b813561483c61478482615dce565b81815291506020808301908481018184028601820187101561485d57600080fd5b60005b848110156147d257813584529282019290820190600101614860565b803561077f81615e81565b600082601f830112614897578081fd5b81356148a561478482615ded565b91508082528360208285010111156148bc57600080fd5b8060208401602084013760009082016020015292915050565b6000604082840312156148e6578081fd5b6148f06040615da8565b905081356148fd81615e73565b8152602082013561490d81615e73565b602082015292915050565b600060208284031215614929578081fd5b8135613f8381615e5e565b600060208284031215614945578081fd5b8151613f8381615e5e565b60008060408385031215614962578081fd5b823561496d81615e5e565b9150602083013561497d81615e5e565b809150509250929050565b60008060006060848603121561499c578081fd5b83356149a781615e5e565b925060208401356149b781615e5e565b929592945050506040919091013590565b6000806000608084860312156149dc578081fd5b83356149e781615e5e565b925060208401356001600160401b0380821115614a02578283fd5b8186019150610140808389031215614a18578384fd5b614a2181615da8565b9050823582811115614a31578485fd5b614a3d89828601614887565b825250602083013582811115614a51578485fd5b614a5d89828601614887565b602083015250604083013582811115614a74578485fd5b614a8089828601614766565b604083015250606083013582811115614a97578485fd5b614aa38982860161481e565b606083015250608083013582811115614aba578485fd5b614ac68982860161481e565b60808301525060a083013560a082015260c083013560c082015260e083013560e0820152610100915081830135828201526101209150614b088883850161487c565b82820152809450505050614b1f85604086016148d5565b90509250925092565b60008060408385031215614b3a578182fd5b8235614b4581615e5e565b946020939093013593505050565b600080600080600060808688031215614b6a578283fd5b8535614b7581615e5e565b94506020860135935060408601356001600160401b0380821115614b97578485fd5b818801915088601f830112614baa578485fd5b813581811115614bb8578586fd5b896020828501011115614bc9578586fd5b6020830195508094505050506060860135614be381615e73565b809150509295509295909350565b600080600080600085870360c0811215614c09578384fd5b8635614c1481615e5e565b95506020870135945060408701359350606087013560088110614c35578283fd5b92506040607f1982011215614c48578182fd5b50614c536040615da8565b6080870135815260a09096013560208701525092959194509290565b60006020808385031215614c81578182fd5b82516001600160401b03811115614c96578283fd5b8301601f81018513614ca6578283fd5b8051614cb461478482615dce565b8181528381019083850185840285018601891015614cd0578687fd5b8694505b83851015614cfb578051614ce781615e5e565b835260019490940193918501918501614cd4565b50979650505050505050565b60008060408385031215614d19578182fd5b82356001600160401b0380821115614d2f578384fd5b614d3b86838701614766565b93506020850135915080821115614d50578283fd5b50614d5d8582860161481e565b9150509250929050565b60006020808385031215614d79578182fd5b82516001600160401b03811115614d8e578283fd5b8301601f81018513614d9e578283fd5b8051614dac61478482615dce565b8181528381019083850185840285018601891015614dc8578687fd5b8694505b83851015614cfb578051835260019490940193918501918501614dcc565b60008060408385031215614dfc578182fd5b82356001600160401b0380821115614e12578384fd5b614e1e8683870161481e565b93506020850135915080821115614e33578283fd5b50614d5d85828601614766565b600060208284031215614e51578081fd5b8151613f8381615e73565b600060208284031215614e6d578081fd5b81516001600160401b03811115614e82578182fd5b8201601f81018413614e92578182fd5b8051614ea061478482615ded565b818152856020838501011115614eb4578384fd5b61434b826020830160208601615e28565b600060208284031215614ed6578081fd5b8135613f8381615e81565b600060208284031215614ef2578081fd5b5035919050565b600060208284031215614f0a578081fd5b5051919050565b60008060008060608587031215614f26578182fd5b8435935060208501356001600160401b03811115614f42578283fd5b614f4e878288016147dd565b9094509250506040850135614f6281615e5e565b939692955090935050565b600080600080600060808688031215614f84578283fd5b8535945060208601356001600160401b03811115614fa0578384fd5b614fac888289016147dd565b9095509350506040860135614fc081615e5e565b91506060860135614be381615e5e565b600080600060608486031215614fe4578081fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0316815260200190565b815260200190565b6000815180845260208085019450808401835b8381101561504e5781516001600160a01b031687529582019590820190600101615029565b509495945050505050565b81835260006001600160fb1b03831115615071578081fd5b6020830280836020870137939093016020019283525090919050565b6000815180845260208085019450808401835b8381101561504e578151875295820195908201906001016150a0565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b600081518084526150fe816020860160208601615e28565b601f01601f19169290920160200192915050565b60008251615124818460208701615e28565b9190910192915050565b642aa82822a960d91b815260050190565b64232627a7a960d91b815260050190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b038581168252841660208201526080604082018190526000906151aa90830185615016565b82810360608401526151bc818561508d565b979650505050505050565b6001600160a01b03858116825284166020820152608060408201819052835460009183019081906151f88183615cd0565b915061520387615e10565b9250835b81811015615231576152228361521d8654615e1c565b614ffd565b60019485019490935001615207565b50508381036060850152809150845461524a8183615cd0565b925061525586615e10565b9150835b8181101561527a5761526c84845461500e565b935060019283019201615259565b509198975050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b0386168252846020830152606060408301526153166060830184866150bc565b9695505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b600060208252613f836020830184615016565b6000604082526153676040830185615016565b828103602084015261434b818561508d565b60006080825261538c6080830187615016565b828103602084015261539e818761508d565b905082810360408401526153b2818661508d565b915050821515606083015295945050505050565b600060208252613f83602083018461508d565b901515815260200190565b91151582521515602082015260400190565b921515835290151560208301526001600160a01b0316604082015260600190565b9315158452911515602084015215156040830152606082015260800190565b92151583526020830191909152604082015260600190565b600060208252613f386020830184866150bc565b600060208252613f8360208301846150e6565b6001600160a01b03969096168652931515602086015291151560408501526060840152608083015260a082015260c00190565b6001600160a01b03958616815293851660208501529190931660408301526060820192909252608081019190915260a00190565b6001600160a01b0386811682528516602082015260a06040820181905260009061550890830186615016565b6060830194909452509015156080909101529392505050565b6001600160a01b0387811682528616602082015260c06040820181905260009061554d90830187615016565b606083019590955250608081019290925260a0909101529392505050565b6001600160a01b03868116825285166020820152604081018490526080606082018190526000906151bc9083018486615059565b6001600160a01b038781168252861660208201526040810185905260a0606082018190526000906155d39083018587615059565b9050826080830152979650505050505050565b602081016155f383615e54565b91905290565b60208082526009908201526837b7363ca0b236b4b760b91b604082015260600190565b60208082526012908201527122a9292fa727aa2fa1a7a72a2927a62622a960711b604082015260600190565b6020808252600d908201526c4552525f4e4f5f52494748545360981b604082015260600190565b6020808252600c908201526b696e697469616c697a65642160a01b604082015260600190565b6020808252601690820152754552525f494c4c4547414c5f50455243454e5441474560501b604082015260600190565b60208082526016908201527526a7a22aa6229024a9902727aa102922a3a4a9aa22a960511b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b60208082526010908201526f4552525f5a45524f5f4144445245535360801b604082015260600190565b602080825260199082015278544f4b454e5f4d5553545f494e5f57484954455f4c4953545360381b604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252600f908201526e11549497d393d517d0d49150551151608a1b604082015260600190565b6020808252600e908201526d11549497d254d7d0d4915055115160921b604082015260600190565b60208082526006908201526506f776e6572560d41b604082015260600190565b602080825260079082015266085c185d5cd95960ca1b604082015260600190565b60208082526010908201526f11549497d1125597d25395115493905360821b604082015260600190565b6020808252600b908201526a4552525f5245454e54525960a81b604082015260600190565b60208082526013908201527222a9292fa727aa2faba424aa22afaa27a5a2a760691b604082015260600190565b6020808252601b908201527a22a9292fa722abafa0a226a4a729afa420a9afa727afa7aba722a960291b604082015260600190565b60208082526010908201526f4552525f4d554c5f4f564552464c4f5760801b604082015260600190565b6020808252600c908201526b4552525f4449565f5a45524f60a01b604082015260600190565b60208082526015908201527411549497d0d05417d31253525517d4915050d21151605a1b604082015260600190565b60208082526016908201527522a9292fa821aa27a5a2a72fa120a22fa1a0a62622a960511b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526017908201527608aa4a4bea69ea4a8bea89e968a9cbe9a92a69a82a8869604b1b604082015260600190565b6020808252601990820152784552525f494e56414c49445f544f4b454e5f4144445245535360381b604082015260600190565b6020808252601890820152774552525f4841535f4245454e5f41444445445f574849544560401b604082015260600190565b6020808252601190820152704552525f5355425f554e444552464c4f5760781b604082015260600190565b60208082526010908201526f4552525f4144445f4f564552464c4f5760801b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526016908201527511549497d0d3d39112551253d394d7d393d517d3515560521b604082015260600190565b60208082526019908201527822a9292fa9a427aaa6222fa9a2aa2faba424aa22aa27a5a2a760391b604082015260600190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b60208082526011908201527022a9292fa6aaa9aa2fa7a822a72fa2aa2360791b604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b600060208252825160208301526020830151604083015260408301516060830152606083015160a06080840152615c8060c0840182615016565b90506080840151601f198483030160a085015261434b828261508d565b825460ff8082161515835260089190911c161515602082015260608101615cc383615e54565b8260408301529392505050565b90815260200190565b9182526001600160a01b0316602082015260400190565b918252602082015260400190565b9283526020830191909152604082015260600190565b978852602088019690965260408701949094526060860192909252608085015260a084015260c0830152151560e08201526101000190565b9a8b5260208b019990995260408a01979097526060890195909552608088019390935260a087019190915260c086015260e08501526101008401526101208301526101408201526101600190565b60ff91909116815260200190565b6040518181016001600160401b0381118282101715615dc657600080fd5b604052919050565b60006001600160401b03821115615de3578081fd5b5060209081020190565b60006001600160401b03821115615e02578081fd5b50601f01601f191660200190565b60009081526020902090565b6001600160a01b031690565b60005b83811015615e43578181015183820152602001615e2b565b838111156143ac5750506000910152565b6002811061104457fe5b6001600160a01b038116811461104457600080fd5b801515811461104457600080fd5b6002811061104457600080fdfecc86385c52bf4aeaa8583735b29e4a0abc0c5489fae93dbaef02bd838c2d297d416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220417b0e50b96f81c4f0b504b01dfb2ef2afea9c4b01e5273f5bfb44dc16f3ce4b64736f6c634300060c0033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.