Contract 0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a8

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x8db5a95ca9c6cc0b2b731f5c9a0df2db321785ca073442a62e5cca37fd705a200x69a1c6d9276571142022-08-17 7:53:2618 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.04998479783844.278377642
0x82c7bff4c05cd1777aa7306c3c3a56eccc81cbe3568ddd4d42f678598ba17ad50x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00205752486842.645654009
0xea07f160ed4b59e416a30334b10db2989708bed8a1936196c01b13d47000d9180x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00206010055142.69903935
0x8e479f176af9a0becbb9c20bde8773ae649c34d6e2c108e909fcc007d20ac5c00x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00208784440143.220328354
0x7199202c1874b2e3e8080825221a924d94f21e15039aed111d4586a99318dc690x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00209686057643.460952519
0xe9482c0ef06fdf5ade7b17017662b3c424d5afe09dd2a738e4099c9f2664dfee0x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00215460703544.657844737
0x4b3ce280e2924114bfc5366947b722dc96383e2bcdf80a1e11c957563efedc040x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00217146736745.007303404
0x19c41691f9bb0274a00f052adf16bc1a4e56b774165e1cb913bb031f99e103a40x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00221389289545.886643642
0x6fad85b5e058d6e41043a1b0cbb57aebc02ea643ebfe1cc7e43b2e458f7c61ca0x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00229323784847.531200876
0x757714f774048238fc117ed7952edb00677b6e85f3d38a6d26de908da0f512af0x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00246504584551.041429657
0x149abe6bd7b053e2453e82689a6e57eb9ab5903166c1eff4756d1c2ac871427d0x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00248973818851.604
0xc651c46f85c284c34b24c823fe1ab2b6656f4784089a3db1f9fd378d788617a20x69a1c6d9276568332022-08-17 7:22:2249 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.01387544642212.291382244
0x9e1132acd4244bf6424ce5960ecb9df8cf1e72d7bcc0657239b0727b4105efe40x69a1c6d9276564802022-08-17 6:42:111 hr 30 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.0078537188956.922772183
0x36d7fe244235d684e74a4f9c4821ee69aa5d4fba3edba0ff5afd7c9bc40ac1410x69a1c6d9276562382022-08-17 6:11:172 hrs 1 min ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.05934741998649.382603243
0x74866614a2348f56d515ff308fe9e7af643770a69e57e8ce20911f0e0392df0a0x69a1c6d9276559652022-08-17 5:40:182 hrs 31 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.04944188190943.689078773
0xa397fd1b5518cc98334d0ef5c267e1846218501aa6c20c5444cbe7e1b84b2efe0x69a1c6d9276556842022-08-17 5:09:243 hrs 2 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.05036285405644.174997155
0x2a6b52311a1a01a868c8bc4ae9712598c868c6b0374b890a8bb42e6f802859ac0x69a1c6d9276554032022-08-17 4:38:293 hrs 33 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.0593070589349.118668281
0xce2c0ab1e7016b8211631deda865ca4886aa1e14ed5fa7310dfb7c5a2f45cd840x69a1c6d9276551372022-08-17 4:07:154 hrs 5 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.06828832407359.895523709
0xc7b72ec923499a5a3af240014e5542fd05690ec2ce235cc645ee6df5429477bb0x69a1c6d9276548712022-08-17 3:36:214 hrs 35 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.05714960484850.249715864
0xb6958302c71fe62a6ebbd753db5a4cf43936a8642d97aa4bfcbb8e95c6a1b1450x69a1c6d9276545922022-08-17 3:05:425 hrs 6 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.00265314247454.990827913
0xeb760fefe9ccdda6376221d3df7f6f935406b180945e8b12d815a3c0f41f329f0x69a1c6d9276545922022-08-17 3:05:425 hrs 6 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.02444140094621.597525216
0x22dce09f2ae142aaf053ef9a1e02832dcb1afd91c5f00708bc38c12fe98e770c0x69a1c6d9276541042022-08-17 2:14:145 hrs 58 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.02976539875224.652720379
0x108286834f1087f30d02ab0446b37a2d8111e8cc9d26f9d42f0e83028e659e020x69a1c6d9276538112022-08-17 1:43:246 hrs 28 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.04996283089344.040447655
0x0b64271a3287ba7932f36a665577b2330da842c8f00f9540a54087ebabe483580x69a1c6d9276535542022-08-17 1:12:157 hrs ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.06439425987453.333526484
0x8281360e9624b6c4ae2250aced7264d32a91cc583d0af500515fb1967902aafc0x69a1c6d9276532472022-08-17 0:41:157 hrs 31 mins ago0x1c29ae2d2d6c8b61802da3b4622c1502699362d3 IN  0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a80 MATIC0.02663873566622.063111168
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xf0bb0f78e9de284632b3c1e806651f0cbd4db8afb8e99e6c72111db35abc64da274387732022-08-02 6:07:0215 days 2 hrs ago 0xd25f0778a6f167fd7fb779c2a350b59cbfcbb3a8  Contract Creation0 MATIC
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
IndexAdmin

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 23 : IndexAdmin.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "../index/Index.sol";
import "../index/IIndexAdmin.sol";

contract IndexAdmin is Index, IIndexAdmin {
    event NewIndexComposition(address[] asset);
    event SetMaxShare(uint256 maxShare);

    function initialize(
        address adminDAO,
        address admin,
        address USD,
        address adapter,
        uint256 startPrice,
        uint256 rebalancePeriod,
        address[] memory newAssets,
        address tresuare,
        address partnerProgram,
        string memory nameIndex
    ) external {
        _initialize(
            adminDAO,
            admin,
            USD,
            adapter,
            startPrice,
            rebalancePeriod,
            newAssets,
            tresuare,
            partnerProgram,
            nameIndex
        );
    }

    function setMaxShare(uint256 maxShare) external onlyRole(DAO_ADMIN_ROLE) {
        require(
            maxShare > 20 * PRECISION_E6 && maxShare < 100 * PRECISION_E6,
            "Invalid Share"
        );
        _setMaxShare(maxShare);
        emit SetMaxShare(maxShare);
    }

    function setRebalancePeriod(uint256 period)
        external
        onlyRole(DAO_ADMIN_ROLE)
    {
        _setRebalancePeriod(period);
    }

    function newIndexComposition(address[] calldata assets)
        external
        onlyRole(DAO_ADMIN_ROLE)
    {
        _clearNewAssets();
        _updateNewAssets(assets);
        emit NewIndexComposition(assets);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            interfaceId == type(IIndexAdmin).interfaceId ||
            super.supportsInterface(interfaceId);
    }
}

File 2 of 23 : Index.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "contracts/interfaces/IUniswapV2Router02.sol";
import "contracts/interfaces/IWETH.sol";
import "../partnerProgram/IPartnerProgram.sol";
import "./IIndex.sol";
import "contracts/IndexLP.sol";
import "contracts/extension/ExtensionPause.sol";

abstract contract Index is
    AccessControl,
    IIndex,
    ReentrancyGuard,
    ExtensionPause
{
    using EnumerableSet for EnumerableSet.AddressSet;
    using SafeERC20 for IERC20;

    EnumerableSet.AddressSet private _newAssets;

    bytes32 public constant DAO_ADMIN_ROLE = keccak256("DAO_ADMIN_ROLE");
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    uint256 constant PRECISION = 1e18;
    uint256 constant PRECISION_E6 = 1e6;

    string private _nameIndex;

    uint256 private _feeStake;
    uint256 private _feeUnstake;
    uint256 private _amountTax;
    uint256 private _maxShare;
    uint256 private _rebalancePeriod;
    uint256 private _lastRebalance;
    uint256 private _startPriceIndex;

    address private _indexLP;
    address private _actualAcceptToken;
    address private _adapter;
    address private _tresuare;
    address public _wETH;
    address private _newAcceptToken;

    bool private _initializer;
    bool _init;

    IPartnerProgram private _ipartnerProgram;

    Asset[] private _activeAssets;

    constructor() {}

    modifier isZeroAmount(uint256 amount) {
        if (amount <= 0) {
            revert ZeroAmount();
        }
        _;
    }

    modifier isInitializer() {
        if (_initializer == true) {
            revert Initializer();
        }
        _;
        _initializer = true;
    }

    /**
     * @dev See {IIndex-setPause}.
     */
    function setPause() external onlyRole(DAO_ADMIN_ROLE) {
        _changeStatusPause();
    }

    /**
     * @dev See {IIndex-setNameIndex}.
     */
    function setNameIndex(string memory name)
        external
        onlyRole(DAO_ADMIN_ROLE)
    {
        _nameIndex = name;
        emit SetName(name);
    }

    /**
     * @dev See {IIndex-setFeeStake}.
     */
    function setFeeStake(uint256 fee) external onlyRole(DAO_ADMIN_ROLE) {
        require(fee < PRECISION_E6 * 100, "Invalid fee");
        _feeStake = fee;

        emit SetFeeStake(fee);
    }

    /**
     * @dev See {IIndex-setFeeUnStake}.
     */
    function setFeeUnStake(uint256 fee) external onlyRole(DAO_ADMIN_ROLE) {
        require(fee < PRECISION_E6 * 100, "Invalid fee");
        _feeUnstake = fee;

        emit SetFeeUnStake(fee);
    }

    /**
     * @dev See {IIndex-setActualToken}.
     */
    function setActualToken(address newToken)
        external
        onlyRole(DAO_ADMIN_ROLE)
    {
        require(newToken != address(0), "Invalid Token");
        _newAcceptToken = newToken;
        emit SetActualToken(newToken);
    }

    /**
     * @dev See {IIndex-init}.
     */
    function init(AssetData[] memory newAssets) external onlyRole(ADMIN_ROLE) {
        require(!_init, "already initialized");
        _rebalance(newAssets, _startPriceIndex);

        uint256 firstPriceIndex = _calcCost(1e18);

        _init = true;
        emit Init(_activeAssets, firstPriceIndex);
    }

    /**
     * @dev See {IIndex-rebalance}.
     */
    function rebalance(AssetData[] memory newAssets, address[] memory path)
        external
        onlyRole(ADMIN_ROLE)
    {
        require(
            block.timestamp > _lastRebalance + _rebalancePeriod,
            "It is not possible to rebalance"
        );
        uint256 oldPrice = _calcCost(1e18);
        uint256 usdAmount = _exchangeToUSD(); // меняет все на доллары
        if (_actualAcceptToken != _newAcceptToken) {
            usdAmount = _changeActualToken(usdAmount, path);
        }
        if (usdAmount == 0) {
            usdAmount = oldPrice;
        }
        _rebalance(newAssets, usdAmount); // обновляет структуры Asset
        uint256 newPrice = _calcCost(1e18);

        emit Rebalance(_activeAssets, oldPrice, newPrice);
    }

    /**
     * @dev See {IIndex-stake}.
     */
    function stake(
        uint256 amountLP,
        uint256 amountUSD,
        uint256 slippage
    ) external isZeroAmount(amountLP) isPause {
        uint256 cost = _calcCost(amountLP);

        _isValidStake(cost, amountUSD, slippage);

        IERC20(_actualAcceptToken).safeTransferFrom(
            msg.sender,
            address(this),
            cost
        );

        _stake(amountLP, cost);
    }

    /**
     * @dev See {IIndex-stakeETH}.
     */
    function stakeETH(uint256 amountLP)
        external
        payable
        isZeroAmount(amountLP)
        isPause
        nonReentrant
    {
        uint256 cost = _calcCost(amountLP);

        require(cost >= msg.value, "Insufficient provision");
        require(
            _actualAcceptToken == _wETH,
            "The current accepted token is not ETH"
        );
        IWETH(_wETH).deposit{value: msg.value}();

        _stake(amountLP, cost);
    }

    /**
     * @dev See {IIndex-unstake}.
     */
    function unstake(uint256 amountLP) external isZeroAmount(amountLP) {
        (uint256 amountLPWithoutTax, uint256 tax) = _taxation(
            amountLP,
            _feeUnstake
        );
        _amountTax += tax;
        _unstake(amountLPWithoutTax);

        IndexLP(_indexLP).burn(msg.sender, amountLP);
        IndexLP(_indexLP).mint(_tresuare, tax);

        emit Unstake(msg.sender, amountLPWithoutTax);
    }

    /**
     * @dev See {IIndex-getStatusPause}.
     */
    function getStatusPause() external view returns (bool status) {
        return _statusPause();
    }

    /**
     * @dev See {IIndex-getNameIndex}.
     */
    function getNameIndex() external view returns (string memory nameIndex) {
        return _nameIndex;
    }

    /**
     * @dev See {IIndex-getLastRebalance}.
     */
    function getLastRebalance() external view returns (uint256) {
        return _lastRebalance;
    }

    /**
     * @dev See {IIndex-getNewAssets}.
     */
    function getNewAssets() external view returns (address[] memory newAssets) {
        uint256 len = _newAssets.length();
        newAssets = new address[](len);
        for (uint256 i; i < len; i++) {
            newAssets[i] = _newAssets.at(i);
        }
    }

    /**
     * @dev See {IIndex-getDataIndex}.
     */
    function getDataIndex()
        external
        view
        returns (
            address indexLP,
            uint256 maxShare,
            uint256 rebalancePeriod,
            uint256 startPriceIndex
        )
    {
        return (_indexLP, _maxShare, _rebalancePeriod, _startPriceIndex);
    }

    /**
     * @dev See {IIndex-getActiveAssets}.
     */
    function getActiveAssets() external view returns (Asset[] memory assets) {
        return _activeAssets;
    }

    /**
     * @dev See {IIndex-getCostLP}.
     */
    function getCostLP(uint256 amountLP)
        external
        view
        returns (uint256 amountUSD)
    {
        return _calcCost(amountLP);
    }

    /**
     * @dev See {IIndex-getFees}.
     */
    function getFees()
        external
        view
        returns (uint256 feeStake, uint256 feeUnstake)
    {
        return (_feeStake, _feeUnstake);
    }

    /**
     * @dev See {IIndex-getAcceptToken}.
     */
    function getAcceptToken()
        external
        view
        returns (address actualAddress, address newAddress)
    {
        return (_actualAcceptToken, _newAcceptToken);
    }

    /**
     * @dev See {IIndex-lengthNewAssets}.
     */
    function lengthNewAssets() public view returns (uint256 len) {
        return _newAssets.length();
    }

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

    function _setRebalancePeriod(uint256 period) internal {
        _rebalancePeriod = period;

        emit SetRebalancePeriod(period);
    }

    function _buyNewAssets(Asset[] memory newAssets, uint256 usdAmount)
        internal
    {
        uint256 len = newAssets.length;
        for (uint256 i; i < len; i++) {
            uint256 amountForSwap = _calcShare(newAssets[i].share, usdAmount);

            uint256 amount = _swapDEX(amountForSwap, newAssets[i].path);
            // fixedAmount = amount/ totalLP;
            _activeAssets[i].totalAmount += amount;
        }
    }

    function _initialize(
        address adminDAO,
        address admin,
        address acceptToken,
        address adapter,
        uint256 startPrice,
        uint256 rebalancePeriod,
        address[] memory newAssets,
        address tresuare,
        address partnerProgram,
        string memory nameIndex
    ) internal isInitializer {
        _setupRole(DEFAULT_ADMIN_ROLE, admin);
        _setupRole(DAO_ADMIN_ROLE, adminDAO);
        _setupRole(ADMIN_ROLE, admin);

        _actualAcceptToken = acceptToken;
        _newAcceptToken = acceptToken;

        _adapter = adapter;
        _wETH = IUniswapV2Router01(adapter).WETH();
        _startPriceIndex = startPrice;
        _maxShare = 20 * PRECISION_E6;
        _rebalancePeriod = rebalancePeriod;
        _indexLP = _deployIndexLP(partnerProgram);
        _tresuare = tresuare;
        _ipartnerProgram = IPartnerProgram(partnerProgram);
        _nameIndex = nameIndex;
        _approveDEX(acceptToken);
        _updateNewAssets(newAssets);
        emit Initialize(adminDAO, admin, acceptToken, _indexLP);
    }

    function _stake(uint256 amountLP, uint256 cost) internal {
        (uint256 amountLPWithoutTax, uint256 tax) = _taxation(
            amountLP,
            _feeStake
        );
        _amountTax += tax;

        _calcStake(amountLPWithoutTax);
        _ipartnerProgram.distributeTheReward(msg.sender, amountLP, _indexLP);
        IndexLP(_indexLP).mint(msg.sender, amountLPWithoutTax);
        IndexLP(_indexLP).mint(_tresuare, tax);

        emit Stake(msg.sender, cost, amountLPWithoutTax);
    }

    function _swapDEX(uint256 amountForSwap, address[] memory path)
        internal
        returns (uint256 amount)
    {
        uint256[] memory amounts = IUniswapV2Router02(_adapter)
            .swapExactTokensForTokens(
                amountForSwap,
                0,
                path,
                address(this),
                block.timestamp + 300
            );
        return amounts[path.length - 1];
    }

    function _exchangeToUSD() internal returns (uint256 sum) {
        uint256 len = _activeAssets.length;

        for (uint256 i; i < len; i++) {
            if (_activeAssets[i].totalAmount != 0) {
                address[] memory reversPath = _reversArray(
                    _activeAssets[i].path
                );
                uint256 amount = _swapDEX(
                    _activeAssets[i].totalAmount,
                    reversPath
                );

                sum += amount;
            }
        }
    }

    function _updateNewAssets(address[] memory assets) internal {
        uint256 len = assets.length;
        require((PRECISION_E6 * 100) / len <= _maxShare, "Invalid MaxShare");
        for (uint256 i; i < len; i++) {
            _addAssetInNewAssets(assets[i]);
        }
    }

    function _addAssetInNewAssets(address asset) internal {
        _newAssets.add(asset);
    }

    function _removeInNewAssets(address asset) internal {
        _newAssets.remove(asset);
    }

    function _changeActualToken(uint256 amount, address[] memory path)
        internal
        returns (uint256 amountActualAcceptToken)
    {
        amountActualAcceptToken = _swapDEX(amount, path);
        _actualAcceptToken = _newAcceptToken;
        _approveDEX(_actualAcceptToken);
    }

    function _pushAssetInActive(AssetData memory newAsset) internal {
        Asset memory asset;
        asset.share = newAsset.share;
        asset.path = newAsset.path;
        asset.asset = newAsset.asset;

        _activeAssets.push(asset);
    }

    function _clearNewAssets() internal {
        uint256 len = _newAssets.length();
        for (uint256 i = len; i > 0; --i) {
            _newAssets.remove(_newAssets.at(i - 1));
        }
    }

    function _clearActiveAssets() internal {
        delete (_activeAssets);
    }

    function _setMaxShare(uint256 maxShare) internal {
        _maxShare = maxShare;
    }

    function _unstake(uint256 amountLP) internal {
        uint256 len = _activeAssets.length;
        uint256 sum;

        for (uint256 i; i < len; i++) {
            address[] memory reversPath = _reversArray(_activeAssets[i].path);
            uint256 amountForSwap = (amountLP * _activeAssets[i].fixedAmount) /
                PRECISION;

            uint256 amount = _swapDEX(amountForSwap, reversPath);
            _activeAssets[i].totalAmount -= amountForSwap;
            sum += amount;
        }
        IERC20(_actualAcceptToken).safeTransfer(msg.sender, sum);
    }

    function _calcStake(uint256 amountLP) internal {
        uint256 len = _activeAssets.length;
        for (uint256 i; i < len; i++) {
            uint256 amountForSwap = (amountLP * _activeAssets[i].fixedAmount) /
                PRECISION;
            uint256[] memory amountsIn = IUniswapV2Router02(_adapter)
                .getAmountsIn(amountForSwap, _activeAssets[i].path);
            _activeAssets[i].totalAmount += _swapDEX(
                amountsIn[0],
                _activeAssets[i].path
            );
        }
    }

    function _approveDEX(address asset) internal {
        if (IERC20(asset).allowance(address(this), _adapter) == 0) {
            IERC20(asset).safeApprove(_adapter, type(uint256).max);
        }
    }

    function _exchangeDEX(address[] memory path, uint256 amountAsset)
        internal
        returns (uint256 assetAmount)
    {
        uint256[] memory amountsIn = IUniswapV2Router02(_adapter).getAmountsIn(
            amountAsset,
            path
        );

        uint256 amount = _swapDEX(amountsIn[0], path);

        return (amount);
    }

    function _rebalance(AssetData[] memory newAssets, uint256 usdAmount)
        internal
        virtual
    {
        _clearActiveAssets();
        uint256 totalLP = IERC20(_indexLP).totalSupply();
        uint256 len = newAssets.length;
        require((PRECISION_E6 * 100) / len <= _maxShare, "Invalid MaxShare");
        for (uint256 i; i < len; i++) {
            if (!_newAssets.contains(newAssets[i].asset)) {
                revert InvalidAsset(newAssets[i].asset);
            }
            _pushAssetInActive(newAssets[i]);
            _approveDEX(newAssets[i].asset);
            uint256 amountForSwap = _calcShare(newAssets[i].share, usdAmount);
            if (totalLP == 0) {
                uint256[] memory amounts = IUniswapV2Router02(_adapter)
                    .getAmountsOut(amountForSwap, newAssets[i].path);
                _activeAssets[i].fixedAmount = amounts[amounts.length - 1];
            } else {
                uint256 amount = _swapDEX(amountForSwap, newAssets[i].path);
                _activeAssets[i].totalAmount += amount;
                _activeAssets[i].fixedAmount = (amount * PRECISION) / totalLP;
            }
        }

        _setTimeRebalance();
    }

    function _setTimeRebalance() internal {
        _lastRebalance = block.timestamp;
    }

    function _deployIndexLP(address partnerProgram) internal returns (address) {
        return address(new IndexLP(partnerProgram));
    }

    function _taxation(uint256 amount, uint256 fee)
        internal
        pure
        returns (uint256 amountWithoutTax, uint256 tax)
    {
        tax = (amount * fee) / (100 * PRECISION_E6);
        amountWithoutTax = amount - tax;
    }

    function _isValidStake(
        uint256 cost,
        uint256 amountUSD,
        uint256 slippage
    ) internal pure {
        if (
            cost >
            (amountUSD * (100 * PRECISION_E6 + slippage)) / (100 * PRECISION_E6)
        ) {
            revert InvalidStake();
        }
    }

    function _calcShare(uint256 percent, uint256 amount)
        internal
        pure
        returns (uint256)
    {
        return (amount * percent) / (100 * PRECISION_E6);
    }

    function _reversArray(address[] memory array)
        internal
        pure
        returns (address[] memory reversArray)
    {
        uint256 len = array.length;
        reversArray = new address[](len);
        for (uint256 i; i <= len - 1; i++) {
            reversArray[i] = array[len - i - 1];
        }
    }

    function _calcCost(uint256 amountLP)
        internal
        view
        returns (uint256 amountUSD)
    {
        uint256 len = _activeAssets.length;
        for (uint256 i; i < len; i++) {
            amountUSD += _getPrice(
                _activeAssets[i].path,
                (_activeAssets[i].fixedAmount * amountLP) / PRECISION
            );
        }
        amountUSD += (amountUSD * 1e2) / PRECISION_E6;
    }

    function _getPrice(address[] memory path, uint256 amount)
        public
        view
        returns (uint256)
    {
        uint256[] memory amounts = IUniswapV2Router02(_adapter).getAmountsIn(
            amount,
            path
        );
        return (amounts[0]);
    }
}

File 3 of 23 : IIndexAdmin.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.10;

interface IIndexAdmin {
    function initialize(
        address adminDAO,
        address admin,
        address USD,
        address adapter,
        uint256 startPrice,
        uint256 rebalancePeriod,
        address[] memory newAssets,
        address tresuare,
        address partnerProgram,
        string memory nameIndex
    ) external;
    }

File 4 of 23 : 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 5 of 23 : 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 6 of 23 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 7 of 23 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 8 of 23 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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);
        _;
    }

    /**
     * @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 `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @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 9 of 23 : IUniswapV2Router02.sol
pragma solidity ^0.8.10;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);

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

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (
            uint256 amountToken,
            uint256 amountETH,
            uint256 liquidity
        );

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

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);

    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETHWithPermit(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountToken, uint256 amountETH);

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

    function swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

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

    function swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

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

    function swapETHForExactTokens(
        uint256 amountOut,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function quote(
        uint256 amountA,
        uint256 reserveA,
        uint256 reserveB
    ) external pure returns (uint256 amountB);

    function getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountOut);

    function getAmountIn(
        uint256 amountOut,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountIn);

    function getAmountsOut(uint256 amountIn, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);

    function getAmountsIn(uint256 amountOut, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);
}

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountETH);

    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

File 10 of 23 : IWETH.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.10;

interface IWETH {
    function deposit() external payable;

    function transfer(address to, uint256 value) external returns (bool);

    function withdraw(uint256) external;

    function approve(address guy, uint256 wad) external returns (bool);

    function balanceOf(address) external view returns (uint256);
}

File 11 of 23 : IPartnerProgram.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IPartnerProgram {
    function setupRoleIndex(address index) external;

    function distributeTheReward(
        address referral,
        uint256 amount,
        address token
    ) external returns (uint256 amountWithoutTax);

    function setReferrer(address referrer) external;

    function setPercentReward(uint256[] memory percentReward) external;
}

File 12 of 23 : IIndex.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.10;
pragma experimental ABIEncoderV2;

interface IIndex {
    event Initialize(address adminDAO, address admin, address USD, address lp);
    event Rebalance(Asset[] assets,uint256 oldPrice, uint256 newPrice);
    event Init(Asset[] assets, uint256 indexPrice);
    event Stake(address account, uint256 amountUSD, uint256 amountLP);
    event Unstake(address account, uint256 amountLP);
    event SetRebalancePeriod(uint256 period);

    event SetFeeUnStake(uint256 newFee);
    event SetFeeStake(uint256 newFee);
    event SetActualToken(address newActualToken);
    event SetName(string name);

    error ZeroAmount();
    error InvalidStake();
    error Initializer();

    error InvalidAsset(address asset);

    struct Asset {
        address asset;
        address[] path;
        uint256 fixedAmount;
        uint256 totalAmount;
        uint256 share;
    }
    struct AssetData {
        address asset;
        address[] path;
        uint256 share;
    }

    /**
     * @dev Stops the work of the contract.
     * Blocks a call to the "stake" method.
     * Users can withdraw their funds
     */
    function setPause() external;

    /**
     * @dev  set a new staking name
     */
    function setNameIndex(string memory name) external;

    /**
     * @dev  set a new commission
     */
    function setFeeStake(uint256 fee) external;

    /**
     * @dev  set a new commission
     */
    function setFeeUnStake(uint256 fee) external;

    /**
     * @dev set the new address of the token for which the index is purchased
     * the changes will take effect after rebalancing
     */
    function setActualToken(address newToken) external;

    /**
     * @dev initial index setup
     */
    function init(AssetData[] memory newAssets) external;

    /**
     * @dev  reconfiguring the index
     * @param newAssets - new assets that will be included in the index after rebalancing
     * @param path - specify the path to exchange "_actualAcceptToken" to "_newAcceptToken".
     * The exchange will take place on quickSwap
     */
    function rebalance(AssetData[] memory newAssets, address[] memory path)
        external;

    /**
     * @dev buying an index
     * @param amountLP - the number of indexes that will be purchased
     * @param amountUSD - number of tokens spent
     * @param slippage - the percentage for which we can spend more "amountUSD".
     * Required due to the variability of the sexes on DEX.
     * In case of exceeding "amountUSD" + "slippage", the transaction is canceled
     */
    function stake(
        uint256 amountLP,
        uint256 amountUSD,
        uint256 slippage
    ) external;

    /**
     * @dev buying an index for ETH
     * @param amountLP - the number of indexes that will be purchased
     */
    function stakeETH(uint256 amountLP) external payable;

    function unstake(uint256 amountLP) external;

    function getStatusPause() external view returns (bool status);

    function getNameIndex() external view returns (string memory nameIndex);

    function getLastRebalance() external view returns (uint256);

    function getNewAssets() external view returns (address[] memory newAssets);

    function getDataIndex()
        external
        view
        returns (
            address indexLP,
            uint256 maxShare,
            uint256 rebalancePeriod,
            uint256 startPriceIndex
        );

    function getActiveAssets() external view returns (Asset[] memory assets);

    function getCostLP(uint256 amountLP)
        external
        view
        returns (uint256 amountUSD);

    function getFees()
        external
        view
        returns (uint256 feeStake, uint256 feeUnstake);

    function getAcceptToken()
        external
        view
        returns (address actualAddress, address newAddress);
}

File 13 of 23 : IndexLP.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./interfaces/IERC20BM.sol";

contract IndexLP is ERC20, IERC20BM, AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");

    constructor(address partnerProgram) ERC20("Polylastic LP", "ILP") {
        _setupRole(MINTER_ROLE, msg.sender);
        _setupRole(BURNER_ROLE, msg.sender);
        _setupRole(MINTER_ROLE, partnerProgram);
        _mint(address(this), 0);
    }

    function mint(address account, uint256 amount)
        external
        onlyRole(MINTER_ROLE)
    {
        _mint(account, amount);
    }

    function burn(address account, uint256 amount)
        external
        onlyRole(BURNER_ROLE)
    {
        _burn(account, amount);
    }
}

File 14 of 23 : ExtensionPause.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

abstract contract ExtensionPause {
    event SetPause(bool status);
    error PauseActive();

    bool internal _pause;

    modifier isPause() {
        if (_pause == true) {
            revert PauseActive();
        }
        _;
    }

    function _changeStatusPause() internal {
        _pause = _pause ? false : true;
        emit SetPause(_pause);
    }

    function _statusPause() internal view returns (bool status) {
        return (_pause);
    }
}

File 15 of 23 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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);
}

File 16 of 23 : 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);
            }
        }
    }
}

File 17 of 23 : 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 18 of 23 : 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 19 of 23 : 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 20 of 23 : 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 21 of 23 : 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 22 of 23 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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, allowance(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 = allowance(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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * 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 23 of 23 : IERC20BM.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.10;

interface IERC20BM {
    function mint(address account, uint256 amount) external;

    function burn(address account, uint256 amount) external;
}

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

Contract ABI

[{"inputs":[],"name":"Initializer","type":"error"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"InvalidAsset","type":"error"},{"inputs":[],"name":"InvalidStake","type":"error"},{"inputs":[],"name":"PauseActive","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"fixedAmount","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"share","type":"uint256"}],"indexed":false,"internalType":"struct IIndex.Asset[]","name":"assets","type":"tuple[]"},{"indexed":false,"internalType":"uint256","name":"indexPrice","type":"uint256"}],"name":"Init","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"adminDAO","type":"address"},{"indexed":false,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"address","name":"USD","type":"address"},{"indexed":false,"internalType":"address","name":"lp","type":"address"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"asset","type":"address[]"}],"name":"NewIndexComposition","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"fixedAmount","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"share","type":"uint256"}],"indexed":false,"internalType":"struct IIndex.Asset[]","name":"assets","type":"tuple[]"},{"indexed":false,"internalType":"uint256","name":"oldPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"Rebalance","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":"address","name":"newActualToken","type":"address"}],"name":"SetActualToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"SetFeeStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"SetFeeUnStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxShare","type":"uint256"}],"name":"SetMaxShare","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"SetName","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SetPause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"SetRebalancePeriod","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountLP","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountLP","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DAO_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"_getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_wETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAcceptToken","outputs":[{"internalType":"address","name":"actualAddress","type":"address"},{"internalType":"address","name":"newAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getActiveAssets","outputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"fixedAmount","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"share","type":"uint256"}],"internalType":"struct IIndex.Asset[]","name":"assets","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountLP","type":"uint256"}],"name":"getCostLP","outputs":[{"internalType":"uint256","name":"amountUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDataIndex","outputs":[{"internalType":"address","name":"indexLP","type":"address"},{"internalType":"uint256","name":"maxShare","type":"uint256"},{"internalType":"uint256","name":"rebalancePeriod","type":"uint256"},{"internalType":"uint256","name":"startPriceIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFees","outputs":[{"internalType":"uint256","name":"feeStake","type":"uint256"},{"internalType":"uint256","name":"feeUnstake","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRebalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNameIndex","outputs":[{"internalType":"string","name":"nameIndex","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewAssets","outputs":[{"internalType":"address[]","name":"newAssets","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStatusPause","outputs":[{"internalType":"bool","name":"status","type":"bool"}],"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":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"share","type":"uint256"}],"internalType":"struct IIndex.AssetData[]","name":"newAssets","type":"tuple[]"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"adminDAO","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"USD","type":"address"},{"internalType":"address","name":"adapter","type":"address"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"rebalancePeriod","type":"uint256"},{"internalType":"address[]","name":"newAssets","type":"address[]"},{"internalType":"address","name":"tresuare","type":"address"},{"internalType":"address","name":"partnerProgram","type":"address"},{"internalType":"string","name":"nameIndex","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lengthNewAssets","outputs":[{"internalType":"uint256","name":"len","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"}],"name":"newIndexComposition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"share","type":"uint256"}],"internalType":"struct IIndex.AssetData[]","name":"newAssets","type":"tuple[]"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"rebalance","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":"address","name":"newToken","type":"address"}],"name":"setActualToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setFeeStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setFeeUnStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxShare","type":"uint256"}],"name":"setMaxShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"setNameIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"setRebalancePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountLP","type":"uint256"},{"internalType":"uint256","name":"amountUSD","type":"uint256"},{"internalType":"uint256","name":"slippage","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountLP","type":"uint256"}],"name":"stakeETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountLP","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600180556157da806100246000396000f3fe6080604052600436106200022f5760003560e01c806391d14854116200012f578063c629b12c11620000ad578063d5da61731162000078578063d5da617314620006b8578063db8d55f114620006dd578063dc53e5cf1462000707578063e01f004e146200072c578063f7c3f6cf146200075157600080fd5b8063c629b12c1462000631578063d14dd2f21462000656578063d431b1ac146200067b578063d547741f146200069357600080fd5b8063b13ce26711620000fa578063b13ce2671462000542578063bb9cd6981462000587578063bf4e56b314620005ac578063c0c7df6f14620005d1578063c45618f5146200060c57600080fd5b806391d1485414620004bc5780639933151014620004e1578063a217fddf1462000506578063a638f2e2146200051d57600080fd5b806336568abe11620001bd578063601c00291162000188578063601c0029146200040157806369a1c6d914620004265780636ecc20da146200044b57806375b238fc14620004625780637f357ce7146200048757600080fd5b806336568abe146200038857806339de9bdf14620003ad5780634259524814620003d257806350b7b44714620003e957600080fd5b80632e17de7811620001fe5780632e17de7814620002f05780632eb39c5114620003175780632f2ff15d146200033e578063338ca320146200036357600080fd5b806301ffc9a714620002345780630fd8aee8146200026e5780632180f0251462000295578063248a9ca314620002bc575b600080fd5b3480156200024157600080fd5b506200025962000253366004620034ec565b62000778565b60405190151581526020015b60405180910390f35b3480156200027b57600080fd5b5062000286620007a6565b60405162000265919062003518565b348015620002a257600080fd5b50620002ad62000895565b60405190815260200162000265565b348015620002c957600080fd5b50620002ad620002db366004620035e9565b60009081526020819052604090206001015490565b348015620002fd57600080fd5b50620003156200030f366004620035e9565b620008a8565b005b3480156200032457600080fd5b506200032f62000a16565b60405162000265919062003649565b3480156200034b57600080fd5b50620003156200035d36600462003686565b62000ad0565b3480156200037057600080fd5b50620002ad62000382366004620035e9565b62000afe565b3480156200039557600080fd5b5062000315620003a736600462003686565b62000b0b565b348015620003ba57600080fd5b5062000315620003cc366004620038b4565b62000b91565b348015620003df57600080fd5b50600b54620002ad565b348015620003f657600080fd5b506200025962000c79565b3480156200040e57600080fd5b50620003156200042036600462003962565b62000c88565b3480156200043357600080fd5b5062000315620004453660046200399a565b62000cf6565b620003156200045c366004620035e9565b62000e33565b3480156200046f57600080fd5b50620002ad6000805160206200578583398151915281565b3480156200049457600080fd5b50600e54601254604080516001600160a01b0393841681529290911660208301520162000265565b348015620004c957600080fd5b5062000259620004db36600462003686565b62001024565b348015620004ee57600080fd5b506200031562000500366004620035e9565b6200104d565b3480156200051357600080fd5b50620002ad600081565b3480156200052a57600080fd5b50620003156200053c36600462003a04565b620010ec565b3480156200054f57600080fd5b50600d54600954600a54600c54604080516001600160a01b039095168552602085019390935291830152606082015260800162000265565b3480156200059457600080fd5b5062000315620005a636600462003a31565b62001182565b348015620005b957600080fd5b5062000315620005cb36600462003aaa565b62001218565b348015620005de57600080fd5b50601154620005f3906001600160a01b031681565b6040516001600160a01b03909116815260200162000265565b3480156200061957600080fd5b50620003156200062b366004620035e9565b620012ca565b3480156200063e57600080fd5b50620003156200065036600462003aca565b62001369565b3480156200066357600080fd5b50620002ad6000805160206200576583398151915281565b3480156200068857600080fd5b506200031562001389565b348015620006a057600080fd5b5062000315620006b236600462003686565b620013b1565b348015620006c557600080fd5b5062000315620006d7366004620035e9565b620013da565b348015620006ea57600080fd5b506006546007546040805192835260208301919091520162000265565b3480156200071457600080fd5b506200031562000726366004620035e9565b6200149b565b3480156200073957600080fd5b50620002ad6200074b36600462003bb9565b620014c1565b3480156200075e57600080fd5b50620007696200156b565b60405162000265919062003c30565b60006001600160e01b0319821663318a6c4b60e21b1480620007a05750620007a08262001605565b92915050565b60606014805480602002602001604051908101604052809291908181526020016000905b828210156200088c5760008481526020908190206040805160a0810182526005860290920180546001600160a01b031683526001810180548351818702810187019094528084529394919385830193928301828280156200085557602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000836575b50505050508152602001600282015481526020016003820154815260200160048201548152505081526020019060010190620007ca565b50505050905090565b6000620008a360036200162d565b905090565b8060008111620008cb57604051631f2a200560e01b815260040160405180910390fd5b600080620008dc8460075462001638565b915091508060086000828254620008f4919062003c7b565b90915550620009059050826200167a565b600d54604051632770a7eb60e21b8152336004820152602481018690526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b1580156200095257600080fd5b505af115801562000967573d6000803e3d6000fd5b5050600d546010546040516340c10f1960e01b81526001600160a01b03918216600482015260248101869052911692506340c10f199150604401600060405180830381600087803b158015620009bc57600080fd5b505af1158015620009d1573d6000803e3d6000fd5b505060408051338152602081018690527f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd93500190505b60405180910390a150505050565b6060600062000a2660036200162d565b9050806001600160401b0381111562000a435762000a43620036b9565b60405190808252806020026020018201604052801562000a6d578160200160208202803683370190505b50915060005b8181101562000acb5762000a89600382620017f8565b83828151811062000a9e5762000a9e62003c96565b6001600160a01b03909216602092830291909101909101528062000ac28162003cac565b91505062000a73565b505090565b60008281526020819052604090206001015462000aed816200180d565b62000af9838362001819565b505050565b6000620007a082620018a1565b6001600160a01b038116331462000b815760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b62000b8d8282620019cf565b5050565b6000805160206200578583398151915262000bac816200180d565b601254600160a81b900460ff161562000bfe5760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640162000b78565b62000c0c82600c5462001a37565b600062000c21670de0b6b3a7640000620018a1565b6012805460ff60a81b1916600160a81b1790556040519091507fb9ae79ebde2a0305f993c3f5d476fd1fa451a049ecd9d6b779b92eafbbe7bae29062000c6c90601490849062003da4565b60405180910390a1505050565b6000620008a360025460ff1690565b6000805160206200576583398151915262000ca3816200180d565b815162000cb890600590602085019062003356565b507f4df9dcd34ae35f40f2c756fd8ac83210ed0b76d065543ee73d868aec7c7fcf028260405162000cea919062003c30565b60405180910390a15050565b6000805160206200578583398151915262000d11816200180d565b600a54600b5462000d23919062003c7b565b421162000d735760405162461bcd60e51b815260206004820152601f60248201527f4974206973206e6f7420706f737369626c6520746f20726562616c616e636500604482015260640162000b78565b600062000d88670de0b6b3a7640000620018a1565b9050600062000d9662001e17565b601254600e549192506001600160a01b0391821691161462000dc15762000dbe818562001ed3565b90505b8062000dca5750805b62000dd6858262001a37565b600062000deb670de0b6b3a7640000620018a1565b90507f0393cf362bf202028ad5ce4c8645d2e13bea234945db39726c2dc064c9ceb2086014848360405162000e239392919062003dc8565b60405180910390a1505050505050565b806000811162000e5657604051631f2a200560e01b815260040160405180910390fd5b60025460ff1615156001141562000e8057604051632529898560e01b815260040160405180910390fd5b6002600154141562000ed55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000b78565b6002600155600062000ee783620018a1565b90503481101562000f345760405162461bcd60e51b815260206004820152601660248201527524b739bab33334b1b4b2b73a10383937bb34b9b4b7b760511b604482015260640162000b78565b601154600e546001600160a01b0390811691161462000fa45760405162461bcd60e51b815260206004820152602560248201527f5468652063757272656e7420616363657074656420746f6b656e206973206e6f6044820152640e8408aa8960db1b606482015260840162000b78565b601160009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801562000ff557600080fd5b505af11580156200100a573d6000803e3d6000fd5b50505050506200101b838262001f10565b50506001805550565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000805160206200576583398151915262001068816200180d565b62001078620f4240606462003def565b8210620010b65760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642066656560a81b604482015260640162000b78565b60078290556040518281527f9d16466526a50cf733bbfb774cebd903abd6a11352c094febe3ffa13d2364e5e9060200162000cea565b82600081116200110f57604051631f2a200560e01b815260040160405180910390fd5b60025460ff161515600114156200113957604051632529898560e01b815260040160405180910390fd5b60006200114685620018a1565b905062001155818585620020dd565b600e546200116f906001600160a01b031633308462002143565b6200117b858262001f10565b5050505050565b600080516020620057658339815191526200119d816200180d565b620011a7620021b0565b620011e58383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506200220492505050565b7f2c6990791bc013b0e2b0b0f9645bd864cc4c15b9b8bedefc10991da8b467678d838360405162000c6c92919062003e11565b6000805160206200576583398151915262001233816200180d565b6001600160a01b0382166200127b5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2102a37b5b2b760991b604482015260640162000b78565b601280546001600160a01b0319166001600160a01b0384169081179091556040519081527f054c0d6a1602f886acc1737c9aa5b191c84d0d77b0f2aa1b21d1354470c1ede99060200162000cea565b60008051602062005765833981519152620012e5816200180d565b620012f5620f4240606462003def565b8210620013335760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642066656560a81b604482015260640162000b78565b60068290556040518281527f1af5d91f6be6c01a908fbc8bf30f01d96ee9749794fa8e3b01c9fb3b2f8c8b6c9060200162000cea565b6200137d8a8a8a8a8a8a8a8a8a8a620022b1565b50505050505050505050565b60008051602062005765833981519152620013a4816200180d565b620013ae620024e6565b50565b600082815260208190526040902060010154620013ce816200180d565b62000af98383620019cf565b60008051602062005765833981519152620013f5816200180d565b62001405620f4240601462003def565b821180156200142257506200141f620f4240606462003def565b82105b620014605760405162461bcd60e51b815260206004820152600d60248201526c496e76616c696420536861726560981b604482015260640162000b78565b6200146a82600955565b6040518281527fd4369cec269714984bbf2195677fd4c8fec380be3f34a89aeca71f7b0b3792149060200162000cea565b60008051602062005765833981519152620014b6816200180d565b62000b8d8262002547565b600f546040516307c0329d60e21b815260009182916001600160a01b0390911690631f00ca7490620014fa908690889060040162003e58565b600060405180830381865afa15801562001518573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001542919081019062003e73565b9050806000815181106200155a576200155a62003c96565b602002602001015191505092915050565b6060600580546200157c9062003f01565b80601f0160208091040260200160405190810160405280929190818152602001828054620015aa9062003f01565b8015620015fb5780601f10620015cf57610100808354040283529160200191620015fb565b820191906000526020600020905b815481529060010190602001808311620015dd57829003601f168201915b5050505050905090565b60006001600160e01b031982166302d4f1bd60e01b1480620007a05750620007a08262002582565b6000620007a0825490565b6000806200164b620f4240606462003def565b62001657848662003def565b62001663919062003f3e565b905062001671818562003f61565b91509250929050565b6014546000805b82811015620017de5760006200171860148381548110620016a657620016a662003c96565b90600052602060002090600502016001018054806020026020016040519081016040528092919081815260200182805480156200170d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620016ee575b5050505050620025b9565b90506000670de0b6b3a7640000601484815481106200173b576200173b62003c96565b906000526020600020906005020160020154876200175a919062003def565b62001766919062003f3e565b905060006200177682846200269c565b905081601485815481106200178f576200178f62003c96565b90600052602060002090600502016003016000828254620017b1919062003f61565b90915550620017c39050818662003c7b565b94505050508080620017d59062003cac565b91505062001681565b50600e5462000af9906001600160a01b0316338362002756565b600062001806838362002788565b9392505050565b620013ae8133620027b5565b62001825828262001024565b62000b8d576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200185d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b601454600090815b81811015620019a5576200198260148281548110620018cc57620018cc62003c96565b90600052602060002090600502016001018054806020026020016040519081016040528092919081815260200182805480156200193357602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162001914575b5050505050670de0b6b3a7640000866014858154811062001958576200195862003c96565b90600052602060002090600502016002015462001976919062003def565b6200074b919062003f3e565b6200198e908462003c7b565b9250806200199c8162003cac565b915050620018a9565b50620f4240620019b783606462003def565b620019c3919062003f3e565b62001806908362003c7b565b620019db828262001024565b1562000b8d576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b62001a4162002824565b600d54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa15801562001a8c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001ab2919062003f7b565b8351600954919250908162001acc620f4240606462003def565b62001ad8919062003f3e565b111562001b1b5760405162461bcd60e51b815260206004820152601060248201526f496e76616c6964204d6178536861726560801b604482015260640162000b78565b60005b8181101562001e065762001b5d85828151811062001b405762001b4062003c96565b60200260200101516000015160036200283490919063ffffffff16565b62001ba95784818151811062001b775762001b7762003c96565b6020908102919091010151516040516337bce3c560e11b81526001600160a01b03909116600482015260240162000b78565b62001bd085828151811062001bc25762001bc262003c96565b602002602001015162002857565b62001bfb85828151811062001be95762001be962003c96565b60200260200101516000015162002965565b600062001c2986838151811062001c165762001c1662003c96565b60200260200101516040015186620029ff565b90508362001d3357600f5486516000916001600160a01b03169063d06ca61f9084908a908790811062001c605762001c6062003c96565b6020026020010151602001516040518363ffffffff1660e01b815260040162001c8b92919062003e58565b600060405180830381865afa15801562001ca9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262001cd3919081019062003e73565b9050806001825162001ce6919062003f61565b8151811062001cf95762001cf962003c96565b60200260200101516014848154811062001d175762001d1762003c96565b9060005260206000209060050201600201819055505062001df0565b600062001d618288858151811062001d4f5762001d4f62003c96565b6020026020010151602001516200269c565b9050806014848154811062001d7a5762001d7a62003c96565b9060005260206000209060050201600301600082825462001d9c919062003c7b565b9091555085905062001db7670de0b6b3a76400008362003def565b62001dc3919062003f3e565b6014848154811062001dd95762001dd962003c96565b906000526020600020906005020160020181905550505b508062001dfd8162003cac565b91505062001b1e565b5062001e1142600b55565b50505050565b601454600090815b8181101562000acb576014818154811062001e3e5762001e3e62003c96565b90600052602060002090600502016003015460001462001ebe57600062001e7460148381548110620016a657620016a662003c96565b9050600062001eab6014848154811062001e925762001e9262003c96565b906000526020600020906005020160030154836200269c565b905062001eb9818662003c7b565b945050505b8062001eca8162003cac565b91505062001e1f565b600062001ee183836200269c565b601254600e80546001600160a01b0319166001600160a01b039092169182179055909150620007a09062002965565b60008062001f218460065462001638565b91509150806008600082825462001f39919062003c7b565b9091555062001f4a90508262002a29565b601354600d5460405163239b44e760e11b8152336004820152602481018790526001600160a01b03918216604482015291169063473689ce906064016020604051808303816000875af115801562001fa6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001fcc919062003f7b565b50600d546040516340c10f1960e01b8152336004820152602481018490526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156200201a57600080fd5b505af11580156200202f573d6000803e3d6000fd5b5050600d546010546040516340c10f1960e01b81526001600160a01b03918216600482015260248101869052911692506340c10f199150604401600060405180830381600087803b1580156200208457600080fd5b505af115801562002099573d6000803e3d6000fd5b505060408051338152602081018790529081018590527f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b69250606001905062000a08565b620020ed620f4240606462003def565b81620020fe620f4240606462003def565b6200210a919062003c7b565b62002116908462003def565b62002122919062003f3e565b83111562000af957604051634eba4d4960e11b815260040160405180910390fd5b6040516001600160a01b038085166024830152831660448201526064810182905262001e119085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262002c33565b6000620021be60036200162d565b9050805b801562000b8d57620021f0620021e7620021de60018462003f61565b600390620017f8565b60039062002d0c565b50620021fc8162003f95565b9050620021c2565b8051600954816200221a620f4240606462003def565b62002226919062003f3e565b1115620022695760405162461bcd60e51b815260206004820152601060248201526f496e76616c6964204d6178536861726560801b604482015260640162000b78565b60005b8181101562000af9576200229c8382815181106200228e576200228e62003c96565b602002602001015162002d23565b80620022a88162003cac565b9150506200226c565b601254600160a01b900460ff16151560011415620022e257604051633dbe7a6760e01b815260040160405180910390fd5b620022ef60008a62002d30565b6200230a600080516020620057658339815191528b62002d30565b62002325600080516020620057858339815191528a62002d30565b600e80546001600160a01b03808b166001600160a01b03199283168117909355601280548316909317909255600f8054928a169290911682179055604080516315ab88c960e31b8152905163ad5c4648916004808201926020929091908290030181865afa1580156200239c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620023c2919062003faf565b601180546001600160a01b0319166001600160a01b0392909216919091179055600c869055620023f7620f4240601462003def565b600955600a8590556200240a8262002d3c565b600d80546001600160a01b03199081166001600160a01b03938416179091556010805482168684161790556013805490911691841691909117905580516200245a90600590602084019062003356565b50620024668862002965565b620024718462002204565b600d54604080516001600160a01b038d811682528c811660208301528b8116828401529092166060830152517f420f11aae030b1b71b7480842c183b50e595c7c74203eb478d183ad7d3fdbd269181900360800190a150506012805460ff60a01b1916600160a01b1790555050505050505050565b60025460ff16620024f9576001620024fc565b60005b6002805460ff1916911515918217905560405160ff909116151581527f140eb9f8b591138e129e4caf389c92df4f0545b902523eee9e63153ecdb2026e9060200160405180910390a1565b600a8190556040518181527f0f794d58e934d66b2d57c6a150000d463da8cf6e2d834f23c37a401966cffac39060200160405180910390a150565b60006001600160e01b03198216637965db0b60e01b1480620007a057506301ffc9a760e01b6001600160e01b0319831614620007a0565b8051606090806001600160401b03811115620025d957620025d9620036b9565b60405190808252806020026020018201604052801562002603578160200160208202803683370190505b50915060005b6200261660018362003f61565b811162002695578360016200262c838562003f61565b62002638919062003f61565b815181106200264b576200264b62003c96565b602002602001015183828151811062002668576200266862003c96565b6001600160a01b0390921660209283029190910190910152806200268c8162003cac565b91505062002609565b5050919050565b600f5460009081906001600160a01b03166338ed173985838630620026c44261012c62003c7b565b6040518663ffffffff1660e01b8152600401620026e695949392919062003fcf565b6000604051808303816000875af115801562002706573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002730919081019062003e73565b9050806001845162002743919062003f61565b815181106200155a576200155a62003c96565b6040516001600160a01b03831660248201526044810182905262000af990849063a9059cbb60e01b9060640162002178565b6000826000018281548110620027a257620027a262003c96565b9060005260206000200154905092915050565b620027c1828262001024565b62000b8d57620027dc816001600160a01b0316601462002d81565b620027e983602062002d81565b604051602001620027fc9291906200400d565b60408051601f198184030181529082905262461bcd60e51b825262000b789160040162003c30565b6200283260146000620033e5565b565b6001600160a01b0381166000908152600183016020526040812054151562001806565b620028936040518060a0016040528060006001600160a01b03168152602001606081526020016000815260200160008152602001600081525090565b6040820151608082015260208083015181830190815283516001600160a01b0390811684526014805460018101825560009190915284517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec600590920291820180546001600160a01b03191691909316178255915180518594929362002940937fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ed90910192019062003408565b5060408201518160020155606082015181600301556080820151816004015550505050565b600f54604051636eb1769f60e11b81523060048201526001600160a01b0391821660248201529082169063dd62ed3e90604401602060405180830381865afa158015620029b6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620029dc919062003f7b565b620013ae57600f54620013ae906001600160a01b03838116911660001962002f3a565b600062002a11620f4240606462003def565b62002a1d848462003def565b62001806919062003f3e565b60145460005b8181101562000af9576000670de0b6b3a76400006014838154811062002a595762002a5962003c96565b9060005260206000209060050201600201548562002a78919062003def565b62002a84919062003f3e565b600f54601480549293506000926001600160a01b0390921691631f00ca749185918790811062002ab85762002ab862003c96565b90600052602060002090600502016001016040518363ffffffff1660e01b815260040162002ae892919062004086565b600060405180830381865afa15801562002b06573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262002b30919081019062003e73565b905062002bdc8160008151811062002b4c5762002b4c62003c96565b60200260200101516014858154811062002b6a5762002b6a62003c96565b906000526020600020906005020160010180548060200260200160405190810160405280929190818152602001828054801562002bd157602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162002bb2575b50505050506200269c565b6014848154811062002bf25762002bf262003c96565b9060005260206000209060050201600301600082825462002c14919062003c7b565b925050819055505050808062002c2a9062003cac565b91505062002a2f565b600062002c8a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620030579092919063ffffffff16565b80519091501562000af9578080602001905181019062002cab9190620040a1565b62000af95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000b78565b600062001806836001600160a01b03841662003070565b62000b8d60038262003174565b62000b8d828262001819565b60008160405162002d4d9062003460565b6001600160a01b039091168152602001604051809103906000f08015801562002d7a573d6000803e3d6000fd5b5092915050565b6060600062002d9283600262003def565b62002d9f90600262003c7b565b6001600160401b0381111562002db95762002db9620036b9565b6040519080825280601f01601f19166020018201604052801562002de4576020820181803683370190505b509050600360fc1b8160008151811062002e025762002e0262003c96565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811062002e345762002e3462003c96565b60200101906001600160f81b031916908160001a905350600062002e5a84600262003def565b62002e6790600162003c7b565b90505b600181111562002ee9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062002e9f5762002e9f62003c96565b1a60f81b82828151811062002eb85762002eb862003c96565b60200101906001600160f81b031916908160001a90535060049490941c9362002ee18162003f95565b905062002e6a565b508315620018065760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000b78565b80158062002fb85750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801562002f90573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002fb6919062003f7b565b155b620030255760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840162000b78565b6040516001600160a01b03831660248201526044810182905262000af990849063095ea7b360e01b9060640162002178565b60606200306884846000856200318b565b949350505050565b60008181526001830160205260408120548015620031695760006200309760018362003f61565b8554909150600090620030ad9060019062003f61565b905081811462003119576000866000018281548110620030d157620030d162003c96565b9060005260206000200154905080876000018481548110620030f757620030f762003c96565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200312d576200312d620040c5565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620007a0565b6000915050620007a0565b600062001806836001600160a01b038416620032c6565b606082471015620031ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000b78565b6001600160a01b0385163b620032475760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000b78565b600080866001600160a01b03168587604051620032659190620040db565b60006040518083038185875af1925050503d8060008114620032a4576040519150601f19603f3d011682016040523d82523d6000602084013e620032a9565b606091505b5091509150620032bb82828662003318565b979650505050505050565b60008181526001830160205260408120546200330f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620007a0565b506000620007a0565b606083156200332957508162001806565b8251156200333a5782518084602001fd5b8160405162461bcd60e51b815260040162000b78919062003c30565b828054620033649062003f01565b90600052602060002090601f016020900481019282620033885760008555620033d3565b82601f10620033a357805160ff1916838001178555620033d3565b82800160010185558215620033d3579182015b82811115620033d3578251825591602001919060010190620033b6565b50620033e19291506200346e565b5090565b5080546000825560050290600052602060002090810190620013ae919062003485565b828054828255906000526020600020908101928215620033d3579160200282015b82811115620033d357825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062003429565b61166b80620040fa83390190565b5b80821115620033e157600081556001016200346f565b80821115620033e15780546001600160a01b03191681556000620034ad6001830182620034cc565b5060006002820181905560038201819055600482015560050162003485565b5080546000825590600052602060002090810190620013ae91906200346e565b600060208284031215620034ff57600080fd5b81356001600160e01b0319811681146200180657600080fd5b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b84811015620035da57898403603f19018652825180516001600160a01b0390811686528982015160a08b8801819052815190880181905260c0880192918c01919086905b80821015620035a857835183168552938d0193928d01926001919091019062003584565b5050505081890151868a0152606080830151908701526080918201519190950152948701949187019160010162003540565b50919998505050505050505050565b600060208284031215620035fc57600080fd5b5035919050565b600081518084526020808501945080840160005b838110156200363e5781516001600160a01b03168752958201959082019060010162003617565b509495945050505050565b60208152600062001806602083018462003603565b6001600160a01b0381168114620013ae57600080fd5b803562003681816200365e565b919050565b600080604083850312156200369a57600080fd5b823591506020830135620036ae816200365e565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620036f457620036f4620036b9565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620037255762003725620036b9565b604052919050565b60006001600160401b03821115620037495762003749620036b9565b5060051b60200190565b600082601f8301126200376557600080fd5b813560206200377e62003778836200372d565b620036fa565b82815260059290921b840181019181810190868411156200379e57600080fd5b8286015b84811015620037c6578035620037b8816200365e565b8352918301918301620037a2565b509695505050505050565b600082601f830112620037e357600080fd5b81356020620037f662003778836200372d565b82815260059290921b840181019181810190868411156200381657600080fd5b8286015b84811015620037c65780356001600160401b03808211156200383c5760008081fd5b908801906060828b03601f1901811315620038575760008081fd5b62003861620036cf565b8784013562003870816200365e565b815260408481013584811115620038875760008081fd5b620038978e8b8389010162003753565b8a840152509190930135908301525083529183019183016200381a565b600060208284031215620038c757600080fd5b81356001600160401b03811115620038de57600080fd5b6200306884828501620037d1565b600082601f830112620038fe57600080fd5b81356001600160401b038111156200391a576200391a620036b9565b6200392f601f8201601f1916602001620036fa565b8181528460208386010111156200394557600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156200397557600080fd5b81356001600160401b038111156200398c57600080fd5b6200306884828501620038ec565b60008060408385031215620039ae57600080fd5b82356001600160401b0380821115620039c657600080fd5b620039d486838701620037d1565b93506020850135915080821115620039eb57600080fd5b50620039fa8582860162003753565b9150509250929050565b60008060006060848603121562003a1a57600080fd5b505081359360208301359350604090920135919050565b6000806020838503121562003a4557600080fd5b82356001600160401b038082111562003a5d57600080fd5b818501915085601f83011262003a7257600080fd5b81358181111562003a8257600080fd5b8660208260051b850101111562003a9857600080fd5b60209290920196919550909350505050565b60006020828403121562003abd57600080fd5b813562001806816200365e565b6000806000806000806000806000806101408b8d03121562003aeb57600080fd5b62003af68b62003674565b995062003b0660208c0162003674565b985062003b1660408c0162003674565b975062003b2660608c0162003674565b965060808b0135955060a08b0135945060c08b01356001600160401b038082111562003b5157600080fd5b62003b5f8e838f0162003753565b955062003b6f60e08e0162003674565b945062003b806101008e0162003674565b93506101208d013591508082111562003b9857600080fd5b5062003ba78d828e01620038ec565b9150509295989b9194979a5092959850565b6000806040838503121562003bcd57600080fd5b82356001600160401b0381111562003be457600080fd5b62003bf28582860162003753565b95602094909401359450505050565b60005b8381101562003c1e57818101518382015260200162003c04565b8381111562001e115750506000910152565b602081526000825180602084015262003c5181604085016020870162003c01565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b6000821982111562003c915762003c9162003c65565b500190565b634e487b7160e01b600052603260045260246000fd5b600060001982141562003cc35762003cc362003c65565b5060010190565b6000815480845260208085019450836000528060002060005b838110156200363e5781546001600160a01b03168752958201956001918201910162003ce3565b600081548084526020808501808196506005915083821b8101866000528360002060005b8681101562003d96578383038a5281546001600160a01b0316835260a086840181905262003d628185016001850162003cca565b6002840154604086015260038401546060860152600484015460809095019490945250988501989084019060010162003d2e565b509098975050505050505050565b60408152600062003db9604083018562003d0a565b90508260208301529392505050565b60608152600062003ddd606083018662003d0a565b60208301949094525060400152919050565b600081600019048311821515161562003e0c5762003e0c62003c65565b500290565b60208082528181018390526000908460408401835b86811015620037c657823562003e3c816200365e565b6001600160a01b03168252918301919083019060010162003e26565b82815260406020820152600062003068604083018462003603565b6000602080838503121562003e8757600080fd5b82516001600160401b0381111562003e9e57600080fd5b8301601f8101851362003eb057600080fd5b805162003ec162003778826200372d565b81815260059190911b8201830190838101908783111562003ee157600080fd5b928401925b82841015620032bb5783518252928401929084019062003ee6565b600181811c9082168062003f1657607f821691505b6020821081141562003f3857634e487b7160e01b600052602260045260246000fd5b50919050565b60008262003f5c57634e487b7160e01b600052601260045260246000fd5b500490565b60008282101562003f765762003f7662003c65565b500390565b60006020828403121562003f8e57600080fd5b5051919050565b60008162003fa75762003fa762003c65565b506000190190565b60006020828403121562003fc257600080fd5b815162001806816200365e565b85815284602082015260a06040820152600062003ff060a083018662003603565b6001600160a01b0394909416606083015250608001529392505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516200404781601785016020880162003c01565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516200407a81602884016020880162003c01565b01602801949350505050565b82815260406020820152600062003068604083018462003cca565b600060208284031215620040b457600080fd5b815180151581146200180657600080fd5b634e487b7160e01b600052603160045260246000fd5b60008251620040ef81846020870162003c01565b919091019291505056fe60806040523480156200001157600080fd5b506040516200166b3803806200166b833981016040819052620000349162000365565b6040518060400160405280600d81526020016c0506f6c796c6173746963204c5609c1b815250604051806040016040528060038152602001620494c560ec1b81525081600390805190602001906200008e929190620002bf565b508051620000a4906004906020840190620002bf565b505050620000c86000805160206200164b833981519152336200012360201b60201c565b620000f47f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8483362000123565b6200010f6000805160206200164b8339815191528262000123565b6200011c30600062000133565b50620003fb565b6200012f82826200021b565b5050565b6001600160a01b0382166200018e5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620001a2919062000397565b90915550506001600160a01b03821660009081526020819052604081208054839290620001d190849062000397565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60008281526005602090815260408083206001600160a01b038516845290915290205460ff166200012f5760008281526005602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200027b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b828054620002cd90620003be565b90600052602060002090601f016020900481019282620002f157600085556200033c565b82601f106200030c57805160ff19168380011785556200033c565b828001600101855582156200033c579182015b828111156200033c5782518255916020019190600101906200031f565b506200034a9291506200034e565b5090565b5b808211156200034a57600081556001016200034f565b6000602082840312156200037857600080fd5b81516001600160a01b03811681146200039057600080fd5b9392505050565b60008219821115620003b957634e487b7160e01b600052601160045260246000fd5b500190565b600181811c90821680620003d357607f821691505b60208210811415620003f557634e487b7160e01b600052602260045260246000fd5b50919050565b611240806200040b6000396000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c806340c10f19116100b8578063a217fddf1161007c578063a217fddf146102ba578063a457c2d7146102c2578063a9059cbb146102d5578063d5391393146102e8578063d547741f1461030f578063dd62ed3e1461032257600080fd5b806340c10f191461025057806370a082311461026357806391d148541461028c57806395d89b411461029f5780639dc29fac146102a757600080fd5b8063248a9ca31161010a578063248a9ca3146101bc578063282c51f3146101df5780632f2ff15d14610206578063313ce5671461021b57806336568abe1461022a578063395093511461023d57600080fd5b806301ffc9a71461014757806306fdde031461016f578063095ea7b31461018457806318160ddd1461019757806323b872dd146101a9575b600080fd5b61015a610155366004610f1e565b610335565b60405190151581526020015b60405180910390f35b61017761036c565b6040516101669190610f74565b61015a610192366004610fc3565b6103fe565b6002545b604051908152602001610166565b61015a6101b7366004610fed565b610416565b61019b6101ca366004611029565b60009081526005602052604090206001015490565b61019b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b610219610214366004611042565b61043a565b005b60405160128152602001610166565b610219610238366004611042565b610464565b61015a61024b366004610fc3565b6104e7565b61021961025e366004610fc3565b610509565b61019b61027136600461106e565b6001600160a01b031660009081526020819052604090205490565b61015a61029a366004611042565b61053d565b610177610568565b6102196102b5366004610fc3565b610577565b61019b600081565b61015a6102d0366004610fc3565b6105ab565b61015a6102e3366004610fc3565b610626565b61019b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61021961031d366004611042565b610634565b61019b610330366004611089565b610659565b60006001600160e01b03198216637965db0b60e01b148061036657506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606003805461037b906110b3565b80601f01602080910402602001604051908101604052809291908181526020018280546103a7906110b3565b80156103f45780601f106103c9576101008083540402835291602001916103f4565b820191906000526020600020905b8154815290600101906020018083116103d757829003601f168201915b5050505050905090565b60003361040c818585610684565b5060019392505050565b6000336104248582856107a8565b61042f858585610822565b506001949350505050565b600082815260056020526040902060010154610455816109f0565b61045f83836109fd565b505050565b6001600160a01b03811633146104d95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6104e38282610a83565b5050565b60003361040c8185856104fa8383610659565b6105049190611104565b610684565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610533816109f0565b61045f8383610aea565b60009182526005602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606004805461037b906110b3565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8486105a1816109f0565b61045f8383610bc9565b600033816105b98286610659565b9050838110156106195760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016104d0565b61042f8286868403610684565b60003361040c818585610822565b60008281526005602052604090206001015461064f816109f0565b61045f8383610a83565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166106e65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104d0565b6001600160a01b0382166107475760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104d0565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006107b48484610659565b9050600019811461081c578181101561080f5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016104d0565b61081c8484848403610684565b50505050565b6001600160a01b0383166108865760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104d0565b6001600160a01b0382166108e85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104d0565b6001600160a01b038316600090815260208190526040902054818110156109605760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016104d0565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610997908490611104565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516109e391815260200190565b60405180910390a361081c565b6109fa8133610d17565b50565b610a07828261053d565b6104e35760008281526005602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610a3f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610a8d828261053d565b156104e35760008281526005602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038216610b405760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104d0565b8060026000828254610b529190611104565b90915550506001600160a01b03821660009081526020819052604081208054839290610b7f908490611104565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610c295760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016104d0565b6001600160a01b03821660009081526020819052604090205481811015610c9d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016104d0565b6001600160a01b0383166000908152602081905260408120838303905560028054849290610ccc90849061111c565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b610d21828261053d565b6104e357610d39816001600160a01b03166014610d7b565b610d44836020610d7b565b604051602001610d55929190611133565b60408051601f198184030181529082905262461bcd60e51b82526104d091600401610f74565b60606000610d8a8360026111a8565b610d95906002611104565b67ffffffffffffffff811115610dad57610dad6111c7565b6040519080825280601f01601f191660200182016040528015610dd7576020820181803683370190505b509050600360fc1b81600081518110610df257610df26111dd565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610e2157610e216111dd565b60200101906001600160f81b031916908160001a9053506000610e458460026111a8565b610e50906001611104565b90505b6001811115610ec8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610e8457610e846111dd565b1a60f81b828281518110610e9a57610e9a6111dd565b60200101906001600160f81b031916908160001a90535060049490941c93610ec1816111f3565b9050610e53565b508315610f175760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104d0565b9392505050565b600060208284031215610f3057600080fd5b81356001600160e01b031981168114610f1757600080fd5b60005b83811015610f63578181015183820152602001610f4b565b8381111561081c5750506000910152565b6020815260008251806020840152610f93816040850160208701610f48565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610fbe57600080fd5b919050565b60008060408385031215610fd657600080fd5b610fdf83610fa7565b946020939093013593505050565b60008060006060848603121561100257600080fd5b61100b84610fa7565b925061101960208501610fa7565b9150604084013590509250925092565b60006020828403121561103b57600080fd5b5035919050565b6000806040838503121561105557600080fd5b8235915061106560208401610fa7565b90509250929050565b60006020828403121561108057600080fd5b610f1782610fa7565b6000806040838503121561109c57600080fd5b6110a583610fa7565b915061106560208401610fa7565b600181811c908216806110c757607f821691505b602082108114156110e857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611117576111176110ee565b500190565b60008282101561112e5761112e6110ee565b500390565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161116b816017850160208801610f48565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161119c816028840160208801610f48565b01602801949350505050565b60008160001904831182151516156111c2576111c26110ee565b500290565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081611202576112026110ee565b50600019019056fea26469706673582212204ae2cabdf381849a6ae255f1efb4ca9939ff6ab3cdaf3edcaa9eb9a4e769cf0664736f6c634300080a00339f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69729b62c1a280a968a683045fd5bbd60b97be4a6b7b0a5b624c9bbc54d6f3b59a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220810c2f615a707f249d02b3b065ec92e5e6d1c26a2d165c11b03605874cac046b64736f6c634300080a0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading