ETH Price: $2,680.12 (-2.09%)

Contract

0xCaB49182aAdCd843b037bBF885AD56A3162698Bd
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Approve205543622024-08-18 8:37:238 days ago1723970243IN
0xCaB49182...3162698Bd
0 ETH0.00004391.8025703
Approve186210452023-11-21 15:31:11279 days ago1700580671IN
0xCaB49182...3162698Bd
0 ETH0.0013963857.32993091
Approve184743612023-11-01 2:44:47300 days ago1698806687IN
0xCaB49182...3162698Bd
0 ETH0.0006406813.81823431
Deposit184743512023-11-01 2:42:47300 days ago1698806567IN
0xCaB49182...3162698Bd
0 ETH0.0129591516.84267286
Approve182117732023-09-25 9:01:35336 days ago1695632495IN
0xCaB49182...3162698Bd
0 ETH0.000245510.07949227
Deposit179104442023-08-14 3:36:47379 days ago1691984207IN
0xCaB49182...3162698Bd
0 ETH0.0097234512.90257359
Deposit179104372023-08-14 3:35:23379 days ago1691984123IN
0xCaB49182...3162698Bd
0 ETH0.0103561813.3557555
Transfer179100902023-08-14 2:24:47379 days ago1691979887IN
0xCaB49182...3162698Bd
0 ETH0.0006268813.38356161
Approve179100192023-08-14 2:10:35379 days ago1691979035IN
0xCaB49182...3162698Bd
0 ETH0.0005633912.148262
Deposit179100152023-08-14 2:09:47379 days ago1691978987IN
0xCaB49182...3162698Bd
0 ETH0.0111296714.35686806
Approve179099442023-08-14 1:55:35379 days ago1691978135IN
0xCaB49182...3162698Bd
0 ETH0.0003119812.80871855
Approve179099272023-08-14 1:52:11379 days ago1691977931IN
0xCaB49182...3162698Bd
0 ETH0.0006562614.154411
Deposit179099212023-08-14 1:50:59379 days ago1691977859IN
0xCaB49182...3162698Bd
0 ETH0.0105370813.58891461
Approve179099202023-08-14 1:50:47379 days ago1691977847IN
0xCaB49182...3162698Bd
0 ETH0.0005657412.20194111
Approve179098812023-08-14 1:42:59379 days ago1691977379IN
0xCaB49182...3162698Bd
0 ETH0.0004871420
Withdraw179098752023-08-14 1:41:47379 days ago1691977307IN
0xCaB49182...3162698Bd
0 ETH0.0007943218.76055412
Withdraw179098722023-08-14 1:41:11379 days ago1691977271IN
0xCaB49182...3162698Bd
0 ETH0.0008160619.27407005
Approve179098682023-08-14 1:40:23379 days ago1691977223IN
0xCaB49182...3162698Bd
0 ETH0.0008612618.5757267
Approve179098552023-08-14 1:37:47379 days ago1691977067IN
0xCaB49182...3162698Bd
0 ETH0.0005553111.97399028
Approve179098482023-08-14 1:36:23379 days ago1691976983IN
0xCaB49182...3162698Bd
0 ETH0.0005592112.05798946
Approve179097922023-08-14 1:24:59379 days ago1691976299IN
0xCaB49182...3162698Bd
0 ETH0.0005328811.49037561
Deposit179097832023-08-14 1:23:11379 days ago1691976191IN
0xCaB49182...3162698Bd
0 ETH0.0114902615.18708902
Deposit179097812023-08-14 1:22:47379 days ago1691976167IN
0xCaB49182...3162698Bd
0 ETH0.0114665715.15601785
Approve179097802023-08-14 1:22:35379 days ago1691976155IN
0xCaB49182...3162698Bd
0 ETH0.0006122613.20868714
Deposit179097712023-08-14 1:20:35379 days ago1691976035IN
0xCaB49182...3162698Bd
0 ETH0.0105285713.74105883
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZunamiAPS

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : ZunamiAPS.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './interfaces/IStrategyAPS.sol';

/**
 *
 * @title Zunami Protocol
 *
 * @notice Contract for Convex&Curve protocols optimize.
 * Users can use this contract for optimize yield and gas.
 *
 *
 * @dev Zunami is main contract.
 * Contract does not store user funds.
 * All user funds goes to Convex&Curve pools.
 *
 */

contract ZunamiAPS is ERC20, Pausable, AccessControl {
    using SafeERC20 for IERC20Metadata;

    bytes32 public constant OPERATOR_ROLE = keccak256('OPERATOR_ROLE');

    uint8 public constant POOL_ASSETS = 1;

    struct PendingWithdrawal {
        uint256 lpShares;
        uint256 tokenAmount;
    }

    struct PoolInfo {
        IStrategyAPS strategy;
        uint256 startTime;
        uint256 lpShares;
    }

    uint256 public constant LP_RATIO_MULTIPLIER = 1e18;
    uint256 public constant FEE_DENOMINATOR = 1000;
    uint256 public constant MAX_FEE = 300; // 30%
    uint256 public constant MIN_LOCK_TIME = 1 days;
    uint256 public constant FUNDS_DENOMINATOR = 10_000;

    PoolInfo[] internal _poolInfo;
    uint256 public defaultDepositPid;
    uint256 public defaultWithdrawPid;

    address public token;

    mapping(address => uint256) internal _pendingDeposits;
    mapping(address => PendingWithdrawal) internal _pendingWithdrawals;

    uint256 public totalDeposited = 0;
    uint256 public managementFee = 100; // 10%
    bool public launched = false;

    event ManagementFeeSet(uint256 oldManagementFee, uint256 newManagementFee);

    event CreatedPendingDeposit(address indexed depositor, uint256 amount);
    event CreatedPendingWithdrawal(
        address indexed withdrawer,
        uint256 lpShares,
        uint256 tokenAmount
    );
    event Deposited(address indexed depositor, uint256 amount, uint256 lpShares, uint256 pid);
    event Withdrawn(
        address indexed withdrawer,
        uint256 tokenAmount,
        uint256 lpShares
    );

    event AddedPool(uint256 pid, address strategyAddr, uint256 startTime);
    event FailedDeposit(address indexed depositor, uint256 amounts, uint256 lpShares);
    event FailedWithdrawal(
        address indexed withdrawer,
        uint256 amounts,
        uint256 lpShares
    );
    event SetDefaultDepositPid(uint256 pid);
    event SetDefaultWithdrawPid(uint256 pid);
    event ClaimedAllManagementFee(uint256 feeValue);
    event AutoCompoundAll();

    modifier startedPool() {
        require(_poolInfo.length != 0, 'Zunami: pool not existed!');
        require(
            block.timestamp >= _poolInfo[defaultDepositPid].startTime,
            'Zunami: default deposit pool not started yet!'
        );
        require(
            block.timestamp >= _poolInfo[defaultWithdrawPid].startTime,
            'Zunami: default withdraw pool not started yet!'
        );
        _;
    }

    constructor(address _token) ERC20('ZunamiAPSLP', 'ZAPSLP') {
        token = _token;
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(OPERATOR_ROLE, msg.sender);
    }

    function poolInfo(uint256 pid) external view returns (PoolInfo memory) {
        return _poolInfo[pid];
    }

    function pendingDeposits(address user) external view returns (uint256) {
        return _pendingDeposits[user];
    }

    function pendingWithdrawals(address user) external view returns (PendingWithdrawal memory) {
        return _pendingWithdrawals[user];
    }

    function pause() external onlyRole(DEFAULT_ADMIN_ROLE) {
        _pause();
    }

    function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {
        _unpause();
    }

    /**
     * @dev update managementFee, this is a Zunami commission from protocol profit
     * @param  newManagementFee - minAmount 0, maxAmount FEE_DENOMINATOR - 1
     */
    function setManagementFee(uint256 newManagementFee) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(newManagementFee <= MAX_FEE, 'Zunami: wrong fee');
        emit ManagementFeeSet(managementFee, newManagementFee);
        managementFee = newManagementFee;
    }

    /**
     * @dev Returns managementFee for strategy's when contract sell rewards
     * @return Returns commission on the amount of profit in the transaction
     * @param amount - amount of profit for calculate managementFee
     */
    function calcManagementFee(uint256 amount) external view returns (uint256) {
        return (amount * managementFee) / FEE_DENOMINATOR;
    }

    /**
     * @dev Claims managementFee from all active strategies
     */
    function claimAllManagementFee() external {
        uint256 feeTotalValue;
        for (uint256 i = 0; i < _poolInfo.length; i++) {
            feeTotalValue += _poolInfo[i].strategy.claimManagementFees();
        }

        emit ClaimedAllManagementFee(feeTotalValue);
    }

    function autoCompoundAll() external {
        for (uint256 i = 0; i < _poolInfo.length; i++) {
            PoolInfo memory poolInfo_ = _poolInfo[i];
            if (poolInfo_.lpShares > 0) {
                poolInfo_.strategy.autoCompound();
            }
        }
        emit AutoCompoundAll();
    }

    /**
     * @dev Returns total holdings for all pools (strategy's)
     * @return Returns sum holdings (USD) for all pools
     */
    function totalHoldings() public view returns (uint256) {
        uint256 length = _poolInfo.length;
        uint256 totalHold = 0;
        for (uint256 pid = 0; pid < length; pid++) {
            PoolInfo memory poolInfo_ = _poolInfo[pid];
            if (poolInfo_.lpShares > 0) {
                totalHold += poolInfo_.strategy.totalHoldings();
            }
        }
        return totalHold;
    }

    /**
     * @dev Returns price depends on the income of users
     * @return Returns currently price of ZLP (1e18 = 1$)
     */
    function lpPrice() external view returns (uint256) {
        return (totalHoldings() * 1e18) / totalSupply();
    }

    /**
     * @dev Returns number of pools
     * @return number of pools
     */
    function poolCount() external view returns (uint256) {
        return _poolInfo.length;
    }

    /**
     * @dev in this func user sends funds to the contract and then waits for the completion
     * of the transaction for all users
     * @param amount - deposit amount by user
     */
    function delegateDeposit(uint256 amount) external whenNotPaused {
        if (amount > 0) {
            IERC20Metadata(token).safeTransferFrom(_msgSender(), address(this), amount);
            _pendingDeposits[_msgSender()] += amount;
        }

        emit CreatedPendingDeposit(_msgSender(), amount);
    }

    /**
     * @dev in this func user sends pending withdraw to the contract and then waits
     * for the completion of the transaction for all users
     * @param  lpShares - amount of ZLP for withdraw
     * @param tokenAmount - stablecoin amount that user want minimum receive
     */
    function delegateWithdrawal(uint256 lpShares, uint256 tokenAmount)
        external
        whenNotPaused
    {
        require(lpShares > 0, 'Zunami: lpAmount must be higher 0');

        PendingWithdrawal memory withdrawal;
        address userAddr = _msgSender();

        withdrawal.lpShares = lpShares;
        withdrawal.tokenAmount = tokenAmount;

        _pendingWithdrawals[userAddr] = withdrawal;

        emit CreatedPendingWithdrawal(userAddr, lpShares, tokenAmount);
    }

    /**
     * @dev Zunami protocol owner complete all active pending deposits of users
     * @param userList - dev send array of users from pending to complete
     */
    function completeDeposits(address[] memory userList)
        external
        onlyRole(OPERATOR_ROLE)
        startedPool
    {
        IStrategyAPS strategy = _poolInfo[defaultDepositPid].strategy;
        uint256 currentTotalHoldings = totalHoldings();

        uint256 newHoldings = 0;
        uint256 totalAmount;
        uint256[] memory userCompleteHoldings = new uint256[](userList.length);
        for (uint256 i = 0; i < userList.length; i++) {
            newHoldings = 0;

            uint256 userTokenDeposit = _pendingDeposits[userList[i]];
            totalAmount += userTokenDeposit;
            newHoldings += userTokenDeposit;
            userCompleteHoldings[i] = newHoldings;
        }

        newHoldings = 0;
        if (totalAmount > 0) {
            newHoldings += totalAmount;
            IERC20Metadata(token).safeTransfer(address(strategy), totalAmount);
        }
        uint256 totalDepositedNow = strategy.deposit(totalAmount);
        require(totalDepositedNow > 0, 'Zunami: too low deposit!');
        uint256 lpShares = 0;
        uint256 addedHoldings = 0;
        uint256 userDeposited = 0;

        for (uint256 z = 0; z < userList.length; z++) {
            userDeposited = (totalDepositedNow * userCompleteHoldings[z]) / newHoldings;
            address userAddr = userList[z];
            if (totalSupply() == 0) {
                lpShares = userDeposited;
            } else {
                lpShares = (totalSupply() * userDeposited) / (currentTotalHoldings + addedHoldings);
            }
            addedHoldings += userDeposited;
            _mint(userAddr, lpShares);
            _poolInfo[defaultDepositPid].lpShares += lpShares;
            emit Deposited(userAddr, _pendingDeposits[userAddr], lpShares, defaultDepositPid);

            // remove deposit from list
            delete _pendingDeposits[userAddr];
        }
        totalDeposited += addedHoldings;
    }

    /**
     * @dev Zunami protocol owner complete all active pending withdrawals of users
     * @param userList - array of users from pending withdraw to complete
     */
    function completeWithdrawals(address[] memory userList)
        external
        onlyRole(OPERATOR_ROLE)
        startedPool
    {
        require(userList.length > 0, 'Zunami: there are no pending withdrawals requests');

        IStrategyAPS withdrawStrategy = _poolInfo[defaultWithdrawPid].strategy;

        address user;
        PendingWithdrawal memory withdrawal;
        for (uint256 i = 0; i < userList.length; i++) {
            user = userList[i];
            withdrawal = _pendingWithdrawals[user];
            if (balanceOf(user) < withdrawal.lpShares) {
                emit FailedWithdrawal(user, withdrawal.tokenAmount, withdrawal.lpShares);
                delete _pendingWithdrawals[user];
                continue;
            }

            if (
                !(
                    withdrawStrategy.withdraw(
                        user,
                        calcLpRatioSafe(
                            withdrawal.lpShares,
                            _poolInfo[defaultWithdrawPid].lpShares
                        ),
                        withdrawal.tokenAmount
                    )
                )
            ) {
                emit FailedWithdrawal(user, withdrawal.tokenAmount, withdrawal.lpShares);
                delete _pendingWithdrawals[user];
                continue;
            }

            uint256 userDeposit = (totalDeposited * withdrawal.lpShares) / totalSupply();
            _burn(user, withdrawal.lpShares);
            _poolInfo[defaultWithdrawPid].lpShares -= withdrawal.lpShares;
            totalDeposited -= userDeposit;

            emit Withdrawn(
                user,
                withdrawal.tokenAmount,
                withdrawal.lpShares
            );
            delete _pendingWithdrawals[user];
        }
    }

    function calcLpRatioSafe(uint256 outLpShares, uint256 strategyLpShares)
        internal
        pure
        returns (uint256 lpShareRatio)
    {
        lpShareRatio = (outLpShares * LP_RATIO_MULTIPLIER) / strategyLpShares;
        require(
            lpShareRatio > 0 && lpShareRatio <= LP_RATIO_MULTIPLIER,
            'Zunami: Wrong out lp ratio'
        );
    }

    function completeWithdrawalsOptimized(address[] memory userList)
        external
        onlyRole(OPERATOR_ROLE)
        startedPool
    {
        require(userList.length > 0, 'Zunami: there are no pending withdrawals requests');

        IStrategyAPS strategy = _poolInfo[defaultWithdrawPid].strategy;

        uint256 lpSharesTotal;
        uint256 minAmountTotal;

        uint256 i;
        address user;
        PendingWithdrawal memory withdrawal;
        for (i = 0; i < userList.length; i++) {
            user = userList[i];
            withdrawal = _pendingWithdrawals[user];

            if (balanceOf(user) < withdrawal.lpShares) {
                emit FailedWithdrawal(user, withdrawal.tokenAmount, withdrawal.lpShares);
                delete _pendingWithdrawals[user];
                continue;
            }

            lpSharesTotal += withdrawal.lpShares;
            minAmountTotal += withdrawal.tokenAmount;
        }

        require(
            lpSharesTotal <= _poolInfo[defaultWithdrawPid].lpShares,
            'Zunami: Insufficient pool LP shares'
        );

        uint256 prevBalance = IERC20Metadata(token).balanceOf(address(this));

        if (
            !strategy.withdraw(
                address(this),
                calcLpRatioSafe(lpSharesTotal, _poolInfo[defaultWithdrawPid].lpShares),
                minAmountTotal
            )
        ) {
            for (i = 0; i < userList.length; i++) {
                user = userList[i];
                withdrawal = _pendingWithdrawals[user];

                emit FailedWithdrawal(user, withdrawal.tokenAmount, withdrawal.lpShares);
                delete _pendingWithdrawals[user];
            }
            return;
        }

        uint256 diffBalance = IERC20Metadata(token).balanceOf(address(this)) - prevBalance;

        for (i = 0; i < userList.length; i++) {
            user = userList[i];
            withdrawal = _pendingWithdrawals[user];

            uint256 userDeposit = (totalDeposited * withdrawal.lpShares) / totalSupply();
            _burn(user, withdrawal.lpShares);
            _poolInfo[defaultWithdrawPid].lpShares -= withdrawal.lpShares;
            totalDeposited -= userDeposit;

            uint256 transferAmount = (diffBalance * withdrawal.lpShares) / lpSharesTotal;
            if (transferAmount > 0) {
                IERC20Metadata(token).safeTransfer(user, transferAmount);
            }

            emit Withdrawn(
                user,
                withdrawal.tokenAmount,
                withdrawal.lpShares
            );

            delete _pendingWithdrawals[user];
        }
    }

    /**
     * @dev deposit in one tx, without waiting complete by dev
     * @return Returns amount of lpShares minted for user
     * @param amount - user send amount of stablecoin to deposit
     */
    function deposit(uint256 amount)
        external
        whenNotPaused
        startedPool
        returns (uint256)
    {
        IStrategyAPS strategy = _poolInfo[defaultDepositPid].strategy;
        uint256 holdings = totalHoldings();
        if (amount > 0) {
            IERC20Metadata(token).safeTransferFrom(
                _msgSender(),
                address(strategy),
                amount
            );
        }
        uint256 newDeposited = strategy.deposit(amount);
        require(newDeposited > 0, 'Zunami: too low deposit!');

        uint256 lpShares = 0;
        if (totalSupply() == 0) {
            lpShares = newDeposited;
        } else {
            lpShares = (totalSupply() * newDeposited) / holdings;
        }

        _mint(_msgSender(), lpShares);
        _poolInfo[defaultDepositPid].lpShares += lpShares;
        totalDeposited += newDeposited;

        emit Deposited(_msgSender(), amount, lpShares, defaultDepositPid);
        return lpShares;
    }

    /**
     * @dev withdraw in one tx, without waiting complete by dev
     * @param lpShares - amount of ZLP for withdraw
     * @param tokenAmount - stablecoin amount that user want minimum receive
     */
    function withdraw(
        uint256 lpShares,
        uint256 tokenAmount
    ) external whenNotPaused startedPool {
        IStrategyAPS strategy = _poolInfo[defaultWithdrawPid].strategy;
        address userAddr = _msgSender();

        require(balanceOf(userAddr) >= lpShares, 'Zunami: not enough LP balance');
        require(
            strategy.withdraw(
                userAddr,
                calcLpRatioSafe(lpShares, _poolInfo[defaultWithdrawPid].lpShares),
                tokenAmount
            ),
            'Zunami: incorrect withdraw params'
        );

        uint256 userDeposit = (totalDeposited * lpShares) / totalSupply();
        _burn(userAddr, lpShares);
        _poolInfo[defaultWithdrawPid].lpShares -= lpShares;

        totalDeposited -= userDeposit;

        emit Withdrawn(userAddr, tokenAmount, lpShares);
    }

    function calcWithdrawOneCoin(uint256 lpShares)
        external
        view
        returns (uint256 tokenAmount)
    {
        require(lpShares <= balanceOf(_msgSender()), 'Zunami: not enough LP balance');

        uint256 lpShareRatio = calcLpRatioSafe(lpShares, _poolInfo[defaultWithdrawPid].lpShares);
        return _poolInfo[defaultWithdrawPid].strategy.calcWithdrawOneCoin(lpShareRatio);
    }

    function calcSharesAmount(uint256 tokenAmount, bool isDeposit)
        external
        view
        returns (uint256 lpShares)
    {
        return _poolInfo[defaultWithdrawPid].strategy.calcSharesAmount(tokenAmount, isDeposit);
    }

    /**
     * @dev add a new pool, deposits in the new pool are blocked for one day for safety
     * @param _strategyAddr - the new pool strategy address
     */

    function addPool(address _strategyAddr) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(_strategyAddr != address(0), 'Zunami: zero strategy addr');
        for(uint256 i = 0; i < _poolInfo.length; i++) {
            require(_strategyAddr != address(_poolInfo[i].strategy), 'Zunami: dublicate strategy addr');
        }

        uint256 startTime = block.timestamp + (launched ? MIN_LOCK_TIME : 0);
        _poolInfo.push(
            PoolInfo({ strategy: IStrategyAPS(_strategyAddr), startTime: startTime, lpShares: 0 })
        );
        emit AddedPool(_poolInfo.length - 1, _strategyAddr, startTime);
    }

    /**
     * @dev set a default pool for deposit funds
     * @param _newPoolId - new pool id
     */
    function setDefaultDepositPid(uint256 _newPoolId) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(_newPoolId < _poolInfo.length, 'Zunami: incorrect default deposit pool id');

        defaultDepositPid = _newPoolId;
        emit SetDefaultDepositPid(_newPoolId);
    }

    /**
     * @dev set a default pool for withdraw funds
     * @param _newPoolId - new pool id
     */
    function setDefaultWithdrawPid(uint256 _newPoolId) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(_newPoolId < _poolInfo.length, 'Zunami: incorrect default withdraw pool id');

        defaultWithdrawPid = _newPoolId;
        emit SetDefaultWithdrawPid(_newPoolId);
    }

    function launch() external onlyRole(DEFAULT_ADMIN_ROLE) {
        launched = true;
    }

    /**
     * @dev dev can transfer funds from few strategy's to one strategy for better APY
     * @param _strategies - array of strategy's, from which funds are withdrawn
     * @param withdrawalsPercents - A percentage of the funds that should be transferred
     * @param _receiverStrategyId - number strategy, to which funds are deposited
     */
    function moveFundsBatch(
        uint256[] memory _strategies,
        uint256[] memory withdrawalsPercents,
        uint256 _receiverStrategyId
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(
            _strategies.length == withdrawalsPercents.length,
            'Zunami: incorrect arguments for the moveFundsBatch'
        );
        require(_receiverStrategyId < _poolInfo.length, 'Zunami: incorrect a receiver strategy ID');

        uint256 tokenBalance = IERC20Metadata(token).balanceOf(address(this));

        uint256 pid;
        uint256 zunamiLp;
        for (uint256 i = 0; i < _strategies.length; i++) {
            pid = _strategies[i];
            zunamiLp += _moveFunds(pid, withdrawalsPercents[i]);
        }

        uint256 tokensRemainder = IERC20Metadata(token).balanceOf(address(this)) - tokenBalance;
        if (tokensRemainder > 0) {
            IERC20Metadata(token).safeTransfer(
                address(_poolInfo[_receiverStrategyId].strategy),
                tokensRemainder
            );
        }

        _poolInfo[_receiverStrategyId].lpShares += zunamiLp;

        require(
            _poolInfo[_receiverStrategyId].strategy.deposit(tokensRemainder) > 0,
            'Zunami: Too low amount!'
        );
    }

    function _moveFunds(uint256 pid, uint256 withdrawAmount) private returns (uint256) {
        uint256 currentLpAmount;

        if (withdrawAmount == FUNDS_DENOMINATOR) {
            _poolInfo[pid].strategy.withdrawAll();

            currentLpAmount = _poolInfo[pid].lpShares;
            _poolInfo[pid].lpShares = 0;
        } else {
            currentLpAmount = (_poolInfo[pid].lpShares * withdrawAmount) / FUNDS_DENOMINATOR;

            _poolInfo[pid].strategy.withdraw(
                address(this),
                calcLpRatioSafe(currentLpAmount, _poolInfo[pid].lpShares),
                0
            );
            _poolInfo[pid].lpShares = _poolInfo[pid].lpShares - currentLpAmount;
        }

        return currentLpAmount;
    }

    /**
     * @dev user remove his active pending deposit
     */
    function removePendingDeposit() external {
        uint256 pendingDeposit_ = _pendingDeposits[_msgSender()];
        if (pendingDeposit_ > 0) {
            IERC20Metadata(token).safeTransfer(
                _msgSender(),
                pendingDeposit_
            );
        }
        delete _pendingDeposits[_msgSender()];
    }

    function removePendingWithdrawal() external {
        delete _pendingWithdrawals[_msgSender()];
    }

    /**
     * @dev governance can withdraw all stuck funds in emergency case
     * @param _token - IERC20Metadata token that should be fully withdraw from Zunami
     */
    function withdrawStuckToken(IERC20Metadata _token) external onlyRole(DEFAULT_ADMIN_ROLE) {
        uint256 tokenBalance = _token.balanceOf(address(this));
        if (tokenBalance > 0) {
            _token.safeTransfer(_msgSender(), tokenBalance);
        }
    }

    /**
     * @dev governance can add new operator for complete pending deposits and withdrawals
     * @param _newOperator - address that governance add in list of operators
     */
    function updateOperator(address _newOperator) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _grantRole(OPERATOR_ROLE, _newOperator);
    }
}

File 2 of 14 : IStrategyAPS.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IStrategyAPS {
    function deposit(uint256 amount) external returns (uint256);

    function withdraw(
        address withdrawer,
        uint256 userRatioOfCrvLps, // multiplied by 1e18
        uint256 tokenAmount
    ) external returns (bool);

    function withdrawAll() external;

    function totalHoldings() external view returns (uint256);

    function claimManagementFees() external returns (uint256);

    function autoCompound() external;

    function calcWithdrawOneCoin(uint256 userRatioOfCrvLps)
        external
        view
        returns (uint256 tokenAmount);

    function calcSharesAmount(uint256 tokenAmount, bool isDeposit)
        external
        view
        returns (uint256 sharesAmount);
}

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

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

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

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

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

        _afterTokenTransfer(address(0), account, amount);
    }

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

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

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

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

        _afterTokenTransfer(account, address(0), amount);
    }

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

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

    /**
     * @dev Spend `amount` form the allowance of `owner` toward `spender`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

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

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

File 4 of 14 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    bool private _paused;

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

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

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

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

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

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

File 5 of 14 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 6 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

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

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

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

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

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

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

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

File 7 of 14 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 10 of 14 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 11 of 14 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 12 of 14 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"strategyAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"AddedPool","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":[],"name":"AutoCompoundAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"feeValue","type":"uint256"}],"name":"ClaimedAllManagementFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CreatedPendingDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"lpShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"CreatedPendingWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amounts","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpShares","type":"uint256"}],"name":"FailedDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amounts","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpShares","type":"uint256"}],"name":"FailedWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldManagementFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newManagementFee","type":"uint256"}],"name":"ManagementFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"SetDefaultDepositPid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"SetDefaultWithdrawPid","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpShares","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNDS_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LP_RATIO_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_LOCK_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL_ASSETS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_strategyAddr","type":"address"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoCompoundAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calcManagementFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"bool","name":"isDeposit","type":"bool"}],"name":"calcSharesAmount","outputs":[{"internalType":"uint256","name":"lpShares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lpShares","type":"uint256"}],"name":"calcWithdrawOneCoin","outputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAllManagementFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"userList","type":"address[]"}],"name":"completeDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"userList","type":"address[]"}],"name":"completeWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"userList","type":"address[]"}],"name":"completeWithdrawalsOptimized","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":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultDepositPid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultWithdrawPid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"delegateDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lpShares","type":"uint256"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"delegateWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launched","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managementFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_strategies","type":"uint256[]"},{"internalType":"uint256[]","name":"withdrawalsPercents","type":"uint256[]"},{"internalType":"uint256","name":"_receiverStrategyId","type":"uint256"}],"name":"moveFundsBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"pendingDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"pendingWithdrawals","outputs":[{"components":[{"internalType":"uint256","name":"lpShares","type":"uint256"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"internalType":"struct ZunamiAPS.PendingWithdrawal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"poolInfo","outputs":[{"components":[{"internalType":"contract IStrategyAPS","name":"strategy","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"lpShares","type":"uint256"}],"internalType":"struct ZunamiAPS.PoolInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removePendingDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removePendingWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPoolId","type":"uint256"}],"name":"setDefaultDepositPid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPoolId","type":"uint256"}],"name":"setDefaultWithdrawPid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newManagementFee","type":"uint256"}],"name":"setManagementFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDeposited","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalHoldings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOperator","type":"address"}],"name":"updateOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lpShares","type":"uint256"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"_token","type":"address"}],"name":"withdrawStuckToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000600d556064600e55600f805460ff191690553480156200002557600080fd5b5060405162004a8a38038062004a8a8339810160408190526200004891620001c7565b6040518060400160405280600b81526020016a05a756e616d694150534c560ac1b8152506040518060400160405280600681526020016505a4150534c560d41b81525081600390816200009c91906200029e565b506004620000ab82826200029e565b50506005805460ff1916905550600a80546001600160a01b0319166001600160a01b038316179055620000e060003362000113565b6200010c7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293362000113565b506200036a565b6200011f828262000123565b5050565b60008281526006602090815260408083206001600160a01b038516845290915290205460ff166200011f5760008281526006602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620001833390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600060208284031215620001da57600080fd5b81516001600160a01b0381168114620001f257600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200022457607f821691505b6020821081036200024557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200029957600081815260208120601f850160051c81016020861015620002745750805b601f850160051c820191505b81811015620002955782815560010162000280565b5050505b505050565b81516001600160401b03811115620002ba57620002ba620001f9565b620002d281620002cb84546200020f565b846200024b565b602080601f8311600181146200030a5760008415620002f15750858301515b600019600386901b1c1916600185901b17855562000295565b600085815260208120601f198616915b828110156200033b578886015182559484019460019091019084016200031a565b50858210156200035a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b614710806200037a6000396000f3fe608060405234801561001057600080fd5b50600436106103b95760003560e01c806391d14854116101f4578063d547741f1161011a578063f23723c0116100ad578063f66f807b1161007c578063f66f807b1461084e578063fc0c546a14610856578063fe56e23214610881578063ff50abdc1461089457600080fd5b8063f23723c0146107ae578063f3f43703146107c1578063f525cb6814610831578063f5b541a61461083957600080fd5b8063dd62ed3e116100e9578063dd62ed3e1461073b578063e9ec2e9914610774578063eb3349b91461077c578063ee03dfca146107a557600080fd5b8063d547741f146106f9578063d73792a91461070c578063d79575a714610715578063d914cd4b1461072857600080fd5b8063a6f7f5d611610192578063b6b55f2511610161578063b6b55f25146106af578063ba346f52146106c2578063bc063e1a146106d5578063c4883fc3146106de57600080fd5b8063a6f7f5d614610677578063a9059cbb14610680578063ac7475ed14610693578063ad5e3472146106a657600080fd5b8063a217fddf116101ce578063a217fddf14610641578063a2ab15a414610649578063a457c2d714610651578063a683c6d91461066457600080fd5b806391d148541461061357806395d89b41146106265780639f6d1d611461062e57600080fd5b8063313ce567116102e45780635c975abb11610277578063798b04bc11610246578063798b04bc146105d85780638091f3bf146105eb5780638456cb59146105f85780638a68e3161461060057600080fd5b80635c975abb146105895780635d4d77b81461059457806370a08231146105a757806375451b4f146105d057600080fd5b80633fe356cf116102b35780633fe356cf1461054a5780633ff0320714610559578063441a3e701461056357806345176f161461057657600080fd5b8063313ce5671461050757806336568abe1461051c578063395093511461052f5780633f4ba83a1461054257600080fd5b80631526fe271161035c57806323b872dd1161032b57806323b872dd146104b5578063248a9ca3146104c85780632a47d039146104eb5780632f2ff15d146104f457600080fd5b80631526fe271461044957806318160ddd146104875780631924ef391461048f5780631d69a472146104a257600080fd5b8063068acf6c11610398578063068acf6c146103f857806306fdde031461040b578063095ea7b3146104205780630c2804441461043357600080fd5b8062acb144146103be57806301339c21146103c857806301ffc9a7146103d0575b600080fd5b6103c661089d565b005b6103c661099b565b6103e36103de366004613faa565b6109b7565b60405190151581526020015b60405180910390f35b6103c6610406366004613fe9565b6109ee565b610413610a86565b6040516103ef919061402a565b6103e361042e36600461405d565b610b18565b61043b610b30565b6040519081526020016103ef565b61045c610457366004614089565b610b64565b6040805182516001600160a01b031681526020808401519082015291810151908201526060016103ef565b60025461043b565b6103c661049d3660046140a2565b610bed565b6103c66104b036600461412f565b610ce5565b6103e36104c33660046141c3565b611396565b61043b6104d6366004614089565b60009081526006602052604090206001015490565b61043b60085481565b6103c6610502366004614204565b6113bc565b60125b60405160ff90911681526020016103ef565b6103c661052a366004614204565b6113e2565b6103e361053d36600461405d565b61145c565b6103c661149b565b61043b670de0b6b3a764000081565b61043b6201518081565b6103c66105713660046140a2565b6114b2565b61043b610584366004614242565b6117db565b60055460ff166103e3565b61043b6105a2366004614089565b611875565b61043b6105b5366004613fe9565b6001600160a01b031660009081526020819052604090205490565b61050a600181565b6103c66105e636600461412f565b611892565b600f546103e39060ff1681565b6103c6611d06565b61043b61060e366004614089565b611d1a565b6103e3610621366004614204565b611dfd565b610413611e28565b6103c661063c366004614089565b611e37565b61043b600081565b6103c6611ee4565b6103e361065f36600461405d565b611f24565b6103c661067236600461412f565b611fc1565b61043b600e5481565b6103e361068e36600461405d565b612395565b6103c66106a1366004613fe9565b6123a3565b61043b61271081565b61043b6106bd366004614089565b6123c7565b6103c66106d03660046142cd565b61269e565b61043b61012c81565b6103c6336000908152600c6020526040812081815560010155565b6103c6610707366004614204565b612a38565b61043b6103e881565b6103c6610723366004614089565b612a5e565b6103c6610736366004613fe9565b612afc565b61043b61074936600461433a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61043b612d3e565b61043b61078a366004613fe9565b6001600160a01b03166000908152600b602052604090205490565b61043b60095481565b6103c66107bc366004614089565b612e3a565b6108166107cf366004613fe9565b6040805180820190915260008082526020820152506001600160a01b03166000908152600c6020908152604091829020825180840190935280548352600101549082015290565b604080518251815260209283015192810192909252016103ef565b60075461043b565b61043b6000805160206146bb83398151915281565b6103c6612ede565b600a54610869906001600160a01b031681565b6040516001600160a01b0390911681526020016103ef565b6103c661088f366004614089565b612fe0565b61043b600d5481565b6000805b60075481101561096457600781815481106108be576108be614368565b906000526020600020906003020160000160009054906101000a90046001600160a01b03166001600160a01b0316635c91bba06040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610922573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610946919061437e565b61095090836143ad565b91508061095c816143c0565b9150506108a1565b506040518181527f228916455433a556d3bb467eadcfbc1396db4a7982ef3b8f601248a5a48e07df9060200160405180910390a150565b60006109a78133613074565b50600f805460ff19166001179055565b60006001600160e01b03198216637965db0b60e01b14806109e857506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006109fa8133613074565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a65919061437e565b90508015610a8157610a816001600160a01b03841633836130d8565b505050565b606060038054610a95906143d9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac1906143d9565b8015610b0e5780601f10610ae357610100808354040283529160200191610b0e565b820191906000526020600020905b815481529060010190602001808311610af157829003601f168201915b5050505050905090565b600033610b2681858561313b565b5060019392505050565b6000610b3b60025490565b610b43612d3e565b610b5590670de0b6b3a7640000614413565b610b5f9190614432565b905090565b610b91604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b60078281548110610ba457610ba4614368565b600091825260209182902060408051606081018252600390930290910180546001600160a01b031683526001810154938301939093526002909201549181019190915292915050565b60055460ff1615610c195760405162461bcd60e51b8152600401610c1090614454565b60405180910390fd5b60008211610c735760405162461bcd60e51b815260206004820152602160248201527f5a756e616d693a206c70416d6f756e74206d75737420626520686967686572206044820152600360fc1b6064820152608401610c10565b6040805180820182528381526020808201848152336000818152600c8452859020845181559151600190920191909155835186815291820185905283519293909283927fd3b1adae8a007ee46253e3bd2977bc9461af25093162d7554b30e6ed3010364a92908290030190a250505050565b6000805160206146bb833981519152610cfe8133613074565b600754600003610d205760405162461bcd60e51b8152600401610c109061447e565b600760085481548110610d3557610d35614368565b906000526020600020906003020160010154421015610d665760405162461bcd60e51b8152600401610c10906144b5565b600760095481548110610d7b57610d7b614368565b906000526020600020906003020160010154421015610dac5760405162461bcd60e51b8152600401610c1090614502565b6000825111610dcd5760405162461bcd60e51b8152600401610c1090614550565b6000600760095481548110610de457610de4614368565b6000918252602080832060039290920290910154604080518082019091528381529182018390526001600160a01b031692508190819081905b8751831015610f1557878381518110610e3857610e38614368565b6020908102919091018101516001600160a01b0381166000818152600c84526040808220815180830183528154808252600190920154818801529383529482905290205491945092501015610ee257602081810151825160408051928352928201526001600160a01b0384169160008051602061469b833981519152910160405180910390a26001600160a01b0382166000908152600c6020526040812081815560010155610f03565b8051610eee90866143ad565b9450806020015184610f0091906143ad565b93505b82610f0d816143c0565b935050610e1d565b600760095481548110610f2a57610f2a614368565b906000526020600020906003020160020154851115610f975760405162461bcd60e51b815260206004820152602360248201527f5a756e616d693a20496e73756666696369656e7420706f6f6c204c502073686160448201526272657360e81b6064820152608401610c10565b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610fe0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611004919061437e565b9050866001600160a01b031663b5c5f672306110468960076009548154811061102f5761102f614368565b90600052602060002090600302016002015461325f565b886040518463ffffffff1660e01b8152600401611065939291906145a1565b6020604051808303816000875af1158015611084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a891906145c2565b61117157600093505b8851841015611166578884815181106110cc576110cc614368565b6020908102919091018101516001600160a01b0381166000818152600c84526040908190208151808301835281548082526001909201548187018190528351908152958601919091529296509194509160008051602061469b833981519152910160405180910390a26001600160a01b0383166000908152600c60205260408120818155600101558361115e816143c0565b9450506110b1565b505050505050505050565b600a546040516370a0823160e01b815230600482015260009183916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156111be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e2919061437e565b6111ec91906145df565b9050600094505b89518510156113895789858151811061120e5761120e614368565b6020908102919091018101516001600160a01b0381166000908152600c8352604080822081518083019092528054825260010154938101939093526002549196509194508451600d546112619190614413565b61126b9190614432565b905061127b8585600001516132e4565b836000015160076009548154811061129557611295614368565b906000526020600020906003020160020160008282546112b591906145df565b9250508190555080600d60008282546112ce91906145df565b9091555050835160009089906112e49085614413565b6112ee9190614432565b9050801561130d57600a5461130d906001600160a01b031687836130d8565b602085810151865160408051928352928201526001600160a01b038816917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a250506001600160a01b0384166000908152600c602052604081208181556001015584611381816143c0565b9550506111f3565b50505050505050505b5050565b6000336113a4858285613432565b6113af8585856134c4565b60019150505b9392505050565b6000828152600660205260409020600101546113d88133613074565b610a818383613692565b6001600160a01b03811633146114525760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c10565b6113928282613718565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610b2690829086906114969087906143ad565b61313b565b60006114a78133613074565b6114af61377f565b50565b60055460ff16156114d55760405162461bcd60e51b8152600401610c1090614454565b6007546000036114f75760405162461bcd60e51b8152600401610c109061447e565b60076008548154811061150c5761150c614368565b90600052602060002090600302016001015442101561153d5760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061155257611552614368565b9060005260206000209060030201600101544210156115835760405162461bcd60e51b8152600401610c1090614502565b600060076009548154811061159a5761159a614368565b600091825260208220600390910201546001600160a01b031691506115bc3390565b9050836115de826001600160a01b031660009081526020819052604090205490565b101561162c5760405162461bcd60e51b815260206004820152601d60248201527f5a756e616d693a206e6f7420656e6f756768204c502062616c616e63650000006044820152606401610c10565b816001600160a01b031663b5c5f672826116558760076009548154811061102f5761102f614368565b866040518463ffffffff1660e01b8152600401611674939291906145a1565b6020604051808303816000875af1158015611693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b791906145c2565b61170d5760405162461bcd60e51b815260206004820152602160248201527f5a756e616d693a20696e636f727265637420776974686472617720706172616d6044820152607360f81b6064820152608401610c10565b600061171860025490565b85600d546117269190614413565b6117309190614432565b905061173c82866132e4565b8460076009548154811061175257611752614368565b9060005260206000209060030201600201600082825461177291906145df565b9250508190555080600d600082825461178b91906145df565b909155505060408051858152602081018790526001600160a01b038416917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a25050505050565b60006007600954815481106117f2576117f2614368565b600091825260209091206003909102015460405163228bb78b60e11b81526004810185905283151560248201526001600160a01b03909116906345176f1690604401602060405180830381865afa158015611851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b5919061437e565b60006103e8600e54836118889190614413565b6109e89190614432565b6000805160206146bb8339815191526118ab8133613074565b6007546000036118cd5760405162461bcd60e51b8152600401610c109061447e565b6007600854815481106118e2576118e2614368565b9060005260206000209060030201600101544210156119135760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061192857611928614368565b9060005260206000209060030201600101544210156119595760405162461bcd60e51b8152600401610c1090614502565b600060076008548154811061197057611970614368565b600091825260208220600390910201546001600160a01b03169150611993612d3e565b905060008080865167ffffffffffffffff8111156119b3576119b36140c4565b6040519080825280602002602001820160405280156119dc578160200160208202803683370190505b50905060005b8751811015611a7d57600093506000600b60008a8481518110611a0757611a07614368565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205490508084611a3e91906143ad565b9350611a4a81866143ad565b945084838381518110611a5f57611a5f614368565b60209081029190910101525080611a75816143c0565b9150506119e2565b50600092508115611aac57611a9282846143ad565b600a54909350611aac906001600160a01b031686846130d8565b60405163b6b55f2560e01b8152600481018390526000906001600160a01b0387169063b6b55f25906024016020604051808303816000875af1158015611af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1a919061437e565b905060008111611b675760405162461bcd60e51b81526020600482015260186024820152775a756e616d693a20746f6f206c6f77206465706f7369742160401b6044820152606401610c10565b6000806000805b8b51811015611ce15787868281518110611b8a57611b8a614368565b602002602001015186611b9d9190614413565b611ba79190614432565b915060008c8281518110611bbd57611bbd614368565b60200260200101519050611bd060025490565b600003611bdf57829450611c0a565b611be9848b6143ad565b83611bf360025490565b611bfd9190614413565b611c079190614432565b94505b611c1483856143ad565b9350611c208186613812565b84600760085481548110611c3657611c36614368565b90600052602060002090600302016002016000828254611c5691906143ad565b90915550506001600160a01b0381166000818152600b6020908152604091829020546008548351918252918101899052918201527f91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada39060600160405180910390a26001600160a01b03166000908152600b602052604081205580611cd9816143c0565b915050611b6e565b5081600d6000828254611cf491906143ad565b90915550505050505050505050505050565b6000611d128133613074565b6114af6138f1565b6000611d25336105b5565b821115611d745760405162461bcd60e51b815260206004820152601d60248201527f5a756e616d693a206e6f7420656e6f756768204c502062616c616e63650000006044820152606401610c10565b6000611d8f8360076009548154811061102f5761102f614368565b9050600760095481548110611da657611da6614368565b6000918252602090912060039091020154604051634534718b60e11b8152600481018390526001600160a01b0390911690638a68e31690602401602060405180830381865afa158015611851573d6000803e3d6000fd5b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060048054610a95906143d9565b6000611e438133613074565b6007548210611ea75760405162461bcd60e51b815260206004820152602a60248201527f5a756e616d693a20696e636f72726563742064656661756c7420776974686472604482015269185dc81c1bdbdb081a5960b21b6064820152608401610c10565b60098290556040518281527f0df37b4befe1955e495c9d20d1912039820f0738ac30c49cf4542ecf04c4fef5906020015b60405180910390a15050565b336000908152600b60205260409020548015611f1157611f1133600a546001600160a01b031690836130d8565b50336000908152600b6020526040812055565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015611fa95760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610c10565b611fb6828686840361313b565b506001949350505050565b6000805160206146bb833981519152611fda8133613074565b600754600003611ffc5760405162461bcd60e51b8152600401610c109061447e565b60076008548154811061201157612011614368565b9060005260206000209060030201600101544210156120425760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061205757612057614368565b9060005260206000209060030201600101544210156120885760405162461bcd60e51b8152600401610c1090614502565b60008251116120a95760405162461bcd60e51b8152600401610c1090614550565b60006007600954815481106120c0576120c0614368565b60009182526020808320600390920290910154604080518082019091528381529182018390526001600160a01b0316925060005b855181101561238d5785818151811061210f5761210f614368565b6020908102919091018101516001600160a01b0381166000818152600c845260408082208151808301835281548082526001909201548188015293835294829052902054919550935010156121ba57602082810151835160408051928352928201526001600160a01b0385169160008051602061469b83398151915291015b60405180910390a26001600160a01b0383166000908152600c602052604081208181556001015561237b565b836001600160a01b031663b5c5f672846121e7856000015160076009548154811061102f5761102f614368565b85602001516040518463ffffffff1660e01b815260040161220a939291906145a1565b6020604051808303816000875af1158015612229573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224d91906145c2565b61228557602082810151835160408051928352928201526001600160a01b0385169160008051602061469b833981519152910161218e565b600061229060025490565b8351600d5461229f9190614413565b6122a99190614432565b90506122b98484600001516132e4565b82600001516007600954815481106122d3576122d3614368565b906000526020600020906003020160020160008282546122f391906145df565b9250508190555080600d600082825461230c91906145df565b9091555050602083810151845160408051928352928201526001600160a01b038616917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a2506001600160a01b0383166000908152600c60205260408120818155600101555b80612385816143c0565b9150506120f4565b505050505050565b600033610b268185856134c4565b60006123af8133613074565b6113926000805160206146bb83398151915283613692565b60006123d560055460ff1690565b156123f25760405162461bcd60e51b8152600401610c1090614454565b6007546000036124145760405162461bcd60e51b8152600401610c109061447e565b60076008548154811061242957612429614368565b90600052602060002090600302016001015442101561245a5760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061246f5761246f614368565b9060005260206000209060030201600101544210156124a05760405162461bcd60e51b8152600401610c1090614502565b60006007600854815481106124b7576124b7614368565b600091825260208220600390910201546001600160a01b031691506124da612d3e565b905083156124fa576124fa33600a546001600160a01b0316908487613949565b60405163b6b55f2560e01b8152600481018590526000906001600160a01b0384169063b6b55f25906024016020604051808303816000875af1158015612544573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612568919061437e565b9050600081116125b55760405162461bcd60e51b81526020600482015260186024820152775a756e616d693a20746f6f206c6f77206465706f7369742160401b6044820152606401610c10565b60006125c060025490565b6000036125ce5750806125f0565b82826125d960025490565b6125e39190614413565b6125ed9190614432565b90505b6125fa3382613812565b8060076008548154811061261057612610614368565b9060005260206000209060030201600201600082825461263091906143ad565b9250508190555081600d600082825461264991906143ad565b909155505060085460408051888152602081018490529081019190915233907f91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada39060600160405180910390a295945050505050565b60006126aa8133613074565b82518451146127165760405162461bcd60e51b815260206004820152603260248201527f5a756e616d693a20696e636f727265637420617267756d656e747320666f72206044820152710e8d0ca40dadeecca8ceadcc8e684c2e8c6d60731b6064820152608401610c10565b60075482106127785760405162461bcd60e51b815260206004820152602860248201527f5a756e616d693a20696e636f7272656374206120726563656976657220737472604482015267185d1959de48125160c21b6064820152608401610c10565b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156127c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e5919061437e565b905060008060005b87518110156128535787818151811061280857612808614368565b602002602001015192506128358388838151811061282857612828614368565b6020026020010151613981565b61283f90836143ad565b91508061284b816143c0565b9150506127ed565b50600a546040516370a0823160e01b815230600482015260009185916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156128a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c5919061437e565b6128cf91906145df565b9050801561291457612914600787815481106128ed576128ed614368565b6000918252602090912060039091020154600a546001600160a01b039081169116836130d8565b816007878154811061292857612928614368565b9060005260206000209060030201600201600082825461294891906143ad565b9250508190555060006007878154811061296457612964614368565b600091825260209091206003909102015460405163b6b55f2560e01b8152600481018490526001600160a01b039091169063b6b55f25906024016020604051808303816000875af11580156129bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129e1919061437e565b11612a2e5760405162461bcd60e51b815260206004820152601760248201527f5a756e616d693a20546f6f206c6f7720616d6f756e74210000000000000000006044820152606401610c10565b5050505050505050565b600082815260066020526040902060010154612a548133613074565b610a818383613718565b60055460ff1615612a815760405162461bcd60e51b8152600401610c1090614454565b8015612ac457612a9f33600a546001600160a01b0316903084613949565b336000908152600b602052604081208054839290612abe9084906143ad565b90915550505b60405181815233907fe5fbbd94268e59434a5d90c30d6d5f20f302ebbcc75887f60552c7cd664709739060200160405180910390a250565b6000612b088133613074565b6001600160a01b038216612b5e5760405162461bcd60e51b815260206004820152601a60248201527f5a756e616d693a207a65726f20737472617465677920616464720000000000006044820152606401610c10565b60005b600754811015612bfc5760078181548110612b7e57612b7e614368565b60009182526020909120600390910201546001600160a01b0390811690841603612bea5760405162461bcd60e51b815260206004820152601f60248201527f5a756e616d693a206475626c69636174652073747261746567792061646472006044820152606401610c10565b80612bf4816143c0565b915050612b61565b50600f5460009060ff16612c11576000612c16565b620151805b612c2090426143ad565b604080516060810182526001600160a01b03868116825260208201848152600093830184815260078054600180820183559682905294517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390960295860180546001600160a01b031916919095161790935590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689840155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a90920191909155549192507f1496d53b2abcedd3c10f20ce28c997e2b25a426e63ab8913ad6e962697c0d7be91612d1391906145df565b604080519182526001600160a01b0386166020830152810183905260600160405180910390a1505050565b60075460009081805b82811015612e3357600060078281548110612d6457612d64614368565b600091825260209182902060408051606081018252600390930290910180546001600160a01b03168352600181015493830193909352600290920154918101829052915015612e205780600001516001600160a01b031663e9ec2e996040518163ffffffff1660e01b8152600401602060405180830381865afa158015612def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e13919061437e565b612e1d90846143ad565b92505b5080612e2b816143c0565b915050612d47565b5092915050565b6000612e468133613074565b6007548210612ea95760405162461bcd60e51b815260206004820152602960248201527f5a756e616d693a20696e636f72726563742064656661756c74206465706f73696044820152681d081c1bdbdb081a5960ba1b6064820152608401610c10565b60088290556040518281527fecef23c1a5909f263ee74730200856ecdaaf8f02c2e2cf36ab21c84dca23770f90602001611ed8565b60005b600754811015612fb457600060078281548110612f0057612f00614368565b600091825260209182902060408051606081018252600390930290910180546001600160a01b03168352600181015493830193909352600290920154918101829052915015612fa15780600001516001600160a01b031663821c05766040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612f8857600080fd5b505af1158015612f9c573d6000803e3d6000fd5b505050505b5080612fac816143c0565b915050612ee1565b506040517f29aeb662d3fc5de1cd1fa30d59f63ca51e5c9e0fa6e79df5844b294be9cbaab790600090a1565b6000612fec8133613074565b61012c8211156130325760405162461bcd60e51b81526020600482015260116024820152705a756e616d693a2077726f6e672066656560781b6044820152606401610c10565b600e5460408051918252602082018490527f4e874b007ab14f7e263baefd44951834c8266f4f224d1092e49e9c254354cc54910160405180910390a150600e55565b61307e8282611dfd565b61139257613096816001600160a01b03166014613bbb565b6130a1836020613bbb565b6040516020016130b29291906145f2565b60408051601f198184030181529082905262461bcd60e51b8252610c109160040161402a565b6040516001600160a01b038316602482015260448101829052610a8190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613d57565b6001600160a01b03831661319d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610c10565b6001600160a01b0382166131fe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610c10565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600081613274670de0b6b3a764000085614413565b61327e9190614432565b90506000811180156132985750670de0b6b3a76400008111155b6109e85760405162461bcd60e51b815260206004820152601a60248201527f5a756e616d693a2057726f6e67206f7574206c7020726174696f0000000000006044820152606401610c10565b6001600160a01b0382166133445760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610c10565b6001600160a01b038216600090815260208190526040902054818110156133b85760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610c10565b6001600160a01b03831660009081526020819052604081208383039055600280548492906133e79084906145df565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146134be57818110156134b15760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610c10565b6134be848484840361313b565b50505050565b6001600160a01b0383166135285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610c10565b6001600160a01b03821661358a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c10565b6001600160a01b038316600090815260208190526040902054818110156136025760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610c10565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906136399084906143ad565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161368591815260200190565b60405180910390a36134be565b61369c8282611dfd565b6113925760008281526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790556136d43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6137228282611dfd565b156113925760008281526006602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60055460ff166137c85760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c10565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166138685760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610c10565b806002600082825461387a91906143ad565b90915550506001600160a01b038216600090815260208190526040812080548392906138a79084906143ad565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60055460ff16156139145760405162461bcd60e51b8152600401610c1090614454565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586137f53390565b6040516001600160a01b03808516602483015283166044820152606481018290526134be9085906323b872dd60e01b90608401613104565b6000806127108303613a5b57600784815481106139a0576139a0614368565b600091825260208220600390910201546040805163429c145b60e11b815290516001600160a01b039092169263853828b69260048084019382900301818387803b1580156139ed57600080fd5b505af1158015613a01573d6000803e3d6000fd5b5050505060078481548110613a1857613a18614368565b9060005260206000209060030201600201549050600060078581548110613a4157613a41614368565b9060005260206000209060030201600201819055506113b5565b6127108360078681548110613a7257613a72614368565b906000526020600020906003020160020154613a8e9190614413565b613a989190614432565b905060078481548110613aad57613aad614368565b906000526020600020906003020160000160009054906101000a90046001600160a01b03166001600160a01b031663b5c5f67230613af8846007898154811061102f5761102f614368565b60006040518463ffffffff1660e01b8152600401613b18939291906145a1565b6020604051808303816000875af1158015613b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b5b91906145c2565b508060078581548110613b7057613b70614368565b906000526020600020906003020160020154613b8c91906145df565b60078581548110613b9f57613b9f614368565b9060005260206000209060030201600201819055509392505050565b60606000613bca836002614413565b613bd59060026143ad565b67ffffffffffffffff811115613bed57613bed6140c4565b6040519080825280601f01601f191660200182016040528015613c17576020820181803683370190505b509050600360fc1b81600081518110613c3257613c32614368565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613c6157613c61614368565b60200101906001600160f81b031916908160001a9053506000613c85846002614413565b613c909060016143ad565b90505b6001811115613d08576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613cc457613cc4614368565b1a60f81b828281518110613cda57613cda614368565b60200101906001600160f81b031916908160001a90535060049490941c93613d0181614667565b9050613c93565b5083156113b55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c10565b6000613dac826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613e299092919063ffffffff16565b805190915015610a815780806020019051810190613dca91906145c2565b610a815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c10565b6060613e388484600085613e40565b949350505050565b606082471015613ea15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c10565b6001600160a01b0385163b613ef85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c10565b600080866001600160a01b03168587604051613f14919061467e565b60006040518083038185875af1925050503d8060008114613f51576040519150601f19603f3d011682016040523d82523d6000602084013e613f56565b606091505b5091509150613f66828286613f71565b979650505050505050565b60608315613f805750816113b5565b825115613f905782518084602001fd5b8160405162461bcd60e51b8152600401610c10919061402a565b600060208284031215613fbc57600080fd5b81356001600160e01b0319811681146113b557600080fd5b6001600160a01b03811681146114af57600080fd5b600060208284031215613ffb57600080fd5b81356113b581613fd4565b60005b83811015614021578181015183820152602001614009565b50506000910152565b6020815260008251806020840152614049816040850160208701614006565b601f01601f19169190910160400192915050565b6000806040838503121561407057600080fd5b823561407b81613fd4565b946020939093013593505050565b60006020828403121561409b57600080fd5b5035919050565b600080604083850312156140b557600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614103576141036140c4565b604052919050565b600067ffffffffffffffff821115614125576141256140c4565b5060051b60200190565b6000602080838503121561414257600080fd5b823567ffffffffffffffff81111561415957600080fd5b8301601f8101851361416a57600080fd5b803561417d6141788261410b565b6140da565b81815260059190911b8201830190838101908783111561419c57600080fd5b928401925b82841015613f665783356141b481613fd4565b825292840192908401906141a1565b6000806000606084860312156141d857600080fd5b83356141e381613fd4565b925060208401356141f381613fd4565b929592945050506040919091013590565b6000806040838503121561421757600080fd5b82359150602083013561422981613fd4565b809150509250929050565b80151581146114af57600080fd5b6000806040838503121561425557600080fd5b82359150602083013561422981614234565b600082601f83011261427857600080fd5b813560206142886141788361410b565b82815260059290921b840181019181810190868411156142a757600080fd5b8286015b848110156142c257803583529183019183016142ab565b509695505050505050565b6000806000606084860312156142e257600080fd5b833567ffffffffffffffff808211156142fa57600080fd5b61430687838801614267565b9450602086013591508082111561431c57600080fd5b5061432986828701614267565b925050604084013590509250925092565b6000806040838503121561434d57600080fd5b823561435881613fd4565b9150602083013561422981613fd4565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561439057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e8576109e8614397565b6000600182016143d2576143d2614397565b5060010190565b600181811c908216806143ed57607f821691505b60208210810361440d57634e487b7160e01b600052602260045260246000fd5b50919050565b600081600019048311821515161561442d5761442d614397565b500290565b60008261444f57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526019908201527f5a756e616d693a20706f6f6c206e6f7420657869737465642100000000000000604082015260600190565b6020808252602d908201527f5a756e616d693a2064656661756c74206465706f73697420706f6f6c206e6f7460408201526c2073746172746564207965742160981b606082015260800190565b6020808252602e908201527f5a756e616d693a2064656661756c7420776974686472617720706f6f6c206e6f60408201526d742073746172746564207965742160901b606082015260800190565b60208082526031908201527f5a756e616d693a20746865726520617265206e6f2070656e64696e67207769746040820152706864726177616c7320726571756573747360781b606082015260800190565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602082840312156145d457600080fd5b81516113b581614234565b818103818111156109e8576109e8614397565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161462a816017850160208801614006565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161465b816028840160208801614006565b01602801949350505050565b60008161467657614676614397565b506000190190565b60008251614690818460208701614006565b919091019291505056fe8f9d7eafbb8475a48c3b40235eefc65652e4e623bb42811ef619e8f46b6b884997667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a264697066735822122086561cb7fad959486a20d7fbcf337d31a50183a6f38b495644409d8a9eac668364736f6c63430008100033000000000000000000000000b40b6608b2743e691c9b54ddbdee7bf03cd79f1c

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103b95760003560e01c806391d14854116101f4578063d547741f1161011a578063f23723c0116100ad578063f66f807b1161007c578063f66f807b1461084e578063fc0c546a14610856578063fe56e23214610881578063ff50abdc1461089457600080fd5b8063f23723c0146107ae578063f3f43703146107c1578063f525cb6814610831578063f5b541a61461083957600080fd5b8063dd62ed3e116100e9578063dd62ed3e1461073b578063e9ec2e9914610774578063eb3349b91461077c578063ee03dfca146107a557600080fd5b8063d547741f146106f9578063d73792a91461070c578063d79575a714610715578063d914cd4b1461072857600080fd5b8063a6f7f5d611610192578063b6b55f2511610161578063b6b55f25146106af578063ba346f52146106c2578063bc063e1a146106d5578063c4883fc3146106de57600080fd5b8063a6f7f5d614610677578063a9059cbb14610680578063ac7475ed14610693578063ad5e3472146106a657600080fd5b8063a217fddf116101ce578063a217fddf14610641578063a2ab15a414610649578063a457c2d714610651578063a683c6d91461066457600080fd5b806391d148541461061357806395d89b41146106265780639f6d1d611461062e57600080fd5b8063313ce567116102e45780635c975abb11610277578063798b04bc11610246578063798b04bc146105d85780638091f3bf146105eb5780638456cb59146105f85780638a68e3161461060057600080fd5b80635c975abb146105895780635d4d77b81461059457806370a08231146105a757806375451b4f146105d057600080fd5b80633fe356cf116102b35780633fe356cf1461054a5780633ff0320714610559578063441a3e701461056357806345176f161461057657600080fd5b8063313ce5671461050757806336568abe1461051c578063395093511461052f5780633f4ba83a1461054257600080fd5b80631526fe271161035c57806323b872dd1161032b57806323b872dd146104b5578063248a9ca3146104c85780632a47d039146104eb5780632f2ff15d146104f457600080fd5b80631526fe271461044957806318160ddd146104875780631924ef391461048f5780631d69a472146104a257600080fd5b8063068acf6c11610398578063068acf6c146103f857806306fdde031461040b578063095ea7b3146104205780630c2804441461043357600080fd5b8062acb144146103be57806301339c21146103c857806301ffc9a7146103d0575b600080fd5b6103c661089d565b005b6103c661099b565b6103e36103de366004613faa565b6109b7565b60405190151581526020015b60405180910390f35b6103c6610406366004613fe9565b6109ee565b610413610a86565b6040516103ef919061402a565b6103e361042e36600461405d565b610b18565b61043b610b30565b6040519081526020016103ef565b61045c610457366004614089565b610b64565b6040805182516001600160a01b031681526020808401519082015291810151908201526060016103ef565b60025461043b565b6103c661049d3660046140a2565b610bed565b6103c66104b036600461412f565b610ce5565b6103e36104c33660046141c3565b611396565b61043b6104d6366004614089565b60009081526006602052604090206001015490565b61043b60085481565b6103c6610502366004614204565b6113bc565b60125b60405160ff90911681526020016103ef565b6103c661052a366004614204565b6113e2565b6103e361053d36600461405d565b61145c565b6103c661149b565b61043b670de0b6b3a764000081565b61043b6201518081565b6103c66105713660046140a2565b6114b2565b61043b610584366004614242565b6117db565b60055460ff166103e3565b61043b6105a2366004614089565b611875565b61043b6105b5366004613fe9565b6001600160a01b031660009081526020819052604090205490565b61050a600181565b6103c66105e636600461412f565b611892565b600f546103e39060ff1681565b6103c6611d06565b61043b61060e366004614089565b611d1a565b6103e3610621366004614204565b611dfd565b610413611e28565b6103c661063c366004614089565b611e37565b61043b600081565b6103c6611ee4565b6103e361065f36600461405d565b611f24565b6103c661067236600461412f565b611fc1565b61043b600e5481565b6103e361068e36600461405d565b612395565b6103c66106a1366004613fe9565b6123a3565b61043b61271081565b61043b6106bd366004614089565b6123c7565b6103c66106d03660046142cd565b61269e565b61043b61012c81565b6103c6336000908152600c6020526040812081815560010155565b6103c6610707366004614204565b612a38565b61043b6103e881565b6103c6610723366004614089565b612a5e565b6103c6610736366004613fe9565b612afc565b61043b61074936600461433a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61043b612d3e565b61043b61078a366004613fe9565b6001600160a01b03166000908152600b602052604090205490565b61043b60095481565b6103c66107bc366004614089565b612e3a565b6108166107cf366004613fe9565b6040805180820190915260008082526020820152506001600160a01b03166000908152600c6020908152604091829020825180840190935280548352600101549082015290565b604080518251815260209283015192810192909252016103ef565b60075461043b565b61043b6000805160206146bb83398151915281565b6103c6612ede565b600a54610869906001600160a01b031681565b6040516001600160a01b0390911681526020016103ef565b6103c661088f366004614089565b612fe0565b61043b600d5481565b6000805b60075481101561096457600781815481106108be576108be614368565b906000526020600020906003020160000160009054906101000a90046001600160a01b03166001600160a01b0316635c91bba06040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610922573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610946919061437e565b61095090836143ad565b91508061095c816143c0565b9150506108a1565b506040518181527f228916455433a556d3bb467eadcfbc1396db4a7982ef3b8f601248a5a48e07df9060200160405180910390a150565b60006109a78133613074565b50600f805460ff19166001179055565b60006001600160e01b03198216637965db0b60e01b14806109e857506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006109fa8133613074565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a65919061437e565b90508015610a8157610a816001600160a01b03841633836130d8565b505050565b606060038054610a95906143d9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac1906143d9565b8015610b0e5780601f10610ae357610100808354040283529160200191610b0e565b820191906000526020600020905b815481529060010190602001808311610af157829003601f168201915b5050505050905090565b600033610b2681858561313b565b5060019392505050565b6000610b3b60025490565b610b43612d3e565b610b5590670de0b6b3a7640000614413565b610b5f9190614432565b905090565b610b91604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b60078281548110610ba457610ba4614368565b600091825260209182902060408051606081018252600390930290910180546001600160a01b031683526001810154938301939093526002909201549181019190915292915050565b60055460ff1615610c195760405162461bcd60e51b8152600401610c1090614454565b60405180910390fd5b60008211610c735760405162461bcd60e51b815260206004820152602160248201527f5a756e616d693a206c70416d6f756e74206d75737420626520686967686572206044820152600360fc1b6064820152608401610c10565b6040805180820182528381526020808201848152336000818152600c8452859020845181559151600190920191909155835186815291820185905283519293909283927fd3b1adae8a007ee46253e3bd2977bc9461af25093162d7554b30e6ed3010364a92908290030190a250505050565b6000805160206146bb833981519152610cfe8133613074565b600754600003610d205760405162461bcd60e51b8152600401610c109061447e565b600760085481548110610d3557610d35614368565b906000526020600020906003020160010154421015610d665760405162461bcd60e51b8152600401610c10906144b5565b600760095481548110610d7b57610d7b614368565b906000526020600020906003020160010154421015610dac5760405162461bcd60e51b8152600401610c1090614502565b6000825111610dcd5760405162461bcd60e51b8152600401610c1090614550565b6000600760095481548110610de457610de4614368565b6000918252602080832060039290920290910154604080518082019091528381529182018390526001600160a01b031692508190819081905b8751831015610f1557878381518110610e3857610e38614368565b6020908102919091018101516001600160a01b0381166000818152600c84526040808220815180830183528154808252600190920154818801529383529482905290205491945092501015610ee257602081810151825160408051928352928201526001600160a01b0384169160008051602061469b833981519152910160405180910390a26001600160a01b0382166000908152600c6020526040812081815560010155610f03565b8051610eee90866143ad565b9450806020015184610f0091906143ad565b93505b82610f0d816143c0565b935050610e1d565b600760095481548110610f2a57610f2a614368565b906000526020600020906003020160020154851115610f975760405162461bcd60e51b815260206004820152602360248201527f5a756e616d693a20496e73756666696369656e7420706f6f6c204c502073686160448201526272657360e81b6064820152608401610c10565b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610fe0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611004919061437e565b9050866001600160a01b031663b5c5f672306110468960076009548154811061102f5761102f614368565b90600052602060002090600302016002015461325f565b886040518463ffffffff1660e01b8152600401611065939291906145a1565b6020604051808303816000875af1158015611084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a891906145c2565b61117157600093505b8851841015611166578884815181106110cc576110cc614368565b6020908102919091018101516001600160a01b0381166000818152600c84526040908190208151808301835281548082526001909201548187018190528351908152958601919091529296509194509160008051602061469b833981519152910160405180910390a26001600160a01b0383166000908152600c60205260408120818155600101558361115e816143c0565b9450506110b1565b505050505050505050565b600a546040516370a0823160e01b815230600482015260009183916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156111be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e2919061437e565b6111ec91906145df565b9050600094505b89518510156113895789858151811061120e5761120e614368565b6020908102919091018101516001600160a01b0381166000908152600c8352604080822081518083019092528054825260010154938101939093526002549196509194508451600d546112619190614413565b61126b9190614432565b905061127b8585600001516132e4565b836000015160076009548154811061129557611295614368565b906000526020600020906003020160020160008282546112b591906145df565b9250508190555080600d60008282546112ce91906145df565b9091555050835160009089906112e49085614413565b6112ee9190614432565b9050801561130d57600a5461130d906001600160a01b031687836130d8565b602085810151865160408051928352928201526001600160a01b038816917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a250506001600160a01b0384166000908152600c602052604081208181556001015584611381816143c0565b9550506111f3565b50505050505050505b5050565b6000336113a4858285613432565b6113af8585856134c4565b60019150505b9392505050565b6000828152600660205260409020600101546113d88133613074565b610a818383613692565b6001600160a01b03811633146114525760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c10565b6113928282613718565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610b2690829086906114969087906143ad565b61313b565b60006114a78133613074565b6114af61377f565b50565b60055460ff16156114d55760405162461bcd60e51b8152600401610c1090614454565b6007546000036114f75760405162461bcd60e51b8152600401610c109061447e565b60076008548154811061150c5761150c614368565b90600052602060002090600302016001015442101561153d5760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061155257611552614368565b9060005260206000209060030201600101544210156115835760405162461bcd60e51b8152600401610c1090614502565b600060076009548154811061159a5761159a614368565b600091825260208220600390910201546001600160a01b031691506115bc3390565b9050836115de826001600160a01b031660009081526020819052604090205490565b101561162c5760405162461bcd60e51b815260206004820152601d60248201527f5a756e616d693a206e6f7420656e6f756768204c502062616c616e63650000006044820152606401610c10565b816001600160a01b031663b5c5f672826116558760076009548154811061102f5761102f614368565b866040518463ffffffff1660e01b8152600401611674939291906145a1565b6020604051808303816000875af1158015611693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b791906145c2565b61170d5760405162461bcd60e51b815260206004820152602160248201527f5a756e616d693a20696e636f727265637420776974686472617720706172616d6044820152607360f81b6064820152608401610c10565b600061171860025490565b85600d546117269190614413565b6117309190614432565b905061173c82866132e4565b8460076009548154811061175257611752614368565b9060005260206000209060030201600201600082825461177291906145df565b9250508190555080600d600082825461178b91906145df565b909155505060408051858152602081018790526001600160a01b038416917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a25050505050565b60006007600954815481106117f2576117f2614368565b600091825260209091206003909102015460405163228bb78b60e11b81526004810185905283151560248201526001600160a01b03909116906345176f1690604401602060405180830381865afa158015611851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b5919061437e565b60006103e8600e54836118889190614413565b6109e89190614432565b6000805160206146bb8339815191526118ab8133613074565b6007546000036118cd5760405162461bcd60e51b8152600401610c109061447e565b6007600854815481106118e2576118e2614368565b9060005260206000209060030201600101544210156119135760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061192857611928614368565b9060005260206000209060030201600101544210156119595760405162461bcd60e51b8152600401610c1090614502565b600060076008548154811061197057611970614368565b600091825260208220600390910201546001600160a01b03169150611993612d3e565b905060008080865167ffffffffffffffff8111156119b3576119b36140c4565b6040519080825280602002602001820160405280156119dc578160200160208202803683370190505b50905060005b8751811015611a7d57600093506000600b60008a8481518110611a0757611a07614368565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205490508084611a3e91906143ad565b9350611a4a81866143ad565b945084838381518110611a5f57611a5f614368565b60209081029190910101525080611a75816143c0565b9150506119e2565b50600092508115611aac57611a9282846143ad565b600a54909350611aac906001600160a01b031686846130d8565b60405163b6b55f2560e01b8152600481018390526000906001600160a01b0387169063b6b55f25906024016020604051808303816000875af1158015611af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1a919061437e565b905060008111611b675760405162461bcd60e51b81526020600482015260186024820152775a756e616d693a20746f6f206c6f77206465706f7369742160401b6044820152606401610c10565b6000806000805b8b51811015611ce15787868281518110611b8a57611b8a614368565b602002602001015186611b9d9190614413565b611ba79190614432565b915060008c8281518110611bbd57611bbd614368565b60200260200101519050611bd060025490565b600003611bdf57829450611c0a565b611be9848b6143ad565b83611bf360025490565b611bfd9190614413565b611c079190614432565b94505b611c1483856143ad565b9350611c208186613812565b84600760085481548110611c3657611c36614368565b90600052602060002090600302016002016000828254611c5691906143ad565b90915550506001600160a01b0381166000818152600b6020908152604091829020546008548351918252918101899052918201527f91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada39060600160405180910390a26001600160a01b03166000908152600b602052604081205580611cd9816143c0565b915050611b6e565b5081600d6000828254611cf491906143ad565b90915550505050505050505050505050565b6000611d128133613074565b6114af6138f1565b6000611d25336105b5565b821115611d745760405162461bcd60e51b815260206004820152601d60248201527f5a756e616d693a206e6f7420656e6f756768204c502062616c616e63650000006044820152606401610c10565b6000611d8f8360076009548154811061102f5761102f614368565b9050600760095481548110611da657611da6614368565b6000918252602090912060039091020154604051634534718b60e11b8152600481018390526001600160a01b0390911690638a68e31690602401602060405180830381865afa158015611851573d6000803e3d6000fd5b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060048054610a95906143d9565b6000611e438133613074565b6007548210611ea75760405162461bcd60e51b815260206004820152602a60248201527f5a756e616d693a20696e636f72726563742064656661756c7420776974686472604482015269185dc81c1bdbdb081a5960b21b6064820152608401610c10565b60098290556040518281527f0df37b4befe1955e495c9d20d1912039820f0738ac30c49cf4542ecf04c4fef5906020015b60405180910390a15050565b336000908152600b60205260409020548015611f1157611f1133600a546001600160a01b031690836130d8565b50336000908152600b6020526040812055565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015611fa95760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610c10565b611fb6828686840361313b565b506001949350505050565b6000805160206146bb833981519152611fda8133613074565b600754600003611ffc5760405162461bcd60e51b8152600401610c109061447e565b60076008548154811061201157612011614368565b9060005260206000209060030201600101544210156120425760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061205757612057614368565b9060005260206000209060030201600101544210156120885760405162461bcd60e51b8152600401610c1090614502565b60008251116120a95760405162461bcd60e51b8152600401610c1090614550565b60006007600954815481106120c0576120c0614368565b60009182526020808320600390920290910154604080518082019091528381529182018390526001600160a01b0316925060005b855181101561238d5785818151811061210f5761210f614368565b6020908102919091018101516001600160a01b0381166000818152600c845260408082208151808301835281548082526001909201548188015293835294829052902054919550935010156121ba57602082810151835160408051928352928201526001600160a01b0385169160008051602061469b83398151915291015b60405180910390a26001600160a01b0383166000908152600c602052604081208181556001015561237b565b836001600160a01b031663b5c5f672846121e7856000015160076009548154811061102f5761102f614368565b85602001516040518463ffffffff1660e01b815260040161220a939291906145a1565b6020604051808303816000875af1158015612229573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224d91906145c2565b61228557602082810151835160408051928352928201526001600160a01b0385169160008051602061469b833981519152910161218e565b600061229060025490565b8351600d5461229f9190614413565b6122a99190614432565b90506122b98484600001516132e4565b82600001516007600954815481106122d3576122d3614368565b906000526020600020906003020160020160008282546122f391906145df565b9250508190555080600d600082825461230c91906145df565b9091555050602083810151845160408051928352928201526001600160a01b038616917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a2506001600160a01b0383166000908152600c60205260408120818155600101555b80612385816143c0565b9150506120f4565b505050505050565b600033610b268185856134c4565b60006123af8133613074565b6113926000805160206146bb83398151915283613692565b60006123d560055460ff1690565b156123f25760405162461bcd60e51b8152600401610c1090614454565b6007546000036124145760405162461bcd60e51b8152600401610c109061447e565b60076008548154811061242957612429614368565b90600052602060002090600302016001015442101561245a5760405162461bcd60e51b8152600401610c10906144b5565b60076009548154811061246f5761246f614368565b9060005260206000209060030201600101544210156124a05760405162461bcd60e51b8152600401610c1090614502565b60006007600854815481106124b7576124b7614368565b600091825260208220600390910201546001600160a01b031691506124da612d3e565b905083156124fa576124fa33600a546001600160a01b0316908487613949565b60405163b6b55f2560e01b8152600481018590526000906001600160a01b0384169063b6b55f25906024016020604051808303816000875af1158015612544573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612568919061437e565b9050600081116125b55760405162461bcd60e51b81526020600482015260186024820152775a756e616d693a20746f6f206c6f77206465706f7369742160401b6044820152606401610c10565b60006125c060025490565b6000036125ce5750806125f0565b82826125d960025490565b6125e39190614413565b6125ed9190614432565b90505b6125fa3382613812565b8060076008548154811061261057612610614368565b9060005260206000209060030201600201600082825461263091906143ad565b9250508190555081600d600082825461264991906143ad565b909155505060085460408051888152602081018490529081019190915233907f91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada39060600160405180910390a295945050505050565b60006126aa8133613074565b82518451146127165760405162461bcd60e51b815260206004820152603260248201527f5a756e616d693a20696e636f727265637420617267756d656e747320666f72206044820152710e8d0ca40dadeecca8ceadcc8e684c2e8c6d60731b6064820152608401610c10565b60075482106127785760405162461bcd60e51b815260206004820152602860248201527f5a756e616d693a20696e636f7272656374206120726563656976657220737472604482015267185d1959de48125160c21b6064820152608401610c10565b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156127c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e5919061437e565b905060008060005b87518110156128535787818151811061280857612808614368565b602002602001015192506128358388838151811061282857612828614368565b6020026020010151613981565b61283f90836143ad565b91508061284b816143c0565b9150506127ed565b50600a546040516370a0823160e01b815230600482015260009185916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156128a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c5919061437e565b6128cf91906145df565b9050801561291457612914600787815481106128ed576128ed614368565b6000918252602090912060039091020154600a546001600160a01b039081169116836130d8565b816007878154811061292857612928614368565b9060005260206000209060030201600201600082825461294891906143ad565b9250508190555060006007878154811061296457612964614368565b600091825260209091206003909102015460405163b6b55f2560e01b8152600481018490526001600160a01b039091169063b6b55f25906024016020604051808303816000875af11580156129bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129e1919061437e565b11612a2e5760405162461bcd60e51b815260206004820152601760248201527f5a756e616d693a20546f6f206c6f7720616d6f756e74210000000000000000006044820152606401610c10565b5050505050505050565b600082815260066020526040902060010154612a548133613074565b610a818383613718565b60055460ff1615612a815760405162461bcd60e51b8152600401610c1090614454565b8015612ac457612a9f33600a546001600160a01b0316903084613949565b336000908152600b602052604081208054839290612abe9084906143ad565b90915550505b60405181815233907fe5fbbd94268e59434a5d90c30d6d5f20f302ebbcc75887f60552c7cd664709739060200160405180910390a250565b6000612b088133613074565b6001600160a01b038216612b5e5760405162461bcd60e51b815260206004820152601a60248201527f5a756e616d693a207a65726f20737472617465677920616464720000000000006044820152606401610c10565b60005b600754811015612bfc5760078181548110612b7e57612b7e614368565b60009182526020909120600390910201546001600160a01b0390811690841603612bea5760405162461bcd60e51b815260206004820152601f60248201527f5a756e616d693a206475626c69636174652073747261746567792061646472006044820152606401610c10565b80612bf4816143c0565b915050612b61565b50600f5460009060ff16612c11576000612c16565b620151805b612c2090426143ad565b604080516060810182526001600160a01b03868116825260208201848152600093830184815260078054600180820183559682905294517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390960295860180546001600160a01b031916919095161790935590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689840155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a90920191909155549192507f1496d53b2abcedd3c10f20ce28c997e2b25a426e63ab8913ad6e962697c0d7be91612d1391906145df565b604080519182526001600160a01b0386166020830152810183905260600160405180910390a1505050565b60075460009081805b82811015612e3357600060078281548110612d6457612d64614368565b600091825260209182902060408051606081018252600390930290910180546001600160a01b03168352600181015493830193909352600290920154918101829052915015612e205780600001516001600160a01b031663e9ec2e996040518163ffffffff1660e01b8152600401602060405180830381865afa158015612def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e13919061437e565b612e1d90846143ad565b92505b5080612e2b816143c0565b915050612d47565b5092915050565b6000612e468133613074565b6007548210612ea95760405162461bcd60e51b815260206004820152602960248201527f5a756e616d693a20696e636f72726563742064656661756c74206465706f73696044820152681d081c1bdbdb081a5960ba1b6064820152608401610c10565b60088290556040518281527fecef23c1a5909f263ee74730200856ecdaaf8f02c2e2cf36ab21c84dca23770f90602001611ed8565b60005b600754811015612fb457600060078281548110612f0057612f00614368565b600091825260209182902060408051606081018252600390930290910180546001600160a01b03168352600181015493830193909352600290920154918101829052915015612fa15780600001516001600160a01b031663821c05766040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612f8857600080fd5b505af1158015612f9c573d6000803e3d6000fd5b505050505b5080612fac816143c0565b915050612ee1565b506040517f29aeb662d3fc5de1cd1fa30d59f63ca51e5c9e0fa6e79df5844b294be9cbaab790600090a1565b6000612fec8133613074565b61012c8211156130325760405162461bcd60e51b81526020600482015260116024820152705a756e616d693a2077726f6e672066656560781b6044820152606401610c10565b600e5460408051918252602082018490527f4e874b007ab14f7e263baefd44951834c8266f4f224d1092e49e9c254354cc54910160405180910390a150600e55565b61307e8282611dfd565b61139257613096816001600160a01b03166014613bbb565b6130a1836020613bbb565b6040516020016130b29291906145f2565b60408051601f198184030181529082905262461bcd60e51b8252610c109160040161402a565b6040516001600160a01b038316602482015260448101829052610a8190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613d57565b6001600160a01b03831661319d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610c10565b6001600160a01b0382166131fe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610c10565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600081613274670de0b6b3a764000085614413565b61327e9190614432565b90506000811180156132985750670de0b6b3a76400008111155b6109e85760405162461bcd60e51b815260206004820152601a60248201527f5a756e616d693a2057726f6e67206f7574206c7020726174696f0000000000006044820152606401610c10565b6001600160a01b0382166133445760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610c10565b6001600160a01b038216600090815260208190526040902054818110156133b85760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610c10565b6001600160a01b03831660009081526020819052604081208383039055600280548492906133e79084906145df565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146134be57818110156134b15760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610c10565b6134be848484840361313b565b50505050565b6001600160a01b0383166135285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610c10565b6001600160a01b03821661358a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610c10565b6001600160a01b038316600090815260208190526040902054818110156136025760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610c10565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906136399084906143ad565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161368591815260200190565b60405180910390a36134be565b61369c8282611dfd565b6113925760008281526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790556136d43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6137228282611dfd565b156113925760008281526006602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60055460ff166137c85760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c10565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166138685760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610c10565b806002600082825461387a91906143ad565b90915550506001600160a01b038216600090815260208190526040812080548392906138a79084906143ad565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60055460ff16156139145760405162461bcd60e51b8152600401610c1090614454565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586137f53390565b6040516001600160a01b03808516602483015283166044820152606481018290526134be9085906323b872dd60e01b90608401613104565b6000806127108303613a5b57600784815481106139a0576139a0614368565b600091825260208220600390910201546040805163429c145b60e11b815290516001600160a01b039092169263853828b69260048084019382900301818387803b1580156139ed57600080fd5b505af1158015613a01573d6000803e3d6000fd5b5050505060078481548110613a1857613a18614368565b9060005260206000209060030201600201549050600060078581548110613a4157613a41614368565b9060005260206000209060030201600201819055506113b5565b6127108360078681548110613a7257613a72614368565b906000526020600020906003020160020154613a8e9190614413565b613a989190614432565b905060078481548110613aad57613aad614368565b906000526020600020906003020160000160009054906101000a90046001600160a01b03166001600160a01b031663b5c5f67230613af8846007898154811061102f5761102f614368565b60006040518463ffffffff1660e01b8152600401613b18939291906145a1565b6020604051808303816000875af1158015613b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b5b91906145c2565b508060078581548110613b7057613b70614368565b906000526020600020906003020160020154613b8c91906145df565b60078581548110613b9f57613b9f614368565b9060005260206000209060030201600201819055509392505050565b60606000613bca836002614413565b613bd59060026143ad565b67ffffffffffffffff811115613bed57613bed6140c4565b6040519080825280601f01601f191660200182016040528015613c17576020820181803683370190505b509050600360fc1b81600081518110613c3257613c32614368565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613c6157613c61614368565b60200101906001600160f81b031916908160001a9053506000613c85846002614413565b613c909060016143ad565b90505b6001811115613d08576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613cc457613cc4614368565b1a60f81b828281518110613cda57613cda614368565b60200101906001600160f81b031916908160001a90535060049490941c93613d0181614667565b9050613c93565b5083156113b55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c10565b6000613dac826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613e299092919063ffffffff16565b805190915015610a815780806020019051810190613dca91906145c2565b610a815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c10565b6060613e388484600085613e40565b949350505050565b606082471015613ea15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c10565b6001600160a01b0385163b613ef85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c10565b600080866001600160a01b03168587604051613f14919061467e565b60006040518083038185875af1925050503d8060008114613f51576040519150601f19603f3d011682016040523d82523d6000602084013e613f56565b606091505b5091509150613f66828286613f71565b979650505050505050565b60608315613f805750816113b5565b825115613f905782518084602001fd5b8160405162461bcd60e51b8152600401610c10919061402a565b600060208284031215613fbc57600080fd5b81356001600160e01b0319811681146113b557600080fd5b6001600160a01b03811681146114af57600080fd5b600060208284031215613ffb57600080fd5b81356113b581613fd4565b60005b83811015614021578181015183820152602001614009565b50506000910152565b6020815260008251806020840152614049816040850160208701614006565b601f01601f19169190910160400192915050565b6000806040838503121561407057600080fd5b823561407b81613fd4565b946020939093013593505050565b60006020828403121561409b57600080fd5b5035919050565b600080604083850312156140b557600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614103576141036140c4565b604052919050565b600067ffffffffffffffff821115614125576141256140c4565b5060051b60200190565b6000602080838503121561414257600080fd5b823567ffffffffffffffff81111561415957600080fd5b8301601f8101851361416a57600080fd5b803561417d6141788261410b565b6140da565b81815260059190911b8201830190838101908783111561419c57600080fd5b928401925b82841015613f665783356141b481613fd4565b825292840192908401906141a1565b6000806000606084860312156141d857600080fd5b83356141e381613fd4565b925060208401356141f381613fd4565b929592945050506040919091013590565b6000806040838503121561421757600080fd5b82359150602083013561422981613fd4565b809150509250929050565b80151581146114af57600080fd5b6000806040838503121561425557600080fd5b82359150602083013561422981614234565b600082601f83011261427857600080fd5b813560206142886141788361410b565b82815260059290921b840181019181810190868411156142a757600080fd5b8286015b848110156142c257803583529183019183016142ab565b509695505050505050565b6000806000606084860312156142e257600080fd5b833567ffffffffffffffff808211156142fa57600080fd5b61430687838801614267565b9450602086013591508082111561431c57600080fd5b5061432986828701614267565b925050604084013590509250925092565b6000806040838503121561434d57600080fd5b823561435881613fd4565b9150602083013561422981613fd4565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561439057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156109e8576109e8614397565b6000600182016143d2576143d2614397565b5060010190565b600181811c908216806143ed57607f821691505b60208210810361440d57634e487b7160e01b600052602260045260246000fd5b50919050565b600081600019048311821515161561442d5761442d614397565b500290565b60008261444f57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60208082526019908201527f5a756e616d693a20706f6f6c206e6f7420657869737465642100000000000000604082015260600190565b6020808252602d908201527f5a756e616d693a2064656661756c74206465706f73697420706f6f6c206e6f7460408201526c2073746172746564207965742160981b606082015260800190565b6020808252602e908201527f5a756e616d693a2064656661756c7420776974686472617720706f6f6c206e6f60408201526d742073746172746564207965742160901b606082015260800190565b60208082526031908201527f5a756e616d693a20746865726520617265206e6f2070656e64696e67207769746040820152706864726177616c7320726571756573747360781b606082015260800190565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602082840312156145d457600080fd5b81516113b581614234565b818103818111156109e8576109e8614397565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161462a816017850160208801614006565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161465b816028840160208801614006565b01602801949350505050565b60008161467657614676614397565b506000190190565b60008251614690818460208701614006565b919091019291505056fe8f9d7eafbb8475a48c3b40235eefc65652e4e623bb42811ef619e8f46b6b884997667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a264697066735822122086561cb7fad959486a20d7fbcf337d31a50183a6f38b495644409d8a9eac668364736f6c63430008100033

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

000000000000000000000000b40b6608b2743e691c9b54ddbdee7bf03cd79f1c

-----Decoded View---------------
Arg [0] : _token (address): 0xb40b6608B2743E691C9B54DdBDEe7bf03cd79f1c

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b40b6608b2743e691c9b54ddbdee7bf03cd79f1c


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.