ETH Price: $3,992.68 (+3.34%)

Contract

0xb245Ab0d2e9dfB99b1212eb3d7732c22591557A2
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Assign Tvl Snaps...164196072023-01-16 13:20:11699 days ago1673875211IN
0xb245Ab0d...2591557A2
0 ETH0.0023810916.91613774
Withdraw Fee163685832023-01-09 10:15:47706 days ago1673259347IN
0xb245Ab0d...2591557A2
0 ETH0.0009306617.15507828
Collect Fee163685612023-01-09 10:11:23706 days ago1673259083IN
0xb245Ab0d...2591557A2
0 ETH0.0039426819.27145707
Assign Tvl Snaps...163685582023-01-09 10:10:47706 days ago1673259047IN
0xb245Ab0d...2591557A2
0 ETH0.0027389616.90303039
Withdraw Fee163685012023-01-09 9:59:23706 days ago1673258363IN
0xb245Ab0d...2591557A2
0 ETH0.0011725816.43421343
Collect Fee163684132023-01-09 9:41:47706 days ago1673257307IN
0xb245Ab0d...2591557A2
0 ETH0.0029097715.87388142
Assign Tvl Snaps...163684082023-01-09 9:40:47706 days ago1673257247IN
0xb245Ab0d...2591557A2
0 ETH0.0023628916.78682624
Assign Tvl Oracl...163489542023-01-06 16:32:11709 days ago1673022731IN
0xb245Ab0d...2591557A2
0 ETH0.001915523.86293975
Initialise Dynas...163486862023-01-06 15:38:23709 days ago1673019503IN
0xb245Ab0d...2591557A2
0 ETH0.0077582320.56523467
Initialise Dynas...163483702023-01-06 14:34:59709 days ago1673015699IN
0xb245Ab0d...2591557A2
0 ETH0.0101190630.46590829
Deploy Dynaset163483612023-01-06 14:33:11709 days ago1673015591IN
0xb245Ab0d...2591557A2
0 ETH0.104733329.68449474
Assign Tvl Oracl...156954942022-10-07 10:00:59800 days ago1665136859IN
0xb245Ab0d...2591557A2
0 ETH0.000516196.43063195
Initialise Dynas...156954902022-10-07 10:00:11800 days ago1665136811IN
0xb245Ab0d...2591557A2
0 ETH0.002302696.1036984
Deploy Dynaset156954772022-10-07 9:57:35800 days ago1665136655IN
0xb245Ab0d...2591557A2
0 ETH0.021079015.97443301
Assign Tvl Oracl...156953852022-10-07 9:39:11800 days ago1665135551IN
0xb245Ab0d...2591557A2
0 ETH0.000479885.97828988
Initialise Dynas...156953782022-10-07 9:37:47800 days ago1665135467IN
0xb245Ab0d...2591557A2
0 ETH0.002455946.40325481
Deploy Dynaset156953642022-10-07 9:34:59800 days ago1665135299IN
0xb245Ab0d...2591557A2
0 ETH0.02351676.63319974

Latest 3 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
163483612023-01-06 14:33:11709 days ago1673015591
0xb245Ab0d...2591557A2
 Contract Creation0 ETH
156954772022-10-07 9:57:35800 days ago1665136655
0xb245Ab0d...2591557A2
 Contract Creation0 ETH
156953642022-10-07 9:34:59800 days ago1665135299
0xb245Ab0d...2591557A2
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DynasetFactory

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : DynasetFactory.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

/* ========== External Inheritance ========== */
import "./AbstractDynasetFactory.sol";
import "./Dynaset.sol";

/**
 * @title DynasetFactory
 * @author singdaodev
 */
contract DynasetFactory is AbstractDynasetFactory {
    constructor(address gnosis)
        AbstractDynasetFactory(gnosis) {
    }

    /* ==========  External Functions  ========== */

    /**   @notice Creates new dynaset contract
     * @dev dam and controller can can not be zero as the checks are
            added to constructor of Dynaset contract
     * @param dam us the asset manager of the new deployed dynaset.
     * @param controller will is the BLACK_SMITH role user for dynaset contract.
     * @param name, @param symbol will be used for dynaset ERC20 token
     */
    function deployDynaset(
        address dam,
        address controller,
        string calldata name,
        string calldata symbol
    ) external override onlyOwner {
        Dynaset dynaset = new Dynaset(
            address(this),
            dam,
            controller,
            name,
            symbol
        );
        dynasetList[address(dynaset)] = DynasetEntity({
            name: name,
            bound: true,
            initialised: false,
            forge: address(0),
            dynaddress: address(dynaset),
            performanceFee: 0,
            managementFee: 0,
            timelock: block.timestamp + 30 days,
            tvlSnapshot: 0
        });
        dynasets.push(address(dynaset));
        emit NewDynaset(address(dynaset), dam, controller);
    }

}

File 2 of 21 : Dynaset.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

import "./libs/OneInchSwapValidation.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/OneInchAggregator.sol";
import "./AbstractDynaset.sol";

contract Dynaset is AbstractDynaset {
    using SafeERC20 for IERC20;
    using OneInchSwapValidation for address;

    /* ==========  Constants  ========== */
    address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d;
    address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

    /* ==========  State variables  ========== */
    address public uniswapV2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
    uint256 public deadline;

    /* ==========  Events  ========== */
    event Swap(
        address indexed tokenIn,
        address indexed tokenOut,
        uint256 amountIn,
        uint256 amountOutMin
    );

    /* ==========  Constructor  ========== */
    constructor(
        address factoryContract,
        address dam,
        address controller_,
        string memory name,
        string memory symbol
    ) AbstractDynaset(factoryContract, dam, controller_, name, symbol) {
    }

    /* ==========  Token Swaps  ========== */
    function swapUniswap(
        address tokenIn,
        address tokenOut,
        uint256 amountIn,
        uint256 amountOutMin
    ) external payable nonReentrant {
        onlyDigitalAssetManager();
        _checkBounds(tokenIn, tokenOut); 
        //next we need to allow the uniswapv2 router to spend the token we just sent to this contract
        //by calling IERC20 approve you allow the uniswap contract to spend the tokens in this contract
        IERC20(tokenIn).safeIncreaseAllowance(uniswapV2Router, amountIn);
        //path is an array of addresses.
        //this path array will have 3 addresses [tokenIn, WETH, tokenOut]
        //the if statement below takes into account if token in or token out is WETH.  then the path is only 2 addresses
        address[] memory path;
        if (tokenIn == WETH || tokenOut == WETH) {
            path = new address[](2);
            path[0] = tokenIn;
            path[1] = tokenOut;
        } else {
            path = new address[](3);
            path[0] = tokenIn;
            path[1] = WETH;
            path[2] = tokenOut;
        }
        //then we will call swapExactTokensForTokens
        //for the deadline we will pass in block.timestamp + deadline
        //the deadline is the latest time the trade is valid for
        IUniswapV2Router(uniswapV2Router).swapExactTokensForTokens(
            amountIn,
            amountOutMin,
            path,
            address(this),
            block.timestamp + deadline
        );
        _afterSwap(tokenIn, tokenOut, amountIn, amountOutMin);
    }



    // swap using 1inch API
    function swapOneInch(
        address tokenIn,
        address tokenOut,
        uint256 amount,
        uint256 minReturn,
        bytes32[] calldata pools
    ) external payable nonReentrant {
        onlyDigitalAssetManager();
        _checkBounds(tokenIn, tokenOut); 
        tokenIn.validateUnoswap(tokenOut, pools);
        IERC20(tokenIn).safeIncreaseAllowance(ONEINCH_V4_AGREGATION_ROUTER, amount);
        OneInchAggregator(ONEINCH_V4_AGREGATION_ROUTER).unoswap(
            tokenIn,
            amount,
            minReturn,
            pools
        );
        _afterSwap(tokenIn, tokenOut, amount, minReturn);
    }

    // swap on uniswapV3 using 1inch API
    function swapOneInchUniV3(
        address tokenIn,
        address tokenOut,
        uint256 amount,
        uint256 minReturn,
        uint256[] calldata pools
    ) external payable nonReentrant {
        onlyDigitalAssetManager();
        _checkBounds(tokenIn, tokenOut); 
        tokenIn.validateUniswapV3Swap(tokenOut, pools);
        IERC20(tokenIn).safeIncreaseAllowance(ONEINCH_V4_AGREGATION_ROUTER, amount);
        OneInchAggregator(ONEINCH_V4_AGREGATION_ROUTER).uniswapV3Swap(
            amount,
            minReturn,
            pools
        );
        _afterSwap(tokenIn, tokenOut, amount, minReturn);
    }
    
    /* =========== Internal functions ============ */
    
    function _checkBounds(address tokenIn, address tokenOut) internal view {
        require(records[tokenIn].bound, "ERR_NOT_BOUND");
        require(records[tokenOut].bound, "ERR_NOT_BOUND");    
    }
    
    function _afterSwap(address tokenIn, address tokenOut, uint256 amount, uint256 minReturn) internal {
        updateAfterSwap(tokenIn, tokenOut);
        emit Swap(tokenIn, tokenOut, amount, minReturn);    
    }

    /* =========== Privileged configuration functions ============ */

    function setDeadline(uint256 newDeadline) external {
        onlyController();
        deadline = newDeadline;
    }

    function upgradeUniswapV2Router(address newUniswapV2Router) external {
        onlyController();
        require(newUniswapV2Router != address(0), "ERR_ADDRESS_ZERO");
        uniswapV2Router = newUniswapV2Router;
    }

}

File 3 of 21 : AbstractDynasetFactory.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

/* ========== External Inheritance ========== */
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IDynasetTvlOracle.sol";
import "./interfaces/IDynasetContract.sol";

/**
 * @title DynasetFactory
 * @author singdaodev
 */
abstract contract AbstractDynasetFactory is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    /* ==========  Constants  ========== */
    
    address public constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
    uint256 public constant WITHDRAW_FEE_FACTOR = 10000;
    // Performance fee should be less than 25%
    uint16 public constant MAX_PERFORMANCE_FEE_FACTOR = 2500;
    // Management fee should be less than 5%
    uint16 public constant MAX_MANAGEMENT_FEE_FACTOR = 500;

    /* ==========  Storage  ========== */

    struct DynasetEntity {
        string name;
        bool bound;
        bool initialised;
        address forge;
        address dynaddress;
        uint16 performanceFee;
        uint16 managementFee;
        uint256 timelock;
        uint256 tvlSnapshot;
    }
    // multisig contract where performance fee is collected
    address public gnosisSafe;
    address[] public dynasets;
    mapping(address => DynasetEntity) internal dynasetList;
    mapping(address => address) internal oracleList;

    /* ==========  Events  ========== */

    /** @dev Emitted when dynaset is deployed. */
    event NewDynaset(
        address indexed dynaset,
        address indexed dam,
        address indexed controller
    );
    event FeeCollected(address indexed dynaset, uint256 indexed amount);
    event OracleAssigned(
        address indexed dynaset,
        address indexed oracleAddress
    );
    event InitialiseDynaset(
        address indexed dynasetAddress,
        address[] tokens,
        address indexed tokenProvider,
        uint16 performanceFee,
        uint16 managementFee
    );
    event DynasetTvlSet(address indexed dynaset, uint256 indexed tvl);

    /* ========== Dynaset Deployment  ========== */

    /**
     * @dev Deploys a dynaset
     *
     * Note: To support future interfaces, this does not initialize or
     * configure the pool, this must be executed by the controller.
     *
     * Note: Must be called by an approved admin.
     *
     */
    constructor(address gnosis) {
        require(gnosis != address(0), "ERR_ZERO_ADDRESS");
        gnosisSafe = gnosis;
    }

    /* ==========  External Functions  ========== */

    /**   @notice Creates new dynaset contract
     * @dev dam and controller can can not be zero as the checks are
            added to constructor of Dynaset contract
     * @param dam us the asset manager of the new deployed dynaset.
     * @param controller will is the BLACK_SMITH role user for dynaset contract.
     * @param name, @param symbol will be used for dynaset ERC20 token
     */
    function deployDynaset(
        address dam,
        address controller,
        string calldata name,
        string calldata symbol
    ) external virtual;

    /**
     * @notice initializes the dynaset contract with tokens.
     * @param dynasetAddress is the dynaset contract address.
     * @param  tokens is the tokens list that will be initialized.
     * @param balances are the initial balance for initialized tokens.
     * @param balances and @param tokens length should be same.
     * the balances for initialization will be transfered from
     * @param tokenProvider address
     * @dev all @param tokens for @param balance must be approved first.
     */
    function initialiseDynaset(
        address dynasetAddress,
        address[] calldata tokens,
        uint256[] calldata balances,
        address tokenProvider,
        uint16 performanceFeeFactor,
        uint16 managementFeeFactor
    ) external onlyOwner {
        // require(_dynasetlist[_dynaset].dynaddress, "ERR_NOT_AUTH");
        require(dynasetList[dynasetAddress].bound, "ADDRESS_NOT_DYNASET");
        require(
            performanceFeeFactor <= MAX_PERFORMANCE_FEE_FACTOR,
            "ERR_HIGH_PERFORMANCE_FEE"
        );
        require(
            managementFeeFactor <= MAX_MANAGEMENT_FEE_FACTOR,
            "ERR_HIGH_MANAGEMENT_FEE"
        );
        require(
            !dynasetList[dynasetAddress].initialised,
            "ERR_ALREADY_INITIALISED"
        );

        IDynasetContract dynaset = IDynasetContract(dynasetAddress);
        dynasetList[dynasetAddress].initialised = true;
        dynasetList[dynasetAddress].performanceFee = performanceFeeFactor;
        dynasetList[dynasetAddress].managementFee = managementFeeFactor;
        dynaset.initialize(tokens, balances, tokenProvider);

        emit InitialiseDynaset(
            dynasetAddress,
            tokens,
            tokenProvider,
            performanceFeeFactor,
            managementFeeFactor
        );
    }

    /**
     * @dev assign which oracle to use for calculating tvl.
     * @notice this function can be called to update the oracle of dynaset as well
     * @param dynaset is the dynasetContract address
     * @param oracle is the DynasetTvlOracle contract which has to be initialized
     * using the @param dynaset address
     */
    function assignTvlOracle(address dynaset, address oracle)
        external
        onlyOwner
        nonReentrant
    {
        require(dynasetList[dynaset].bound, "ADDRESS_NOT_DYNASET");
        oracleList[dynaset] = oracle;
        IDynasetContract(dynaset).setDynasetOracle(oracle);
        emit OracleAssigned(dynaset, oracle);
    }

    function assignTvlSnapshot(address dynasetAddress)
        external
        onlyOwner
        nonReentrant
    {
        require(dynasetList[dynasetAddress].bound, "ADDRESS_NOT_DYNASET");
        require(
            dynasetList[dynasetAddress].tvlSnapshot == 0,
            "ERR_SNAPSHOT_SET"
        );
        uint256 totalvalue = IDynasetTvlOracle(getDynasetOracle(dynasetAddress))
            .dynasetTvlUsdc();

        dynasetList[dynasetAddress].tvlSnapshot = totalvalue;
        emit DynasetTvlSet(dynasetAddress, totalvalue);
    }

    /**  @notice collects fee from dynaset contract.
    * Fee can only be collected after atleast 30 days.
    * total fee collected will be performanceFee + managementFee
     @dev collected fee is in USDC token.
     @param dynasetAddress is address of dynaset contract.
    */
    function collectFee(address dynasetAddress)
        external
        onlyOwner
        nonReentrant
    {
        require(dynasetList[dynasetAddress].bound, "ADDRESS_NOT_DYNASET");
        uint256 feeLock = dynasetList[dynasetAddress].timelock;
        require(block.timestamp >= feeLock, "ERR_FEE_PRRIOD_LOCKED");

        uint256 snapshot = dynasetList[dynasetAddress].tvlSnapshot;
        require(snapshot > 0, "ERR_TVL_NOT_SET");
        uint256 totalValue = IDynasetTvlOracle(getDynasetOracle(dynasetAddress))
            .dynasetTvlUsdc();
        uint256 withdrawFee_;

        if (totalValue > snapshot) {
            // withdrawFee_ = (performance * (performanceFeeFactor) ) / 10,000
            withdrawFee_ =
                ((totalValue - snapshot) *
                    dynasetList[dynasetAddress].performanceFee) /
                (WITHDRAW_FEE_FACTOR);
        }

        uint256 managementFee = (totalValue *
            dynasetList[dynasetAddress].managementFee) / (WITHDRAW_FEE_FACTOR);
        uint256 timeSinceLastFeeCollection = block.timestamp -
            (dynasetList[dynasetAddress].timelock - 30 days);

        // managementFee = (0-5 % of tvl) * (no. sec from last fee collection / no. sec in year);
        uint256 managementFeeAnnualised = (managementFee *
            (timeSinceLastFeeCollection)) / (365 days);
        uint256 finalFee = managementFeeAnnualised + withdrawFee_;

        require(
            IERC20(USDC).balanceOf(dynasetAddress) >= finalFee,
            "ERR_INSUFFICIENT_USDC"
        );
        dynasetList[dynasetAddress].timelock = block.timestamp + 30 days;
        IDynasetContract(dynasetAddress).withdrawFee(USDC, finalFee);
        emit FeeCollected(dynasetAddress, finalFee);
    }

    /**  @notice fee collected from dynasets is transfered to
     * externaly owned account.
     * the account is set in constructor gnosisSafe.
     * NOTE NO user funds are transfered or withdrawn.
     * only the fee collected from dynasets is transfered
     */
    function withdrawFee(address tokenAddress, uint256 amount)
        external
        onlyOwner
    {
        require(amount > 0, "ERR_INVALID_AMOUNT");
        IERC20 token = IERC20(tokenAddress);
        require(
            token.balanceOf(address(this)) >= amount,
            "ERR_INSUFFICUENT_BALANCE"
        );
        token.safeTransfer(gnosisSafe, amount);
    }

    function updateGnosisSafe(address newGnosisSafe) external onlyOwner {
        require(newGnosisSafe != address(0), "ERR_ZERO_ADDRESS");
        gnosisSafe = newGnosisSafe;
    }

    /* ==========  Public Functions  ========== */

    function getDynasetOracle(address dynaset)
        public
        view
        returns (address oracle)
    {
        require(oracleList[dynaset] != address(0), "ERR_ORACLE_UNASSIGNED");
        return oracleList[dynaset];
    }
}

File 4 of 21 : AbstractDynaset.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

/* ========== Internal Inheritance ========== */
import {DToken} from "./DToken.sol";

/* ========== Internal Interfaces ========== */
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IDynasetContract.sol";
import "./interfaces/IUniswapV2Router.sol";
import "./interfaces/IDynasetTvlOracle.sol";
import "./balancer/BNum.sol";

/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol

This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.

Subject to the GPL-3.0 license 
*************************************************************************************************/
abstract contract AbstractDynaset is DToken, BNum, IDynasetContract, ReentrancyGuard {
    using SafeERC20 for IERC20;

    /* ==========  Storage  ========== */

    // Account with CONTROL role.
    // set mint/burn forges.
    address internal controller;

    address internal factory;

    address internal digitalAssetManager;

    mapping(address => bool) internal mintForges;
    mapping(address => bool) internal burnForges;
    // Array of underlying tokens in the dynaset.
    address[] internal dynasetTokens;
    // Internal records of the dynaset's underlying tokens
    mapping(address => Record) internal records;
    address internal dynasetTvlOracle;

    /* ==========  Events  ========== */

    event LogTokenAdded(address indexed tokenIn, address indexed provider);
    event LogTokenRemoved(address indexed tokenOut);
    event DynasetInitialized(
        address[] indexed tokens,
        uint256[] balances,
        address indexed tokenProvider
    );
    event MintForge(address indexed forgeAddress);
    event BurnForge(address indexed forgeAddress);
    event WithdrawalFee(address token, uint256 indexed amount);

    /* ==========  Access Modifiers (changed to internal functions to decrease contract size)  ========== */

    function onlyFactory() internal view {
        require(msg.sender == factory, "ERR_NOT_FACTORY");
    }

    function onlyController() internal view {
        require(msg.sender == controller, "ERR_NOT_CONTROLLER");
    }

    function onlyDigitalAssetManager() internal view {
        require(msg.sender == digitalAssetManager, "ERR_NOT_DAM");
    }

    /* ==========  Constructor  ========== */
    constructor(
        address factoryContract,
        address dam,
        address controller_,
        string memory name,
        string memory symbol
    ) {
        require(
            factoryContract != address(0) &&
                dam != address(0) &&
                controller_ != address(0),
            "ERR_ZERO_ADDRESS"
        );
        factory = factoryContract;
        controller = controller_;
        digitalAssetManager = dam;
        _initializeToken(name, symbol);
    }

    /* ==========  External Functions  ========== */
    /**
     * @dev Sets up the initial assets for the pool.
     *
     * Note: `tokenProvider` must have approved the pool to transfer the
     * corresponding `balances` of `tokens`.
     *
     * @param tokens Underlying tokens to initialize the pool with
     * @param balances Initial balances to transfer
     * @param tokenProvider Address to transfer the balances from
     */
    function initialize(
        address[] calldata tokens,
        uint256[] calldata balances,
        address tokenProvider
    ) external nonReentrant override {
        onlyFactory();
        require(dynasetTokens.length == 0, "ERR_INITIALIZED");
        require(tokenProvider != address(0), "INVALID_TOKEN_PROVIDER");
        uint256 len = tokens.length;
        require(len >= MIN_BOUND_TOKENS, "ERR_MIN_TOKENS");
        require(len <= MAX_BOUND_TOKENS, "ERR_MAX_TOKENS");
        _mint(INIT_POOL_SUPPLY);
        address token;
        uint256 balance;
        for (uint256 i = 0; i < len; i++) {
            token = tokens[i];
            require(token != address(0), "INVALID_TOKEN");
            balance = balances[i];
            require(balance > 0, "ERR_MIN_BALANCE");
            records[token] = Record({
                bound: true,
                ready: true,
                index: uint8(i),
                balance: balance
            });

            dynasetTokens.push(token);
            // ! external interaction
            _pullUnderlying(token, tokenProvider, balance);
        }
        _push(tokenProvider, INIT_POOL_SUPPLY);
        emit DynasetInitialized(tokens, balances, tokenProvider);
    }

    function addToken(
        address token,
        uint256 minimumBalance,
        address tokenProvider
    ) external nonReentrant {
        onlyDigitalAssetManager();
        require(token != address(0), "ERR_ZERO_TOKEN");
        require(dynasetTokens.length < MAX_BOUND_TOKENS, "ERR_MAX_TOKENS");
        require(tokenProvider != address(0), "ERR_ZERO_TOKEN_PROVIDER");
        require(!records[token].bound, "ERR_IS_BOUND");
        require(minimumBalance > 0, "ERR_MIN_BALANCE");
        require(
            IERC20(token).allowance(address(tokenProvider), address(this)) >=
                minimumBalance,
            "ERR_INSUFFICIENT_ALLOWANCE"
        );
        records[token] = Record({
            bound: true,
            ready: true,
            index: uint8(dynasetTokens.length),
            balance: minimumBalance
        });
        dynasetTokens.push(token);
        _pullUnderlying(token, tokenProvider, minimumBalance);
        emit LogTokenAdded(token, tokenProvider);
    }

    function removeToken(address token) external nonReentrant {
        onlyDigitalAssetManager();
        require(dynasetTokens.length > MIN_BOUND_TOKENS, "ERR_MIN_TOKENS");
        Record memory record = records[token];
        uint256 tokenBalance = record.balance;
        require(tokenBalance == 0, "ERR_CAN_NOT_REMOVE_TOKEN");
        // Swap the token-to-unbind with the last token,
        // then delete the last token
        uint256 index = record.index;
        uint256 last = dynasetTokens.length - 1;
        // Only swap the token with the last token if it is not
        // already at the end of the array.
        if (index != last) {
            dynasetTokens[index] = dynasetTokens[last];
            records[dynasetTokens[index]].index = uint8(index);
            records[dynasetTokens[index]].balance = records[dynasetTokens[last]]
                .balance;
        }
        dynasetTokens.pop();
        records[token] = Record({
            bound: false,
            ready: false,
            index: 0,
            balance: 0
        });
        emit LogTokenRemoved(token);
    }

    function setMintForge(address newMintForge) external {
        onlyController();
        require(!mintForges[newMintForge], "ERR_FORGE_ALREADY_ADDED");
        mintForges[newMintForge] = true;
        emit MintForge(newMintForge);
    }

    function setBurnForge(address newBurnForge) external {
        onlyController();
        require(!burnForges[newBurnForge], "ERR_FORGE_ALREADY_ADDED");
        burnForges[newBurnForge] = true;
        emit BurnForge(newBurnForge);
    }

    function setDynasetOracle(address oracleAddress) external {
        onlyFactory();
        dynasetTvlOracle = oracleAddress;
    }

    /**
    NOTE The function can only be called using dynaset factory contract.
    * It is made sure that fee is not taken too frequently or 
    * not more than 25% more details can be found in DynasetFactory contract 
    * collectFee funciton.
    */
    function withdrawFee(address token, uint256 amount) external {
        onlyFactory();
        IERC20 token_ = IERC20(token);
        token_.safeTransfer(msg.sender, amount);
        emit WithdrawalFee(token, amount);
    }

    /**
     *
     * @param amount is number of dynaset amount
     * @return tokens returns the tokens list in the dynasets and
     * their respective @return amounts which combines make same
     * usd value as the amount of dynasets
     */
    function calcTokensForAmount(uint256 amount)
        external
        view
        returns (address[] memory tokens, uint256[] memory amounts)
    {
        uint256 dynasetTotal = totalSupply();
        uint256 ratio = bdiv(amount, dynasetTotal);
        require(ratio != 0, "ERR_MATH_APPROX");
        tokens = dynasetTokens;
        amounts = new uint256[](dynasetTokens.length);
        uint256 tokenAmountIn;
        for (uint256 i = 0; i < dynasetTokens.length; i++) {
            (Record memory record, ) = _getInputToken(tokens[i]);
            tokenAmountIn = bmul(ratio, record.balance);
            amounts[i] = tokenAmountIn;
        }
    }

    function getTokenAmounts()
        external
        view
        returns (address[] memory tokens, uint256[] memory amounts)
    {
        tokens = dynasetTokens;
        amounts = new uint256[](dynasetTokens.length);
        for (uint256 i = 0; i < dynasetTokens.length; i++) {
            amounts[i] = records[tokens[i]].balance;
        }
    }

    /**
     * @dev Returns the controller address.
     */
    function getController() external view override returns (address) {
        return controller;
    }

    /**
     * @dev Check if a token is bound to the dynaset.
     */
    function isBound(address token) external view override returns (bool) {
        return records[token].bound;
    }

    /**
     * @dev Get the number of tokens bound to the dynaset.
     */
    function getNumTokens() external view override returns (uint256) {
        return dynasetTokens.length;
    }

    /**
     * @dev Returns the record for a token bound to the dynaset.
     */
    function getTokenRecord(address token)
        external
        view
        override
        returns (Record memory record)
    {
        record = records[token];
        require(record.bound, "ERR_NOT_BOUND");
    }

    /**
     * @dev Returns the stored balance of a bound token.
     */
    function getBalance(address token)
        external
        view
        override
        returns (uint256)
    {
        Record memory record = records[token];
        require(record.bound, "ERR_NOT_BOUND");
        return record.balance;
    }

    /**
     * @dev Get all bound tokens.
     */
    function getCurrentTokens()
        external
        view
        override
        returns (address[] memory tokens)
    {
        tokens = dynasetTokens;
    }

    /* ==========  Public Functions  ========== */
    /**
     * @dev Absorb any tokens that have been sent to the dynaset.
     * If the token is not bound, it will be sent to the unbound
     * token handler.
     */
    function updateAfterSwap(address tokenIn, address tokenOut) public {
        uint256 balanceIn = IERC20(tokenIn).balanceOf(address(this));
        uint256 balanceOut = IERC20(tokenOut).balanceOf(address(this));

        records[tokenIn].balance = balanceIn;
        records[tokenOut].balance = balanceOut;
    }

    /*
     * @dev Mint new dynaset tokens by providing the proportional amount of each
     * underlying token's balance relative to the proportion of dynaset tokens minted.
     *
     * NOTE: function can only be called by the forge contracts and min/max amounts checks are
     * implemented in forge contracts.
     * For any underlying tokens which are not initialized, the caller must provide
     * the proportional share of the minimum balance for the token rather than the
     * actual balance.
     *
     * @param dynasetAmountOut Amount of dynaset tokens to mint
     * order as the dynaset's dynasetTokens list.
     */
    function joinDynaset(uint256 expectedSharesToMint)
        external
        override
        nonReentrant
        returns (uint256 sharesToMint)
    {
        require(mintForges[msg.sender], "ERR_NOT_FORGE");
        require(dynasetTvlOracle != address(0), "ERR_DYNASET_ORACLE_NOT_SET");
        sharesToMint = expectedSharesToMint;
        uint256 dynasetTotal = totalSupply();
        uint256 ratio = bdiv(sharesToMint, dynasetTotal);
        require(ratio != 0, "ERR_MATH_APPROX");
        uint256 tokenAmountIn;
        address token;
        uint256 dynaset_usd_value_before_join = IDynasetTvlOracle(dynasetTvlOracle).dynasetTvlUsdc();
        for (uint256 i = 0; i < dynasetTokens.length; i++) {
            token = dynasetTokens[i];
            (, uint256 realBalance) = _getInputToken(token);
            tokenAmountIn = bmul(ratio, realBalance);
            require(tokenAmountIn != 0, "ERR_MATH_APPROX");
            uint256 forgeTokenBalance = IERC20(token).balanceOf(msg.sender);
            if (forgeTokenBalance < tokenAmountIn) {
                tokenAmountIn = forgeTokenBalance;
            }
            uint256 forgeTokenAllowance = IERC20(token).allowance(msg.sender, address(this));
            if (forgeTokenAllowance < tokenAmountIn) {
               tokenAmountIn = forgeTokenAllowance;
            }
            _updateInputToken(token, badd(realBalance, tokenAmountIn));
            _pullUnderlying(token, msg.sender, tokenAmountIn);
            emit LOG_JOIN(token, msg.sender, tokenAmountIn);
        }
        // calculate correct sharesToMint
        uint256 dynaset_added_value = IDynasetTvlOracle(dynasetTvlOracle).dynasetTvlUsdc() 
                                      - dynaset_usd_value_before_join;
        sharesToMint = dynaset_added_value * dynasetTotal / dynaset_usd_value_before_join;
        require(sharesToMint > 0, "MINT_ZERO_DYNASETS");
        _mint(sharesToMint);
        _push(msg.sender, sharesToMint);
    }

    /**
     * @dev Burns `_amount` dynaset tokens in exchange for the amounts of each
     * underlying token's balance proportional to the ratio of tokens burned to
     * total dynaset supply.
     *
     * @param dynasetAmountIn Exact amount of dynaset tokens to burn
     */
    function exitDynaset(uint256 dynasetAmountIn)
        external
        override
        nonReentrant
    {
        require(burnForges[msg.sender], "ERR_NOT_FORGE");
        uint256 dynasetTotal = totalSupply();
        uint256 ratio = bdiv(dynasetAmountIn, dynasetTotal);
        require(ratio != 0, "ERR_MATH_APPROX");
        _pull(msg.sender, dynasetAmountIn);
        _burn(dynasetAmountIn);
        address token;
        Record memory record;
        uint256 tokenAmountOut;
        for (uint256 i = 0; i < dynasetTokens.length; i++) {
            token = dynasetTokens[i];
            record = records[token];
            require(record.ready, "ERR_OUT_NOT_READY");
            tokenAmountOut = bmul(ratio, record.balance);
            require(tokenAmountOut != 0, "ERR_MATH_APPROX");

            records[token].balance = bsub(record.balance, tokenAmountOut);
            _pushUnderlying(token, msg.sender, tokenAmountOut);
            emit LOG_EXIT(msg.sender, token, tokenAmountOut);
        }
    }

    /* ==========  Underlying Token Internal Functions  ========== */
    // 'Underlying' token-manipulation functions make external calls but are NOT locked
    function _pullUnderlying(
        address erc20,
        address from,
        uint256 amount
    ) internal {
        IERC20(erc20).safeTransferFrom(from, address(this), amount);
    }

    function _pushUnderlying(
        address erc20,
        address to,
        uint256 amount
    ) internal {
        IERC20(erc20).safeTransfer(to, amount);
    }

    /* ==========  Token Management Internal Functions  ========== */

    /**
     * @dev Handles weight changes and initialization of an
     * input token.
     * @param token Address of the input token
     * @param realBalance real balance is set to the records for token
     * and weight if the token was uninitialized.
     */
    function _updateInputToken(address token, uint256 realBalance) internal {
        records[token].balance = realBalance;
    }

    /* ==========  Token Query Internal Functions  ========== */

    /**
     * @dev Get the record for a token.
     * The token must be bound to the dynaset. If the token is not
     * initialized (meaning it does not have the minimum balance)
     * this function will return the actual balance of the token
     */
    function _getInputToken(address token)
        internal
        view
        returns (Record memory record, uint256 realBalance)
    {
        record = records[token];
        require(record.bound, "ERR_NOT_BOUND");
        realBalance = record.balance;
    }
}

File 5 of 21 : IUniswapV2Router.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

interface IUniswapV2Router {
    function swapExactTokensForTokens(
        //amount of tokens we are sending in
        uint256 amountIn,
        //the minimum amount of tokens we want out of the trade
        uint256 amountOutMin,
        //list of token addresses we are going to trade in.  this is necessary to calculate amounts
        address[] calldata path,
        //this is the address we are going to send the output tokens to
        address to,
        //the last time that the trade is valid for
        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 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);
}

File 6 of 21 : OneInchSwapValidation.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;
import "../interfaces/IUniswapV2Pair.sol";

library OneInchSwapValidation {
    function getOutputTokenForInputTokenAndPair(address tokenIn, address pair)
        internal
        view
        returns (address)
    {
        address token0 = IUniswapV2Pair(pair).token0();
        address token1 = IUniswapV2Pair(pair).token1();
        if (token0 == tokenIn) {
            return token1;
        }
        if (token1 == tokenIn) {
            return token0;
        }
        revert("ERR_TOKEN_MISSING_IN_PAIR");
    }

    function validateUnoswap(
        address tokenIn,
        address tokenOut,
        bytes32[] calldata pools
    ) internal view {
        address outputToken = tokenIn;
        for (uint8 i = 0; i < pools.length; i++) {
            outputToken = getOutputTokenForInputTokenAndPair(
                outputToken,
                address(uint160(uint256(pools[i])))
            );
        }
        require(outputToken == tokenOut, "ERR_OUTPUT_TOKEN");
    }

    function validateUniswapV3Swap(
        address tokenIn,
        address tokenOut,
        uint256[] calldata pools
    ) internal view {
        address outputToken = tokenIn;
        for (uint8 i = 0; i < pools.length; i++) {
            outputToken = getOutputTokenForInputTokenAndPair(
                outputToken,
                address(uint160(pools[i]))
            );
        }
        require(outputToken == tokenOut, "ERR_OUTPUT_TOKEN");
    }

    
}

File 7 of 21 : OneInchAggregator.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

interface OneInchAggregator {
    function unoswap(
        address srcToken,
        uint256 amount,
        uint256 minReturn,
        bytes32[] calldata _pools
    ) external payable returns (uint256 returnAmount);

    function uniswapV3Swap(
        uint256 amount,
        uint256 minReturn,
        uint256[] calldata pools
    ) external payable returns (uint256 returnAmount);
}

File 8 of 21 : DToken.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

import "./interfaces/IERC20.sol";

/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BToken.sol

This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.

Subject to the GPL-3.0 license
*************************************************************************************************/

contract DTokenBase {
    mapping(address => uint256) internal _balance;
    mapping(address => mapping(address => uint256)) internal _allowance;
    uint256 internal _totalSupply;

    event Transfer(address indexed src, address indexed dst, uint256 amt);

    function _mint(uint256 amt) internal {
        _balance[address(this)] = (_balance[address(this)] + amt);
        _totalSupply = (_totalSupply + amt);
        emit Transfer(address(0), address(this), amt);
    }

    function _burn(uint256 amt) internal {
        require(_balance[address(this)] >= amt, "ERR_INSUFFICIENT_BAL");
        _balance[address(this)] = (_balance[address(this)] - amt);
        _totalSupply = (_totalSupply - amt);
        emit Transfer(address(this), address(0), amt);
    }

    function _move(
        address src,
        address dst,
        uint256 amt
    ) internal {
        require(_balance[src] >= amt, "ERR_INSUFFICIENT_BAL");
        _balance[src] = (_balance[src] - amt);
        _balance[dst] = (_balance[dst] + amt);
        emit Transfer(src, dst, amt);
    }

    function _push(address to, uint256 amt) internal {
        _move(address(this), to, amt);
    }

    function _pull(address from, uint256 amt) internal {
        _move(from, address(this), amt);
    }
}

contract DToken is DTokenBase, IERC20 {
    uint8 private constant DECIMALS = 18;
    string private _name;
    string private _symbol;

    function _initializeToken(string memory name_, string memory symbol_)
        internal
    {
        require(
            bytes(_name).length == 0 &&
                bytes(name_).length != 0 &&
                bytes(symbol_).length != 0,
            "ERR_BTOKEN_INITIALIZED"
        );
        _name = name_;
        _symbol = symbol_;
    }

    function name() external view returns (string memory) {
        return _name;
    }

    function symbol() external view returns (string memory) {
        return _symbol;
    }

    function decimals() external pure returns (uint8) {
        return DECIMALS;
    }

    function allowance(address src, address dst)
        external
        view
        override
        returns (uint256)
    {
        return _allowance[src][dst];
    }

    function balanceOf(address whom) external view override returns (uint256) {
        return _balance[whom];
    }

    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    function approve(address dst, uint256 amt)
        external
        override
        returns (bool)
    {
        _allowance[msg.sender][dst] = amt;
        emit Approval(msg.sender, dst, amt);
        return true;
    }

    function increaseApproval(address dst, uint256 amt)
        external
        returns (bool)
    {
        _allowance[msg.sender][dst] = (_allowance[msg.sender][dst] + amt);
        emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);
        return true;
    }

    function decreaseApproval(address dst, uint256 amt)
        external
        returns (bool)
    {
        uint256 oldValue = _allowance[msg.sender][dst];
        if (amt > oldValue) {
            _allowance[msg.sender][dst] = 0;
        } else {
            _allowance[msg.sender][dst] = (oldValue - amt);
        }
        emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);
        return true;
    }

    function transfer(address dst, uint256 amt)
        external
        override
        returns (bool)
    {
        _move(msg.sender, dst, amt);
        return true;
    }

    function transferFrom(
        address src,
        address dst,
        uint256 amt
    ) external override returns (bool) {
        require(
            msg.sender == src || amt <= _allowance[src][msg.sender],
            "ERR_BTOKEN_BAD_CALLER"
        );
        _move(src, dst, amt);
        if (
            msg.sender != src &&
            _allowance[src][msg.sender] != type(uint128).max
        ) {
            _allowance[src][msg.sender] = (_allowance[src][msg.sender] - amt);
            emit Approval(msg.sender, dst, _allowance[src][msg.sender]);
        }
        return true;
    }
}

File 9 of 21 : IDynasetContract.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

interface IDynasetContract {
    /**
     * @dev Token record data structure
     * @param bound is token bound to pool
     * @param ready has token been initialized
     * @param lastDenormUpdate timestamp of last denorm change
     * @param desiredDenorm desired denormalized weight (used for incremental changes)
     * @param index of address in tokens array
     * @param balance token balance
     */
    struct Record {
        bool bound; // is token bound to dynaset
        bool ready;
        uint256 index; // private
        uint256 balance;
    }

    event LOG_SWAP(
        address indexed caller,
        address indexed tokenIn,
        address indexed tokenOut,
        uint256 tokenAmountIn,
        uint256 tokenAmountOut
    );

    event LOG_JOIN(
        address indexed tokenIn,
        address indexed caller,
        uint256 tokenAmountIn
    );

    event LOG_EXIT(
        address indexed caller,
        address indexed tokenOut,
        uint256 tokenAmountOut
    );

    event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm);

    event LOG_DESIRED_DENORM_SET(address indexed token, uint256 desiredDenorm);

    event LOG_MINIMUM_BALANCE_UPDATED(address token, uint256 minimumBalance);

    event LOG_TOKEN_READY(address indexed token);

    event LOG_PUBLIC_SWAP_TOGGLED(bool enabled);

    function initialize(
        address[] calldata tokens,
        uint256[] calldata balances,
        address tokenProvider
    ) external;

    function joinDynaset(uint256 _amount) external returns (uint256);

    function exitDynaset(uint256 _amount) external;

    function getController() external view returns (address);

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

    function getNumTokens() external view returns (uint256);

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

    function getTokenRecord(address token)
        external
        view
        returns (Record memory record);

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

    function setDynasetOracle(address oracle) external;
    
    function withdrawFee(address token, uint256 amount) external;

}

File 10 of 21 : IDynasetTvlOracle.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

interface IDynasetTvlOracle {
    function dynasetTvlUsdc() external view returns (uint256 total_usd);

    function tokenUsdcValue(address _tokenIn, uint256 _amount) external view returns (uint256);

    function dynasetUsdcValuePerShare() external view returns (uint256);

    function dynasetTokenUsdcRatios() external view returns (address[] memory, uint256[] memory, uint256);
    
}

File 11 of 21 : BNum.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

import "./BConst.sol";

/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BNum.sol

This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.

Subject to the GPL-3.0 license
*************************************************************************************************/

contract BNum is BConst {
    function btoi(uint256 a) internal pure returns (uint256) {
        return a / BONE;
    }

    function bfloor(uint256 a) internal pure returns (uint256) {
        return btoi(a) * BONE;
    }

    function badd(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "ERR_ADD_OVERFLOW");
        return c;
    }

    function bsub(uint256 a, uint256 b) internal pure returns (uint256) {
        (uint256 c, bool flag) = bsubSign(a, b);
        require(!flag, "ERR_SUB_UNDERFLOW");
        return c;
    }

    function bsubSign(uint256 a, uint256 b)
        internal
        pure
        returns (uint256, bool)
    {
        if (a >= b) {
            return (a - b, false);
        } else {
            return (b - a, true);
        }
    }

    function bmul(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c0 = a * b;
        require(a == 0 || c0 / a == b, "ERR_MUL_OVERFLOW");
        uint256 c1 = c0 + (BONE / 2);
        require(c1 >= c0, "ERR_MUL_OVERFLOW");
        uint256 c2 = c1 / BONE;
        return c2;
    }

    function bdiv(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0, "ERR_DIV_ZERO");
        uint256 c0 = a * BONE;
        require(a == 0 || c0 / a == BONE, "ERR_DIV_INTERNAL"); // bmul overflow
        uint256 c1 = c0 + (b / 2);
        require(c1 >= c0, "ERR_DIV_INTERNAL"); //  badd require
        uint256 c2 = c1 / b;
        return c2;
    }

    // DSMath.wpow
    function bpowi(uint256 a, uint256 n) internal pure returns (uint256) {
        uint256 z = n % 2 != 0 ? a : BONE;

        for (n /= 2; n != 0; n /= 2) {
            a = bmul(a, a);

            if (n % 2 != 0) {
                z = bmul(z, a);
            }
        }
        return z;
    }

    // Compute b^(e.w) by splitting it into (b^e)*(b^0.w).
    // Use `bpowi` for `b^e` and `bpowK` for k iterations
    // of approximation of b^0.w
    function bpow(uint256 base, uint256 exp) internal pure returns (uint256) {
        require(base >= MIN_BPOW_BASE, "ERR_BPOW_BASE_TOO_LOW");
        require(base <= MAX_BPOW_BASE, "ERR_BPOW_BASE_TOO_HIGH");

        uint256 whole = bfloor(exp);
        uint256 remain = bsub(exp, whole);

        uint256 wholePow = bpowi(base, btoi(whole));

        if (remain == 0) {
            return wholePow;
        }

        uint256 partialResult = bpowApprox(base, remain, BPOW_PRECISION);
        return bmul(wholePow, partialResult);
    }

    function bpowApprox(
        uint256 base,
        uint256 exp,
        uint256 precision
    ) internal pure returns (uint256) {
        // term 0:
        uint256 a = exp;
        (uint256 x, bool xneg) = bsubSign(base, BONE);
        uint256 term = BONE;
        uint256 sum = term;
        bool negative = false;

        // term(k) = numer / denom
        //         = (product(a - i - 1, i=1-->k) * x^k) / (k!)
        // each iteration, multiply previous term by (a-(k-1)) * x / k
        // continue until term is less than precision
        for (uint256 i = 1; term >= precision; i++) {
            uint256 bigK = i * BONE;
            (uint256 c, bool cneg) = bsubSign(a, bsub(bigK, BONE));
            term = bmul(term, bmul(c, x));
            term = bdiv(term, bigK);
            if (term == 0) break;

            if (xneg) negative = !negative;
            if (cneg) negative = !negative;
            if (negative) {
                sum = bsub(sum, term);
            } else {
                sum = badd(sum, term);
            }
        }

        return sum;
    }
}

File 12 of 21 : 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 13 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.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));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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 14 of 21 : IERC20.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

interface IERC20 {
    event Approval(address indexed _src, address indexed _dst, uint256 _amount);

    function totalSupply() external view returns (uint256);

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

    function allowance(address _src, address _dst)
        external
        view
        returns (uint256);

    function approve(address _dst, uint256 _amount) external returns (bool);

    function transfer(address _dst, uint256 _amount) external returns (bool);

    function transferFrom(
        address _src,
        address _dst,
        uint256 _amount
    ) external returns (bool);
}

File 15 of 21 : BConst.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

/************************************************************************************************
Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BConst.sol

This source code has been modified from the original, which was copied from the github repository
at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f.

Subject to the GPL-3.0 license
*************************************************************************************************/

contract BConst {
    uint256 public constant VERSION_NUMBER = 1;

    /* ---  Weight Updates  --- */

    // Minimum time passed between each weight update for a token.
    uint256 internal constant WEIGHT_UPDATE_DELAY = 1 hours;

    // Maximum percent by which a weight can adjust at a time
    // relative to the current weight.
    // The number of iterations needed to move from weight A to weight B is the floor of:
    // (A > B): (ln(A) - ln(B)) / ln(1.01)
    // (B > A): (ln(A) - ln(B)) / ln(0.99)
    uint256 internal constant WEIGHT_CHANGE_PCT = BONE / 100;

    uint256 internal constant BONE = 10**18;

    uint256 internal constant MIN_BOUND_TOKENS = 2;
    uint256 internal constant MAX_BOUND_TOKENS = 20;
    // Minimum swap fee.
    uint256 internal constant MIN_FEE = BONE / 10**6;
    // Maximum swap or exit fee.
    uint256 internal constant MAX_FEE = BONE / 10;
    // Actual exit fee.
    uint256 internal constant EXIT_FEE = 5e15;

    // Minimum weight for any token (1/100).
    uint256 internal constant MIN_WEIGHT = BONE;
    uint256 internal constant MAX_WEIGHT = BONE * 50;
    // Maximum total weight.
    uint256 internal constant MAX_TOTAL_WEIGHT = BONE * 50;
    // Minimum balance for a token (only applied at initialization)
    // uint256 internal constant MIN_BALANCE = BONE / 10**12;
    // Initial pool tokens
    uint256 internal constant INIT_POOL_SUPPLY = BONE * 100;

    uint256 internal constant MIN_BPOW_BASE = 1 wei;
    uint256 internal constant MAX_BPOW_BASE = (2 * BONE) - 1 wei;
    uint256 internal constant BPOW_PRECISION = BONE / 10**10;

    // Maximum ratio of input tokens to balance for swaps.
    uint256 internal constant MAX_IN_RATIO = BONE / 2;
    // Maximum ratio of output tokens to balance for swaps.
    uint256 internal constant MAX_OUT_RATIO = (BONE / 3) + 1 wei;
}

File 16 of 21 : 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 17 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 18 of 21 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 19 of 21 : IUniswapV2Pair.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 20 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 21 of 21 : 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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"gnosis","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dynaset","type":"address"},{"indexed":true,"internalType":"uint256","name":"tvl","type":"uint256"}],"name":"DynasetTvlSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dynaset","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dynasetAddress","type":"address"},{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":true,"internalType":"address","name":"tokenProvider","type":"address"},{"indexed":false,"internalType":"uint16","name":"performanceFee","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"managementFee","type":"uint16"}],"name":"InitialiseDynaset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dynaset","type":"address"},{"indexed":true,"internalType":"address","name":"dam","type":"address"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"NewDynaset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dynaset","type":"address"},{"indexed":true,"internalType":"address","name":"oracleAddress","type":"address"}],"name":"OracleAssigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_MANAGEMENT_FEE_FACTOR","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PERFORMANCE_FEE_FACTOR","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_FEE_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dynaset","type":"address"},{"internalType":"address","name":"oracle","type":"address"}],"name":"assignTvlOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dynasetAddress","type":"address"}],"name":"assignTvlSnapshot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dynasetAddress","type":"address"}],"name":"collectFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dam","type":"address"},{"internalType":"address","name":"controller","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"deployDynaset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dynasets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dynaset","type":"address"}],"name":"getDynasetOracle","outputs":[{"internalType":"address","name":"oracle","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gnosisSafe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dynasetAddress","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"address","name":"tokenProvider","type":"address"},{"internalType":"uint16","name":"performanceFeeFactor","type":"uint16"},{"internalType":"uint16","name":"managementFeeFactor","type":"uint16"}],"name":"initialiseDynaset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGnosisSafe","type":"address"}],"name":"updateGnosisSafe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620060cb380380620060cb833981016040819052620000349162000109565b806200004033620000b9565b600180556001600160a01b038116620000925760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b604482015260640160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055506200013b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156200011c57600080fd5b81516001600160a01b03811681146200013457600080fd5b9392505050565b615f80806200014b6000396000f3fe60806040523480156200001157600080fd5b5060043610620001215760003560e01c80638da5cb5b11620000af578063ede9c548116200007a578063ede9c5481462000243578063ef1a0a71146200025a578063f2fde38b1462000273578063f8e12b57146200028a578063fd9be52214620002a157600080fd5b80638da5cb5b14620001ef57806390b24edb1462000201578063a84173ae1462000218578063ac7ff9a0146200022c57600080fd5b806373d603b711620000f057806373d603b71462000194578063870da6f114620001b257806389a3027114620001bc5780638b71cc8514620001d857600080fd5b806338f49060146200012657806362f5f111146200013f57806369b59e751462000173578063715018a6146200018a575b600080fd5b6200013d620001373660046200151d565b620002b8565b005b62000156620001503660046200151d565b62000333565b6040516001600160a01b0390911681526020015b60405180910390f35b6200013d620001843660046200151d565b620003b5565b6200013d6200081a565b6200019e6101f481565b60405161ffff90911681526020016200016a565b6200019e6109c481565b6200015673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b6200013d620001e936600462001587565b62000832565b6000546001600160a01b031662000156565b6200013d620002123660046200151d565b62000a6e565b60025462000156906001600160a01b031681565b6200013d6200023d3660046200167e565b62000c03565b6200013d620002543660046200173f565b62000e90565b6200026461271081565b6040519081526020016200016a565b6200013d620002843660046200151d565b62000fc2565b620001566200029b36600462001777565b62001041565b6200013d620002b236600462001791565b6200106c565b620002c26200119d565b6001600160a01b038116620003115760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b60448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03818116600090815260056020526040812054909116620003965760405162461bcd60e51b815260206004820152601560248201527411549497d3d49050d31157d5539054d4d251d39151605a1b604482015260640162000308565b506001600160a01b039081166000908152600560205260409020541690565b620003bf6200119d565b600260015403620003e45760405162461bcd60e51b81526004016200030890620017be565b600260019081556001600160a01b0382166000908152600460205260409020015460ff16620004275760405162461bcd60e51b81526004016200030890620017f5565b6001600160a01b038116600090815260046020526040902060030154428111156200048d5760405162461bcd60e51b815260206004820152601560248201527411549497d1915157d414949253d117d313d0d2d151605a1b604482015260640162000308565b6001600160a01b0382166000908152600460208190526040909120015480620004eb5760405162461bcd60e51b815260206004820152600f60248201526e11549497d5159317d393d517d4d155608a1b604482015260640162000308565b6000620004f88462000333565b6001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000536573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200055c919062001822565b9050600082821115620005bb576001600160a01b03851660009081526004602052604090206002015461271090600160a01b900461ffff16620005a0858562001852565b620005ac91906200186c565b620005b891906200188e565b90505b6001600160a01b03851660009081526004602052604081206002015461271090620005f290600160b01b900461ffff16856200186c565b620005fe91906200188e565b6001600160a01b038716600090815260046020526040812060030154919250906200062e9062278d009062001852565b6200063a904262001852565b905060006301e133806200064f83856200186c565b6200065b91906200188e565b905060006200066b8583620018b1565b6040516370a0823160e01b81526001600160a01b038b166004820152909150819073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48906370a0823190602401602060405180830381865afa158015620006c9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006ef919062001822565b1015620007375760405162461bcd60e51b81526020600482015260156024820152744552525f494e53554646494349454e545f5553444360581b604482015260640162000308565b620007464262278d00620018b1565b6001600160a01b038a166000818152600460208190526040918290206003019390935551637ecdf29160e11b815273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4892810192909252602482018390529063fd9be52290604401600060405180830381600087803b158015620007bc57600080fd5b505af1158015620007d1573d6000803e3d6000fd5b50506040518392506001600160a01b038c1691507f06c5efeff5c320943d265dc4e5f1af95ad523555ce0c1957e367dda5514572df90600090a350506001805550505050505050565b620008246200119d565b620008306000620011f9565b565b6200083c6200119d565b6000308787878787876040516200085390620014f2565b620008659796959493929190620018f5565b604051809103906000f08015801562000882573d6000803e3d6000fd5b50604080516101406020601f890181900402820181019092526101208101878152929350918291889088908190850183828082843760009201829052509385525050600160208401525060408201819052606082018190526001600160a01b038416608083015260a0820181905260c082015260e001620009074262278d00620018b1565b8152600060209182018190526001600160a01b038416815260049091526040902081518190620009389082620019f3565b50602082015160018281018054604080870151606088015161ffff1990931695151561ff0019169590951761010095151586021762010000600160b01b031916620100006001600160a01b039384160217909255608086015160028601805460a089015160c08a01519385166001600160b01b031990921691909117600160a01b61ffff928316021761ffff60b01b1916600160b01b919093160291909117905560e086015160038087019190915593909501516004909401939093558154908101825560009182527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319168585169081179091559151898416938b1692917fdd0f4d88527d1eb3cb443e15b9cae58853d927ef5095aae23a5f326368eb94ce91a450505050505050565b62000a786200119d565b60026001540362000a9d5760405162461bcd60e51b81526004016200030890620017be565b600260019081556001600160a01b0382166000908152600460205260409020015460ff1662000ae05760405162461bcd60e51b81526004016200030890620017f5565b6001600160a01b038116600090815260046020819052604090912001541562000b3f5760405162461bcd60e51b815260206004820152601060248201526f11549497d4d3905414d213d517d4d15560821b604482015260640162000308565b600062000b4c8262000333565b6001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000b8a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000bb0919062001822565b6001600160a01b03831660008181526004602081905260408083209091018490555192935083927fff06f63f7e4f2a23ca1763c7d5dcb7ce1a5a52106180fe0f811ede48b5700aa89190a3505060018055565b62000c0d6200119d565b6001600160a01b03881660009081526004602052604090206001015460ff1662000c4b5760405162461bcd60e51b81526004016200030890620017f5565b6109c461ffff8316111562000ca35760405162461bcd60e51b815260206004820152601860248201527f4552525f484947485f504552464f524d414e43455f4645450000000000000000604482015260640162000308565b6101f461ffff8216111562000cfb5760405162461bcd60e51b815260206004820152601760248201527f4552525f484947485f4d414e4147454d454e545f464545000000000000000000604482015260640162000308565b6001600160a01b038816600090815260046020526040902060010154610100900460ff161562000d6e5760405162461bcd60e51b815260206004820152601760248201527f4552525f414c52454144595f494e495449414c49534544000000000000000000604482015260640162000308565b6001600160a01b03881660008181526004602081905260409182902060018101805461ff001916610100179055600201805461ffff868116600160b01b0261ffff60b01b19918916600160a01b029190911663ffffffff60a01b1990921691909117179055905163b9d52f7160e01b81528a929163b9d52f719162000dfe918c918c918c918c918c910162001b0b565b600060405180830381600087803b15801562000e1957600080fd5b505af115801562000e2e573d6000803e3d6000fd5b50505050836001600160a01b0316896001600160a01b03167fd7f73f8a783505113d127acd0d84a444f198d7b42c82be38272d513a7ad146888a8a878760405162000e7d949392919062001b75565b60405180910390a3505050505050505050565b62000e9a6200119d565b60026001540362000ebf5760405162461bcd60e51b81526004016200030890620017be565b600260019081556001600160a01b0383166000908152600460205260409020015460ff1662000f025760405162461bcd60e51b81526004016200030890620017f5565b6001600160a01b038281166000818152600560205260409081902080546001600160a01b0319169385169384179055516365db091360e11b815260048101929092529063cbb6122690602401600060405180830381600087803b15801562000f6957600080fd5b505af115801562000f7e573d6000803e3d6000fd5b50506040516001600160a01b038085169350851691507fd35615cf633cdd04206b370029477f61d6ad0a5bac9f345812359d782d14e89c90600090a3505060018055565b62000fcc6200119d565b6001600160a01b038116620010335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000308565b6200103e81620011f9565b50565b600381815481106200105257600080fd5b6000918252602090912001546001600160a01b0316905081565b620010766200119d565b60008111620010bd5760405162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015260640162000308565b6040516370a0823160e01b8152306004820152829082906001600160a01b038316906370a0823190602401602060405180830381865afa15801562001106573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200112c919062001822565b10156200117c5760405162461bcd60e51b815260206004820152601860248201527f4552525f494e53554646494355454e545f42414c414e43450000000000000000604482015260640162000308565b60025462001198906001600160a01b0383811691168462001249565b505050565b6000546001600160a01b03163314620008305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000308565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526200119892869291600091620012dc9185169084906200135e565b805190915015620011985780806020019051810190620012fd919062001ba7565b620011985760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000308565b60606200136f848460008562001379565b90505b9392505050565b606082471015620013dc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000308565b6001600160a01b0385163b620014355760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000308565b600080866001600160a01b0316858760405162001453919062001bfe565b60006040518083038185875af1925050503d806000811462001492576040519150601f19603f3d011682016040523d82523d6000602084013e62001497565b606091505b5091509150620014a9828286620014b4565b979650505050505050565b60608315620014c557508162001372565b825115620014d65782518084602001fd5b8160405162461bcd60e51b815260040162000308919062001c1c565b6142f98062001c5283390190565b80356001600160a01b03811681146200151857600080fd5b919050565b6000602082840312156200153057600080fd5b620013728262001500565b60008083601f8401126200154e57600080fd5b50813567ffffffffffffffff8111156200156757600080fd5b6020830191508360208285010111156200158057600080fd5b9250929050565b60008060008060008060808789031215620015a157600080fd5b620015ac8762001500565b9550620015bc6020880162001500565b9450604087013567ffffffffffffffff80821115620015da57600080fd5b620015e88a838b016200153b565b909650945060608901359150808211156200160257600080fd5b506200161189828a016200153b565b979a9699509497509295939492505050565b60008083601f8401126200163657600080fd5b50813567ffffffffffffffff8111156200164f57600080fd5b6020830191508360208260051b85010111156200158057600080fd5b803561ffff811681146200151857600080fd5b60008060008060008060008060c0898b0312156200169b57600080fd5b620016a68962001500565b9750602089013567ffffffffffffffff80821115620016c457600080fd5b620016d28c838d0162001623565b909950975060408b0135915080821115620016ec57600080fd5b50620016fb8b828c0162001623565b909650945062001710905060608a0162001500565b92506200172060808a016200166b565b91506200173060a08a016200166b565b90509295985092959890939650565b600080604083850312156200175357600080fd5b6200175e8362001500565b91506200176e6020840162001500565b90509250929050565b6000602082840312156200178a57600080fd5b5035919050565b60008060408385031215620017a557600080fd5b620017b08362001500565b946020939093013593505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b602080825260139082015272105111149154d4d7d393d517d116539054d155606a1b604082015260600190565b6000602082840312156200183557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156200186757620018676200183c565b500390565b60008160001904831182151516156200188957620018896200183c565b500290565b600082620018ac57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115620018c757620018c76200183c565b500190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03888116825287811660208301528616604082015260a0606082018190526000906200192c9083018688620018cc565b828103608084015262001941818587620018cc565b9a9950505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200197a57607f821691505b6020821081036200199b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200119857600081815260208120601f850160051c81016020861015620019ca5750805b601f850160051c820191505b81811015620019eb57828155600101620019d6565b505050505050565b815167ffffffffffffffff81111562001a105762001a106200194f565b62001a288162001a21845462001965565b84620019a1565b602080601f83116001811462001a60576000841562001a475750858301515b600019600386901b1c1916600185901b178555620019eb565b600085815260208120601f198616915b8281101562001a915788860151825594840194600190910190840162001a70565b508582101562001ab05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8183526000602080850194508260005b8581101562001b00576001600160a01b0362001aec8362001500565b168752958201959082019060010162001ad0565b509495945050505050565b60608152600062001b2160608301878962001ac0565b82810360208401528481526001600160fb1b0385111562001b4157600080fd5b8460051b80876020840137600091016020019081526001600160a01b03939093166040929092019190915250949350505050565b60608152600062001b8b60608301868862001ac0565b61ffff9485166020840152929093166040909101529392505050565b60006020828403121562001bba57600080fd5b815180151581146200137257600080fd5b60005b8381101562001be857818101518382015260200162001bce565b8381111562001bf8576000848401525b50505050565b6000825162001c1281846020870162001bcb565b9190910192915050565b602081526000825180602084015262001c3d81604085016020870162001bcb565b601f01601f1916919091016040019291505056fe6080604052600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d1790553480156200003757600080fd5b50604051620042f9380380620042f98339810160408190526200005a91620002be565b600160055584848484846001600160a01b038516158015906200008557506001600160a01b03841615155b80156200009a57506001600160a01b03831615155b620000df5760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b60448201526064015b60405180910390fd5b600780546001600160a01b038088166001600160a01b03199283161790925560068054868416908316179055600880549287169290911691909117905562000128828262000138565b50505050505050505050620004bb565b60038054620001479062000361565b1590508015620001575750815115155b8015620001645750805115155b620001b25760405162461bcd60e51b815260206004820152601660248201527f4552525f42544f4b454e5f494e495449414c495a4544000000000000000000006044820152606401620000d6565b6003620001c08382620003ef565b506004620001cf8282620003ef565b505050565b80516001600160a01b0381168114620001ec57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200021957600080fd5b81516001600160401b0380821115620002365762000236620001f1565b604051601f8301601f19908116603f01168101908282118183101715620002615762000261620001f1565b816040528381526020925086838588010111156200027e57600080fd5b600091505b83821015620002a2578582018301518183018401529082019062000283565b83821115620002b45760008385830101525b9695505050505050565b600080600080600060a08688031215620002d757600080fd5b620002e286620001d4565b9450620002f260208701620001d4565b93506200030260408701620001d4565b60608701519093506001600160401b03808211156200032057600080fd5b6200032e89838a0162000207565b935060808801519150808211156200034557600080fd5b50620003548882890162000207565b9150509295509295909350565b600181811c908216806200037657607f821691505b6020821081036200039757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001cf57600081815260208120601f850160051c81016020861015620003c65750805b601f850160051c820191505b81811015620003e757828155600101620003d2565b505050505050565b81516001600160401b038111156200040b576200040b620001f1565b62000423816200041c845462000361565b846200039d565b602080601f8311600181146200045b5760008415620004425750858301515b600019600386901b1c1916600185901b178555620003e7565b600085815260208120601f198616915b828110156200048c578886015182559484019460019091019084016200046b565b5085821015620004ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613e2e80620004cb6000396000f3fe60806040526004361061021a5760003560e01c806370a0823111610123578063cbb61226116100ab578063d73dd6231161006f578063d73dd62314610666578063dd62ed3e14610686578063de009a44146106cc578063f8b2cb4f146106ec578063fd9be5221461070c57600080fd5b8063cbb61226146105da578063cc77828d146105fa578063cd2ed8fb1461061c578063cd4c690214610631578063d73cc4df1461065157600080fd5b806395d89b41116100f257806395d89b4114610545578063a766a3921461055a578063a9059cbb1461057a578063b9d52f711461059a578063c963ac98146105ba57600080fd5b806370a08231146104d45780637cb470d71461050a5780638025e3031461051d578063848955461461053257600080fd5b80632f37b624116101a6578063371babdc11610175578063371babdc146103ef5780633fe906751461041d5780635fa7b5841461043d57806364c7d6611461045d57806366188463146104b457600080fd5b80632f37b6241461035c5780633018205f14610395578063313ce567146103b3578063339c0528146103cf57600080fd5b806318160ddd116101ed57806318160ddd146102c7578063195199f6146102e657806323b872dd1461030657806323ddc5ab1461032657806329dcb0cf1461034657600080fd5b806306fdde031461021f578063095ea7b31461024a578063107783ec1461027a5780631694505e1461028f575b600080fd5b34801561022b57600080fd5b5061023461072c565b604051610241919061362d565b60405180910390f35b34801561025657600080fd5b5061026a610265366004613678565b6107be565b6040519015158152602001610241565b61028d6102883660046136e9565b610819565b005b34801561029b57600080fd5b50600e546102af906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102d357600080fd5b506002545b604051908152602001610241565b3480156102f257600080fd5b5061028d610301366004613765565b610934565b34801561031257600080fd5b5061026a61032136600461377e565b610941565b34801561033257600080fd5b5061028d610341366004613765565b610aa5565b34801561035257600080fd5b506102d8600f5481565b34801561036857600080fd5b5061026a6103773660046137bf565b6001600160a01b03166000908152600c602052604090205460ff1690565b3480156103a157600080fd5b506006546001600160a01b03166102af565b3480156103bf57600080fd5b5060405160128152602001610241565b3480156103db57600080fd5b5061028d6103ea3660046137bf565b610d12565b3480156103fb57600080fd5b5061040f61040a366004613765565b610dc9565b604051610241929190613820565b34801561042957600080fd5b506102d8610438366004613765565b610f2c565b34801561044957600080fd5b5061028d6104583660046137bf565b6113b2565b34801561046957600080fd5b5061047d6104783660046137bf565b611709565b6040516102419190815115158152602080830151151590820152604080830151908201526060918201519181019190915260800190565b3480156104c057600080fd5b5061026a6104cf366004613678565b6117a4565b3480156104e057600080fd5b506102d86104ef3660046137bf565b6001600160a01b031660009081526020819052604090205490565b61028d6105183660046136e9565b61187a565b34801561052957600080fd5b506102d8600181565b61028d610540366004613877565b61192d565b34801561055157600080fd5b50610234611bd7565b34801561056657600080fd5b5061028d6105753660046138bd565b611be6565b34801561058657600080fd5b5061026a610595366004613678565b611f5b565b3480156105a657600080fd5b5061028d6105b53660046138ff565b611f71565b3480156105c657600080fd5b5061028d6105d5366004613983565b612302565b3480156105e657600080fd5b5061028d6105f53660046137bf565b61240d565b34801561060657600080fd5b5061060f612437565b60405161024191906139bc565b34801561062857600080fd5b50600b546102d8565b34801561063d57600080fd5b5061028d61064c3660046137bf565b612498565b34801561065d57600080fd5b5061040f61250b565b34801561067257600080fd5b5061026a610681366004613678565b612637565b34801561069257600080fd5b506102d86106a1366004613983565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156106d857600080fd5b5061028d6106e73660046137bf565b6126ab565b3480156106f857600080fd5b506102d86107073660046137bf565b612762565b34801561071857600080fd5b5061028d610727366004613678565b6127dd565b60606003805461073b906139cf565b80601f0160208091040260200160405190810160405280929190818152602001828054610767906139cf565b80156107b45780601f10610789576101008083540402835291602001916107b4565b820191906000526020600020905b81548152906001019060200180831161079757829003601f168201915b5050505050905090565b3360008181526001602090815260408083206001600160a01b03871680855292528083208590555191929091600080516020613dd9833981519152906108079086815260200190565b60405180910390a35060015b92915050565b6002600554036108445760405162461bcd60e51b815260040161083b90613a09565b60405180910390fd5b600260055561085161283d565b61085b8686612887565b6108706001600160a01b0387168684846128fb565b6108986001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b6040516305d2b6d960e31b8152731111111254fb6c44bac0bed2854e76f90643097d90632e95b6c8906108d79089908890889088908890600401613a76565b6020604051808303816000875af11580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a9190613aa4565b5061092786868686612a8d565b5050600160055550505050565b61093c612af3565b600f55565b6000336001600160a01b038516148061097d57506001600160a01b03841660009081526001602090815260408083203384529091529020548211155b6109c15760405162461bcd60e51b815260206004820152601560248201527422a9292fa12a27a5a2a72fa120a22fa1a0a62622a960591b604482015260640161083b565b6109cc848484612b42565b336001600160a01b03851614801590610a1857506001600160a01b03841660009081526001602090815260408083203384529091529020546fffffffffffffffffffffffffffffffff14155b15610a9a576001600160a01b0384166000908152600160209081526040808320338452909152902054610a4c908390613ad3565b6001600160a01b038581166000908152600160209081526040808320338085529083529281902085905551938452918616929091600080516020613dd9833981519152910160405180910390a35b5060015b9392505050565b600260055403610ac75760405162461bcd60e51b815260040161083b90613a09565b6002600555336000908152600a602052604090205460ff16610b1b5760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b6000610b2660025490565b90506000610b348383612c4e565b905080600003610b565760405162461bcd60e51b815260040161083b90613aea565b610b603384612d73565b610b6983612d7e565b60408051608081018252600080825260208201819052918101829052606081018290526000805b600b54811015610d0457600b8181548110610bad57610bad613b13565b60009182526020808320909101546001600160a01b0316808352600c82526040928390208351608081018552815460ff808216151583526101009091041615159381018490526001820154948101949094526002015460608401529550909350610c4d5760405162461bcd60e51b81526020600482015260116024820152704552525f4f55545f4e4f545f524541445960781b604482015260640161083b565b610c5b858460600151612e4c565b915081600003610c7d5760405162461bcd60e51b815260040161083b90613aea565b610c8b836060015183612f27565b6001600160a01b0385166000908152600c6020526040902060020155610cb2843384612f84565b6040518281526001600160a01b0385169033907fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed9060200160405180910390a380610cfc81613b29565b915050610b90565b505060016005555050505050565b610d1a612af3565b6001600160a01b03811660009081526009602052604090205460ff1615610d7d5760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b038116600081815260096020526040808220805460ff19166001179055517f3e8033965d38bf14f7324229095da5e193ecb0204a77a56d309da0c94882fd279190a250565b6060806000610dd760025490565b90506000610de58583612c4e565b905080600003610e075760405162461bcd60e51b815260040161083b90613aea565b600b805480602002602001604051908101604052809291908181526020018280548015610e5d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e3f575b5050600b54939750505067ffffffffffffffff8211159050610e8157610e81613b42565b604051908082528060200260200182016040528015610eaa578160200160208202803683370190505b5092506000805b600b54811015610f23576000610edf878381518110610ed257610ed2613b13565b6020026020010151612f9d565b509050610ef0848260600151612e4c565b925082868381518110610f0557610f05613b13565b60209081029190910101525080610f1b81613b29565b915050610eb1565b50505050915091565b6000600260055403610f505760405162461bcd60e51b815260040161083b90613a09565b60026005553360009081526009602052604090205460ff16610fa45760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b600d546001600160a01b0316610ffc5760405162461bcd60e51b815260206004820152601a60248201527f4552525f44594e415345545f4f5241434c455f4e4f545f534554000000000000604482015260640161083b565b5080600061100960025490565b905060006110178383612c4e565b9050806000036110395760405162461bcd60e51b815260040161083b90613aea565b6000806000600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b59190613aa4565b905060005b600b548110156112ab57600b81815481106110d7576110d7613b13565b60009182526020822001546001600160a01b031693506110f684612f9d565b9150506111038682612e4c565b9450846000036111255760405162461bcd60e51b815260040161083b90613aea565b6040516370a0823160e01b81523360048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561116c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111909190613aa4565b90508581101561119e578095505b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0387169063dd62ed3e90604401602060405180830381865afa1580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f9190613aa4565b90508681101561121d578096505b61124a8661122b858a613040565b6001600160a01b039091166000908152600c6020526040902060020155565b611255863389613092565b60405187815233906001600160a01b038816907f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a9060200160405180910390a350505080806112a390613b29565b9150506110ba565b50600081600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190613aa4565b6113309190613ad3565b90508161133d8783613b58565b6113479190613b77565b96506000871161138e5760405162461bcd60e51b81526020600482015260126024820152714d494e545f5a45524f5f44594e415345545360701b604482015260640161083b565b611397876130a7565b6113a13388613118565b505060016005555092949350505050565b6002600554036113d45760405162461bcd60e51b815260040161083b90613a09565b60026005556113e161283d565b600b546002106114245760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b6001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158352610100909104161515928101929092526001810154928201929092526002909101546060820181905280156114ca5760405162461bcd60e51b815260206004820152601860248201527f4552525f43414e5f4e4f545f52454d4f56455f544f4b454e0000000000000000604482015260640161083b565b6040820151600b546000906114e190600190613ad3565b905080821461163857600b81815481106114fd576114fd613b13565b600091825260209091200154600b80546001600160a01b03909216918490811061152957611529613b13565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160ff16600c6000600b858154811061157257611572613b13565b60009182526020808320909101546001600160a01b03168352820192909252604001812060010191909155600b8054600c929190849081106115b6576115b6613b13565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060020154600c6000600b858154811061160f5761160f613b13565b60009182526020808320909101546001600160a01b031683528201929092526040019020600201555b600b80548061164957611649613b99565b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b038c16808852600c90965284872093518454935161ffff1990941690151561ff0019161761010093151593909302929092178355516001830155516002909101555190917f48207b8b88ad0363606ff7f381bc9ee60bb9b614b5dccd985ae4cb02af0f77c391a250506001600555505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158084526101009092041615159382019390935260018201549381019390935260020154606083015261179f5760405162461bcd60e51b815260040161083b90613baf565b919050565b3360009081526001602090815260408083206001600160a01b0386168452909152812054808311156117f9573360009081526001602090815260408083206001600160a01b0388168452909152812055611828565b6118038382613ad3565b3360009081526001602090815260408083206001600160a01b03891684529091529020555b3360008181526001602090815260408083206001600160a01b03891680855290835292819020549051908152919291600080516020613dd9833981519152910160405180910390a35060019392505050565b60026005540361189c5760405162461bcd60e51b815260040161083b90613a09565b60026005556118a961283d565b6118b38686612887565b6118c86001600160a01b038716868484613123565b6118f06001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b604051637224811760e11b8152731111111254fb6c44bac0bed2854e76f90643097d9063e449022e906108d7908790879087908790600401613bd6565b60026005540361194f5760405162461bcd60e51b815260040161083b90613a09565b600260055561195c61283d565b6119668484612887565b600e54611980906001600160a01b038681169116846129a2565b60606001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214806119c957506001600160a01b03841673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b15611a5b5760408051600280825260608201835290916020830190803683370190505090508481600081518110611a0257611a02613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110611a3657611a36613b13565b60200260200101906001600160a01b031690816001600160a01b031681525050611b2d565b6040805160038082526080820190925290602082016060803683370190505090508481600081518110611a9057611a90613b13565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600181518110611ad857611ad8613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600281518110611b0c57611b0c613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250505b600e54600f546001600160a01b03909116906338ed1739908590859085903090611b579042613bf6565b6040518663ffffffff1660e01b8152600401611b77959493929190613c0e565b6000604051808303816000875af1158015611b96573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bbe9190810190613c4a565b50611bcb85858585612a8d565b50506001600555505050565b60606004805461073b906139cf565b600260055403611c085760405162461bcd60e51b815260040161083b90613a09565b6002600555611c1561283d565b6001600160a01b038316611c5c5760405162461bcd60e51b815260206004820152600e60248201526d22a9292fad22a927afaa27a5a2a760911b604482015260640161083b565b600b54601411611c9f5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6001600160a01b038116611cf55760405162461bcd60e51b815260206004820152601760248201527f4552525f5a45524f5f544f4b454e5f50524f5649444552000000000000000000604482015260640161083b565b6001600160a01b0383166000908152600c602052604090205460ff1615611d4d5760405162461bcd60e51b815260206004820152600c60248201526b11549497d254d7d093d5539160a21b604482015260640161083b565b60008211611d8f5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604051636eb1769f60e11b81526001600160a01b03828116600483015230602483015283919085169063dd62ed3e90604401602060405180830381865afa158015611dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e029190613aa4565b1015611e505760405162461bcd60e51b815260206004820152601a60248201527f4552525f494e53554646494349454e545f414c4c4f57414e4345000000000000604482015260640161083b565b6040805160808101825260018082526020808301828152600b805460ff16858701908152606086018981526001600160a01b038b166000818152600c90965297852096518754945161ffff1990951690151561ff00191617610100941515949094029390931786555185850155905160029094019390935582549182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055611f11838284613092565b806001600160a01b0316836001600160a01b03167fad3294aab2ec3d457e8b2c34125e9cc6abb32088405c71d3701d59c189d1688b60405160405180910390a35050600160055550565b6000611f68338484612b42565b50600192915050565b600260055403611f935760405162461bcd60e51b815260040161083b90613a09565b6002600555611fa061316b565b600b5415611fe25760405162461bcd60e51b815260206004820152600f60248201526e11549497d253925512505312569151608a1b604482015260640161083b565b6001600160a01b0381166120315760405162461bcd60e51b815260206004820152601660248201527524a72b20a624a22faa27a5a2a72fa82927ab24a222a960511b604482015260640161083b565b8360028110156120745760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b60148111156120b65760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6120d16120cc670de0b6b3a76400006064613b58565b6130a7565b60008060005b8381101561227b578888828181106120f1576120f1613b13565b905060200201602081019061210691906137bf565b92506001600160a01b03831661214e5760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015260640161083b565b86868281811061216057612160613b13565b905060200201359150600082116121ab5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604080516080810182526001808252602080830182815260ff8616848601908152606085018881526001600160a01b038a166000818152600c90955296842095518654935161ffff1990941690151561ff0019161761010093151593909302929092178555518484015551600290930192909255600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055612269838684613092565b8061227381613b29565b9150506120d7565b5061229884612293670de0b6b3a76400006064613b58565b613118565b836001600160a01b031688886040516122b2929190613d08565b60405180910390207fee29c4ecb305fc552ccd2503b77a9b843043f6298df130f25f2c272716206ea088886040516122eb929190613d4a565b60405180910390a350506001600555505050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236d9190613aa4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156123b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123db9190613aa4565b6001600160a01b039485166000908152600c602052604080822060029081019590955594909516855292909320015550565b61241561316b565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600b8054806020026020016040519081016040528092919081815260200182805480156107b457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612471575050505050905090565b6124a0612af3565b6001600160a01b0381166124e95760405162461bcd60e51b815260206004820152601060248201526f4552525f414444524553535f5a45524f60801b604482015260640161083b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b606080600b80548060200260200160405190810160405280929190818152602001828054801561256457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612546575b5050600b54939550505067ffffffffffffffff821115905061258857612588613b42565b6040519080825280602002602001820160405280156125b1578160200160208202803683370190505b50905060005b600b5481101561263257600c60008483815181106125d7576125d7613b13565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002015482828151811061261557612615613b13565b60209081029190910101528061262a81613b29565b9150506125b7565b509091565b3360009081526001602090815260408083206001600160a01b0386168452909152812054612666908390613bf6565b3360008181526001602090815260408083206001600160a01b03891680855290835292819020859055519384529092600080516020613dd98339815191529101610807565b6126b3612af3565b6001600160a01b0381166000908152600a602052604090205460ff16156127165760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b0381166000818152600a6020526040808220805460ff19166001179055517fb8aafec1aa056456cdaa0f9446ba81026cd6950d76df9602a23f41435cde410a9190a250565b6001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff808216151580845261010090920416151594820194909452600182015492810192909252600201546060820152906127d35760405162461bcd60e51b815260040161083b90613baf565b6060015192915050565b6127e561316b565b816127fa6001600160a01b03821633846131b7565b6040516001600160a01b038416815282907fc18340ba98721bcff47f10f30da90ced66f2b96b9afed4cbdf4e0184b4a704699060200160405180910390a2505050565b6008546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600b60248201526a4552525f4e4f545f44414d60a81b604482015260640161083b565b565b6001600160a01b0382166000908152600c602052604090205460ff166128bf5760405162461bcd60e51b815260040161083b90613baf565b6001600160a01b0381166000908152600c602052604090205460ff166128f75760405162461bcd60e51b815260040161083b90613baf565b5050565b8360005b60ff8116831115612946576129328285858460ff1681811061292357612923613b13565b9050602002013560001c6131e7565b91508061293e81613d5e565b9150506128ff565b50836001600160a01b0316816001600160a01b03161461299b5760405162461bcd60e51b815260206004820152601060248201526f22a9292fa7aaaa282aaa2faa27a5a2a760811b604482015260640161083b565b5050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156129f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a179190613aa4565b612a219190613bf6565b6040516001600160a01b038516602482015260448101829052909150612a8790859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261333f565b50505050565b612a978484612302565b826001600160a01b0316846001600160a01b03167ffa2dda1cc1b86e41239702756b13effbc1a092b5c57e3ad320fbe4f3b13fe2358484604051612ae5929190918252602082015260400190565b60405180910390a350505050565b6006546001600160a01b031633146128855760405162461bcd60e51b815260206004820152601260248201527122a9292fa727aa2fa1a7a72a2927a62622a960711b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054811115612ba15760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054612bc5908290613ad3565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612bf5908290613bf6565b6001600160a01b038381166000818152602081815260409182902094909455518481529092918616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600081600003612c8f5760405162461bcd60e51b815260206004820152600c60248201526b4552525f4449565f5a45524f60a01b604482015260640161083b565b6000612ca3670de0b6b3a764000085613b58565b9050831580612cc25750670de0b6b3a7640000612cc08583613b77565b145b612d015760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d0e600285613b77565b612d189083613bf6565b905081811015612d5d5760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d698583613b77565b9695505050505050565b6128f7823083612b42565b30600090815260208190526040902054811115612dd45760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b30600090815260208190526040902054612def908290613ad3565b30600090815260208190526040902055600254612e0d908290613ad3565b60025560405181815260009030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350565b600080612e598385613b58565b9050831580612e70575082612e6e8583613b77565b145b612eaf5760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612ec46002670de0b6b3a7640000613b77565b612ece9083613bf6565b905081811015612f135760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612d69670de0b6b3a764000083613b77565b6000806000612f368585613411565b915091508015612f7c5760405162461bcd60e51b81526020600482015260116024820152704552525f5355425f554e444552464c4f5760781b604482015260640161083b565b509392505050565b612f986001600160a01b03841683836131b7565b505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff80821615158084526101009092041615159482019490945260018201549281019290925260020154606082015291906130345760405162461bcd60e51b815260040161083b90613baf565b81606001519050915091565b60008061304d8385613bf6565b905083811015610a9e5760405162461bcd60e51b815260206004820152601060248201526f4552525f4144445f4f564552464c4f5760801b604482015260640161083b565b612f986001600160a01b038416833084613448565b306000908152602081905260409020546130c2908290613bf6565b306000908152602081905260409020556002546130e0908290613bf6565b60025560405181815230906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612e41565b6128f7308383612b42565b8360005b60ff8116831115612946576131578285858460ff1681811061314b5761314b613b13565b905060200201356131e7565b91508061316381613d5e565b915050613127565b6007546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f545f464143544f525960881b604482015260640161083b565b6040516001600160a01b038316602482015260448101829052612f9890849063a9059cbb60e01b90606401612a50565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324c9190613d7d565b90506000836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561328e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132b29190613d7d565b9050846001600160a01b0316826001600160a01b0316036132d65791506108139050565b846001600160a01b0316816001600160a01b0316036132f757509050610813565b60405162461bcd60e51b815260206004820152601960248201527f4552525f544f4b454e5f4d495353494e475f494e5f5041495200000000000000604482015260640161083b565b6000613394826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134809092919063ffffffff16565b805190915015612f9857808060200190518101906133b29190613d9a565b612f985760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161083b565b600080828410613430576134258385613ad3565b600091509150613441565b61343a8484613ad3565b6001915091505b9250929050565b6040516001600160a01b0380851660248301528316604482015260648101829052612a879085906323b872dd60e01b90608401612a50565b606061348f8484600085613497565b949350505050565b6060824710156134f85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161083b565b6001600160a01b0385163b61354f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161083b565b600080866001600160a01b0316858760405161356b9190613dbc565b60006040518083038185875af1925050503d80600081146135a8576040519150601f19603f3d011682016040523d82523d6000602084013e6135ad565b606091505b50915091506135bd8282866135c8565b979650505050505050565b606083156135d7575081610a9e565b8251156135e75782518084602001fd5b8160405162461bcd60e51b815260040161083b919061362d565b60005b8381101561361c578181015183820152602001613604565b83811115612a875750506000910152565b602081526000825180602084015261364c816040850160208701613601565b601f01601f19169190910160400192915050565b6001600160a01b038116811461367557600080fd5b50565b6000806040838503121561368b57600080fd5b823561369681613660565b946020939093013593505050565b60008083601f8401126136b657600080fd5b50813567ffffffffffffffff8111156136ce57600080fd5b6020830191508360208260051b850101111561344157600080fd5b60008060008060008060a0878903121561370257600080fd5b863561370d81613660565b9550602087013561371d81613660565b94506040870135935060608701359250608087013567ffffffffffffffff81111561374757600080fd5b61375389828a016136a4565b979a9699509497509295939492505050565b60006020828403121561377757600080fd5b5035919050565b60008060006060848603121561379357600080fd5b833561379e81613660565b925060208401356137ae81613660565b929592945050506040919091013590565b6000602082840312156137d157600080fd5b8135610a9e81613660565b600081518084526020808501945080840160005b838110156138155781516001600160a01b0316875295820195908201906001016137f0565b509495945050505050565b60408152600061383360408301856137dc565b82810360208481019190915284518083528582019282019060005b8181101561386a5784518352938301939183019160010161384e565b5090979650505050505050565b6000806000806080858703121561388d57600080fd5b843561389881613660565b935060208501356138a881613660565b93969395505050506040820135916060013590565b6000806000606084860312156138d257600080fd5b83356138dd81613660565b92506020840135915060408401356138f481613660565b809150509250925092565b60008060008060006060868803121561391757600080fd5b853567ffffffffffffffff8082111561392f57600080fd5b61393b89838a016136a4565b9097509550602088013591508082111561395457600080fd5b50613961888289016136a4565b909450925050604086013561397581613660565b809150509295509295909350565b6000806040838503121561399657600080fd5b82356139a181613660565b915060208301356139b181613660565b809150509250929050565b602081526000610a9e60208301846137dc565b600181811c908216806139e357607f821691505b602082108103613a0357634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b81835260006001600160fb1b03831115613a5957600080fd5b8260051b8083602087013760009401602001938452509192915050565b60018060a01b03861681528460208201528360408201526080606082015260006135bd608083018486613a40565b600060208284031215613ab657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613ae557613ae5613abd565b500390565b6020808252600f908201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201613b3b57613b3b613abd565b5060010190565b634e487b7160e01b600052604160045260246000fd5b6000816000190483118215151615613b7257613b72613abd565b500290565b600082613b9457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fd5b6020808252600d908201526c11549497d393d517d093d55391609a1b604082015260600190565b848152836020820152606060408201526000612d69606083018486613a40565b60008219821115613c0957613c09613abd565b500190565b85815284602082015260a060408201526000613c2d60a08301866137dc565b6001600160a01b0394909416606083015250608001529392505050565b60006020808385031215613c5d57600080fd5b825167ffffffffffffffff80821115613c7557600080fd5b818501915085601f830112613c8957600080fd5b815181811115613c9b57613c9b613b42565b8060051b604051601f19603f83011681018181108582111715613cc057613cc0613b42565b604052918252848201925083810185019188831115613cde57600080fd5b938501935b82851015613cfc57845184529385019392850192613ce3565b98975050505050505050565b60008184825b85811015613d3f578135613d2181613660565b6001600160a01b031683526020928301929190910190600101613d0e565b509095945050505050565b60208152600061348f602083018486613a40565b600060ff821660ff8103613d7457613d74613abd565b60010192915050565b600060208284031215613d8f57600080fd5b8151610a9e81613660565b600060208284031215613dac57600080fd5b81518015158114610a9e57600080fd5b60008251613dce818460208701613601565b919091019291505056fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220b77a6de6c5965c542b537bfee3b2a2e4c3fd8e348b922de9578f27839594b2dc64736f6c634300080f0033a2646970667358221220ecfacf377009db04bb6a199a8bb1d43453f52a36a426924d04168f9060bfe54564736f6c634300080f0033000000000000000000000000c9c65e72f15e97d729db9fc95f9d30fb45b971f5

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620001215760003560e01c80638da5cb5b11620000af578063ede9c548116200007a578063ede9c5481462000243578063ef1a0a71146200025a578063f2fde38b1462000273578063f8e12b57146200028a578063fd9be52214620002a157600080fd5b80638da5cb5b14620001ef57806390b24edb1462000201578063a84173ae1462000218578063ac7ff9a0146200022c57600080fd5b806373d603b711620000f057806373d603b71462000194578063870da6f114620001b257806389a3027114620001bc5780638b71cc8514620001d857600080fd5b806338f49060146200012657806362f5f111146200013f57806369b59e751462000173578063715018a6146200018a575b600080fd5b6200013d620001373660046200151d565b620002b8565b005b62000156620001503660046200151d565b62000333565b6040516001600160a01b0390911681526020015b60405180910390f35b6200013d620001843660046200151d565b620003b5565b6200013d6200081a565b6200019e6101f481565b60405161ffff90911681526020016200016a565b6200019e6109c481565b6200015673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b6200013d620001e936600462001587565b62000832565b6000546001600160a01b031662000156565b6200013d620002123660046200151d565b62000a6e565b60025462000156906001600160a01b031681565b6200013d6200023d3660046200167e565b62000c03565b6200013d620002543660046200173f565b62000e90565b6200026461271081565b6040519081526020016200016a565b6200013d620002843660046200151d565b62000fc2565b620001566200029b36600462001777565b62001041565b6200013d620002b236600462001791565b6200106c565b620002c26200119d565b6001600160a01b038116620003115760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b60448201526064015b60405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03818116600090815260056020526040812054909116620003965760405162461bcd60e51b815260206004820152601560248201527411549497d3d49050d31157d5539054d4d251d39151605a1b604482015260640162000308565b506001600160a01b039081166000908152600560205260409020541690565b620003bf6200119d565b600260015403620003e45760405162461bcd60e51b81526004016200030890620017be565b600260019081556001600160a01b0382166000908152600460205260409020015460ff16620004275760405162461bcd60e51b81526004016200030890620017f5565b6001600160a01b038116600090815260046020526040902060030154428111156200048d5760405162461bcd60e51b815260206004820152601560248201527411549497d1915157d414949253d117d313d0d2d151605a1b604482015260640162000308565b6001600160a01b0382166000908152600460208190526040909120015480620004eb5760405162461bcd60e51b815260206004820152600f60248201526e11549497d5159317d393d517d4d155608a1b604482015260640162000308565b6000620004f88462000333565b6001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000536573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200055c919062001822565b9050600082821115620005bb576001600160a01b03851660009081526004602052604090206002015461271090600160a01b900461ffff16620005a0858562001852565b620005ac91906200186c565b620005b891906200188e565b90505b6001600160a01b03851660009081526004602052604081206002015461271090620005f290600160b01b900461ffff16856200186c565b620005fe91906200188e565b6001600160a01b038716600090815260046020526040812060030154919250906200062e9062278d009062001852565b6200063a904262001852565b905060006301e133806200064f83856200186c565b6200065b91906200188e565b905060006200066b8583620018b1565b6040516370a0823160e01b81526001600160a01b038b166004820152909150819073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48906370a0823190602401602060405180830381865afa158015620006c9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006ef919062001822565b1015620007375760405162461bcd60e51b81526020600482015260156024820152744552525f494e53554646494349454e545f5553444360581b604482015260640162000308565b620007464262278d00620018b1565b6001600160a01b038a166000818152600460208190526040918290206003019390935551637ecdf29160e11b815273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4892810192909252602482018390529063fd9be52290604401600060405180830381600087803b158015620007bc57600080fd5b505af1158015620007d1573d6000803e3d6000fd5b50506040518392506001600160a01b038c1691507f06c5efeff5c320943d265dc4e5f1af95ad523555ce0c1957e367dda5514572df90600090a350506001805550505050505050565b620008246200119d565b620008306000620011f9565b565b6200083c6200119d565b6000308787878787876040516200085390620014f2565b620008659796959493929190620018f5565b604051809103906000f08015801562000882573d6000803e3d6000fd5b50604080516101406020601f890181900402820181019092526101208101878152929350918291889088908190850183828082843760009201829052509385525050600160208401525060408201819052606082018190526001600160a01b038416608083015260a0820181905260c082015260e001620009074262278d00620018b1565b8152600060209182018190526001600160a01b038416815260049091526040902081518190620009389082620019f3565b50602082015160018281018054604080870151606088015161ffff1990931695151561ff0019169590951761010095151586021762010000600160b01b031916620100006001600160a01b039384160217909255608086015160028601805460a089015160c08a01519385166001600160b01b031990921691909117600160a01b61ffff928316021761ffff60b01b1916600160b01b919093160291909117905560e086015160038087019190915593909501516004909401939093558154908101825560009182527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319168585169081179091559151898416938b1692917fdd0f4d88527d1eb3cb443e15b9cae58853d927ef5095aae23a5f326368eb94ce91a450505050505050565b62000a786200119d565b60026001540362000a9d5760405162461bcd60e51b81526004016200030890620017be565b600260019081556001600160a01b0382166000908152600460205260409020015460ff1662000ae05760405162461bcd60e51b81526004016200030890620017f5565b6001600160a01b038116600090815260046020819052604090912001541562000b3f5760405162461bcd60e51b815260206004820152601060248201526f11549497d4d3905414d213d517d4d15560821b604482015260640162000308565b600062000b4c8262000333565b6001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000b8a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000bb0919062001822565b6001600160a01b03831660008181526004602081905260408083209091018490555192935083927fff06f63f7e4f2a23ca1763c7d5dcb7ce1a5a52106180fe0f811ede48b5700aa89190a3505060018055565b62000c0d6200119d565b6001600160a01b03881660009081526004602052604090206001015460ff1662000c4b5760405162461bcd60e51b81526004016200030890620017f5565b6109c461ffff8316111562000ca35760405162461bcd60e51b815260206004820152601860248201527f4552525f484947485f504552464f524d414e43455f4645450000000000000000604482015260640162000308565b6101f461ffff8216111562000cfb5760405162461bcd60e51b815260206004820152601760248201527f4552525f484947485f4d414e4147454d454e545f464545000000000000000000604482015260640162000308565b6001600160a01b038816600090815260046020526040902060010154610100900460ff161562000d6e5760405162461bcd60e51b815260206004820152601760248201527f4552525f414c52454144595f494e495449414c49534544000000000000000000604482015260640162000308565b6001600160a01b03881660008181526004602081905260409182902060018101805461ff001916610100179055600201805461ffff868116600160b01b0261ffff60b01b19918916600160a01b029190911663ffffffff60a01b1990921691909117179055905163b9d52f7160e01b81528a929163b9d52f719162000dfe918c918c918c918c918c910162001b0b565b600060405180830381600087803b15801562000e1957600080fd5b505af115801562000e2e573d6000803e3d6000fd5b50505050836001600160a01b0316896001600160a01b03167fd7f73f8a783505113d127acd0d84a444f198d7b42c82be38272d513a7ad146888a8a878760405162000e7d949392919062001b75565b60405180910390a3505050505050505050565b62000e9a6200119d565b60026001540362000ebf5760405162461bcd60e51b81526004016200030890620017be565b600260019081556001600160a01b0383166000908152600460205260409020015460ff1662000f025760405162461bcd60e51b81526004016200030890620017f5565b6001600160a01b038281166000818152600560205260409081902080546001600160a01b0319169385169384179055516365db091360e11b815260048101929092529063cbb6122690602401600060405180830381600087803b15801562000f6957600080fd5b505af115801562000f7e573d6000803e3d6000fd5b50506040516001600160a01b038085169350851691507fd35615cf633cdd04206b370029477f61d6ad0a5bac9f345812359d782d14e89c90600090a3505060018055565b62000fcc6200119d565b6001600160a01b038116620010335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000308565b6200103e81620011f9565b50565b600381815481106200105257600080fd5b6000918252602090912001546001600160a01b0316905081565b620010766200119d565b60008111620010bd5760405162461bcd60e51b815260206004820152601260248201527111549497d253959053125117d05353d5539560721b604482015260640162000308565b6040516370a0823160e01b8152306004820152829082906001600160a01b038316906370a0823190602401602060405180830381865afa15801562001106573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200112c919062001822565b10156200117c5760405162461bcd60e51b815260206004820152601860248201527f4552525f494e53554646494355454e545f42414c414e43450000000000000000604482015260640162000308565b60025462001198906001600160a01b0383811691168462001249565b505050565b6000546001600160a01b03163314620008305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000308565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526200119892869291600091620012dc9185169084906200135e565b805190915015620011985780806020019051810190620012fd919062001ba7565b620011985760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840162000308565b60606200136f848460008562001379565b90505b9392505050565b606082471015620013dc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840162000308565b6001600160a01b0385163b620014355760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000308565b600080866001600160a01b0316858760405162001453919062001bfe565b60006040518083038185875af1925050503d806000811462001492576040519150601f19603f3d011682016040523d82523d6000602084013e62001497565b606091505b5091509150620014a9828286620014b4565b979650505050505050565b60608315620014c557508162001372565b825115620014d65782518084602001fd5b8160405162461bcd60e51b815260040162000308919062001c1c565b6142f98062001c5283390190565b80356001600160a01b03811681146200151857600080fd5b919050565b6000602082840312156200153057600080fd5b620013728262001500565b60008083601f8401126200154e57600080fd5b50813567ffffffffffffffff8111156200156757600080fd5b6020830191508360208285010111156200158057600080fd5b9250929050565b60008060008060008060808789031215620015a157600080fd5b620015ac8762001500565b9550620015bc6020880162001500565b9450604087013567ffffffffffffffff80821115620015da57600080fd5b620015e88a838b016200153b565b909650945060608901359150808211156200160257600080fd5b506200161189828a016200153b565b979a9699509497509295939492505050565b60008083601f8401126200163657600080fd5b50813567ffffffffffffffff8111156200164f57600080fd5b6020830191508360208260051b85010111156200158057600080fd5b803561ffff811681146200151857600080fd5b60008060008060008060008060c0898b0312156200169b57600080fd5b620016a68962001500565b9750602089013567ffffffffffffffff80821115620016c457600080fd5b620016d28c838d0162001623565b909950975060408b0135915080821115620016ec57600080fd5b50620016fb8b828c0162001623565b909650945062001710905060608a0162001500565b92506200172060808a016200166b565b91506200173060a08a016200166b565b90509295985092959890939650565b600080604083850312156200175357600080fd5b6200175e8362001500565b91506200176e6020840162001500565b90509250929050565b6000602082840312156200178a57600080fd5b5035919050565b60008060408385031215620017a557600080fd5b620017b08362001500565b946020939093013593505050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b602080825260139082015272105111149154d4d7d393d517d116539054d155606a1b604082015260600190565b6000602082840312156200183557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156200186757620018676200183c565b500390565b60008160001904831182151516156200188957620018896200183c565b500290565b600082620018ac57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115620018c757620018c76200183c565b500190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03888116825287811660208301528616604082015260a0606082018190526000906200192c9083018688620018cc565b828103608084015262001941818587620018cc565b9a9950505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200197a57607f821691505b6020821081036200199b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200119857600081815260208120601f850160051c81016020861015620019ca5750805b601f850160051c820191505b81811015620019eb57828155600101620019d6565b505050505050565b815167ffffffffffffffff81111562001a105762001a106200194f565b62001a288162001a21845462001965565b84620019a1565b602080601f83116001811462001a60576000841562001a475750858301515b600019600386901b1c1916600185901b178555620019eb565b600085815260208120601f198616915b8281101562001a915788860151825594840194600190910190840162001a70565b508582101562001ab05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8183526000602080850194508260005b8581101562001b00576001600160a01b0362001aec8362001500565b168752958201959082019060010162001ad0565b509495945050505050565b60608152600062001b2160608301878962001ac0565b82810360208401528481526001600160fb1b0385111562001b4157600080fd5b8460051b80876020840137600091016020019081526001600160a01b03939093166040929092019190915250949350505050565b60608152600062001b8b60608301868862001ac0565b61ffff9485166020840152929093166040909101529392505050565b60006020828403121562001bba57600080fd5b815180151581146200137257600080fd5b60005b8381101562001be857818101518382015260200162001bce565b8381111562001bf8576000848401525b50505050565b6000825162001c1281846020870162001bcb565b9190910192915050565b602081526000825180602084015262001c3d81604085016020870162001bcb565b601f01601f1916919091016040019291505056fe6080604052600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d1790553480156200003757600080fd5b50604051620042f9380380620042f98339810160408190526200005a91620002be565b600160055584848484846001600160a01b038516158015906200008557506001600160a01b03841615155b80156200009a57506001600160a01b03831615155b620000df5760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b60448201526064015b60405180910390fd5b600780546001600160a01b038088166001600160a01b03199283161790925560068054868416908316179055600880549287169290911691909117905562000128828262000138565b50505050505050505050620004bb565b60038054620001479062000361565b1590508015620001575750815115155b8015620001645750805115155b620001b25760405162461bcd60e51b815260206004820152601660248201527f4552525f42544f4b454e5f494e495449414c495a4544000000000000000000006044820152606401620000d6565b6003620001c08382620003ef565b506004620001cf8282620003ef565b505050565b80516001600160a01b0381168114620001ec57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200021957600080fd5b81516001600160401b0380821115620002365762000236620001f1565b604051601f8301601f19908116603f01168101908282118183101715620002615762000261620001f1565b816040528381526020925086838588010111156200027e57600080fd5b600091505b83821015620002a2578582018301518183018401529082019062000283565b83821115620002b45760008385830101525b9695505050505050565b600080600080600060a08688031215620002d757600080fd5b620002e286620001d4565b9450620002f260208701620001d4565b93506200030260408701620001d4565b60608701519093506001600160401b03808211156200032057600080fd5b6200032e89838a0162000207565b935060808801519150808211156200034557600080fd5b50620003548882890162000207565b9150509295509295909350565b600181811c908216806200037657607f821691505b6020821081036200039757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001cf57600081815260208120601f850160051c81016020861015620003c65750805b601f850160051c820191505b81811015620003e757828155600101620003d2565b505050505050565b81516001600160401b038111156200040b576200040b620001f1565b62000423816200041c845462000361565b846200039d565b602080601f8311600181146200045b5760008415620004425750858301515b600019600386901b1c1916600185901b178555620003e7565b600085815260208120601f198616915b828110156200048c578886015182559484019460019091019084016200046b565b5085821015620004ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613e2e80620004cb6000396000f3fe60806040526004361061021a5760003560e01c806370a0823111610123578063cbb61226116100ab578063d73dd6231161006f578063d73dd62314610666578063dd62ed3e14610686578063de009a44146106cc578063f8b2cb4f146106ec578063fd9be5221461070c57600080fd5b8063cbb61226146105da578063cc77828d146105fa578063cd2ed8fb1461061c578063cd4c690214610631578063d73cc4df1461065157600080fd5b806395d89b41116100f257806395d89b4114610545578063a766a3921461055a578063a9059cbb1461057a578063b9d52f711461059a578063c963ac98146105ba57600080fd5b806370a08231146104d45780637cb470d71461050a5780638025e3031461051d578063848955461461053257600080fd5b80632f37b624116101a6578063371babdc11610175578063371babdc146103ef5780633fe906751461041d5780635fa7b5841461043d57806364c7d6611461045d57806366188463146104b457600080fd5b80632f37b6241461035c5780633018205f14610395578063313ce567146103b3578063339c0528146103cf57600080fd5b806318160ddd116101ed57806318160ddd146102c7578063195199f6146102e657806323b872dd1461030657806323ddc5ab1461032657806329dcb0cf1461034657600080fd5b806306fdde031461021f578063095ea7b31461024a578063107783ec1461027a5780631694505e1461028f575b600080fd5b34801561022b57600080fd5b5061023461072c565b604051610241919061362d565b60405180910390f35b34801561025657600080fd5b5061026a610265366004613678565b6107be565b6040519015158152602001610241565b61028d6102883660046136e9565b610819565b005b34801561029b57600080fd5b50600e546102af906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102d357600080fd5b506002545b604051908152602001610241565b3480156102f257600080fd5b5061028d610301366004613765565b610934565b34801561031257600080fd5b5061026a61032136600461377e565b610941565b34801561033257600080fd5b5061028d610341366004613765565b610aa5565b34801561035257600080fd5b506102d8600f5481565b34801561036857600080fd5b5061026a6103773660046137bf565b6001600160a01b03166000908152600c602052604090205460ff1690565b3480156103a157600080fd5b506006546001600160a01b03166102af565b3480156103bf57600080fd5b5060405160128152602001610241565b3480156103db57600080fd5b5061028d6103ea3660046137bf565b610d12565b3480156103fb57600080fd5b5061040f61040a366004613765565b610dc9565b604051610241929190613820565b34801561042957600080fd5b506102d8610438366004613765565b610f2c565b34801561044957600080fd5b5061028d6104583660046137bf565b6113b2565b34801561046957600080fd5b5061047d6104783660046137bf565b611709565b6040516102419190815115158152602080830151151590820152604080830151908201526060918201519181019190915260800190565b3480156104c057600080fd5b5061026a6104cf366004613678565b6117a4565b3480156104e057600080fd5b506102d86104ef3660046137bf565b6001600160a01b031660009081526020819052604090205490565b61028d6105183660046136e9565b61187a565b34801561052957600080fd5b506102d8600181565b61028d610540366004613877565b61192d565b34801561055157600080fd5b50610234611bd7565b34801561056657600080fd5b5061028d6105753660046138bd565b611be6565b34801561058657600080fd5b5061026a610595366004613678565b611f5b565b3480156105a657600080fd5b5061028d6105b53660046138ff565b611f71565b3480156105c657600080fd5b5061028d6105d5366004613983565b612302565b3480156105e657600080fd5b5061028d6105f53660046137bf565b61240d565b34801561060657600080fd5b5061060f612437565b60405161024191906139bc565b34801561062857600080fd5b50600b546102d8565b34801561063d57600080fd5b5061028d61064c3660046137bf565b612498565b34801561065d57600080fd5b5061040f61250b565b34801561067257600080fd5b5061026a610681366004613678565b612637565b34801561069257600080fd5b506102d86106a1366004613983565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156106d857600080fd5b5061028d6106e73660046137bf565b6126ab565b3480156106f857600080fd5b506102d86107073660046137bf565b612762565b34801561071857600080fd5b5061028d610727366004613678565b6127dd565b60606003805461073b906139cf565b80601f0160208091040260200160405190810160405280929190818152602001828054610767906139cf565b80156107b45780601f10610789576101008083540402835291602001916107b4565b820191906000526020600020905b81548152906001019060200180831161079757829003601f168201915b5050505050905090565b3360008181526001602090815260408083206001600160a01b03871680855292528083208590555191929091600080516020613dd9833981519152906108079086815260200190565b60405180910390a35060015b92915050565b6002600554036108445760405162461bcd60e51b815260040161083b90613a09565b60405180910390fd5b600260055561085161283d565b61085b8686612887565b6108706001600160a01b0387168684846128fb565b6108986001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b6040516305d2b6d960e31b8152731111111254fb6c44bac0bed2854e76f90643097d90632e95b6c8906108d79089908890889088908890600401613a76565b6020604051808303816000875af11580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a9190613aa4565b5061092786868686612a8d565b5050600160055550505050565b61093c612af3565b600f55565b6000336001600160a01b038516148061097d57506001600160a01b03841660009081526001602090815260408083203384529091529020548211155b6109c15760405162461bcd60e51b815260206004820152601560248201527422a9292fa12a27a5a2a72fa120a22fa1a0a62622a960591b604482015260640161083b565b6109cc848484612b42565b336001600160a01b03851614801590610a1857506001600160a01b03841660009081526001602090815260408083203384529091529020546fffffffffffffffffffffffffffffffff14155b15610a9a576001600160a01b0384166000908152600160209081526040808320338452909152902054610a4c908390613ad3565b6001600160a01b038581166000908152600160209081526040808320338085529083529281902085905551938452918616929091600080516020613dd9833981519152910160405180910390a35b5060015b9392505050565b600260055403610ac75760405162461bcd60e51b815260040161083b90613a09565b6002600555336000908152600a602052604090205460ff16610b1b5760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b6000610b2660025490565b90506000610b348383612c4e565b905080600003610b565760405162461bcd60e51b815260040161083b90613aea565b610b603384612d73565b610b6983612d7e565b60408051608081018252600080825260208201819052918101829052606081018290526000805b600b54811015610d0457600b8181548110610bad57610bad613b13565b60009182526020808320909101546001600160a01b0316808352600c82526040928390208351608081018552815460ff808216151583526101009091041615159381018490526001820154948101949094526002015460608401529550909350610c4d5760405162461bcd60e51b81526020600482015260116024820152704552525f4f55545f4e4f545f524541445960781b604482015260640161083b565b610c5b858460600151612e4c565b915081600003610c7d5760405162461bcd60e51b815260040161083b90613aea565b610c8b836060015183612f27565b6001600160a01b0385166000908152600c6020526040902060020155610cb2843384612f84565b6040518281526001600160a01b0385169033907fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed9060200160405180910390a380610cfc81613b29565b915050610b90565b505060016005555050505050565b610d1a612af3565b6001600160a01b03811660009081526009602052604090205460ff1615610d7d5760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b038116600081815260096020526040808220805460ff19166001179055517f3e8033965d38bf14f7324229095da5e193ecb0204a77a56d309da0c94882fd279190a250565b6060806000610dd760025490565b90506000610de58583612c4e565b905080600003610e075760405162461bcd60e51b815260040161083b90613aea565b600b805480602002602001604051908101604052809291908181526020018280548015610e5d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e3f575b5050600b54939750505067ffffffffffffffff8211159050610e8157610e81613b42565b604051908082528060200260200182016040528015610eaa578160200160208202803683370190505b5092506000805b600b54811015610f23576000610edf878381518110610ed257610ed2613b13565b6020026020010151612f9d565b509050610ef0848260600151612e4c565b925082868381518110610f0557610f05613b13565b60209081029190910101525080610f1b81613b29565b915050610eb1565b50505050915091565b6000600260055403610f505760405162461bcd60e51b815260040161083b90613a09565b60026005553360009081526009602052604090205460ff16610fa45760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b600d546001600160a01b0316610ffc5760405162461bcd60e51b815260206004820152601a60248201527f4552525f44594e415345545f4f5241434c455f4e4f545f534554000000000000604482015260640161083b565b5080600061100960025490565b905060006110178383612c4e565b9050806000036110395760405162461bcd60e51b815260040161083b90613aea565b6000806000600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b59190613aa4565b905060005b600b548110156112ab57600b81815481106110d7576110d7613b13565b60009182526020822001546001600160a01b031693506110f684612f9d565b9150506111038682612e4c565b9450846000036111255760405162461bcd60e51b815260040161083b90613aea565b6040516370a0823160e01b81523360048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561116c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111909190613aa4565b90508581101561119e578095505b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0387169063dd62ed3e90604401602060405180830381865afa1580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f9190613aa4565b90508681101561121d578096505b61124a8661122b858a613040565b6001600160a01b039091166000908152600c6020526040902060020155565b611255863389613092565b60405187815233906001600160a01b038816907f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a9060200160405180910390a350505080806112a390613b29565b9150506110ba565b50600081600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190613aa4565b6113309190613ad3565b90508161133d8783613b58565b6113479190613b77565b96506000871161138e5760405162461bcd60e51b81526020600482015260126024820152714d494e545f5a45524f5f44594e415345545360701b604482015260640161083b565b611397876130a7565b6113a13388613118565b505060016005555092949350505050565b6002600554036113d45760405162461bcd60e51b815260040161083b90613a09565b60026005556113e161283d565b600b546002106114245760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b6001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158352610100909104161515928101929092526001810154928201929092526002909101546060820181905280156114ca5760405162461bcd60e51b815260206004820152601860248201527f4552525f43414e5f4e4f545f52454d4f56455f544f4b454e0000000000000000604482015260640161083b565b6040820151600b546000906114e190600190613ad3565b905080821461163857600b81815481106114fd576114fd613b13565b600091825260209091200154600b80546001600160a01b03909216918490811061152957611529613b13565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160ff16600c6000600b858154811061157257611572613b13565b60009182526020808320909101546001600160a01b03168352820192909252604001812060010191909155600b8054600c929190849081106115b6576115b6613b13565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060020154600c6000600b858154811061160f5761160f613b13565b60009182526020808320909101546001600160a01b031683528201929092526040019020600201555b600b80548061164957611649613b99565b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b038c16808852600c90965284872093518454935161ffff1990941690151561ff0019161761010093151593909302929092178355516001830155516002909101555190917f48207b8b88ad0363606ff7f381bc9ee60bb9b614b5dccd985ae4cb02af0f77c391a250506001600555505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158084526101009092041615159382019390935260018201549381019390935260020154606083015261179f5760405162461bcd60e51b815260040161083b90613baf565b919050565b3360009081526001602090815260408083206001600160a01b0386168452909152812054808311156117f9573360009081526001602090815260408083206001600160a01b0388168452909152812055611828565b6118038382613ad3565b3360009081526001602090815260408083206001600160a01b03891684529091529020555b3360008181526001602090815260408083206001600160a01b03891680855290835292819020549051908152919291600080516020613dd9833981519152910160405180910390a35060019392505050565b60026005540361189c5760405162461bcd60e51b815260040161083b90613a09565b60026005556118a961283d565b6118b38686612887565b6118c86001600160a01b038716868484613123565b6118f06001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b604051637224811760e11b8152731111111254fb6c44bac0bed2854e76f90643097d9063e449022e906108d7908790879087908790600401613bd6565b60026005540361194f5760405162461bcd60e51b815260040161083b90613a09565b600260055561195c61283d565b6119668484612887565b600e54611980906001600160a01b038681169116846129a2565b60606001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214806119c957506001600160a01b03841673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b15611a5b5760408051600280825260608201835290916020830190803683370190505090508481600081518110611a0257611a02613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110611a3657611a36613b13565b60200260200101906001600160a01b031690816001600160a01b031681525050611b2d565b6040805160038082526080820190925290602082016060803683370190505090508481600081518110611a9057611a90613b13565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600181518110611ad857611ad8613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600281518110611b0c57611b0c613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250505b600e54600f546001600160a01b03909116906338ed1739908590859085903090611b579042613bf6565b6040518663ffffffff1660e01b8152600401611b77959493929190613c0e565b6000604051808303816000875af1158015611b96573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bbe9190810190613c4a565b50611bcb85858585612a8d565b50506001600555505050565b60606004805461073b906139cf565b600260055403611c085760405162461bcd60e51b815260040161083b90613a09565b6002600555611c1561283d565b6001600160a01b038316611c5c5760405162461bcd60e51b815260206004820152600e60248201526d22a9292fad22a927afaa27a5a2a760911b604482015260640161083b565b600b54601411611c9f5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6001600160a01b038116611cf55760405162461bcd60e51b815260206004820152601760248201527f4552525f5a45524f5f544f4b454e5f50524f5649444552000000000000000000604482015260640161083b565b6001600160a01b0383166000908152600c602052604090205460ff1615611d4d5760405162461bcd60e51b815260206004820152600c60248201526b11549497d254d7d093d5539160a21b604482015260640161083b565b60008211611d8f5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604051636eb1769f60e11b81526001600160a01b03828116600483015230602483015283919085169063dd62ed3e90604401602060405180830381865afa158015611dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e029190613aa4565b1015611e505760405162461bcd60e51b815260206004820152601a60248201527f4552525f494e53554646494349454e545f414c4c4f57414e4345000000000000604482015260640161083b565b6040805160808101825260018082526020808301828152600b805460ff16858701908152606086018981526001600160a01b038b166000818152600c90965297852096518754945161ffff1990951690151561ff00191617610100941515949094029390931786555185850155905160029094019390935582549182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055611f11838284613092565b806001600160a01b0316836001600160a01b03167fad3294aab2ec3d457e8b2c34125e9cc6abb32088405c71d3701d59c189d1688b60405160405180910390a35050600160055550565b6000611f68338484612b42565b50600192915050565b600260055403611f935760405162461bcd60e51b815260040161083b90613a09565b6002600555611fa061316b565b600b5415611fe25760405162461bcd60e51b815260206004820152600f60248201526e11549497d253925512505312569151608a1b604482015260640161083b565b6001600160a01b0381166120315760405162461bcd60e51b815260206004820152601660248201527524a72b20a624a22faa27a5a2a72fa82927ab24a222a960511b604482015260640161083b565b8360028110156120745760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b60148111156120b65760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6120d16120cc670de0b6b3a76400006064613b58565b6130a7565b60008060005b8381101561227b578888828181106120f1576120f1613b13565b905060200201602081019061210691906137bf565b92506001600160a01b03831661214e5760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015260640161083b565b86868281811061216057612160613b13565b905060200201359150600082116121ab5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604080516080810182526001808252602080830182815260ff8616848601908152606085018881526001600160a01b038a166000818152600c90955296842095518654935161ffff1990941690151561ff0019161761010093151593909302929092178555518484015551600290930192909255600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055612269838684613092565b8061227381613b29565b9150506120d7565b5061229884612293670de0b6b3a76400006064613b58565b613118565b836001600160a01b031688886040516122b2929190613d08565b60405180910390207fee29c4ecb305fc552ccd2503b77a9b843043f6298df130f25f2c272716206ea088886040516122eb929190613d4a565b60405180910390a350506001600555505050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236d9190613aa4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156123b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123db9190613aa4565b6001600160a01b039485166000908152600c602052604080822060029081019590955594909516855292909320015550565b61241561316b565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600b8054806020026020016040519081016040528092919081815260200182805480156107b457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612471575050505050905090565b6124a0612af3565b6001600160a01b0381166124e95760405162461bcd60e51b815260206004820152601060248201526f4552525f414444524553535f5a45524f60801b604482015260640161083b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b606080600b80548060200260200160405190810160405280929190818152602001828054801561256457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612546575b5050600b54939550505067ffffffffffffffff821115905061258857612588613b42565b6040519080825280602002602001820160405280156125b1578160200160208202803683370190505b50905060005b600b5481101561263257600c60008483815181106125d7576125d7613b13565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002015482828151811061261557612615613b13565b60209081029190910101528061262a81613b29565b9150506125b7565b509091565b3360009081526001602090815260408083206001600160a01b0386168452909152812054612666908390613bf6565b3360008181526001602090815260408083206001600160a01b03891680855290835292819020859055519384529092600080516020613dd98339815191529101610807565b6126b3612af3565b6001600160a01b0381166000908152600a602052604090205460ff16156127165760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b0381166000818152600a6020526040808220805460ff19166001179055517fb8aafec1aa056456cdaa0f9446ba81026cd6950d76df9602a23f41435cde410a9190a250565b6001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff808216151580845261010090920416151594820194909452600182015492810192909252600201546060820152906127d35760405162461bcd60e51b815260040161083b90613baf565b6060015192915050565b6127e561316b565b816127fa6001600160a01b03821633846131b7565b6040516001600160a01b038416815282907fc18340ba98721bcff47f10f30da90ced66f2b96b9afed4cbdf4e0184b4a704699060200160405180910390a2505050565b6008546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600b60248201526a4552525f4e4f545f44414d60a81b604482015260640161083b565b565b6001600160a01b0382166000908152600c602052604090205460ff166128bf5760405162461bcd60e51b815260040161083b90613baf565b6001600160a01b0381166000908152600c602052604090205460ff166128f75760405162461bcd60e51b815260040161083b90613baf565b5050565b8360005b60ff8116831115612946576129328285858460ff1681811061292357612923613b13565b9050602002013560001c6131e7565b91508061293e81613d5e565b9150506128ff565b50836001600160a01b0316816001600160a01b03161461299b5760405162461bcd60e51b815260206004820152601060248201526f22a9292fa7aaaa282aaa2faa27a5a2a760811b604482015260640161083b565b5050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156129f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a179190613aa4565b612a219190613bf6565b6040516001600160a01b038516602482015260448101829052909150612a8790859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261333f565b50505050565b612a978484612302565b826001600160a01b0316846001600160a01b03167ffa2dda1cc1b86e41239702756b13effbc1a092b5c57e3ad320fbe4f3b13fe2358484604051612ae5929190918252602082015260400190565b60405180910390a350505050565b6006546001600160a01b031633146128855760405162461bcd60e51b815260206004820152601260248201527122a9292fa727aa2fa1a7a72a2927a62622a960711b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054811115612ba15760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054612bc5908290613ad3565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612bf5908290613bf6565b6001600160a01b038381166000818152602081815260409182902094909455518481529092918616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600081600003612c8f5760405162461bcd60e51b815260206004820152600c60248201526b4552525f4449565f5a45524f60a01b604482015260640161083b565b6000612ca3670de0b6b3a764000085613b58565b9050831580612cc25750670de0b6b3a7640000612cc08583613b77565b145b612d015760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d0e600285613b77565b612d189083613bf6565b905081811015612d5d5760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d698583613b77565b9695505050505050565b6128f7823083612b42565b30600090815260208190526040902054811115612dd45760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b30600090815260208190526040902054612def908290613ad3565b30600090815260208190526040902055600254612e0d908290613ad3565b60025560405181815260009030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350565b600080612e598385613b58565b9050831580612e70575082612e6e8583613b77565b145b612eaf5760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612ec46002670de0b6b3a7640000613b77565b612ece9083613bf6565b905081811015612f135760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612d69670de0b6b3a764000083613b77565b6000806000612f368585613411565b915091508015612f7c5760405162461bcd60e51b81526020600482015260116024820152704552525f5355425f554e444552464c4f5760781b604482015260640161083b565b509392505050565b612f986001600160a01b03841683836131b7565b505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff80821615158084526101009092041615159482019490945260018201549281019290925260020154606082015291906130345760405162461bcd60e51b815260040161083b90613baf565b81606001519050915091565b60008061304d8385613bf6565b905083811015610a9e5760405162461bcd60e51b815260206004820152601060248201526f4552525f4144445f4f564552464c4f5760801b604482015260640161083b565b612f986001600160a01b038416833084613448565b306000908152602081905260409020546130c2908290613bf6565b306000908152602081905260409020556002546130e0908290613bf6565b60025560405181815230906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612e41565b6128f7308383612b42565b8360005b60ff8116831115612946576131578285858460ff1681811061314b5761314b613b13565b905060200201356131e7565b91508061316381613d5e565b915050613127565b6007546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f545f464143544f525960881b604482015260640161083b565b6040516001600160a01b038316602482015260448101829052612f9890849063a9059cbb60e01b90606401612a50565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324c9190613d7d565b90506000836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561328e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132b29190613d7d565b9050846001600160a01b0316826001600160a01b0316036132d65791506108139050565b846001600160a01b0316816001600160a01b0316036132f757509050610813565b60405162461bcd60e51b815260206004820152601960248201527f4552525f544f4b454e5f4d495353494e475f494e5f5041495200000000000000604482015260640161083b565b6000613394826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134809092919063ffffffff16565b805190915015612f9857808060200190518101906133b29190613d9a565b612f985760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161083b565b600080828410613430576134258385613ad3565b600091509150613441565b61343a8484613ad3565b6001915091505b9250929050565b6040516001600160a01b0380851660248301528316604482015260648101829052612a879085906323b872dd60e01b90608401612a50565b606061348f8484600085613497565b949350505050565b6060824710156134f85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161083b565b6001600160a01b0385163b61354f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161083b565b600080866001600160a01b0316858760405161356b9190613dbc565b60006040518083038185875af1925050503d80600081146135a8576040519150601f19603f3d011682016040523d82523d6000602084013e6135ad565b606091505b50915091506135bd8282866135c8565b979650505050505050565b606083156135d7575081610a9e565b8251156135e75782518084602001fd5b8160405162461bcd60e51b815260040161083b919061362d565b60005b8381101561361c578181015183820152602001613604565b83811115612a875750506000910152565b602081526000825180602084015261364c816040850160208701613601565b601f01601f19169190910160400192915050565b6001600160a01b038116811461367557600080fd5b50565b6000806040838503121561368b57600080fd5b823561369681613660565b946020939093013593505050565b60008083601f8401126136b657600080fd5b50813567ffffffffffffffff8111156136ce57600080fd5b6020830191508360208260051b850101111561344157600080fd5b60008060008060008060a0878903121561370257600080fd5b863561370d81613660565b9550602087013561371d81613660565b94506040870135935060608701359250608087013567ffffffffffffffff81111561374757600080fd5b61375389828a016136a4565b979a9699509497509295939492505050565b60006020828403121561377757600080fd5b5035919050565b60008060006060848603121561379357600080fd5b833561379e81613660565b925060208401356137ae81613660565b929592945050506040919091013590565b6000602082840312156137d157600080fd5b8135610a9e81613660565b600081518084526020808501945080840160005b838110156138155781516001600160a01b0316875295820195908201906001016137f0565b509495945050505050565b60408152600061383360408301856137dc565b82810360208481019190915284518083528582019282019060005b8181101561386a5784518352938301939183019160010161384e565b5090979650505050505050565b6000806000806080858703121561388d57600080fd5b843561389881613660565b935060208501356138a881613660565b93969395505050506040820135916060013590565b6000806000606084860312156138d257600080fd5b83356138dd81613660565b92506020840135915060408401356138f481613660565b809150509250925092565b60008060008060006060868803121561391757600080fd5b853567ffffffffffffffff8082111561392f57600080fd5b61393b89838a016136a4565b9097509550602088013591508082111561395457600080fd5b50613961888289016136a4565b909450925050604086013561397581613660565b809150509295509295909350565b6000806040838503121561399657600080fd5b82356139a181613660565b915060208301356139b181613660565b809150509250929050565b602081526000610a9e60208301846137dc565b600181811c908216806139e357607f821691505b602082108103613a0357634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b81835260006001600160fb1b03831115613a5957600080fd5b8260051b8083602087013760009401602001938452509192915050565b60018060a01b03861681528460208201528360408201526080606082015260006135bd608083018486613a40565b600060208284031215613ab657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613ae557613ae5613abd565b500390565b6020808252600f908201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201613b3b57613b3b613abd565b5060010190565b634e487b7160e01b600052604160045260246000fd5b6000816000190483118215151615613b7257613b72613abd565b500290565b600082613b9457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fd5b6020808252600d908201526c11549497d393d517d093d55391609a1b604082015260600190565b848152836020820152606060408201526000612d69606083018486613a40565b60008219821115613c0957613c09613abd565b500190565b85815284602082015260a060408201526000613c2d60a08301866137dc565b6001600160a01b0394909416606083015250608001529392505050565b60006020808385031215613c5d57600080fd5b825167ffffffffffffffff80821115613c7557600080fd5b818501915085601f830112613c8957600080fd5b815181811115613c9b57613c9b613b42565b8060051b604051601f19603f83011681018181108582111715613cc057613cc0613b42565b604052918252848201925083810185019188831115613cde57600080fd5b938501935b82851015613cfc57845184529385019392850192613ce3565b98975050505050505050565b60008184825b85811015613d3f578135613d2181613660565b6001600160a01b031683526020928301929190910190600101613d0e565b509095945050505050565b60208152600061348f602083018486613a40565b600060ff821660ff8103613d7457613d74613abd565b60010192915050565b600060208284031215613d8f57600080fd5b8151610a9e81613660565b600060208284031215613dac57600080fd5b81518015158114610a9e57600080fd5b60008251613dce818460208701613601565b919091019291505056fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220b77a6de6c5965c542b537bfee3b2a2e4c3fd8e348b922de9578f27839594b2dc64736f6c634300080f0033a2646970667358221220ecfacf377009db04bb6a199a8bb1d43453f52a36a426924d04168f9060bfe54564736f6c634300080f0033

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

000000000000000000000000c9c65e72f15e97d729db9fc95f9d30fb45b971f5

-----Decoded View---------------
Arg [0] : gnosis (address): 0xc9C65e72F15e97D729dB9fC95F9d30fb45B971f5

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


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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