ETH Price: $2,646.86 (-0.46%)

Contract

0xbAae36ceF9Ad432A40DeBaFa26d7A479CBbd0642
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EcoceliumInit

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Multiple files format)

File 1 of 3: Ecocelium_Initializer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "./helpers.sol";

contract IAbacusOracle{
    uint public callFee;
    function getJobResponse(uint64 _jobId) public view returns(uint64[] memory _values){    }
    function scheduleFunc(address to ,uint callTime, bytes memory data , uint fee , uint gaslimit ,uint gasprice)public payable{}
}

contract EcoceliumInit is Initializable {

    address payable owner;
    address payable public MONEYMANAGER;
    address payable public DATAMANAGER;
    address payable public ECOCELIUM;
    address payable public ABACUS;
    string public WRAP_ECO_SYMBOL;
    string public ECO;
    string public ETH_SYMBOL;
    string public WRAP_ETH_SYMBOL;
    uint public swapFee;
    uint public rewardFee;
    uint public tradeFee;
    uint public CDSpercent;
    string [] rtokenlist;
    string [] wtokenlist;
    mapping (string => uint) public rcurrencyID;
    mapping (string => uint) public wcurrencyID;
    mapping (address => bool)  public isRegistrar;
    mapping (address => bool) public isUserLocked;
    mapping (string => uint ) public ownerFeeVault;
    mapping (string => uint) public slabRateDeposit;
    mapping (address => bool) public friendlyaddress;
    mapping (address => address) public SponsorAddress;
    mapping (address => uint) public usertreasuryearnings;
    
    event OrderCreated(
        address userAddress,
        uint duration,
        uint yield,
        uint amount,
        string token
        );
        
    event Swap(
        address userAddress,
        string from,
        string to,
        uint amount
        );
        
    event Borrowed(
        uint64 orderId,
        address borrower,
        uint amount,
        uint duration
        );
        
    event Deposit(
         address userAddress,
         string token,
         uint tokenAmount,
         uint collateralValue
         );
         
    event DuePaid(
        uint64 orderId,
        address borrower,
        uint amount
        );
        
    event WrapTokenCreated(
        address TokenAddress,
        string  TokenName,
        string  TokenSymbol,
        uint    Decimals
        );
        
    receive() payable external {     }    
        
    function initializeAddress(address payable _owner) public initializer {
        friendlyaddress[_owner] = true;
        owner = _owner;
    }
       
    function addRealCurrency(string memory rtoken) public{
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        if(rcurrencyID[rtoken] == 0) {
            rtokenlist.push(rtoken);
            rcurrencyID[rtoken] = rtokenlist.length; }
    }
    
    function addWrapCurrency (string memory wtoken) public{
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        if(wcurrencyID[wtoken] == 0) {
            wtokenlist.push(wtoken);
            wcurrencyID[wtoken] = wtokenlist.length; }
    }
    
    function setSlabRate(string memory WToken, uint rate) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        slabRateDeposit[WToken] = rate;
    }
    
    function setUserLocked(address userAddress, bool value) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        isUserLocked[userAddress] = value;
    }
    
    function setFriendlyAddress(address Address) public {
        (msg.sender == owner,"not owner");
        friendlyaddress[Address] = true;
    }
    
    function addRegistrar(address _registrar) public{
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        isRegistrar[_registrar] = true;
    }
    
    function setOwnerFeeVault(string memory add,uint value) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        ownerFeeVault[add] += value; 
    }
       
    function emitOrderCreated(address userAddress, uint _duration, uint _yield, uint newAmount,string  memory _tokenSymbol) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        emit OrderCreated(userAddress,_duration,_yield,newAmount,_tokenSymbol);        
    }
    
    function emitSwap(address msgSender, string memory from, string memory to,uint _amount) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        emit Swap(msgSender,from,to,_amount);
    }
    
    function emitBorrowed(uint64 _orderId, address msgSender, uint _amount,uint _duration) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        emit Borrowed(_orderId,msgSender,_amount,_duration);
    }
    
    function emitWrappedCreated(address tokenAddress,string memory name, string memory symbol,uint8 decimals) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        emit WrapTokenCreated(tokenAddress,name,symbol,decimals);   
    }
    
    function emitDeposit(address msgSender, string memory _tokenSymbol, uint amount, uint tokenUsdValue) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        emit Deposit(msgSender,_tokenSymbol,amount,tokenUsdValue);
    }
    
    function emitDuePaid(uint64 _orderId, address msgSender, uint due) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        emit DuePaid(_orderId,msgSender,due);
    }
    
    function setCONSTSYMBOLS(string[4] memory _symbolCONST) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        WRAP_ECO_SYMBOL = _symbolCONST[0];
        ECO = _symbolCONST[1];
        ETH_SYMBOL = _symbolCONST[2];
        WRAP_ETH_SYMBOL = _symbolCONST[3];
    }
    
    function updateFees(uint _swapFee,uint _tradeFee,uint _rewardFee) public{
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        (swapFee,tradeFee,rewardFee) = (_swapFee,_tradeFee,_rewardFee);
    }
    
    function setCSDpercent(uint percent) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        CDSpercent = percent;
    }
    
    function changeAbacusaddress(address payable Abacusaddress) public{
        require(msg.sender == owner,"not owner");
        ABACUS = Abacusaddress;
    } 
    
    function changeEcoceliumaddress(address payable Ecocelium) public{
        require(msg.sender == owner,"not owner");
        ECOCELIUM = Ecocelium;
    } 
    
    function changeDMaddress(address payable DMAddress) public{
        require(msg.sender == owner,"not owner");
        DATAMANAGER = DMAddress;
    }
    
     function changeMMaddress(address payable MMaddress) public{
        require(msg.sender == owner,"not owner");
        MONEYMANAGER = MMaddress;
    }
    
    function changeOwner(address payable _owner) public{
        require(msg.sender==owner);
        owner = _owner;
    }
    
    function setSponsor(address userAddress, address _sponsorAddress) external {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        SponsorAddress[userAddress] = _sponsorAddress;
    }
    
    function updateTreasuryEarnings(address userAddress, uint _amount) public {
        require(friendlyaddress[msg.sender],"Not Friendly Address");
        usertreasuryearnings[userAddress] = _amount;
    }
}


contract EcoMoneyManager is Initializable {
    

    
    
    EcoceliumInit Init;
    address public owner;
    address [] public TokenAddresses;
    address [] public wTokenAddresses;
    mapping (string => address) rTokens;    
    mapping (string => string)  rTokensTowToken;
    mapping (string => TokenConfig)  wTokens;
    mapping (address => uint) public ecoWithdrawls;
    mapping (string => uint) public WGains;
    mapping (string => uint) public WLoss;
    
    receive() payable external {     }
    
    struct TokenConfig{
        address tokenAddress;
        uint64 fetchId;
    }
    
    function initialize(address _owner, address payable _Init) public initializer{
        owner = _owner;
        Init = EcoceliumInit(_Init);
    }
    
    function updateAdminAddress(address adminAddress) public {
        require(msg.sender == owner);
        for(uint i = 0;i<wTokenAddresses.length;i++){
            wERC20(wTokenAddresses[i]).changeAdmin(adminAddress);
        }
    }
    
    function addTokenWithAddress(address tokenAddress) public {
        require(msg.sender == owner);
        ERC20Basic token = ERC20Basic(tokenAddress);
        require(getrTokenAddress(token.symbol())== address(0),"token exist");
        rTokens[token.symbol()] = tokenAddress;  
        TokenAddresses.push(tokenAddress);
    } 

    function createWrapToken(string memory name,string memory symbol,uint64 _fetchId, uint8 decimal, string memory wrapOf) public  returns(address TokenAddress){
        require(msg.sender == owner);
        wERC20  token = new wERC20(name,symbol,decimal, address(this), address(this));        
        rTokensTowToken[wrapOf] = symbol;
        TokenAddresses.push(address(token));
        wTokenAddresses.push(address(token));
        wTokens[symbol] = TokenConfig({
                                        tokenAddress:address(token),
                                        fetchId : _fetchId
                                    });
        Init.emitWrappedCreated(address(token),name,symbol,token.decimals());                 
        return address(token);
    } 
    
    function changeOwner(address _owner) public{
        require(owner == msg.sender);
        owner =_owner;
    }    
    function getwTokenAddress(string memory symbol) public view returns(address){
        return wTokens[symbol].tokenAddress;
    }
    
    function getFetchId(string memory symbol ) public view returns(uint64){
        return wTokens[symbol].fetchId;
    }
    
    function getrTokenAddress(string memory symbol) public view returns(address){
        return rTokens[symbol];
    }
    
    function getTokenAddresses() public view returns(address[] memory){
        return TokenAddresses;
    }
    
    function getWrapped(string memory symbol) public view returns(string memory){
        return rTokensTowToken[symbol];
    }
    
    function getTokenID(string memory symbol) public view returns(uint){
        for(uint i=0; i< TokenAddresses.length; i++) {
            if(TokenAddresses[i] == wTokens[symbol].tokenAddress) {
                return i;
            }
        }
    }
    
    function releaseWrappedToken (address _userAddress, uint amount, string memory WToken) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(WToken)).release(_userAddress,amount);
    }
    
    function mintWrappedToken (address _userAddress, uint amount, string memory WToken) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(WToken)).mint(_userAddress,amount);
    }
    
    function lockWrappedToken (address _userAddress, uint amount, string memory WToken) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(WToken)).lock(_userAddress,amount);
    }
    
    function burnWrappedFrom(address userAddress, uint amount, string memory WToken) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(WToken)).burnFrom(userAddress,amount);
    }
     
    function mintECO(address userAddress, uint amount) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(Init.WRAP_ECO_SYMBOL())).mint(userAddress,amount);
    }
    
    function lockECO(address userAddress, uint amount) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(Init.WRAP_ECO_SYMBOL())).lock(userAddress,amount);
    }
    
    function releaseECO(address userAddress, uint amount) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(Init.WRAP_ECO_SYMBOL())).release(userAddress,amount);
    }
    
    function burnECOFrom(address userAddress, uint amount) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        wERC20(getwTokenAddress(Init.WRAP_ECO_SYMBOL())).burnFrom(userAddress,amount);
    }
    
    function DepositManager(string memory _rtoken, uint amount, address userAddress) public payable {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        if(Init.rcurrencyID(_rtoken) == Init.rcurrencyID(Init.ETH_SYMBOL()))
        {   require(msg.value >= amount,"Invalid Amount");  }
        else {ERC20Basic rtoken = ERC20Basic(getrTokenAddress(_rtoken));
        require(rtoken.allowance(userAddress, address(this)) >= amount,"set allowance");
        rtoken.transferFrom(userAddress,address(this),amount);}
    }
    
    function WithdrawManager(string memory _rtoken, uint amount, address payable userAddress) public payable {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        if(Init.rcurrencyID(_rtoken) == Init.rcurrencyID(Init.ETH_SYMBOL()))
        {   userAddress.transfer(amount);        }
        else {
        ERC20Basic rtoken = ERC20Basic(getrTokenAddress(_rtoken));
        rtoken.approve(userAddress, amount);
        rtoken.transferFrom(address(this),userAddress,amount);}
    }
    
    function redeemEcoEarning(address userAddress, uint amount) public {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        ecoWithdrawls[userAddress] += amount;
        wERC20(getwTokenAddress(Init.WRAP_ECO_SYMBOL())).transferFrom(address(this),userAddress,amount);
    }
    
    function updateFetchID (string memory wtoken, uint64 _fetchID) external {
        require(owner == msg.sender);
        wTokens[wtoken].fetchId = _fetchID;
    }
    
    function w2wswap (address msgSender, string memory token1, uint token1amount, uint token2amount, string memory token2) external {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        releaseWrappedToken(msgSender, token1amount, token1);
        burnWrappedFrom(msgSender,token1amount,token1);
        WGains[token1]=token1amount;
        mintWrappedToken(msgSender,token2amount, token2);
        lockWrappedToken(msgSender, token2amount, token2);
        WLoss[token2]=token2amount;
    }
    
}

File 2 of 3: Ecocelium_Core.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "./Ecocelium_Initializer.sol";

/*

███████╗░█████╗░░█████╗░░█████╗░███████╗██╗░░░░░██╗██╗░░░██╗███╗░░░███╗
██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝██║░░░░░██║██║░░░██║████╗░████║
█████╗░░██║░░╚═╝██║░░██║██║░░╚═╝█████╗░░██║░░░░░██║██║░░░██║██╔████╔██║
██╔══╝░░██║░░██╗██║░░██║██║░░██╗██╔══╝░░██║░░░░░██║██║░░░██║██║╚██╔╝██║
███████╗╚█████╔╝╚█████╔╝╚█████╔╝███████╗███████╗██║╚██████╔╝██║░╚═╝░██║
╚══════╝░╚════╝░░╚════╝░░╚════╝░╚══════╝╚══════╝╚═╝░╚═════╝░╚═╝░░░░░╚═╝

Brought to you by Kryptual Team */

contract EcoceliumDataManager is Initializable {
    
    IAbacusOracle abacus;
    EcoMoneyManager EMM;
    EcoceliumInit Init;
    enum Status {OPENCREATOR, OPENBORROW, MATCHED, CLOSED} 

    /*============Mappings=============
    ----------------------------------*/
    mapping (string => uint64[]) public orderpool;  //is an always sorted array based on Yield Rate of Pending Orders for all currencies
    mapping (string => uint) public poolindex;  //Index of First Investor Bid for all currencies
    
    mapping (address => User) public users;
    //mapping (address => address) public sponsorAddress; //FOR TREASURY PLAN
    mapping (uint64 => Status) public orderStatus;
    mapping (uint64 => matchedOrder) public matchOrderMap;
    mapping (uint64 => Order) public openOrderMap;
    
    /*=========Structs and Initializer================
    --------------------------------*/    
    
    struct freeStorage{     //USER DEPOSIT / BORROW STRUCTURE
        uint amount;
        uint time;
        string wtoken;
        uint usdvalue;
    }
    
    struct matchedOrder{            //RUNNING OR MATCHED ORDERS IN THIS FORM
        address supplier;
        address borrower;
        uint time;
        uint expiryDate;
        uint duration;
        uint amount;
        uint usdvalue;
        uint yield;
        string wtoken;
        uint duesPaid;
    }

    struct Order{       // PENDING ORDERS IN THIS FORMAT
        address creator;
        uint duration;
        uint amount;
        uint yield;
        string wtoken;
    }    
    
    struct User{
        uint totalDeposit;  //USD VALUE OF TOTAL DEPOSIT AT DEPOSIT TIME
        uint totalBorrowed; //USD VALUE OF TOTAL DEPOSIT AT BORROW TIME
        freeStorage [] myDeposits; //DEPOSIT DATA
        freeStorage [] myBorrows; //BORROW DATA
        mapping(string => uint) deposits; //CURRENCY-WISE TOTAL DEPOSIT COUNT FULL VALUE 
        mapping(string => uint) borrows; //CURRENCY-WISE TOTAL BORROW COUNT FULL VALUE
        uint64 [] borrowedOrders; //BORROWED ORDER - ORDER ID
        uint64 [] createdOrders; //CREATED ORDER - ORDER ID
        uint64 [] myOrders; //MATCHED ORDR - ORDER ID
    }
    
    function initializeAddress(address payable EMMaddress,address AbacusAddress, address payable Initaddress) external initializer{
            EMM = EcoMoneyManager(EMMaddress);
            abacus = IAbacusOracle(AbacusAddress); 
            Init = EcoceliumInit(Initaddress);
    }

    /*============Main Functions===============
    Key Notes - 
    1) Always call main functions of Data Manager with Wrapped Token
    2) _status signifies (status == Status.OPENCREATOR) operation - Returns True for Deposit Functions and False for Borrow Function
    3) require(Init.friendlyaddress(msg.sender) ,"Not Friendly Address"); - This is mentioned in the EcoceliumInit Contract
    4) FreePusher/Popper are for Liquidity Pools and push/pop order and matchOrder is the Order Matching Engine
    5) Fetch Token Price Returns Values in 10**8
    6) Amounts are with setting off Token Decimals
    ---------------------------------*/
    
    function freePusher(address userAddress, string memory token, uint _amount, bool _status) external {  //_status signifies (status == Status.OPENCREATOR) operation
        require(Init.friendlyaddress(msg.sender) ,"Not Friendly Address");
        uint _usdValue = USDValue(_amount, token);
        freeStorage memory newStorage = freeStorage({  amount: _amount,
                                                    time: now,
                                                    wtoken: token,
                                                    usdvalue: _usdValue   });
        if(_status){
            users[userAddress].myDeposits.push(newStorage);
            users[userAddress].totalDeposit += _usdValue;
            users[userAddress].deposits[token] += _amount;
        }   else {
            users[userAddress].myBorrows.push(newStorage);
            users[userAddress].totalBorrowed += _usdValue;
            users[userAddress].borrows[token] += _amount;
        }
    }
    
    function freePopper(address userAddress, string memory _tokenSymbol, uint _amount, bool _status) public returns (uint dues) {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        if(_status) { 
            require(users[userAddress].deposits[_tokenSymbol]>_amount, "Insufficient Deposits");
            users[userAddress].deposits[_tokenSymbol] -= _amount;
            users[userAddress].totalDeposit -= USDValue(_amount, _tokenSymbol); 
        } else {
            require(users[userAddress].borrows[_tokenSymbol]>_amount,"Insufficient Borrowings");
            users[userAddress].borrows[_tokenSymbol] -= _amount;
            users[userAddress].totalBorrowed -= USDValue(_amount, _tokenSymbol);
        }
        uint amountLeft= _amount;
        freeStorage [] storage mystorage = _status ?  users[userAddress].myDeposits : users[userAddress].myBorrows;
        for( uint i= mystorage.length-1; amountLeft >0 ; i--){
            if(keccak256(abi.encodePacked(mystorage[i].wtoken)) != keccak256(abi.encodePacked(_tokenSymbol))) { continue; }
            if (mystorage[i].amount <= amountLeft){
                amountLeft -= mystorage[i].amount;
                dues+= calculateECOEarning(USDValue(mystorage[i].amount,_tokenSymbol), _tokenSymbol, mystorage[i].time);
                mystorage.pop(); 
            } else {
                mystorage[i].amount -= amountLeft;
                dues += calculateECOEarning(USDValue(amountLeft,_tokenSymbol), _tokenSymbol, mystorage[i].time);
                amountLeft = 0;
            }
        } 
        _status ? users[userAddress].myDeposits = mystorage :   users[userAddress].myBorrows = mystorage;
        Init.setOwnerFeeVault(_tokenSymbol, (dues*Init.rewardFee()/100));
    }
    
    function pushOrder(address userAddress,string memory _tokenSymbol ,uint _amount,uint _duration, uint _yield, bool _status) internal returns (uint){
        (uint64 _orderId,uint newAmount,uint fee) = _ordersub(_amount,userAddress,_duration,_tokenSymbol);
        openOrderMap[_orderId] = Order({       
                                            creator : userAddress,
                                            duration : _duration,
                                            amount : newAmount,
                                            yield : _yield,
                                            wtoken : _tokenSymbol
                                 });
        if(_status) {
            orderStatus[_orderId] = Status.OPENCREATOR;
            users[userAddress].createdOrders.push(_orderId);
        } else  {
            orderStatus[_orderId] = Status.OPENBORROW;
            users[userAddress].borrowedOrders.push(_orderId);  }
        poolSorter(_orderId, _tokenSymbol, true);
        return fee;
    }
    
    function poolSorter(uint64 _orderId, string memory _tokenSymbol, bool _status) internal {        //Status here signifies Insertion if True, and Deletion if false
        uint64 [] memory temp;
        bool task;
        poolindex[_tokenSymbol]=0;
        for((uint i, uint j)=(0,0);i<orderpool[_tokenSymbol].length;(i++,j++)) {
            temp[j]=orderpool[_tokenSymbol][i];
            if(!task && _status && openOrderMap[temp[j]].yield > openOrderMap[_orderId].yield) {    //Insertion Case
                    temp[j]=_orderId; temp[++j]=orderpool[_tokenSymbol][i]; task = true;
            }else if(!task && !_status && _orderId == temp[j]){     //Deletion Case
                temp[j]=orderpool[_tokenSymbol][++i]; task = true;
            }
            if(orderStatus[orderpool[_tokenSymbol][i-1]]==Status.OPENBORROW && orderStatus[orderpool[_tokenSymbol][i]]==Status.OPENCREATOR) {       //Assigns updatePoolIndex
                poolindex[_tokenSymbol] = i;
                break;
            }
        }
        orderpool[_tokenSymbol] = temp;
    }
    
    function matchOrder(address userAddress, string memory _tokenSymbol ,uint _amount,uint _duration,uint _yield, uint64 _orderId, bool _status) internal    {
        matchOrderMap[_orderId] = matchedOrder({       
                                            supplier : (orderStatus[_orderId] == Status.OPENBORROW) ? userAddress : openOrderMap[_orderId].creator,
                                            borrower : (orderStatus[_orderId] == Status.OPENCREATOR) ? userAddress : openOrderMap[_orderId].creator,
                                            time    : now,
                                            expiryDate : now + _duration*(30 days),
                                            duration : _duration,
                                            amount : _amount,
                                            usdvalue : USDValue(_amount,_tokenSymbol),
                                            yield : _yield,
                                            wtoken : _tokenSymbol,
                                            duesPaid : 0
                                            });
        _status ? delete users[openOrderMap[_orderId].creator].borrowedOrders[_orderId] : delete users[userAddress].createdOrders[_orderId];
        delete openOrderMap[_orderId];
        orderStatus[_orderId]=Status.MATCHED;
        users[matchOrderMap[_orderId].supplier].myOrders.push(_orderId);
        users[matchOrderMap[_orderId].borrower].myOrders.push(_orderId);
        scheduleExpiry(_orderId);
        scheduleCheck(_orderId,matchOrderMap[_orderId].borrower,1);
        EMM.mintWrappedToken(matchOrderMap[_orderId].borrower, _amount, _tokenSymbol);
        Init.emitOrderCreated(userAddress,_duration,_yield,_amount,_tokenSymbol); 
    }
    
    function newOrder(address userAddress,string memory _tokenSymbol ,uint _amount,uint _duration, uint _yield, bool _status) external {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        uint amountLeft= _amount;
        uint index;
        if(_status){
           index = poolindex[_tokenSymbol]-1;
           users[userAddress].deposits[_tokenSymbol] +=_amount;
           users[userAddress].totalDeposit += USDValue(_amount, _tokenSymbol);
        }   else {
           index = poolindex[_tokenSymbol];
            users[userAddress].borrows[_tokenSymbol] +=_amount;
           users[userAddress].totalBorrowed += USDValue(_amount, _tokenSymbol);
        }
        while(amountLeft>0){
            if(poolindex[_tokenSymbol] == 0) { pushOrder(userAddress, _tokenSymbol, _amount, _duration, _yield, _status);  break; }
            Order memory iOrder = openOrderMap[orderpool[_tokenSymbol][index]];
            if((_status && _yield>iOrder.yield) || (!_status && _yield<iOrder.yield) || (_status)?(orderStatus[orderpool[_tokenSymbol][index]] == Status.OPENCREATOR):(orderStatus[orderpool[_tokenSymbol][index]] == Status.OPENBORROW)){
                pushOrder(userAddress, _tokenSymbol, _amount, _duration, _yield, _status);
                break;
            } else   {
                uint tduration = _duration > iOrder.duration ? iOrder.duration : _duration;
                uint tyield = _yield > iOrder.yield ? iOrder.yield : _yield;
                uint64 tID = orderpool[_tokenSymbol][index];
                if(iOrder.amount>=amountLeft) { 
                    if(iOrder.amount != amountLeft) {
                        pushOrder(iOrder.creator, _tokenSymbol, iOrder.amount-amountLeft, iOrder.duration, iOrder.yield, !_status);     }
                    matchOrder(userAddress, _tokenSymbol, amountLeft, tduration, tyield, tID, _status);
                    amountLeft=0;
                } else {
                    pushOrder(userAddress, _tokenSymbol, amountLeft- iOrder.amount, _duration, _yield, _status);
                    matchOrder(userAddress, _tokenSymbol, amountLeft, tduration, tyield, tID , _status);
                    amountLeft -= openOrderMap[orderpool[_tokenSymbol][index]].amount;    }
            }
        }
    }
    
    function orderExpired  (uint64 _orderId) external {
        require(Init.friendlyaddress(msg.sender),"Not Friendly Address");
        require (matchOrderMap[_orderId].expiryDate <= now);
        EMM.releaseWrappedToken(matchOrderMap[_orderId].supplier,matchOrderMap[_orderId].amount, matchOrderMap[_orderId].wtoken);    
        users[matchOrderMap[_orderId].supplier].totalDeposit -= matchOrderMap[_orderId].usdvalue;
        users[matchOrderMap[_orderId].borrower].totalBorrowed -= matchOrderMap[_orderId].usdvalue;
        orderStatus[_orderId] = Status.CLOSED;
        delete matchOrderMap[_orderId];
        delete users[matchOrderMap[_orderId].supplier].myOrders[_orderId];
        delete users[matchOrderMap[_orderId].borrower].myOrders[_orderId];
        //Init.OrderExpired(_orderId,msgSender,orderMonthlyDue(_orderId,msgSender,_duration));
    } 

    function payDue(uint64 _orderId,uint _duration,address msgSender) external returns (uint due){
        due = orderMonthlyDue(_orderId,_duration);
        uint fee = (due*Init.rewardFee())/100;
        EMM.burnECOFrom(msgSender,due+fee);
        Init.setOwnerFeeVault(Init.WRAP_ECO_SYMBOL(), fee);
        matchOrderMap[_orderId].duesPaid += 1;
        matchOrderMap[_orderId].duesPaid >= matchOrderMap[_orderId].duration  ? Init.setUserLocked(msgSender,false) :  Init.setUserLocked(msgSender,true);
        Init.emitDuePaid(_orderId,msgSender,orderMonthlyDue(_orderId,_duration));
    }

    function dueCheck(uint64 _orderId,address borrower,uint month) external returns(uint) {
        require (Init.friendlyaddress(msg.sender) && now >= matchOrderMap[_orderId].time + matchOrderMap[_orderId].duesPaid * 30 days);
        if(matchOrderMap[_orderId].duesPaid < month && !Init.isRegistrar(borrower) && !Init.isUserLocked(borrower)){
            uint due = orderMonthlyDue(_orderId,1);
            matchOrderMap[_orderId].duesPaid >= matchOrderMap[_orderId].duration  ? Init.setUserLocked(borrower,false) :  Init.setUserLocked(borrower,true);
            EMM.mintECO(matchOrderMap[_orderId].supplier,due*(100-Init.rewardFee())/100);
            Init.emitDuePaid(_orderId,borrower,orderMonthlyDue(_orderId,1));
        }
        if(matchOrderMap[_orderId].duesPaid >= matchOrderMap[_orderId].duration){
            scheduleCheck(_orderId,borrower,1);
        }
    }

    function scheduleExpiry(uint64 _orderId) internal{
        uint time = matchOrderMap[_orderId].expiryDate - matchOrderMap[_orderId].time;
        bytes memory data = abi.encodeWithSelector(bytes4(keccak256('orderExpired(uint256)')),_orderId);
        uint callCost = 300000*1e9 + abacus.callFee();
        abacus.scheduleFunc{value:callCost}(address(this), time ,data , abacus.callFee() ,300000 , 1e9 );
    }    
    
    function scheduleCheck(uint _orderId,address borrower,uint month) internal{
        bytes memory data = abi.encodeWithSelector(bytes4(keccak256('dueCheck(uint256,address,uint256)')),_orderId,borrower,month);
        uint callCost = 300000*1e9 + abacus.callFee();
        abacus.scheduleFunc{value:callCost}(address(this), 30 days ,data , abacus.callFee() ,300000 , 1e9 );
    } 
    
    function cancelOrder(uint64 _orderId) external{
        require(Init.friendlyaddress(msg.sender));
        if(orderStatus[_orderId]==Status.OPENCREATOR) {
            EMM.releaseWrappedToken(openOrderMap[_orderId].creator,openOrderMap[_orderId].amount, openOrderMap[_orderId].wtoken);
            delete users[openOrderMap[_orderId].creator].borrowedOrders[_orderId];  
        }   else {
            delete users[openOrderMap[_orderId].creator].createdOrders[_orderId];   
        }
        poolSorter(_orderId, openOrderMap[_orderId].wtoken,false);
        delete openOrderMap[_orderId];
        orderStatus[_orderId] = Status.CLOSED;
    }
    
     /*==============Helpers============
    ---------------------------------*/   
    
    function USDValue(uint amount, string memory _token) internal view returns (uint usdvalue) {
        usdvalue = amount*fetchTokenPrice(_token)/(10**8);
    }
    
    function orderMonthlyDue(uint64 _orderId, uint _duration) public view returns(uint due){
        orderStatus[_orderId] == Status.MATCHED ?  due = USDValue (matchOrderMap[_orderId].amount, matchOrderMap[_orderId].wtoken) * matchOrderMap[_orderId].yield * _duration*30 days*fetchTokenPrice(Init.WRAP_ECO_SYMBOL())/ 3155695200 : due = 0;
    }
    
    function fetchTokenPrice(string memory _tokenSymbol) public view returns(uint64){ //Put any Token Wrapped or Direct
            return abacus.getJobResponse(EMM.getFetchId(_tokenSymbol))[0];
    }
    
    /*function issueReward(address userAddress, string memory _tokenSymbol, uint time, uint tokenUsdValue) internal {
        uint reward = calculateECOEarning(tokenUsdValue, _tokenSymbol, time);
        EMM.mintECO(userAddress, reward);
    }*/
    
    function calculateECOEarning(uint usdvalue, string memory _tokenSymbol, uint time) private view returns (uint){
        uint _amount = usdvalue*fetchTokenPrice(Init.WRAP_ECO_SYMBOL())/(10**8);
        uint reward = (_amount * Init.slabRateDeposit(_tokenSymbol) * (time - now))/3155695200; //decimal from Abacus is setoff by decimal from Eco
        return reward;
    }
    
    function getECOEarnings(address userAddress) public view returns (uint){
        uint ecobalance;
        for(uint i=0; i<users[userAddress].myDeposits.length || i<users[userAddress].myBorrows.length; i++) {
            ecobalance += calculateECOEarning(users[userAddress].myDeposits[i].usdvalue, users[userAddress].myDeposits[i].wtoken, users[userAddress].myDeposits[i].time);
            ecobalance -= calculateECOEarning(users[userAddress].myBorrows[i].usdvalue, users[userAddress].myBorrows[i].wtoken, users[userAddress].myBorrows[i].time);
        }
        return ecobalance - EMM.ecoWithdrawls(userAddress);
    }
    
    function _ordersub(uint amount,address userAddress,uint _duration,string memory _tokenSymbol) internal view returns (uint64, uint, uint){
        uint newAmount = amount - (amount*Init.tradeFee())/100;
        uint fee = (amount*Init.tradeFee())/100;
        uint64 _orderId = uint64(uint(keccak256(abi.encodePacked(userAddress,_tokenSymbol,_duration,now))));
        return (_orderId,newAmount,fee);
    }
    
    function getUserDepositsbyToken(address userAddress, string memory wtoken) public view returns(uint) {
        return users[userAddress].deposits[wtoken];
    }
    
    function getUserBorrowedOrderbyToken(address userAddress, string memory wtoken) public view returns(uint) {
        return users[userAddress].borrows[wtoken];
    }
    
    function getUserBorrowedOrder(address userAddress) public view returns (uint64 [] memory) {
        return users[userAddress].borrowedOrders;
    }
    
    function getUserDepositOrder(address userAddress) public view returns (uint64 [] memory) {
        return users[userAddress].createdOrders;
    }
    
    function getUserMatchOrder(address userAddress) public view returns (uint64 [] memory) {
        return users[userAddress].myOrders;
    }
    
    function getbuyPower(address userAddress) public view returns (uint){
        if(!Init.isRegistrar(userAddress)) { return (10**30);   }
        if(Init.isUserLocked(userAddress)) { return 0; }
        uint buyPower;
        buyPower += users[userAddress].totalDeposit - ((users[userAddress].totalDeposit*Init.CDSpercent())/100);
        buyPower -= users[userAddress].totalBorrowed;
        return buyPower;
    }
    
    function getOrderIds(string memory wtoken) public view returns (uint64 [] memory orderIds) {
        return orderpool[wtoken];
    }
}

contract Ecocelium is Initializable{

    address public owner;
    address payable EMMAddress;
    IAbacusOracle abacus;
    EcoMoneyManager EMM;
    EcoceliumDataManager EDM;
    EcoceliumInit Init;
    
    function initialize(address _owner,address payable EMMaddress,address payable AbacusAddress,address EDMaddress, address payable Initaddress)public payable initializer {
        owner = _owner;
        EMM = EcoMoneyManager(EMMaddress);
        EMMAddress = EMMaddress;
        abacus = IAbacusOracle(AbacusAddress);//0x323f81D9F57d2c3d5555b14d90651aCDc03F9d52
        EDM = EcoceliumDataManager(EDMaddress);
        Init = EcoceliumInit(Initaddress);
    }
    
    function changeOwner(address _owner) public{
        require(msg.sender==owner);
        owner = _owner;
    }
    
    function updateContracts() public{
        require(msg.sender==owner);
        EMM = EcoMoneyManager(Init.MONEYMANAGER());
        abacus = IAbacusOracle(Init.ABACUS());
        EDM = EcoceliumDataManager(Init.DATAMANAGER());
    }
    
     /*===========Main functions============
    -------------------------------------*/   

    function Deposit(string memory rtoken, uint _amount) external payable {
        address _msgSender = msg.sender;
        string memory wtoken = EMM.getWrapped(rtoken);
        _deposit(rtoken, _amount, _msgSender, wtoken);
        EDM.freePusher(_msgSender, wtoken, _amount, true);
        EMM.mintWrappedToken(_msgSender, _amount, wtoken);
        EMM.lockWrappedToken(_msgSender, _amount,wtoken);
    }
    
    function _deposit(string memory rtoken,uint _amount, address msgSender, string memory wtoken) internal {
        require(EMM.getwTokenAddress(wtoken) != address(0),"not supported");
        if(keccak256(abi.encodePacked(rtoken)) == keccak256(abi.encodePacked(Init.ETH_SYMBOL()))) { 
            require(msg.value >= _amount);
            EMM.DepositManager{value:msg.value}(rtoken, _amount, msgSender);
        }else {
        EMM.DepositManager(rtoken, _amount, msgSender); }
        Init.emitSwap(msgSender,rtoken,wtoken,_amount);
    }
    
    function depositAndOrder(address userAddress,string memory rtoken ,uint _amount,uint _duration,uint _yield) external payable {
        require(msg.sender == userAddress);
        _deposit(rtoken, _amount, userAddress, EMM.getWrapped(rtoken));
        EDM.newOrder(userAddress, EMM.getWrapped(rtoken), _amount, _duration, _yield, true);
    }
    
    function createOrder(address userAddress,string memory _tokenSymbol ,uint _amount,uint _duration,uint _yield) external payable {
        require(msg.sender == userAddress);
        string memory wtoken = EMM.getWrapped(_tokenSymbol);
        require(EDM.getUserDepositsbyToken(userAddress, wtoken) >= _amount, "Insufficient Balance"); 
        uint ecoEarnings = EDM.freePopper(userAddress, wtoken , _amount, true);
        EMM.mintECO(userAddress,ecoEarnings);
        EDM.newOrder(userAddress, wtoken, _amount, _duration, _yield, true); 
    }
    
    function getAggEcoBalance(address userAddress) public view returns(uint) {
        return wERC20(EMM.getwTokenAddress(Init.WRAP_ECO_SYMBOL())).balanceOf(userAddress) + EDM.getECOEarnings(userAddress);
    }
    
    function borrowOrder(address userAddress, string memory rtoken, uint amount, uint duration, uint yield) public {//Rewrite this part
        require(isWithdrawEligible(userAddress, rtoken, amount));
        EDM.newOrder(msg.sender,rtoken, amount,duration,yield,false);
    }
    
    function payDueOrder(uint64 _orderId,uint _duration) external {
        EDM.payDue(_orderId,_duration,msg.sender);
    }
    
    function clearBorrow(string memory rtoken, uint _amount) external payable{
        address msgSender = msg.sender;
        string memory wtoken = EMM.getWrapped(rtoken);
        uint dues = EDM.freePopper(msgSender, wtoken, _amount, false);
        if(keccak256(abi.encodePacked(rtoken)) == keccak256(abi.encodePacked(Init.ETH_SYMBOL()))) { 
            require(msg.value == _amount);
            EMM.DepositManager{value:_amount}(rtoken, _amount, msgSender);
        }else {
        EMM.DepositManager(rtoken, dues, msgSender);    }
    }
    
    function Borrow(address payable userAddress, uint _amount, string memory _tokenSymbol) public {
        require(userAddress == msg.sender);
        require(isWithdrawEligible(userAddress, _tokenSymbol, _amount));
        EDM.freePusher(msg.sender, EMM.getWrapped(_tokenSymbol), _amount,false);
        EMM.WithdrawManager(_tokenSymbol, _amount, userAddress);
    }
    
    function SwapWrapToWrap(string memory token1,string memory token2, uint token1amount)  external returns(uint) {
        address msgSender = msg.sender;
        (uint token1price,uint token2price) = (fetchTokenPrice(token1),fetchTokenPrice(token2));
        uint token2amount = (token1amount*token1price*(100-Init.swapFee()))/token2price/100;
        EMM.w2wswap(msgSender, token1, token1amount, token2amount, token2);
        EDM.freePopper(msgSender,token1,token1amount,true);
        Init.setOwnerFeeVault(token1, token1price*Init.swapFee()/100);
        EDM.freePusher(msgSender, token2,token2amount,true);
        Init.emitSwap(msgSender,token1,token2,token2amount);
        return token2amount;
    }
    
    function cancelOrder(uint64 _orderId) public{
        (address creator,,,,) = EDM.openOrderMap(_orderId);
        require(msg.sender==creator);
        EDM.cancelOrder(_orderId);
    }
    
    receive() external payable {  }

    /*==============Helpers============
    ---------------------------------*/    
    
    function orderMonthlyDue(uint64 _orderId,uint _duration) public view returns(uint){
        return EDM.orderMonthlyDue(_orderId,_duration);
    }
    
    function updateFees(uint _swapFee,uint _tradeFee,uint _rewardFee) public{
        require(msg.sender == owner);
        Init.updateFees(_swapFee,_tradeFee,_rewardFee);
    }
    
    function getOrderIds(string memory wtoken) public view returns(uint64 [] memory){
        return EDM.getOrderIds(wtoken);
    }
    
    function fetchTokenPrice(string memory _tokenSymbol) public view returns(uint64){
        return EDM.fetchTokenPrice(_tokenSymbol);
    }
    
    function Withdraw(string memory to, uint _amount) external payable{
        address payable msgSender = msg.sender;
        string memory from = EMM.getWrapped(to);
        require(EMM.getwTokenAddress(from) != address(0),"not supported");
        require(!Init.isUserLocked(msgSender), "Your Address is Locked Pay Dues");
        require(isWithdrawEligible(msgSender, to, _amount) , "Not Eligible for Withdraw");
        wERC20 wToken = wERC20(EMM.getwTokenAddress(to));
        uint amountLeft;
        uint availableBalance = wToken.balanceOf(msgSender) - EDM.getUserDepositsbyToken(msgSender, from) - EDM.getUserBorrowedOrderbyToken(msgSender, from);
        if(keccak256(abi.encodePacked(to)) == keccak256(abi.encodePacked(Init.ECO()))) {
            require( wToken.balanceOf(msgSender) + EDM.getECOEarnings(msgSender) >= _amount,"Insufficient Balance");
            if(availableBalance >= _amount) {
                EMM.WithdrawManager(to,_amount, msgSender);
            } else {
                if(wToken.balanceOf(msgSender) >=_amount)   { 
                _withdraw(msgSender, from, _amount, to);        }  else {
                amountLeft =  _amount - wToken.balanceOf(msgSender);
                _withdraw(msgSender, from, wToken.balanceOf(msgSender), to);
                EMM.redeemEcoEarning(msgSender,amountLeft); }
            }
        }
        else  {  require(wToken.balanceOf(msgSender)>=_amount,"Insufficient balance");
                _withdraw(msgSender, from, wToken.balanceOf(msgSender), to);
        }
        Init.emitSwap(msgSender,from,to,_amount);
    }
    
    function _withdraw(address payable msgSender, string memory from, uint amount, string memory to) internal {
        EMM.releaseWrappedToken(msgSender,amount, from);
        EMM.burnWrappedFrom(msgSender, amount, from);
        Init.setOwnerFeeVault(to,(amount*Init.swapFee())/100);
        EDM.freePopper(msgSender,from,amount, true);
        uint newAmount = amount - (amount*Init.swapFee())/100;
        EMM.WithdrawManager(to,newAmount, msgSender);
    }
    
    function isWithdrawEligible(address userAddress, string memory to, uint amount) internal view returns (bool Eligible){
        return (EDM.getbuyPower(userAddress)*(Init.CDSpercent())/100) > (amount*fetchTokenPrice(to)/(10**8));
    }    
}

    

File 3 of 3: helpers.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;


contract Initializable {

  /**
   * @dev Indicates that the contract has been initialized.
   */
  bool private initialized;

  /**
   * @dev Indicates that the contract is in the process of being initialized.
   */
  bool private initializing;

  /**
   * @dev Modifier to use in the initializer function of a contract.
   */
  modifier initializer() {
    require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");

    bool isTopLevelCall = !initializing;
    if (isTopLevelCall) {
      initializing = true;
      initialized = true;
    }

    _;

    if (isTopLevelCall) {
      initializing = false;
    }
  }


    
  /// @dev Returns true if and only if the function is running in the constructor
  function isConstructor() private view returns (bool) {
    // extcodesize checks the size of the code stored in an address, and
    // address returns the current address. Since the code is still not
    // deployed when running a constructor, any checks on its code size will
    // yield zero, making it an effective way to detect if a contract is
    // under construction or not.
    address self = address(this);
    uint256 cs;
    assembly { cs := extcodesize(self) }
    return cs == 0;
  }

  // Reserved storage space to allow for layout changes in the future.
  uint256[50] private ______gap;
    
}


abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}


abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

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

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

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

        _revokeRole(role, account);
    }

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

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

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}


contract ERC20Basic {
    uint public _totalSupply;
    string public name;
    string public symbol;
    uint public decimals;
    function totalSupply() public view  returns (uint){}
    function balanceOf(address who) public view returns (uint){}
    function transfer(address to, uint value) public {}
    function transferFrom(address _from, address _to, uint _value) public{}
    function approve(address spender, uint amount) public {}
    function allowance(address _owner, address _spender) public view returns (uint remaining) {}
    
    event Transfer(address indexed from, address indexed to, uint value);
}


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

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

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

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

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

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

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


contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;
    mapping (address => uint256) public  lockedAmount;
    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol,uint8 decimals) public {
        _name = name;
        _symbol = symbol;
        _decimals = decimals;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

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

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

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

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

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

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

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

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

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

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

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

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

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

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

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
     *
     * This is internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");
        require(amount <= availableAmount(owner),"ERC20 : approve amount exceeds available amount");
        
        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }
    
    function _lock(address owner,uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: lock for zero address");
        require(amount <= availableAmount(owner),"ERC20: lock value more tha available amount");
        
        lockedAmount[owner] = lockedAmount[owner].add(amount);
    }
    function _release(address owner,uint256 amount) internal virtual{
        require(owner != address(0), "ERC20: release for zero address");
        require(amount <= lockedAmount[owner],"ERC20 : release value more then locked value");
        
        lockedAmount[owner] = lockedAmount[owner].sub(amount);
    }
    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

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


library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

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

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

    /**
     * @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");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

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

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

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


library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

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

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

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

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

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

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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


    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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


library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

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

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

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

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


contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

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

    bool private _paused;

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

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

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

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

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

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


abstract contract ERC20Pausable is ERC20, Pausable {
    /**
     * @dev See {ERC20-_beforeTokenTransfer}.
     *
     * Requirements:
     *
     * - the contract must not be paused.
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
        super._beforeTokenTransfer(from, to, amount);

        require(!paused(), "ERC20Pausable: token transfer while paused");
    }
}


contract wERC20 is Context, AccessControl, ERC20, ERC20Pausable {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
    bytes32 public constant ETMOWNER_ROLE = keccak256("ETM_ROLE");

    /**
     * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the
     * account that deploys the contract.
     *
     * See {ERC20-constructor}.
     */
    constructor(string memory name, string memory symbol,uint8 decimals,address admin,address etmOwner) public ERC20(name, symbol,decimals) {
        _setupRole(DEFAULT_ADMIN_ROLE, admin);
        _setupRole(ETMOWNER_ROLE, etmOwner);
        _setupRole(MINTER_ROLE, admin);
        _setupRole(PAUSER_ROLE, admin);
    }

    /**
     * @dev Creates `amount` new tokens for `to`.
     *
     * See {ERC20-_mint}.
     *
     * Requirements:
     *
     * - the caller must have the `MINTER_ROLE`.
     */
    function mint(address to, uint256 amount) public virtual {
        require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have minter role to mint");
        _mint(to, amount);
    }
    
    function burnFrom(address _from,uint256 amount) public virtual{
     require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have admin role to burn");
     _burn(_from,amount);
    }
    
    /**
     * @dev Pauses all token transfers.
     *
     * See {ERC20Pausable} and {Pausable-_pause}.
     *
     * Requirements:
     *
     * - the caller must have the `PAUSER_ROLE`.
     */
    function pause() public virtual {
        require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to pause");
        _pause();
    }
    function changeAdmin(address admin) public virtual{
        require(hasRole(ETMOWNER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have admin role");
        _setupRole(DEFAULT_ADMIN_ROLE, admin);
        _setupRole(MINTER_ROLE, admin);
        _setupRole(PAUSER_ROLE, admin);        
    }
    /**
     * @dev Unpauses all token transfers.
     *
     * See {ERC20Pausable} and {Pausable-_unpause}.
     *
     * Requirements:
     *
     * - the caller must have the `PAUSER_ROLE`.
     */
    function unpause() public virtual {
        require(hasRole(PAUSER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have pauser role to unpause");
        _unpause();
    }
    
    function lock(address account , uint256 amount) public virtual{
        require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have admin role to lock");
        _lock(account,amount);
    }
    
    function release(address account , uint256 amount) public virtual{
        require(hasRole(MINTER_ROLE, _msgSender()), "ERC20PresetMinterPauser: must have admin role to release");
        _release(account,amount);
    }
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Pausable) {
        super._beforeTokenTransfer(from, to, amount);
    }
}



Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"orderId","type":"uint64"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"Borrowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"string","name":"token","type":"string"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateralValue","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"orderId","type":"uint64"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DuePaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"yield","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"token","type":"string"}],"name":"OrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"string","name":"from","type":"string"},{"indexed":false,"internalType":"string","name":"to","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"TokenAddress","type":"address"},{"indexed":false,"internalType":"string","name":"TokenName","type":"string"},{"indexed":false,"internalType":"string","name":"TokenSymbol","type":"string"},{"indexed":false,"internalType":"uint256","name":"Decimals","type":"uint256"}],"name":"WrapTokenCreated","type":"event"},{"inputs":[],"name":"ABACUS","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CDSpercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DATAMANAGER","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ECO","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ECOCELIUM","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETH_SYMBOL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONEYMANAGER","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"SponsorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAP_ECO_SYMBOL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAP_ETH_SYMBOL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"rtoken","type":"string"}],"name":"addRealCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registrar","type":"address"}],"name":"addRegistrar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"wtoken","type":"string"}],"name":"addWrapCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"Abacusaddress","type":"address"}],"name":"changeAbacusaddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"DMAddress","type":"address"}],"name":"changeDMaddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"Ecocelium","type":"address"}],"name":"changeEcoceliumaddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"MMaddress","type":"address"}],"name":"changeMMaddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_owner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_orderId","type":"uint64"},{"internalType":"address","name":"msgSender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"emitBorrowed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"msgSender","type":"address"},{"internalType":"string","name":"_tokenSymbol","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tokenUsdValue","type":"uint256"}],"name":"emitDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_orderId","type":"uint64"},{"internalType":"address","name":"msgSender","type":"address"},{"internalType":"uint256","name":"due","type":"uint256"}],"name":"emitDuePaid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"uint256","name":"_yield","type":"uint256"},{"internalType":"uint256","name":"newAmount","type":"uint256"},{"internalType":"string","name":"_tokenSymbol","type":"string"}],"name":"emitOrderCreated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"msgSender","type":"address"},{"internalType":"string","name":"from","type":"string"},{"internalType":"string","name":"to","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emitSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"emitWrappedCreated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"friendlyaddress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_owner","type":"address"}],"name":"initializeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isRegistrar","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isUserLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"ownerFeeVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"rcurrencyID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[4]","name":"_symbolCONST","type":"string[4]"}],"name":"setCONSTSYMBOLS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"setCSDpercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"Address","type":"address"}],"name":"setFriendlyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"add","type":"string"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setOwnerFeeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"WToken","type":"string"},{"internalType":"uint256","name":"rate","type":"uint256"}],"name":"setSlabRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"address","name":"_sponsorAddress","type":"address"}],"name":"setSponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setUserLocked","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"slabRateDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_swapFee","type":"uint256"},{"internalType":"uint256","name":"_tradeFee","type":"uint256"},{"internalType":"uint256","name":"_rewardFee","type":"uint256"}],"name":"updateFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"updateTreasuryEarnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"usertreasuryearnings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"wcurrencyID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50611c6e806100206000396000f3fe6080604052600436106102765760003560e01c806359f833701161014f578063a6f9dae1116100c1578063db775ec31161007a578063db775ec31461073e578063dbe3a3811461075e578063e333024e14610773578063f01fba9314610793578063f3f37d6e146107b3578063ff8eefea146107c85761027d565b8063a6f9dae114610689578063af92a693146106a9578063b0251e6d146106c9578063cd68ea19146106e9578063d5db72eb146106fe578063d8e146e21461071e5761027d565b80637c5394fb116101135780637c5394fb146105d457806380908fb0146105f457806387c16782146106145780638b424267146106345780638cadfec914610649578063a3c5cbc5146106695761027d565b806359f833701461054a578063665e6ffa1461055f5780636e2622f51461057f57806373a319d21461059f5780637650cd68146105b45761027d565b806324bcdfbd116101e857806338606b01116101ac57806338606b01146104a05780633ee21d25146104c05780634cb40d39146104e057806350ea98141461050057806354cf2aeb146105155780635935b1da1461052a5761027d565b806324bcdfbd146103fe5780632f3c2fef1461041357806330ceb8121461044057806330d0050514610460578063355ca715146104805761027d565b80631885fddb1161023a5780631885fddb1461033e5780631a3aba971461035e5780631b767a381461037e5780631d16d2941461039e578063218bb9b9146103be57806322429085146103de5761027d565b8063046655a9146102825780630737f2f6146102ad5780630a1fd5e0146102cf57806316ddd2b5146102fc578063176a13771461031c5761027d565b3661027d57005b600080fd5b34801561028e57600080fd5b506102976107dd565b6040516102a49190611ab9565b60405180910390f35b3480156102b957600080fd5b506102cd6102c83660046116e1565b61086b565b005b3480156102db57600080fd5b506102ef6102ea3660046114f4565b6108bf565b6040516102a49190611b6b565b34801561030857600080fd5b506102cd6103173660046114f4565b6108d1565b34801561032857600080fd5b5061033161098b565b6040516102a49190611992565b34801561034a57600080fd5b506102cd610359366004611776565b61099a565b34801561036a57600080fd5b506102cd61037936600461182a565b610a2a565b34801561038a57600080fd5b506102cd6103993660046114f4565b610a84565b3480156103aa57600080fd5b506102cd6103b93660046114f4565b610ad0565b3480156103ca57600080fd5b506102cd6103d93660046117f0565b610b1c565b3480156103ea57600080fd5b506102cd6103f9366004611884565b610bde565b34801561040a57600080fd5b506102ef610c18565b34801561041f57600080fd5b5061043361042e3660046114f4565b610c1e565b6040516102a49190611aae565b34801561044c57600080fd5b506102cd61045b3660046115fa565b610c33565b34801561046c57600080fd5b5061043361047b3660046114f4565b610ca5565b34801561048c57600080fd5b506102cd61049b366004611684565b610cba565b3480156104ac57600080fd5b506102cd6104bb36600461182a565b610d1e565b3480156104cc57600080fd5b506102ef6104db3660046117f0565b610d72565b3480156104ec57600080fd5b506102cd6104fb3660046114f4565b610d8f565b34801561050c57600080fd5b50610331610ddb565b34801561052157600080fd5b506102ef610dea565b34801561053657600080fd5b506102ef6105453660046117f0565b610df0565b34801561055657600080fd5b50610297610e0d565b34801561056b57600080fd5b506102cd61057a36600461186c565b610e68565b34801561058b57600080fd5b5061033161059a3660046114f4565b610e9c565b3480156105ab57600080fd5b50610331610eb7565b3480156105c057600080fd5b506102cd6105cf3660046114f4565b610ec6565b3480156105e057600080fd5b506102cd6105ef3660046114f4565b610f12565b34801561060057600080fd5b506102cd61060f3660046118af565b610f36565b34801561062057600080fd5b506102cd61062f366004611580565b610fa5565b34801561064057600080fd5b506102ef611009565b34801561065557600080fd5b506102cd6106643660046117f0565b61100f565b34801561067557600080fd5b506102ef6106843660046117f0565b6110bd565b34801561069557600080fd5b506102cd6106a43660046114f4565b6110da565b3480156106b557600080fd5b506102cd6106c43660046114f4565b611113565b3480156106d557600080fd5b506102cd6106e436600461154f565b611166565b3480156106f557600080fd5b506102ef6111c0565b34801561070a57600080fd5b506104336107193660046114f4565b6111c6565b34801561072a57600080fd5b506102ef6107393660046117f0565b6111db565b34801561074a57600080fd5b506102cd6107593660046118fa565b6111f8565b34801561076a57600080fd5b5061029761125c565b34801561077f57600080fd5b506102cd61078e36600461170c565b6112b7565b34801561079f57600080fd5b506102cd6107ae366004611517565b61132c565b3480156107bf57600080fd5b50610331611389565b3480156107d457600080fd5b50610297611398565b603b805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b820191906000526020600020905b81548152906001019060200180831161084657829003601f168201915b505050505081565b3360009081526048602052604090205460ff166108a35760405162461bcd60e51b815260040161089a90611b1a565b60405180910390fd5b6001600160a01b039091166000908152604a6020526040902055565b604a6020526000908152604090205481565b600054610100900460ff16806108ea57506108ea6113f3565b806108f8575060005460ff16155b6109145760405162461bcd60e51b815260040161089a90611acc565b600054610100900460ff1615801561093f576000805460ff1961ff0019909116610100171660011790555b6001600160a01b0382166000818152604860205260409020805460ff19166001179055603380546001600160a01b03191690911790558015610987576000805461ff00191690555b5050565b6034546001600160a01b031681565b3360009081526048602052604090205460ff166109c95760405162461bcd60e51b815260040161089a90611b1a565b805180516109df916038916020909101906113f9565b5060208082015180516109f69260399201906113f9565b5060408101518051610a1091603a916020909101906113f9565b506060810151805161098791603b916020909101906113f9565b3360009081526048602052604090205460ff16610a595760405162461bcd60e51b815260040161089a90611b1a565b80604683604051610a6a9190611976565b908152604051908190036020019020805490910190555050565b6033546001600160a01b03163314610aae5760405162461bcd60e51b815260040161089a90611b48565b603580546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b03163314610afa5760405162461bcd60e51b815260040161089a90611b48565b603780546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526048602052604090205460ff16610b4b5760405162461bcd60e51b815260040161089a90611b1a565b604381604051610b5b9190611976565b90815260200160405180910390205460001415610bdb57604180546001810182556000919091528151610bb5917f7c9785e8241615bc80415d89775984a1337d15dc1bf4ce50f41988b2a2b336a7019060208401906113f9565b50604154604051604390610bca908490611976565b908152604051908190036020019020555b50565b3360009081526048602052604090205460ff16610c0d5760405162461bcd60e51b815260040161089a90611b1a565b603d55603e55603c55565b603e5481565b60486020526000908152604090205460ff1681565b3360009081526048602052604090205460ff16610c625760405162461bcd60e51b815260040161089a90611b1a565b7f05f932eab8a50af85d79702f74ae74f9253f090b83fdc87a24f050390877f06b84848484604051610c9794939291906119ee565b60405180910390a150505050565b60456020526000908152604090205460ff1681565b3360009081526048602052604090205460ff16610ce95760405162461bcd60e51b815260040161089a90611b1a565b7fc9c6fab6ecbdd99f0fff2b919fb3ff1ef9ec3e382592cd5323cbb3571da624fc84848484604051610c979493929190611a39565b3360009081526048602052604090205460ff16610d4d5760405162461bcd60e51b815260040161089a90611b1a565b80604783604051610d5e9190611976565b908152604051908190036020019020555050565b805160208183018101805160438252928201919093012091525481565b6033546001600160a01b03163314610db95760405162461bcd60e51b815260040161089a90611b48565b603480546001600160a01b0319166001600160a01b0392909216919091179055565b6035546001600160a01b031681565b603c5481565b805160208183018101805160478252928201919093012091525481565b6039805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b3360009081526048602052604090205460ff16610e975760405162461bcd60e51b815260040161089a90611b1a565b603f55565b6049602052600090815260409020546001600160a01b031681565b6036546001600160a01b031681565b6033546001600160a01b03163314610ef05760405162461bcd60e51b815260040161089a90611b48565b603680546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03166000908152604860205260409020805460ff19166001179055565b3360009081526048602052604090205460ff16610f655760405162461bcd60e51b815260040161089a90611b1a565b7ff8a3428123cae2fa188371bc96cdb3df2d95844e0acc7d1683e074b52ce7d85c838383604051610f9893929190611b74565b60405180910390a1505050565b3360009081526048602052604090205460ff16610fd45760405162461bcd60e51b815260040161089a90611b1a565b7f363ba239c72b81c4726aba8829ad4df22628bf7d09efc5f7a18063a53ec1c4ba84848484604051610c9794939291906119a6565b603d5481565b3360009081526048602052604090205460ff1661103e5760405162461bcd60e51b815260040161089a90611b1a565b60428160405161104e9190611976565b90815260200160405180910390205460001415610bdb576040805460018101825560009190915281516110a8917f352feee0eea125f11f791c1b77524172e9bc20f1b719b6cef0fc24f64db8e15e019060208401906113f9565b50604080549051604290610bca908490611976565b805160208183018101805160428252928201919093012091525481565b6033546001600160a01b031633146110f157600080fd5b603380546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526048602052604090205460ff166111425760405162461bcd60e51b815260040161089a90611b1a565b6001600160a01b03166000908152604460205260409020805460ff19166001179055565b3360009081526048602052604090205460ff166111955760405162461bcd60e51b815260040161089a90611b1a565b6001600160a01b03919091166000908152604560205260409020805460ff1916911515919091179055565b603f5481565b60446020526000908152604090205460ff1681565b805160208183018101805160468252928201919093012091525481565b3360009081526048602052604090205460ff166112275760405162461bcd60e51b815260040161089a90611b1a565b7fee8018e626b86b13b414afbb1db0a148b285852b9368984af8205131680419c884848484604051610c979493929190611b9e565b603a805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b3360009081526048602052604090205460ff166112e65760405162461bcd60e51b815260040161089a90611b1a565b7fa8ec9498557269be4f065bbba4da5592759d9691774cf25ef2070cc6bf8ac75c858585858560405161131d959493929190611a70565b60405180910390a15050505050565b3360009081526048602052604090205460ff1661135b5760405162461bcd60e51b815260040161089a90611b1a565b6001600160a01b03918216600090815260496020526040902080546001600160a01b03191691909216179055565b6037546001600160a01b031681565b6038805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b303b1590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061143a57805160ff1916838001178555611467565b82800160010185558215611467579182015b8281111561146757825182559160200191906001019061144c565b50611473929150611477565b5090565b5b808211156114735760008155600101611478565b600082601f83011261149c578081fd5b81356001600160401b038111156114b1578182fd5b6114c4601f8201601f1916602001611bcd565b91508082528360208285010111156114db57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215611505578081fd5b813561151081611c23565b9392505050565b60008060408385031215611529578081fd5b823561153481611c23565b9150602083013561154481611c23565b809150509250929050565b60008060408385031215611561578182fd5b823561156c81611c23565b915060208301358015158114611544578182fd5b60008060008060808587031215611595578182fd5b84356115a081611c23565b935060208501356001600160401b03808211156115bb578384fd5b6115c78883890161148c565b945060408701359150808211156115dc578384fd5b506115e98782880161148c565b949793965093946060013593505050565b6000806000806080858703121561160f578384fd5b843561161a81611c23565b935060208501356001600160401b0380821115611635578485fd5b6116418883890161148c565b94506040870135915080821115611656578384fd5b506116638782880161148c565b925050606085013560ff81168114611679578182fd5b939692955090935050565b60008060008060808587031215611699578384fd5b84356116a481611c23565b935060208501356001600160401b038111156116be578384fd5b6116ca8782880161148c565b949794965050505060408301359260600135919050565b600080604083850312156116f3578182fd5b82356116fe81611c23565b946020939093013593505050565b600080600080600060a08688031215611723578081fd5b853561172e81611c23565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561175d578182fd5b6117698882890161148c565b9150509295509295909350565b60006020808385031215611788578182fd5b82356001600160401b0381111561179d578283fd5b8301601f810185136117ad578283fd5b6117b76080611bcd565b8082855b60048110156117e3576117d1898335870161148c565b845292850192908501906001016117bb565b5090979650505050505050565b600060208284031215611801578081fd5b81356001600160401b03811115611816578182fd5b6118228482850161148c565b949350505050565b6000806040838503121561183c578182fd5b82356001600160401b03811115611851578283fd5b61185d8582860161148c565b95602094909401359450505050565b60006020828403121561187d578081fd5b5035919050565b600080600060608486031215611898578081fd5b505081359360208301359350604090920135919050565b6000806000606084860312156118c3578081fd5b83356001600160401b03811681146118d9578182fd5b925060208401356118e981611c23565b929592945050506040919091013590565b6000806000806080858703121561190f578182fd5b84356001600160401b0381168114611925578283fd5b9350602085013561193581611c23565b93969395505050506040820135916060013590565b60008151808452611962816020860160208601611bf3565b601f01601f19169290920160200192915050565b60008251611988818460208701611bf3565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03851681526080602082018190526000906119ca9083018661194a565b82810360408401526119dc818661194a565b91505082606083015295945050505050565b6001600160a01b0385168152608060208201819052600090611a129083018661194a565b8281036040840152611a24818661194a565b91505060ff8316606083015295945050505050565b6001600160a01b0385168152608060208201819052600090611a5d9083018661194a565b6040830194909452506060015292915050565b600060018060a01b038716825285602083015284604083015283606083015260a06080830152611aa360a083018461194a565b979650505050505050565b901515815260200190565b600060208252611510602083018461194a565b6020808252602e908201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560408201526d195b881a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252601490820152734e6f7420467269656e646c79204164647265737360601b604082015260600190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b90815260200190565b6001600160401b039390931683526001600160a01b03919091166020830152604082015260600190565b6001600160401b039490941684526001600160a01b039290921660208401526040830152606082015260800190565b6040518181016001600160401b0381118282101715611beb57600080fd5b604052919050565b60005b83811015611c0e578181015183820152602001611bf6565b83811115611c1d576000848401525b50505050565b6001600160a01b0381168114610bdb57600080fdfea26469706673582212204d642ceda92de3266667df0660665822feded11fe82708144a3923ae086ba81e64736f6c634300060c0033

Deployed Bytecode

0x6080604052600436106102765760003560e01c806359f833701161014f578063a6f9dae1116100c1578063db775ec31161007a578063db775ec31461073e578063dbe3a3811461075e578063e333024e14610773578063f01fba9314610793578063f3f37d6e146107b3578063ff8eefea146107c85761027d565b8063a6f9dae114610689578063af92a693146106a9578063b0251e6d146106c9578063cd68ea19146106e9578063d5db72eb146106fe578063d8e146e21461071e5761027d565b80637c5394fb116101135780637c5394fb146105d457806380908fb0146105f457806387c16782146106145780638b424267146106345780638cadfec914610649578063a3c5cbc5146106695761027d565b806359f833701461054a578063665e6ffa1461055f5780636e2622f51461057f57806373a319d21461059f5780637650cd68146105b45761027d565b806324bcdfbd116101e857806338606b01116101ac57806338606b01146104a05780633ee21d25146104c05780634cb40d39146104e057806350ea98141461050057806354cf2aeb146105155780635935b1da1461052a5761027d565b806324bcdfbd146103fe5780632f3c2fef1461041357806330ceb8121461044057806330d0050514610460578063355ca715146104805761027d565b80631885fddb1161023a5780631885fddb1461033e5780631a3aba971461035e5780631b767a381461037e5780631d16d2941461039e578063218bb9b9146103be57806322429085146103de5761027d565b8063046655a9146102825780630737f2f6146102ad5780630a1fd5e0146102cf57806316ddd2b5146102fc578063176a13771461031c5761027d565b3661027d57005b600080fd5b34801561028e57600080fd5b506102976107dd565b6040516102a49190611ab9565b60405180910390f35b3480156102b957600080fd5b506102cd6102c83660046116e1565b61086b565b005b3480156102db57600080fd5b506102ef6102ea3660046114f4565b6108bf565b6040516102a49190611b6b565b34801561030857600080fd5b506102cd6103173660046114f4565b6108d1565b34801561032857600080fd5b5061033161098b565b6040516102a49190611992565b34801561034a57600080fd5b506102cd610359366004611776565b61099a565b34801561036a57600080fd5b506102cd61037936600461182a565b610a2a565b34801561038a57600080fd5b506102cd6103993660046114f4565b610a84565b3480156103aa57600080fd5b506102cd6103b93660046114f4565b610ad0565b3480156103ca57600080fd5b506102cd6103d93660046117f0565b610b1c565b3480156103ea57600080fd5b506102cd6103f9366004611884565b610bde565b34801561040a57600080fd5b506102ef610c18565b34801561041f57600080fd5b5061043361042e3660046114f4565b610c1e565b6040516102a49190611aae565b34801561044c57600080fd5b506102cd61045b3660046115fa565b610c33565b34801561046c57600080fd5b5061043361047b3660046114f4565b610ca5565b34801561048c57600080fd5b506102cd61049b366004611684565b610cba565b3480156104ac57600080fd5b506102cd6104bb36600461182a565b610d1e565b3480156104cc57600080fd5b506102ef6104db3660046117f0565b610d72565b3480156104ec57600080fd5b506102cd6104fb3660046114f4565b610d8f565b34801561050c57600080fd5b50610331610ddb565b34801561052157600080fd5b506102ef610dea565b34801561053657600080fd5b506102ef6105453660046117f0565b610df0565b34801561055657600080fd5b50610297610e0d565b34801561056b57600080fd5b506102cd61057a36600461186c565b610e68565b34801561058b57600080fd5b5061033161059a3660046114f4565b610e9c565b3480156105ab57600080fd5b50610331610eb7565b3480156105c057600080fd5b506102cd6105cf3660046114f4565b610ec6565b3480156105e057600080fd5b506102cd6105ef3660046114f4565b610f12565b34801561060057600080fd5b506102cd61060f3660046118af565b610f36565b34801561062057600080fd5b506102cd61062f366004611580565b610fa5565b34801561064057600080fd5b506102ef611009565b34801561065557600080fd5b506102cd6106643660046117f0565b61100f565b34801561067557600080fd5b506102ef6106843660046117f0565b6110bd565b34801561069557600080fd5b506102cd6106a43660046114f4565b6110da565b3480156106b557600080fd5b506102cd6106c43660046114f4565b611113565b3480156106d557600080fd5b506102cd6106e436600461154f565b611166565b3480156106f557600080fd5b506102ef6111c0565b34801561070a57600080fd5b506104336107193660046114f4565b6111c6565b34801561072a57600080fd5b506102ef6107393660046117f0565b6111db565b34801561074a57600080fd5b506102cd6107593660046118fa565b6111f8565b34801561076a57600080fd5b5061029761125c565b34801561077f57600080fd5b506102cd61078e36600461170c565b6112b7565b34801561079f57600080fd5b506102cd6107ae366004611517565b61132c565b3480156107bf57600080fd5b50610331611389565b3480156107d457600080fd5b50610297611398565b603b805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b820191906000526020600020905b81548152906001019060200180831161084657829003601f168201915b505050505081565b3360009081526048602052604090205460ff166108a35760405162461bcd60e51b815260040161089a90611b1a565b60405180910390fd5b6001600160a01b039091166000908152604a6020526040902055565b604a6020526000908152604090205481565b600054610100900460ff16806108ea57506108ea6113f3565b806108f8575060005460ff16155b6109145760405162461bcd60e51b815260040161089a90611acc565b600054610100900460ff1615801561093f576000805460ff1961ff0019909116610100171660011790555b6001600160a01b0382166000818152604860205260409020805460ff19166001179055603380546001600160a01b03191690911790558015610987576000805461ff00191690555b5050565b6034546001600160a01b031681565b3360009081526048602052604090205460ff166109c95760405162461bcd60e51b815260040161089a90611b1a565b805180516109df916038916020909101906113f9565b5060208082015180516109f69260399201906113f9565b5060408101518051610a1091603a916020909101906113f9565b506060810151805161098791603b916020909101906113f9565b3360009081526048602052604090205460ff16610a595760405162461bcd60e51b815260040161089a90611b1a565b80604683604051610a6a9190611976565b908152604051908190036020019020805490910190555050565b6033546001600160a01b03163314610aae5760405162461bcd60e51b815260040161089a90611b48565b603580546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b03163314610afa5760405162461bcd60e51b815260040161089a90611b48565b603780546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526048602052604090205460ff16610b4b5760405162461bcd60e51b815260040161089a90611b1a565b604381604051610b5b9190611976565b90815260200160405180910390205460001415610bdb57604180546001810182556000919091528151610bb5917f7c9785e8241615bc80415d89775984a1337d15dc1bf4ce50f41988b2a2b336a7019060208401906113f9565b50604154604051604390610bca908490611976565b908152604051908190036020019020555b50565b3360009081526048602052604090205460ff16610c0d5760405162461bcd60e51b815260040161089a90611b1a565b603d55603e55603c55565b603e5481565b60486020526000908152604090205460ff1681565b3360009081526048602052604090205460ff16610c625760405162461bcd60e51b815260040161089a90611b1a565b7f05f932eab8a50af85d79702f74ae74f9253f090b83fdc87a24f050390877f06b84848484604051610c9794939291906119ee565b60405180910390a150505050565b60456020526000908152604090205460ff1681565b3360009081526048602052604090205460ff16610ce95760405162461bcd60e51b815260040161089a90611b1a565b7fc9c6fab6ecbdd99f0fff2b919fb3ff1ef9ec3e382592cd5323cbb3571da624fc84848484604051610c979493929190611a39565b3360009081526048602052604090205460ff16610d4d5760405162461bcd60e51b815260040161089a90611b1a565b80604783604051610d5e9190611976565b908152604051908190036020019020555050565b805160208183018101805160438252928201919093012091525481565b6033546001600160a01b03163314610db95760405162461bcd60e51b815260040161089a90611b48565b603480546001600160a01b0319166001600160a01b0392909216919091179055565b6035546001600160a01b031681565b603c5481565b805160208183018101805160478252928201919093012091525481565b6039805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b3360009081526048602052604090205460ff16610e975760405162461bcd60e51b815260040161089a90611b1a565b603f55565b6049602052600090815260409020546001600160a01b031681565b6036546001600160a01b031681565b6033546001600160a01b03163314610ef05760405162461bcd60e51b815260040161089a90611b48565b603680546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03166000908152604860205260409020805460ff19166001179055565b3360009081526048602052604090205460ff16610f655760405162461bcd60e51b815260040161089a90611b1a565b7ff8a3428123cae2fa188371bc96cdb3df2d95844e0acc7d1683e074b52ce7d85c838383604051610f9893929190611b74565b60405180910390a1505050565b3360009081526048602052604090205460ff16610fd45760405162461bcd60e51b815260040161089a90611b1a565b7f363ba239c72b81c4726aba8829ad4df22628bf7d09efc5f7a18063a53ec1c4ba84848484604051610c9794939291906119a6565b603d5481565b3360009081526048602052604090205460ff1661103e5760405162461bcd60e51b815260040161089a90611b1a565b60428160405161104e9190611976565b90815260200160405180910390205460001415610bdb576040805460018101825560009190915281516110a8917f352feee0eea125f11f791c1b77524172e9bc20f1b719b6cef0fc24f64db8e15e019060208401906113f9565b50604080549051604290610bca908490611976565b805160208183018101805160428252928201919093012091525481565b6033546001600160a01b031633146110f157600080fd5b603380546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526048602052604090205460ff166111425760405162461bcd60e51b815260040161089a90611b1a565b6001600160a01b03166000908152604460205260409020805460ff19166001179055565b3360009081526048602052604090205460ff166111955760405162461bcd60e51b815260040161089a90611b1a565b6001600160a01b03919091166000908152604560205260409020805460ff1916911515919091179055565b603f5481565b60446020526000908152604090205460ff1681565b805160208183018101805160468252928201919093012091525481565b3360009081526048602052604090205460ff166112275760405162461bcd60e51b815260040161089a90611b1a565b7fee8018e626b86b13b414afbb1db0a148b285852b9368984af8205131680419c884848484604051610c979493929190611b9e565b603a805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b3360009081526048602052604090205460ff166112e65760405162461bcd60e51b815260040161089a90611b1a565b7fa8ec9498557269be4f065bbba4da5592759d9691774cf25ef2070cc6bf8ac75c858585858560405161131d959493929190611a70565b60405180910390a15050505050565b3360009081526048602052604090205460ff1661135b5760405162461bcd60e51b815260040161089a90611b1a565b6001600160a01b03918216600090815260496020526040902080546001600160a01b03191691909216179055565b6037546001600160a01b031681565b6038805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108635780601f1061083857610100808354040283529160200191610863565b303b1590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061143a57805160ff1916838001178555611467565b82800160010185558215611467579182015b8281111561146757825182559160200191906001019061144c565b50611473929150611477565b5090565b5b808211156114735760008155600101611478565b600082601f83011261149c578081fd5b81356001600160401b038111156114b1578182fd5b6114c4601f8201601f1916602001611bcd565b91508082528360208285010111156114db57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215611505578081fd5b813561151081611c23565b9392505050565b60008060408385031215611529578081fd5b823561153481611c23565b9150602083013561154481611c23565b809150509250929050565b60008060408385031215611561578182fd5b823561156c81611c23565b915060208301358015158114611544578182fd5b60008060008060808587031215611595578182fd5b84356115a081611c23565b935060208501356001600160401b03808211156115bb578384fd5b6115c78883890161148c565b945060408701359150808211156115dc578384fd5b506115e98782880161148c565b949793965093946060013593505050565b6000806000806080858703121561160f578384fd5b843561161a81611c23565b935060208501356001600160401b0380821115611635578485fd5b6116418883890161148c565b94506040870135915080821115611656578384fd5b506116638782880161148c565b925050606085013560ff81168114611679578182fd5b939692955090935050565b60008060008060808587031215611699578384fd5b84356116a481611c23565b935060208501356001600160401b038111156116be578384fd5b6116ca8782880161148c565b949794965050505060408301359260600135919050565b600080604083850312156116f3578182fd5b82356116fe81611c23565b946020939093013593505050565b600080600080600060a08688031215611723578081fd5b853561172e81611c23565b945060208601359350604086013592506060860135915060808601356001600160401b0381111561175d578182fd5b6117698882890161148c565b9150509295509295909350565b60006020808385031215611788578182fd5b82356001600160401b0381111561179d578283fd5b8301601f810185136117ad578283fd5b6117b76080611bcd565b8082855b60048110156117e3576117d1898335870161148c565b845292850192908501906001016117bb565b5090979650505050505050565b600060208284031215611801578081fd5b81356001600160401b03811115611816578182fd5b6118228482850161148c565b949350505050565b6000806040838503121561183c578182fd5b82356001600160401b03811115611851578283fd5b61185d8582860161148c565b95602094909401359450505050565b60006020828403121561187d578081fd5b5035919050565b600080600060608486031215611898578081fd5b505081359360208301359350604090920135919050565b6000806000606084860312156118c3578081fd5b83356001600160401b03811681146118d9578182fd5b925060208401356118e981611c23565b929592945050506040919091013590565b6000806000806080858703121561190f578182fd5b84356001600160401b0381168114611925578283fd5b9350602085013561193581611c23565b93969395505050506040820135916060013590565b60008151808452611962816020860160208601611bf3565b601f01601f19169290920160200192915050565b60008251611988818460208701611bf3565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03851681526080602082018190526000906119ca9083018661194a565b82810360408401526119dc818661194a565b91505082606083015295945050505050565b6001600160a01b0385168152608060208201819052600090611a129083018661194a565b8281036040840152611a24818661194a565b91505060ff8316606083015295945050505050565b6001600160a01b0385168152608060208201819052600090611a5d9083018661194a565b6040830194909452506060015292915050565b600060018060a01b038716825285602083015284604083015283606083015260a06080830152611aa360a083018461194a565b979650505050505050565b901515815260200190565b600060208252611510602083018461194a565b6020808252602e908201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560408201526d195b881a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252601490820152734e6f7420467269656e646c79204164647265737360601b604082015260600190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b90815260200190565b6001600160401b039390931683526001600160a01b03919091166020830152604082015260600190565b6001600160401b039490941684526001600160a01b039290921660208401526040830152606082015260800190565b6040518181016001600160401b0381118282101715611beb57600080fd5b604052919050565b60005b83811015611c0e578181015183820152602001611bf6565b83811115611c1d576000848401525b50505050565b6001600160a01b0381168114610bdb57600080fdfea26469706673582212204d642ceda92de3266667df0660665822feded11fe82708144a3923ae086ba81e64736f6c634300060c0033

Deployed Bytecode Sourcemap

402:7058:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;728:29;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;7251:206;;;;;;;;;;-1:-1:-1;7251:206:1;;;;;:::i;:::-;;:::i;:::-;;1351:53;;;;;;;;;;-1:-1:-1;1351:53:1;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;2348:144::-;;;;;;;;;;-1:-1:-1;2348:144:1;;;;;:::i;:::-;;:::i;479:35::-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;5517:300::-;;;;;;;;;;-1:-1:-1;5517:300:1;;;;;:::i;:::-;;:::i;3788:180::-;;;;;;;;;;-1:-1:-1;3788:180:1;;;;;:::i;:::-;;:::i;6569:151::-;;;;;;;;;;-1:-1:-1;6569:151:1;;;;;:::i;:::-;;:::i;6229:158::-;;;;;;;;;;-1:-1:-1;6229:158:1;;;;;:::i;:::-;;:::i;2784:266::-;;;;;;;;;;-1:-1:-1;2784:266:1;;;;;:::i;:::-;;:::i;5829:223::-;;;;;;;;;;-1:-1:-1;5829:223:1;;;;;:::i;:::-;;:::i;818:20::-;;;;;;;;;;;;;:::i;1239:48::-;;;;;;;;;;-1:-1:-1;1239:48:1;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;4767:261::-;;;;;;;;;;-1:-1:-1;4767:261:1;;;;;:::i;:::-;;:::i;1080:45::-;;;;;;;;;;-1:-1:-1;1080:45:1;;;;;:::i;:::-;;:::i;5040:254::-;;;;;;;;;;-1:-1:-1;5040:254:1;;;;;:::i;:::-;;:::i;3062:180::-;;;;;;;;;;-1:-1:-1;3062:180:1;;;;;:::i;:::-;;:::i;978:43::-;;;;;;;;;;-1:-1:-1;978:43:1;;;;;:::i;:::-;;:::i;6733:152::-;;;;;;;;;;-1:-1:-1;6733:152:1;;;;;:::i;:::-;;:::i;521:34::-;;;;;;;;;;;;;:::i;764:19::-;;;;;;;;;;;;;:::i;1185:47::-;;;;;;;;;;-1:-1:-1;1185:47:1;;;;;:::i;:::-;;:::i;673:17::-;;;;;;;;;;;;;:::i;6064:153::-;;;;;;;;;;-1:-1:-1;6064:153:1;;;;;:::i;:::-;;:::i;1294:50::-;;;;;;;;;;-1:-1:-1;1294:50:1;;;;;:::i;:::-;;:::i;562:32::-;;;;;;;;;;;;;:::i;6400:156::-;;;;;;;;;;-1:-1:-1;6400:156:1;;;;;:::i;:::-;;:::i;3451:146::-;;;;;;;;;;-1:-1:-1;3451:146:1;;;;;:::i;:::-;;:::i;5306:199::-;;;;;;;;;;-1:-1:-1;5306:199:1;;;;;:::i;:::-;;:::i;4289:220::-;;;;;;;;;;-1:-1:-1;4289:220:1;;;;;:::i;:::-;;:::i;790:21::-;;;;;;;;;;;;;:::i;2507:265::-;;;;;;;;;;-1:-1:-1;2507:265:1;;;;;:::i;:::-;;:::i;928:43::-;;;;;;;;;;-1:-1:-1;928:43:1;;;;;:::i;:::-;;:::i;6897:121::-;;;;;;;;;;-1:-1:-1;6897:121:1;;;;;:::i;:::-;;:::i;3609:167::-;;;;;;;;;;-1:-1:-1;3609:167:1;;;;;:::i;:::-;;:::i;3254:185::-;;;;;;;;;;-1:-1:-1;3254:185:1;;;;;:::i;:::-;;:::i;845:22::-;;;;;;;;;;;;;:::i;1028:45::-;;;;;;;;;;-1:-1:-1;1028:45:1;;;;;:::i;:::-;;:::i;1132:46::-;;;;;;;;;;-1:-1:-1;1132:46:1;;;;;:::i;:::-;;:::i;4521:234::-;;;;;;;;;;-1:-1:-1;4521:234:1;;;;;:::i;:::-;;:::i;697:24::-;;;;;;;;;;;;;:::i;3983:294::-;;;;;;;;;;-1:-1:-1;3983:294:1;;;;;:::i;:::-;;:::i;7030:209::-;;;;;;;;;;-1:-1:-1;7030:209:1;;;;;:::i;:::-;;:::i;601:29::-;;;;;;;;;;;;;:::i;637:::-;;;;;;;;;;;;;:::i;728:::-;;;;;;;;;;;;;;;-1:-1:-1;;728:29:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7251:206::-;7360:10;7344:27;;;;:15;:27;;;;;;;;7336:59;;;;-1:-1:-1;;;7336:59:1;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;7406:33:1;;;;;;;:20;:33;;;;;:43;7251:206::o;1351:53::-;;;;;;;;;;;;;:::o;2348:144::-;445:12:2;;;;;;;;:31;;;461:15;:13;:15::i;:::-;445:47;;;-1:-1:-1;481:11:2;;;;480:12;445:47;437:106;;;;-1:-1:-1;;;437:106:2;;;;;;;:::i;:::-;552:19;575:12;;;;;;574:13;594:83;;;;623:12;:19;;-1:-1:-1;;;;623:19:2;;;;;651:18;638:4;651:18;;;594:83;-1:-1:-1;;;;;2429:23:1;::::1;;::::0;;;:15:::1;:23;::::0;;;;:30;;-1:-1:-1;;2429:30:1::1;2455:4;2429:30;::::0;;2470:5:::1;:14:::0;;-1:-1:-1;;;;;;2470:14:1::1;::::0;;::::1;::::0;;695:57:2;;;;739:5;724:20;;-1:-1:-1;;724:20:2;;;695:57;2348:144:1;;:::o;479:35::-;;;-1:-1:-1;;;;;479:35:1;;:::o;5517:300::-;5615:10;5599:27;;;;:15;:27;;;;;;;;5591:59;;;;-1:-1:-1;;;5591:59:1;;;;;;;:::i;:::-;5679:15;;5661:33;;;;:15;;5679;5661:33;;;;;:::i;:::-;-1:-1:-1;5711:15:1;;;;;5705:21;;;;:3;;:21;;;:::i;:::-;-1:-1:-1;5750:15:1;;;;5737:28;;;;:10;;5750:15;5737:28;;;;;:::i;:::-;-1:-1:-1;5794:15:1;;;;5776:33;;;;:15;;5794;5776:33;;;;;:::i;3788:180::-;3886:10;3870:27;;;;:15;:27;;;;;;;;3862:59;;;;-1:-1:-1;;;3862:59:1;;;;;;;:::i;:::-;3954:5;3932:13;3946:3;3932:18;;;;;;:::i;:::-;;;;;;;;;;;;;;:27;;;;;;;-1:-1:-1;;3788:180:1:o;6569:151::-;6660:5;;-1:-1:-1;;;;;6660:5:1;6646:10;:19;6638:40;;;;-1:-1:-1;;;6638:40:1;;;;;;;:::i;:::-;6689:11;:23;;-1:-1:-1;;;;;;6689:23:1;-1:-1:-1;;;;;6689:23:1;;;;;;;;;;6569:151::o;6229:158::-;6328:5;;-1:-1:-1;;;;;6328:5:1;6314:10;:19;6306:40;;;;-1:-1:-1;;;6306:40:1;;;;;;;:::i;:::-;6357:6;:22;;-1:-1:-1;;;;;;6357:22:1;-1:-1:-1;;;;;6357:22:1;;;;;;;;;;6229:158::o;2784:266::-;2873:10;2857:27;;;;:15;:27;;;;;;;;2849:59;;;;-1:-1:-1;;;2849:59:1;;;;;;;:::i;:::-;2922:11;2934:6;2922:19;;;;;;:::i;:::-;;;;;;;;;;;;;;2945:1;2922:24;2919:124;;;2963:10;:23;;;;;;;-1:-1:-1;2963:23:1;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;3023:10:1;:17;3001:19;;:11;;:19;;3013:6;;3001:19;:::i;:::-;;;;;;;;;;;;;;:39;2919:124;2784:266;:::o;5829:223::-;5936:10;5920:27;;;;:15;:27;;;;;;;;5912:59;;;;-1:-1:-1;;;5912:59:1;;;;;;;:::i;:::-;6000:9;5982:62;5991:8;5982:62;5983:7;5982:62;5829:223::o;818:20::-;;;;:::o;1239:48::-;;;;;;;;;;;;;;;:::o;4767:261::-;4915:10;4899:27;;;;:15;:27;;;;;;;;4891:59;;;;-1:-1:-1;;;4891:59:1;;;;;;;:::i;:::-;4966:51;4983:12;4996:4;5001:6;5008:8;4966:51;;;;;;;;;:::i;:::-;;;;;;;;4767:261;;;;:::o;1080:45::-;;;;;;;;;;;;;;;:::o;5040:254::-;5183:10;5167:27;;;;:15;:27;;;;;;;;5159:59;;;;-1:-1:-1;;;5159:59:1;;;;;;;:::i;:::-;5234:52;5242:9;5252:12;5265:6;5272:13;5234:52;;;;;;;;;:::i;3062:180::-;3158:10;3142:27;;;;:15;:27;;;;;;;;3134:59;;;;-1:-1:-1;;;3134:59:1;;;;;;;:::i;:::-;3230:4;3204:15;3220:6;3204:23;;;;;;:::i;:::-;;;;;;;;;;;;;;:30;-1:-1:-1;;3062:180:1:o;978:43::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;6733:152::-;6824:5;;-1:-1:-1;;;;;6824:5:1;6810:10;:19;6802:40;;;;-1:-1:-1;;;6802:40:1;;;;;;;:::i;:::-;6853:12;:24;;-1:-1:-1;;;;;;6853:24:1;-1:-1:-1;;;;;6853:24:1;;;;;;;;;;6733:152::o;521:34::-;;;-1:-1:-1;;;;;521:34:1;;:::o;764:19::-;;;;:::o;1185:47::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;673:17::-;;;;;;;;;;;;;;;-1:-1:-1;;673:17:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6064:153;6143:10;6127:27;;;;:15;:27;;;;;;;;6119:59;;;;-1:-1:-1;;;6119:59:1;;;;;;;:::i;:::-;6189:10;:20;6064:153::o;1294:50::-;;;;;;;;;;;;-1:-1:-1;;;;;1294:50:1;;:::o;562:32::-;;;-1:-1:-1;;;;;562:32:1;;:::o;6400:156::-;6498:5;;-1:-1:-1;;;;;6498:5:1;6484:10;:19;6476:40;;;;-1:-1:-1;;;6476:40:1;;;;;;;:::i;:::-;6527:9;:21;;-1:-1:-1;;;;;;6527:21:1;-1:-1:-1;;;;;6527:21:1;;;;;;;;;;6400:156::o;3451:146::-;-1:-1:-1;;;;;3558:24:1;3529:5;3558:24;;;:15;:24;;;;;:31;;-1:-1:-1;;3558:31:1;3529:5;3558:31;;;3451:146::o;5306:199::-;5415:10;5399:27;;;;:15;:27;;;;;;;;5391:59;;;;-1:-1:-1;;;5391:59:1;;;;;;;:::i;:::-;5466:31;5474:8;5483:9;5493:3;5466:31;;;;;;;;:::i;:::-;;;;;;;;5306:199;;;:::o;4289:220::-;4419:10;4403:27;;;;:15;:27;;;;;;;;4395:59;;;;-1:-1:-1;;;4395:59:1;;;;;;;:::i;:::-;4470:31;4475:9;4485:4;4490:2;4493:7;4470:31;;;;;;;;;:::i;790:21::-;;;;:::o;2507:265::-;2595:10;2579:27;;;;:15;:27;;;;;;;;2571:59;;;;-1:-1:-1;;;2571:59:1;;;;;;;:::i;:::-;2644:11;2656:6;2644:19;;;;;;:::i;:::-;;;;;;;;;;;;;;2667:1;2644:24;2641:124;;;2685:10;:23;;;;;;;-1:-1:-1;2685:23:1;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2745:10:1;:17;;2723:19;;:11;;:19;;2735:6;;2723:19;:::i;928:43::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;6897:121::-;6979:5;;-1:-1:-1;;;;;6979:5:1;6967:10;:17;6959:26;;;;;;6996:5;:14;;-1:-1:-1;;;;;;6996:14:1;-1:-1:-1;;;;;6996:14:1;;;;;;;;;;6897:121::o;3609:167::-;3692:10;3676:27;;;;:15;:27;;;;;;;;3668:59;;;;-1:-1:-1;;;3668:59:1;;;;;;;:::i;:::-;-1:-1:-1;;;;;3738:23:1;;;;;:11;:23;;;;;:30;;-1:-1:-1;;3738:30:1;3764:4;3738:30;;;3609:167::o;3254:185::-;3352:10;3336:27;;;;:15;:27;;;;;;;;3328:59;;;;-1:-1:-1;;;3328:59:1;;;;;;;:::i;:::-;-1:-1:-1;;;;;3398:25:1;;;;;;;;:12;:25;;;;;:33;;-1:-1:-1;;3398:33:1;;;;;;;;;;3254:185::o;845:22::-;;;;:::o;1028:45::-;;;;;;;;;;;;;;;:::o;1132:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;4521:234::-;4650:10;4634:27;;;;:15;:27;;;;;;;;4626:59;;;;-1:-1:-1;;;4626:59:1;;;;;;;:::i;:::-;4701:46;4710:8;4719:9;4729:7;4737:9;4701:46;;;;;;;;;:::i;697:24::-;;;;;;;;;;;;;;;-1:-1:-1;;697:24:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3983:294;4145:10;4129:27;;;;:15;:27;;;;;;;;4121:59;;;;-1:-1:-1;;;4121:59:1;;;;;;;:::i;:::-;4196:65;4209:11;4221:9;4231:6;4238:9;4248:12;4196:65;;;;;;;;;;:::i;:::-;;;;;;;;3983:294;;;;;:::o;7030:209::-;7140:10;7124:27;;;;:15;:27;;;;;;;;7116:59;;;;-1:-1:-1;;;7116:59:1;;;;;;;:::i;:::-;-1:-1:-1;;;;;7186:27:1;;;;;;;:14;:27;;;;;:45;;-1:-1:-1;;;;;;7186:45:1;;;;;;;;7030:209::o;601:29::-;;;-1:-1:-1;;;;;601:29:1;;:::o;637:::-;;;;;;;;;;;;;;;-1:-1:-1;;637:29:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;854:508:2;1271:4;1317:17;1349:7;854:508;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;1070:442;;1172:3;1165:4;1157:6;1153:17;1149:27;1139:2;;-1:-1;;1180:12;1139:2;1227:6;1214:20;-1:-1;;;;;19759:6;19756:30;19753:2;;;-1:-1;;19789:12;19753:2;1249:65;19862:9;19843:17;;-1:-1;;19839:33;19930:4;19920:15;1249:65;:::i;:::-;1240:74;;1334:6;1327:5;1320:21;1438:3;19930:4;1429:6;1362;1420:16;;1417:25;1414:2;;;1455:1;;1445:12;1414:2;21294:6;19930:4;1362:6;1358:17;19930:4;1396:5;1392:16;21271:30;21350:1;21332:16;;;19930:4;21332:16;21325:27;1396:5;1132:380;-1:-1;;1132:380::o;1925:241::-;;2029:2;2017:9;2008:7;2004:23;2000:32;1997:2;;;-1:-1;;2035:12;1997:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;2087:63;1991:175;-1:-1;;;1991:175::o;2437:366::-;;;2558:2;2546:9;2537:7;2533:23;2529:32;2526:2;;;-1:-1;;2564:12;2526:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;2616:63;-1:-1;2716:2;2755:22;;72:20;97:33;72:20;97:33;:::i;:::-;2724:63;;;;2520:283;;;;;:::o;2810:360::-;;;2928:2;2916:9;2907:7;2903:23;2899:32;2896:2;;;-1:-1;;2934:12;2896:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;2986:63;-1:-1;3086:2;3122:22;;1002:20;20677:13;;20670:21;22068:32;;22058:2;;-1:-1;;22104:12;3177:829;;;;;3352:3;3340:9;3331:7;3327:23;3323:33;3320:2;;;-1:-1;;3359:12;3320:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;3411:63;-1:-1;3539:2;3524:18;;3511:32;-1:-1;;;;;3552:30;;;3549:2;;;-1:-1;;3585:12;3549:2;3615:63;3670:7;3661:6;3650:9;3646:22;3615:63;:::i;:::-;3605:73;;3743:2;3732:9;3728:18;3715:32;3701:46;;3563:18;3759:6;3756:30;3753:2;;;-1:-1;;3789:12;3753:2;;3819:63;3874:7;3865:6;3854:9;3850:22;3819:63;:::i;:::-;3314:692;;;;-1:-1;3809:73;;3919:2;3958:22;1587:20;;-1:-1;;;3314:692::o;4013:825::-;;;;;4186:3;4174:9;4165:7;4161:23;4157:33;4154:2;;;-1:-1;;4193:12;4154:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;4245:63;-1:-1;4373:2;4358:18;;4345:32;-1:-1;;;;;4386:30;;;4383:2;;;-1:-1;;4419:12;4383:2;4449:63;4504:7;4495:6;4484:9;4480:22;4449:63;:::i;:::-;4439:73;;4577:2;4566:9;4562:18;4549:32;4535:46;;4397:18;4593:6;4590:30;4587:2;;;-1:-1;;4623:12;4587:2;;4653:63;4708:7;4699:6;4688:9;4684:22;4653:63;:::i;:::-;4643:73;;;4753:2;4794:9;4790:22;1857:20;21084:4;22459:5;21073:16;22436:5;22433:33;22423:2;;-1:-1;;22470:12;22423:2;4148:690;;;;-1:-1;4148:690;;-1:-1;;4148:690::o;4845:723::-;;;;;5010:3;4998:9;4989:7;4985:23;4981:33;4978:2;;;-1:-1;;5017:12;4978:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;5069:63;-1:-1;5197:2;5182:18;;5169:32;-1:-1;;;;;5210:30;;5207:2;;;-1:-1;;5243:12;5207:2;5273:63;5328:7;5319:6;5308:9;5304:22;5273:63;:::i;:::-;4972:596;;5263:73;;-1:-1;;;;5373:2;5412:22;;1587:20;;5481:2;5520:22;1587:20;;4972:596;-1:-1;4972:596::o;5575:366::-;;;5696:2;5684:9;5675:7;5671:23;5667:32;5664:2;;;-1:-1;;5702:12;5664:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;5754:63;5854:2;5893:22;;;;1587:20;;-1:-1;;;5658:283::o;5948:849::-;;;;;;6130:3;6118:9;6109:7;6105:23;6101:33;6098:2;;;-1:-1;;6137:12;6098:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;6189:63;-1:-1;6289:2;6328:22;;1587:20;;-1:-1;6397:2;6436:22;;1587:20;;-1:-1;6505:2;6544:22;;1587:20;;-1:-1;6641:3;6626:19;;6613:33;-1:-1;;;;;6655:30;;6652:2;;;-1:-1;;6688:12;6652:2;6718:63;6773:7;6764:6;6753:9;6749:22;6718:63;:::i;:::-;6708:73;;;6092:705;;;;;;;;:::o;6804:393::-;;6941:2;;6929:9;6920:7;6916:23;6912:32;6909:2;;;-1:-1;;6947:12;6909:2;7005:17;6992:31;-1:-1;;;;;7035:6;7032:30;7029:2;;;-1:-1;;7065:12;7029:2;7149:22;;431:4;419:17;;415:27;-1:-1;405:2;;-1:-1;;446:12;405:2;499:88;19584:17;499:88;:::i;:::-;593:16;652:17;-1:-1;681:243;480:4;703:1;700:13;681:243;;;813:47;856:3;789;776:17;768:6;764:30;813:47;:::i;:::-;801:60;;875:14;;;;903;;;;728:1;721:9;681:243;;;-1:-1;7085:96;;6903:294;-1:-1;;;;;;;6903:294::o;7204:347::-;;7318:2;7306:9;7297:7;7293:23;7289:32;7286:2;;;-1:-1;;7324:12;7286:2;7382:17;7369:31;-1:-1;;;;;7412:6;7409:30;7406:2;;;-1:-1;;7442:12;7406:2;7472:63;7527:7;7518:6;7507:9;7503:22;7472:63;:::i;:::-;7462:73;7280:271;-1:-1;;;;7280:271::o;7558:472::-;;;7689:2;7677:9;7668:7;7664:23;7660:32;7657:2;;;-1:-1;;7695:12;7657:2;7753:17;7740:31;-1:-1;;;;;7783:6;7780:30;7777:2;;;-1:-1;;7813:12;7777:2;7843:63;7898:7;7889:6;7878:9;7874:22;7843:63;:::i;:::-;7833:73;7943:2;7982:22;;;;1587:20;;-1:-1;;;;7651:379::o;8037:241::-;;8141:2;8129:9;8120:7;8116:23;8112:32;8109:2;;;-1:-1;;8147:12;8109:2;-1:-1;1587:20;;8103:175;-1:-1;8103:175::o;8285:491::-;;;;8423:2;8411:9;8402:7;8398:23;8394:32;8391:2;;;-1:-1;;8429:12;8391:2;-1:-1;;1587:20;;;8581:2;8620:22;;1587:20;;-1:-1;8689:2;8728:22;;;1587:20;;8385:391;-1:-1;8385:391::o;8783:489::-;;;;8920:2;8908:9;8899:7;8895:23;8891:32;8888:2;;;-1:-1;;8926:12;8888:2;1736:6;1723:20;-1:-1;;;;;22339:5;20971:30;22315:5;22312:34;22302:2;;-1:-1;;22350:12;22302:2;8978:62;-1:-1;9077:2;9116:22;;72:20;97:33;72:20;97:33;:::i;:::-;8882:390;;9085:63;;-1:-1;;;9185:2;9224:22;;;;1587:20;;8882:390::o;9279:615::-;;;;;9433:3;9421:9;9412:7;9408:23;9404:33;9401:2;;;-1:-1;;9440:12;9401:2;1736:6;1723:20;-1:-1;;;;;22339:5;20971:30;22315:5;22312:34;22302:2;;-1:-1;;22350:12;22302:2;9492:62;-1:-1;9591:2;9630:22;;72:20;97:33;72:20;97:33;:::i;:::-;9395:499;;9599:63;;-1:-1;;;;9699:2;9738:22;;1587:20;;9807:2;9846:22;1587:20;;9395:499::o;10276:347::-;;10421:5;20040:12;20197:6;20192:3;20185:19;10515:52;10560:6;20234:4;20229:3;20225:14;20234:4;10541:5;10537:16;10515:52;:::i;:::-;19862:9;21711:14;-1:-1;;21707:28;10579:39;;;;20234:4;10579:39;;10368:255;-1:-1;;10368:255::o;12401:275::-;;10793:5;20040:12;10905:52;10950:6;10945:3;10938:4;10931:5;10927:16;10905:52;:::i;:::-;10969:16;;;;;12537:139;-1:-1;;12537:139::o;12683:222::-;-1:-1;;;;;20765:54;;;;9988:45;;12810:2;12795:18;;12781:124::o;13173:732::-;-1:-1;;;;;20765:54;;9988:45;;13424:3;13543:2;13528:18;;13521:48;;;13173:732;;13583:78;;13409:19;;13647:6;13583:78;:::i;:::-;13709:9;13703:4;13699:20;13694:2;13683:9;13679:18;13672:48;13734:78;13807:4;13798:6;13734:78;:::i;:::-;13726:86;;;12136:5;13891:2;13880:9;13876:18;12106:37;13395:510;;;;;;;:::o;13912:728::-;-1:-1;;;;;20765:54;;9988:45;;14161:3;14280:2;14265:18;;14258:48;;;13912:728;;14320:78;;14146:19;;14384:6;14320:78;:::i;:::-;14446:9;14440:4;14436:20;14431:2;14420:9;14416:18;14409:48;14471:78;14544:4;14535:6;14471:78;:::i;:::-;14463:86;;;21084:4;21077:5;21073:16;14626:2;14615:9;14611:18;12341:48;14132:508;;;;;;;:::o;14647:644::-;-1:-1;;;;;20765:54;;9988:45;;14878:3;14997:2;14982:18;;14975:48;;;14647:644;;15037:78;;14863:19;;15101:6;15037:78;:::i;:::-;15194:2;15179:18;;12106:37;;;;-1:-1;15277:2;15262:18;12106:37;15029:86;14849:442;-1:-1;;14849:442::o;15298:756::-;;19767:18;;20776:42;;;10026:5;20765:54;9995:3;9988:45;12136:5;15722:2;15711:9;15707:18;12106:37;12136:5;15805:2;15794:9;15790:18;12106:37;12136:5;15888:2;15877:9;15873:18;12106:37;15557:3;15925;15914:9;15910:19;15903:49;15966:78;15557:3;15546:9;15542:19;16030:6;15966:78;:::i;:::-;15958:86;15528:526;-1:-1;;;;;;;15528:526::o;16061:210::-;20677:13;;20670:21;10230:34;;16182:2;16167:18;;16153:118::o;16278:310::-;;16425:2;16446:17;16439:47;16500:78;16425:2;16414:9;16410:18;16564:6;16500:78;:::i;16595:416::-;16795:2;16809:47;;;11222:2;16780:18;;;20185:19;11258:34;20225:14;;;11238:55;-1:-1;;;11313:12;;;11306:38;11363:12;;;16766:245::o;17018:416::-;17218:2;17232:47;;;11614:2;17203:18;;;20185:19;-1:-1;;;20225:14;;;11630:43;11692:12;;;17189:245::o;17441:416::-;17641:2;17655:47;;;11943:1;17626:18;;;20185:19;-1:-1;;;20225:14;;;11958:32;12009:12;;;17612:245::o;17864:222::-;12106:37;;;17991:2;17976:18;;17962:124::o;18093:440::-;-1:-1;;;;;20971:30;;;;12224:36;;-1:-1;;;;;20765:54;;;;18436:2;18421:18;;9988:45;18519:2;18504:18;;12106:37;18274:2;18259:18;;18245:288::o;18540:552::-;-1:-1;;;;;20971:30;;;;12224:36;;-1:-1;;;;;20765:54;;;;18912:2;18897:18;;9988:45;18995:2;18980:18;;12106:37;19078:2;19063:18;;12106:37;18749:3;18734:19;;18720:372::o;19099:256::-;19161:2;19155:9;19187:17;;;-1:-1;;;;;19247:34;;19283:22;;;19244:62;19241:2;;;19319:1;;19309:12;19241:2;19161;19328:22;19139:216;;-1:-1;19139:216::o;21367:268::-;21432:1;21439:101;21453:6;21450:1;21447:13;21439:101;;;21520:11;;;21514:18;21501:11;;;21494:39;21475:2;21468:10;21439:101;;;21555:6;21552:1;21549:13;21546:2;;;21432:1;21611:6;21606:3;21602:16;21595:27;21546:2;;21416:219;;;:::o;21748:117::-;-1:-1;;;;;20765:54;;21807:35;;21797:2;;21856:1;;21846:12

Swarm Source

ipfs://4d642ceda92de3266667df0660665822feded11fe82708144a3923ae086ba81e

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

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.