POL Price: $0.58718 (-3.01%)
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint Tup As Depo...655762142024-12-17 2:51:505 hrs ago1734403910IN
0x6B29763B...34bdeB8b8
1 POL0.019469427.99999998
Deposit655761792024-12-17 2:50:365 hrs ago1734403836IN
0x6B29763B...34bdeB8b8
0 POL0.2665958327.99999998
Mint Tup As Depo...655378902024-12-16 3:56:1528 hrs ago1734321375IN
0x6B29763B...34bdeB8b8
1 POL0.0215037631.54635974
Call To Producti...655361442024-12-16 2:52:4929 hrs ago1734317569IN
0x6B29763B...34bdeB8b8
0 POL0.0879545443.78405368
Call To Producti...655130412024-12-15 12:59:2943 hrs ago1734267569IN
0x6B29763B...34bdeB8b8
0 POL0.043534930.00007097
Mint Tup As Depo...654941292024-12-15 1:38:352 days ago1734226715IN
0x6B29763B...34bdeB8b8
3.85 POL0.0196291129.99999989
Mint Tup As Depo...654930402024-12-15 0:59:502 days ago1734224390IN
0x6B29763B...34bdeB8b8
3.66 POL0.0207928729.99999963
Deposit654930152024-12-15 0:58:562 days ago1734224336IN
0x6B29763B...34bdeB8b8
0 POL0.2779713229.99999964
Mint Tup As Depo...654911492024-12-14 23:49:492 days ago1734220189IN
0x6B29763B...34bdeB8b8
1.74 POL0.0199020630
Mint Tup As Depo...654911372024-12-14 23:49:252 days ago1734220165IN
0x6B29763B...34bdeB8b8
14.36 POL0.0208600830
Deposit654910932024-12-14 23:47:512 days ago1734220071IN
0x6B29763B...34bdeB8b8
0 POL0.2798804629.99999999
Call To Producti...654804022024-12-14 17:24:192 days ago1734197059IN
0x6B29763B...34bdeB8b8
0 POL0.0539565229.86322767
Deposit654803952024-12-14 17:24:032 days ago1734197043IN
0x6B29763B...34bdeB8b8
0 POL0.2974637229.86322766
Call To Producti...654743822024-12-14 13:48:462 days ago1734184126IN
0x6B29763B...34bdeB8b8
0 POL0.0814425642.57748915
Call To Producti...654606422024-12-14 5:33:403 days ago1734154420IN
0x6B29763B...34bdeB8b8
0 POL0.07239630.00000003
Mint Tup As Depo...653734862024-12-12 1:35:515 days ago1733967351IN
0x6B29763B...34bdeB8b8
0.48 POL0.0195776130.00000003
Mint Tup As Depo...653734392024-12-12 1:34:115 days ago1733967251IN
0x6B29763B...34bdeB8b8
3.72 POL0.0195776130.00000003
Mint Tup As Depo...653734182024-12-12 1:33:275 days ago1733967207IN
0x6B29763B...34bdeB8b8
7.93 POL0.0195778530.00000003
Mint Tup As Depo...653734022024-12-12 1:32:525 days ago1733967172IN
0x6B29763B...34bdeB8b8
10.62 POL0.0197150730.00000002
Mint Tup As Depo...653733782024-12-12 1:32:025 days ago1733967122IN
0x6B29763B...34bdeB8b8
11.6 POL0.0206033130.00000003
Deposit653732012024-12-12 1:25:425 days ago1733966742IN
0x6B29763B...34bdeB8b8
0 POL0.2770782330.00000004
Deposit653597542024-12-11 17:24:095 days ago1733937849IN
0x6B29763B...34bdeB8b8
0 POL0.2771491930.74026227
Mint Tup As Depo...652716342024-12-09 12:46:287 days ago1733748388IN
0x6B29763B...34bdeB8b8
15.81 POL0.0752904937.69506192
Call To Producti...652713562024-12-09 12:36:367 days ago1733747796IN
0x6B29763B...34bdeB8b8
0 POL0.0718322554.09299731
Call To Producti...652713432024-12-09 12:36:087 days ago1733747768IN
0x6B29763B...34bdeB8b8
0 POL0.0732547150.63643003
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
655762142024-12-17 2:51:505 hrs ago1734403910
0x6B29763B...34bdeB8b8
0.985 POL
655761792024-12-17 2:50:365 hrs ago1734403836
0x6B29763B...34bdeB8b8
0.02133016 POL
655761792024-12-17 2:50:365 hrs ago1734403836
0x6B29763B...34bdeB8b8
0.0639905 POL
655761792024-12-17 2:50:365 hrs ago1734403836
0x6B29763B...34bdeB8b8
0.00392074 POL
655378902024-12-16 3:56:1528 hrs ago1734321375
0x6B29763B...34bdeB8b8
0.985 POL
655361442024-12-16 2:52:4929 hrs ago1734317569
0x6B29763B...34bdeB8b8
0 POL
655361442024-12-16 2:52:4929 hrs ago1734317569
0x6B29763B...34bdeB8b8
0.00000068 POL
655130312024-12-15 12:59:0043 hrs ago1734267540
0x6B29763B...34bdeB8b8
0.11846741 POL
655130312024-12-15 12:59:0043 hrs ago1734267540
0x6B29763B...34bdeB8b8
0.01814652 POL
654941292024-12-15 1:38:352 days ago1734226715
0x6B29763B...34bdeB8b8
3.79225 POL
654930402024-12-15 0:59:502 days ago1734224390
0x6B29763B...34bdeB8b8
3.6051 POL
654930152024-12-15 0:58:562 days ago1734224336
0x6B29763B...34bdeB8b8
0.04031061 POL
654930152024-12-15 0:58:562 days ago1734224336
0x6B29763B...34bdeB8b8
0.12093183 POL
654930152024-12-15 0:58:562 days ago1734224336
0x6B29763B...34bdeB8b8
0.02424428 POL
654911492024-12-14 23:49:492 days ago1734220189
0x6B29763B...34bdeB8b8
1.7139 POL
654911372024-12-14 23:49:252 days ago1734220165
0x6B29763B...34bdeB8b8
14.1446 POL
654910932024-12-14 23:47:512 days ago1734220071
0x6B29763B...34bdeB8b8
0.00010721 POL
654910932024-12-14 23:47:512 days ago1734220071
0x6B29763B...34bdeB8b8
0.00032164 POL
654910932024-12-14 23:47:512 days ago1734220071
0x6B29763B...34bdeB8b8
0.04109249 POL
654804022024-12-14 17:24:192 days ago1734197059
0x6B29763B...34bdeB8b8
0.0000797 POL
654804022024-12-14 17:24:192 days ago1734197059
0x6B29763B...34bdeB8b8
0.00179321 POL
654803952024-12-14 17:24:032 days ago1734197043
0x6B29763B...34bdeB8b8
0.08601402 POL
654803952024-12-14 17:24:032 days ago1734197043
0x6B29763B...34bdeB8b8
0.25804206 POL
654803952024-12-14 17:24:032 days ago1734197043
0x6B29763B...34bdeB8b8
0.01414876 POL
654743822024-12-14 13:48:462 days ago1734184126
0x6B29763B...34bdeB8b8
0.00000167 POL
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WorkerVault

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 2000000 runs

Other Settings:
paris EvmVersion
File 1 of 21 : WorkerVault.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import { ERC4626 } from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
import { ERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

import { IEmployer } from "./IEmployer.sol";
import { InvestmentCoordinator } from "./InvestmentCoordinator.sol";
import { ITimeIsUp } from "./ITimeIsUp.sol";
import { ITimeToken } from "./ITimeToken.sol";
import { IWorker } from "./IWorker.sol";
import { MinionCoordinator } from "./MinionCoordinator.sol";

/// @title WorkerVault contract - It follows the ERC-4626 standard
/// @author Einar Cesar - TIME Token Finance - https://timetoken.finance
/// @notice Main contract for the Worker vault which receives TUP tokens in order to produce TIME from Minion contracts
/// @dev It receives TUP tokens and mints vWORK tokens for the depositants. It allows its holders to earn from other vaults and also to produce TIME used as collateral for TUP (only)
contract WorkerVault is ERC4626, Ownable, IWorker {
    using Math for uint256;

    bool private _isOperationLocked;

    bool public isEmergencyWithdrawEnabled;

    InvestmentCoordinator public investmentCoordinator;
    ITimeToken public timeToken;
    MinionCoordinator public minionCoordinator;

    address public constant DONATION_ADDRESS = 0x731591207791A93fB0Ec481186fb086E16A7d6D0;

    uint256 public constant DONATION_FEE = 25;
    uint256 public constant CALLER_FEE = 50;
    uint256 public constant FACTOR = 10 ** 18;
    uint256 public constant INVESTMENT_FEE = 50;
    uint256 public constant MAX_PERCENTAGE_ALLOCATION_OF_TIME = 4_900;
    uint256 public constant MINION_CREATION_FEE = 75;

    uint256 private _callerComission;
    uint256 private _donations;
    uint256 private _minionCreation;

    uint256 public baseTimeFrame;
    uint256 public earnedAmount;

    mapping(address => uint256) private _currentBlock;
    mapping(address => uint256) private _lastCalculatedTimeToLock;

    mapping(address => uint256) public availableTimeAsCaller;
    mapping(address => uint256) public blockToUnlock;
    mapping(address => uint256) public consumedShares;

    // Deposit can not be zero
    error DepositEqualsToZero();
    // This operation is not allowed in this context
    error NotAllowed(string message);
    // Contract does not have enough balance to perform the called operation
    error NotHaveEnoughBalance(uint256 amountAsked, uint256 amountAvailable);
    // Contract does not have enough TIME tokens to perform the called operation
    error NotHaveEnoughTime(uint256 timeAsked, uint256 balanceInTime);
    // No TUP tokens were minted in this operation. The transaction will be reverted
    error NoTupMinted();
    // This operation is locked for security reasons
    error OperationLocked(address sender, uint256 blockNumber);
    // The informed native amount is less than the value of TIME tokens in terms of native currency
    error TimeValueConsumedGreaterThanNative(uint256 timeValue, uint256 native);
    // The withdraw is current locked
    error WithdrawLocked(uint256 currentBlock, uint256 blockToWithdraw);

    // POST-CONDITIONS:
    // IMPORTANT (at deployment):
    //      * deposit a minimum amount of TUP in the contract to avoid frontrunning "donation" attack
    //      * "burn" the share of the minimum amount deposited - send to a dead address
    constructor(address _asset, address _timeTokenAddress, address _employerAddress, address _owner)
        ERC20("Worker Vault", "vWORK")
        ERC4626(ERC20(_asset))
        Ownable(_owner)
    {
        timeToken = ITimeToken(payable(_timeTokenAddress));
        IEmployer employer = IEmployer(payable(_employerAddress));
        minionCoordinator = new MinionCoordinator(this);
        baseTimeFrame = employer.ONE_YEAR().mulDiv(1, employer.D().mulDiv(365, 1));
        investmentCoordinator = new InvestmentCoordinator(address(this), _owner);
    }

    receive() external payable { }

    fallback() external payable {
        require(msg.data.length == 0);
    }

    /// @notice Modifier used to avoid reentrancy attacks
    modifier nonReentrant() {
        if (_isOperationLocked) {
            revert OperationLocked(_msgSender(), block.number);
        }
        _isOperationLocked = true;
        _;
        _isOperationLocked = false;
    }

    /// @notice Modifier to make a function runs only once per block (also avoids reentrancy, but in a different way)
    modifier onlyOncePerBlock() {
        if (block.number == _currentBlock[tx.origin]) {
            revert OperationLocked(tx.origin, block.number);
        }
        _currentBlock[tx.origin] = block.number;
        _;
    }

    /// @notice Transfer some amount of TIME to be staked
    /// @dev Transfer TIME to InvestmentCoordinator and then to vaults which run on TIME
    /// @param amountTime The amount of TIME passed
    function _addTimeToInvest(uint256 amountTime) private {
        if (amountTime > 0) {
            try timeToken.transfer(address(investmentCoordinator), amountTime) {
                try investmentCoordinator.depositAssetOnVault(address(timeToken)) { } catch { }
            } catch { }
        }
    }

    /// @notice Dedicate some TUP tokens for investments which should add value to the whole platform and will be distributed to users
    /// @dev Transfer TUP to InvestmentCoordinator and then to vaults which run on TUP
    /// @param amountTup The amount of TUP tokens to be transferred to InvestmentCoordinator
    function _addTupToInvest(uint256 amountTup) private {
        if (amountTup > 0) {
            try ITimeIsUp(asset()).transfer(address(investmentCoordinator), amountTup) {
                try investmentCoordinator.depositAssetOnVault(asset()) { } catch { }
            } catch { }
        }
    }

    /// @notice Defines for how long the TUP token of the user should be locked
    /// @dev It calculates the number of blocks the TUP tokens of depositant will be locked in this contract. The depositant CAN NOT anticipate this time using TIME tokens
    /// @param depositant Address of the depositant of TUP tokens
    function _adjustBlockToUnlock(address depositant) private {
        if (depositant != address(0)) {
            uint256 currentCalculatedTimeToLock = calculateTimeToLock(convertToAssets(balanceOf(depositant)));
            uint256 blockAdjustment = block.number + currentCalculatedTimeToLock;
            if (currentCalculatedTimeToLock < _lastCalculatedTimeToLock[depositant]) {
                if (blockToUnlock[depositant] > blockAdjustment || blockToUnlock[depositant] == 0) {
                    blockToUnlock[depositant] = blockAdjustment;
                }
            } else {
                blockToUnlock[depositant] = blockAdjustment;
            }
            _lastCalculatedTimeToLock[depositant] = currentCalculatedTimeToLock;
        }
    }

    /// @notice Calculates the correct amount of consumed shares in case of transferring of the vWORK tokens
    /// @dev Consumed shares are always passed to the address which receives the tokens
    /// @param from The address that will send the value
    /// @param to The address that will receive the value
    /// @param value The amount of shares transferred
    function _adjustConsumedShares(address from, address to, uint256 value) private {
        if (from != address(0) && to != address(0)) {
            uint256 shareToTransfer = (value > consumedShares[from] || consumedShares[from] == 0) ? consumedShares[from] : value;
            consumedShares[to] += shareToTransfer;
            consumedShares[from] -= shareToTransfer;
        }
    }

    /// @notice Hook called after deposit of TUP tokens in the Worker vault
    /// @dev It calculates the block to unlock, call MinionCoordinator for TIME production, check for earnings and profit, create new Minions automatically, and transfer some TUP to InvestmentCoordinator
    /// @param receiver The address of the receiver of vWORK tokens
    /// @param assets The deposited amount in terms of assets
    /// @param shares The deposited amount in terms of shares
    function _afterDeposit(address receiver, uint256 assets, uint256 shares) private {
        assets = assets == 0 ? convertToAssets(shares) : assets;
        _adjustBlockToUnlock(receiver);
        _earn();
        if (_minionCreation > 0) {
            minionCoordinator.addResourcesForMinionCreation{ value: _minionCreation }();
            _minionCreation = 0;
        }
        if (_donations > 0) {
            payable(DONATION_ADDRESS).call{ value: _donations }("");
            _donations = 0;
        }
        if (minionCoordinator.dedicatedAmount() > 0) {
            try minionCoordinator.createMinionsForFree() { } catch { }
        }
        _callToProduction(false);
        try investmentCoordinator.checkProfitAndWithdraw() { } catch { }
        _addTupToInvest(assets.mulDiv(INVESTMENT_FEE, 10_000));
    }

    /// @notice Hook called after the withdraw of TUP tokens from the Worker vault
    /// @dev It calls MinionCoordinator for TIME production, check for earnings and profit, create new Minions automatically, and transfer some TUP to InvestmentCoordinator
    /// @param assets The withdrawn amount in terms of assets
    /// @param shares The withdrawn amount in terms of shares
    function _afterWithdraw(uint256 assets, uint256 shares) private {
        _earn();
        if (_minionCreation > 0) {
            minionCoordinator.addResourcesForMinionCreation{ value: _minionCreation }();
            _minionCreation = 0;
        }
        if (_donations > 0) {
            payable(DONATION_ADDRESS).call{ value: _donations }("");
            _donations = 0;
        }
        if (minionCoordinator.dedicatedAmount() > 0) {
            try minionCoordinator.createMinionsForFree() { } catch { }
        }
        _callToProduction(false);
        uint256 balanceInShares = balanceOf(_msgSender());
        if (consumedShares[_msgSender()] > balanceInShares) {
            consumedShares[_msgSender()] = balanceInShares;
        }
    }

    /// @notice Hook called before the deposit of TUP tokens into the Worker vault
    /// @dev It just check if the deposit is equals to zero
    /// @param assets The deposited amount in terms of assets
    /// @param shares The deposited amount in terms of shares
    function _beforeDeposit(uint256 assets, uint256 shares) private {
        assets = assets == 0 ? convertToAssets(shares) : assets;
        if (assets == 0) {
            revert DepositEqualsToZero();
        }
    }

    /// @notice Hook called before the withdrawn of TUP tokens from the Worker vault
    /// @dev It just check if the withdrawn is locked or not
    /// @param assets The withdrawn amount in terms of assets
    /// @param shares The withdrawn amount in terms of shares
    function _beforeWithdraw(uint256 assets, uint256 shares) private {
        if (block.number < blockToUnlock[_msgSender()] && !isEmergencyWithdrawEnabled) {
            revert WithdrawLocked(block.number, blockToUnlock[_msgSender()]);
        }
    }

    /// @notice Call the Worker contract to produce TIME and earn resources. It redirects the call to work() function of MinionCoordinator contract
    /// @dev Private function used to avoid onlyOncePerBlock modifier internally
    /// @param chargeFeeForCaller Informs whether the function should charge some fee for the caller
    /// @return production The amount of TIME produced in the call
    function _callToProduction(bool chargeFeeForCaller) private returns (uint256 production) {
        if (chargeFeeForCaller) {
            production = minionCoordinator.work().mulDiv(CALLER_FEE, 10_000);
        } else {
            try minionCoordinator.work() returns (uint256 amount) {
                production = amount;
            } catch {
                production = 0;
            }
        }
        if (production > 0) {
            _addTimeToInvest(production.mulDiv(INVESTMENT_FEE, 10_000));
        }
    }

    /// @notice Performs routine to earn additional resources from InvestmentCoordinator contract, TIME and TUP tokens
    /// @dev It takes advantage of some features of TIME and TUP tokens in order to earn native tokens of the underlying network
    function _earn() private {
        if (timeToken.withdrawableShareBalance(address(this)) > 0) {
            uint256 balanceBefore = address(this).balance;
            try timeToken.withdrawShare() {
                if (address(this).balance > balanceBefore) {
                    _splitEarnings(address(this).balance - balanceBefore);
                }
            } catch { }
        }
        uint256 tupDividends = ITimeIsUp(asset()).accountShareBalance(address(this));
        _addTupToInvest(tupDividends);
    }

    /// @notice Returns the factor information about an informed amount of TUP tokens
    /// @dev It calculates the factor information from the amount of TUP and returns to the caller
    /// @param amountTup The amount of TUP tokens used to calculate factor
    /// @return factor The information about TUP total supply over the amount of TUP tokens informed
    function _getFactor(uint256 amountTup) private view returns (uint256) {
        return ITimeIsUp(asset()).totalSupply().mulDiv(10, amountTup + 1);
    }

    /// @notice Performs TUP token mint for a minter address given the amount of native and TIME tokens informed
    /// @dev Public and external functions can point to this private function since it can be reused for different purposes
    /// @param minter The address that will receive minted TUP tokens
    /// @param amountNative The amount of native tokens to be used in order to mint TUP tokens
    /// @param amountTime The amount of TIME tokens to be used in order to mint TUP tokens
    /// @param reinvestTup Checks whether the minted TUP will be reinvested in the contract
    function _mintTup(address minter, uint256 amountNative, uint256 amountTime, bool reinvestTup) private {
        if (ITimeIsUp(asset()).queryNativeFromTimeAmount(amountTime) > amountNative) {
            revert TimeValueConsumedGreaterThanNative(ITimeIsUp(asset()).queryNativeFromTimeAmount(amountTime), amountNative);
        }
        if (amountTime > timeToken.balanceOf(address(this))) {
            revert NotHaveEnoughTime(amountTime, timeToken.balanceOf(address(this)));
        }
        if (amountNative > address(this).balance) {
            revert NotHaveEnoughBalance(amountNative, address(this).balance);
        }
        timeToken.approve(asset(), amountTime);
        uint256 tupBalanceBefore = ITimeIsUp(asset()).balanceOf(address(this)) - ITimeIsUp(asset()).accountShareBalance(address(this));
        ITimeIsUp(asset()).mint{ value: amountNative }(amountTime);
        uint256 tupBalanceAfter = ITimeIsUp(asset()).balanceOf(address(this)) - ITimeIsUp(asset()).accountShareBalance(address(this));
        uint256 mintedTup = tupBalanceAfter - tupBalanceBefore;
        if (mintedTup == 0) {
            revert NoTupMinted();
        }
        uint256 shares = convertToShares(mintedTup);
        if (balanceOf(minter) > 0 && queryAvailableTimeForDepositant(minter) > 0) {
            consumedShares[minter] += shares;
        }
        if (reinvestTup) {
            _mint(minter, shares);
            _adjustBlockToUnlock(minter);
            emit Deposit(minter, minter, mintedTup, shares);
        } else {
            if (minter != address(this)) {
                ITimeIsUp(asset()).transfer(minter, mintedTup);
            }
        }
    }

    /// @notice It returns the remaining balance in terms of native tokens
    /// @dev It is called to avoid having unused balance in the contract
    /// @return remainingBalance The amount remaining after all comissions
    function _remainingBalance() private view returns (uint256) {
        uint256 total = earnedAmount + _callerComission + _donations + _minionCreation;
        if (address(this).balance > total) {
            return address(this).balance - total;
        } else {
            return 0;
        }
    }

    /// @notice Hook called during a transfer
    /// @dev It recalculates blocks for unlocking of TUP tokens together with the amount of consumed shares 
    /// @param from The address that will send the value
    /// @param to The address that will receive the value
    /// @param value The amount of shares transferred
    function _update(address from, address to, uint256 value) internal override {
        super._update(from, to, value);
        _adjustBlockToUnlock(from);
        _adjustBlockToUnlock(to);
        _adjustConsumedShares(from, to, value);
        if (balanceOf(from) == 0) {
            blockToUnlock[from] = 0;
            _lastCalculatedTimeToLock[from] = 0;
        }
        if (balanceOf(to) == 0) {
            blockToUnlock[to] = 0;
            _lastCalculatedTimeToLock[to] = 0;
        }
    }

    /// @notice Splits the amount earned from this contract into comissions
    /// @param earned The amount earned from this contract at the moment
    function _splitEarnings(uint256 earned) private returns (uint256) {
        uint256 currentCallerComission = earned.mulDiv(CALLER_FEE, 10_000);
        uint256 currentDonation = earned.mulDiv(DONATION_FEE, 10_000);
        uint256 currentMinionCreationFee = earned.mulDiv(MINION_CREATION_FEE, 10_000);
        _donations += currentDonation;
        _minionCreation += currentMinionCreationFee;
        _callerComission += currentCallerComission;
        earned -= (currentDonation + currentMinionCreationFee + currentCallerComission);
        earnedAmount += earned;
        return earned;
    }

    /// @notice Calculates the amount of blocks needed to unlock TUP tokens of the depositants
    /// @dev It must consider the initial base timeframe, which can be altered by calling the updateBaseTimeFrame() function (admin only)
    /// @param amountTup The amount of TUP tokens deposited
    function calculateTimeToLock(uint256 amountTup) public view returns (uint256) {
        return _getFactor(amountTup).mulDiv(baseTimeFrame, 10);
    }

    /// @notice Externally calls the Worker contract and redirects this call to private function _callToProduction(bool chargeFeeForCaller) in order to produce TIME and earn resources
    /// @dev Anyone can call this function and receive part of the produced TIME (available in the contract only for TUP mint) and resources earned. _callerComission receives zero before transferring all the comission value
    /// @param callerAddress The address of the receiver of comission. It is used instead of msg.sender to avoid some types of MEV front running. If address zero is informed, all resources are sent to DEVELOPER_ADDRESS
    function callToProduction(address callerAddress) external nonReentrant onlyOncePerBlock {
        callerAddress = callerAddress == address(0) ? timeToken.DEVELOPER_ADDRESS() : callerAddress;
        availableTimeAsCaller[callerAddress] += _callToProduction(true);
        _earn();
        if (_callerComission > 0) {
            _mintTup(callerAddress, _callerComission, 0, false);
            _callerComission = 0;
        }
    }

    /// @notice Externally calls the Worker contract to create Minions on demand given some amount of native tokens paid/passed (msg.value parameter)
    /// @dev It performs some additional checks and redirects to the _createMinions() function
    /// @return numberOfMinionsCreated The number of active Minions created for TIME production
    function createMinions() external payable nonReentrant onlyOncePerBlock returns (uint256) {
        return minionCoordinator.createMinions{ value: msg.value }(_msgSender());
    }

    /// @notice Overrided deposit function from the parent ERC4626 contract
    /// @dev It just includes the hooks called before and after the whole operation
    /// @param assets The deposited amount in terms of assets
    /// @return shares The deposited amount in terms of shares (confirmed after deposit)
    function deposit(uint256 assets, address receiver) public override nonReentrant onlyOncePerBlock returns (uint256 shares) {
        _beforeDeposit(assets, shares);
        uint256 maxAssets = maxDeposit(receiver);
        if (assets > maxAssets) {
            revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);
        }
        shares = previewDeposit(assets);
        _deposit(_msgSender(), receiver, assets, shares);
        _afterDeposit(receiver, assets, shares);
    }

    /// @notice Disables all emergency withdrawals (admin only)
    /// @dev Adjusts the flag to disable emergency withdrawals
    function disableEmergencyWithdraw() external onlyOwner {
        isEmergencyWithdrawEnabled = false;
    }

    /// @notice Enables all emergency withdrawals (admin only)
    /// @dev Adjusts the flag to allow emergency withdrawals
    function enableEmergencyWithdraw() external onlyOwner {
        isEmergencyWithdrawEnabled = true;
    }

    /// @notice Call the Worker contract to earn resources, pay a given comission to the caller and reinvest comission in the contract
    /// @dev Call Minions for TIME production and this contract to earn resources from TIME and TUP tokens. It reinvests the earned comission with no cost for the caller
    function investWithNoCapital() external nonReentrant onlyOncePerBlock {
        availableTimeAsCaller[_msgSender()] += _callToProduction(true);
        _earn();
        if (_callerComission > 0) {
            uint256 amountTimeNeeded = queryAvailableTimeForTupMint(_callerComission);
            uint256 amountNativeNeeded = ITimeIsUp(asset()).queryNativeFromTimeAmount(availableTimeAsCaller[_msgSender()]);
            if (_callerComission >= amountNativeNeeded) {
                // mint and reinvest TUP with _callerComission and availableTimeAsCaller[_msgSender()] - nothing remains
                _mintTup(_msgSender(), _callerComission, availableTimeAsCaller[_msgSender()], true);
                _callerComission = 0;
                availableTimeAsCaller[_msgSender()] = 0;
            } else if (availableTimeAsCaller[_msgSender()] >= amountTimeNeeded) {
                // mint and reinvest TUP with _callerComission and amountTimeNeeded - it remains some amount of availableTimeAsCaller[_msgSender()]
                availableTimeAsCaller[_msgSender()] -= amountTimeNeeded;
                _mintTup(_msgSender(), _callerComission, amountTimeNeeded, true);
                _callerComission = 0;
            }
        }
    }

    /// @notice Overrided mint function from the parent ERC4626 contract
    /// @dev It just includes the hooks called before and after the whole operation
    /// @param shares The minted amount in terms of shares
    /// @return assets The minted amount in terms of assets (confirmed after deposit)
    function mint(uint256 shares, address receiver) public override nonReentrant onlyOncePerBlock returns (uint256 assets) {
        _beforeDeposit(assets, shares);
        uint256 maxShares = maxMint(receiver);
        if (shares > maxShares) {
            revert ERC4626ExceededMaxMint(receiver, shares, maxShares);
        }
        assets = previewMint(shares);
        _deposit(_msgSender(), receiver, assets, shares);
        _afterDeposit(receiver, assets, shares);
    }

    /// @notice Performs TUP minting as depositant, using the TIME produced from Minions as part of collateral needed
    /// @dev It must use the available TIME from depositant to mint TUP according to the amount of native tokens passed into this function
    /// @param reinvestTup Checks whether the minted TUP will be reinvested in the contract
    function mintTupAsDepositant(bool reinvestTup) external payable nonReentrant onlyOncePerBlock {
        if (msg.value == 0) {
            revert DepositEqualsToZero();
        }
        if (convertToAssets(balanceOf(_msgSender())) == 0) {
            revert NotAllowed("Worker: please refer the depositant should have some deposited TUP tokens in advance");
        }
        uint256 amountNative = _splitEarnings(msg.value);
        uint256 amountTimeAvailable = queryAvailableTimeForDepositant(_msgSender());
        uint256 amountTimeNeeded = queryAvailableTimeForTupMint(amountNative);
        if (amountTimeAvailable < amountTimeNeeded) {
            amountTimeNeeded = amountTimeAvailable;
        }
        if (availableTimeAsCaller[_msgSender()] < amountTimeNeeded) {
            availableTimeAsCaller[_msgSender()] = 0;
        } else {
            availableTimeAsCaller[_msgSender()] -= amountTimeNeeded;
        }
        _mintTup(_msgSender(), amountNative, amountTimeNeeded, reinvestTup);
        earnedAmount -= amountNative;
        if (_remainingBalance() > 0) {
            _mintTup(address(this), _remainingBalance(), 0, false);
            earnedAmount = 0;
        }
    }

    /// @notice Performs TUP minting as a third party involved
    /// @dev It should calculate the correct amount to mint before internal calls
    /// @param minter The address that should receive TUP tokens minted
    /// @param reinvestTup Checks whether the minted TUP will be reinvested in the contract
    function mintTupAsThirdParty(address minter, bool reinvestTup) external payable nonReentrant onlyOncePerBlock {
        if (msg.value == 0) {
            revert DepositEqualsToZero();
        }
        uint256 amountNativeForTimeAllocation = msg.value.mulDiv(MAX_PERCENTAGE_ALLOCATION_OF_TIME, 10_000);
        uint256 amountTime = queryAvailableTimeForTupMint(amountNativeForTimeAllocation);
        uint256 amountNative = _splitEarnings(msg.value - amountNativeForTimeAllocation);
        if (amountTime > timeToken.balanceOf(address(this))) {
            amountTime = timeToken.balanceOf(address(this));
        }
        _mintTup(minter, amountNative, amountTime, reinvestTup);
        earnedAmount -= amountNative;
        if (availableTimeAsCaller[minter] > 0) {
            if (availableTimeAsCaller[minter] < amountTime) {
                availableTimeAsCaller[minter] = 0;
            } else {
                availableTimeAsCaller[minter] -= amountTime;
            }
        }
        if (_remainingBalance() > 0) {
            _mintTup(address(this), _remainingBalance(), 0, false);
            earnedAmount = 0;
        }
    }

    /// @notice Query the amount of TIME available for a depositant address
    /// @dev It should reflect the amount of TIME a TUP depositant has after TIME being producted
    /// @param depositant The address of an user who has deposited and locked TUP in the contract or have called the contract to produce TIME before
    /// @return amountTimeAvailable Amount of TIME available for depositant
    function queryAvailableTimeForDepositant(address depositant) public view returns (uint256) {
        uint256 balanceInShares = balanceOf(depositant);
        if (balanceInShares <= consumedShares[depositant]) {
            return availableTimeAsCaller[depositant];
        } else {
            return (timeToken.balanceOf(address(this)).mulDiv(convertToAssets(balanceInShares - consumedShares[depositant]), totalAssets() + 1)).mulDiv(
                10_000 - (CALLER_FEE + INVESTMENT_FEE), 10_000
            ) + availableTimeAsCaller[depositant];
        }
    }

    /// @notice Query the amount of TIME available to mint new TUP tokens given some amount of native tokens
    /// @dev It must consider the current price of TIME tokens
    /// @param amountNative The amount of native tokens an user wants to spend
    /// @return amountTimeAvailable The available amount of TIME tokens to be used
    function queryAvailableTimeForTupMint(uint256 amountNative) public view returns (uint256) {
        return amountNative.mulDiv(timeToken.swapPriceNative(amountNative), FACTOR);
    }

    /// @notice Queries the contract for the estimated amount needed to activate new Minions given an expected number of them
    /// @dev It should query the TIME token contract for the estimated fees to cover new activations
    /// @param numberOfMinions The number of new Minions an user wants to query
    /// @return amountNative The amount neeed to cover expenses, in terms of native tokens
    function queryFeeAmountToActivateMinions(uint256 numberOfMinions) public view returns (uint256) {
        return timeToken.fee().mulDiv(numberOfMinions, 1);
    }

    /// @notice Queries the amount of a given asset invested in the InvestmentCoordinator contract
    /// @dev The InvestmentCoordinator can invest in several assets (TUP and TIME for instance). So, this function allows anyone to query for the invested amount
    /// @param _asset The address of asset's contract
    /// @return amountInvested The amount of assets invested
    function queryInvestedAmountForAsset(address _asset) external view returns (uint256) {
        return investmentCoordinator.queryTotalInvestedAmountForAsset(_asset);
    }

    /// @notice Queries the minimum amount need to mint TUP tokens given the amount of ALL TIME tokens in the contract
    function queryMinNativeAmountToMintTup() public view returns (uint256) {
        return ITimeIsUp(asset()).queryNativeFromTimeAmount(timeToken.balanceOf(address(this)));
    }

    /// @notice Returns the estimated number of Minions should be created given an amount of native tokens informed
    /// @param amount The amount of native tokens that should be considered to create new Minions
    /// @return estimatedNumberOfMinions The estimated number of Minions
    function queryNumberOfMinionsToActivateFromAmount(uint256 amount) public view returns (uint256) {
        return amount.mulDiv(1, timeToken.fee() + 1);
    }

    /// @notice Overrided redeem function from the parent ERC4626 contract
    /// @dev It just includes the hooks called before and after the whole operation
    /// @param shares The redeemed amount in terms of shares
    /// @param receiver The address that will receive the redeemed assets
    /// @param owner The address owner of the vWORK tokens
    /// @return assets The redeemed amount in terms of assets (confirmed after withdrawn)
    function redeem(uint256 shares, address receiver, address owner) public override nonReentrant onlyOncePerBlock returns (uint256 assets) {
        uint256 maxShares = maxRedeem(owner);
        if (shares > maxShares) {
            revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);
        }
        assets = previewRedeem(shares);
        _beforeWithdraw(assets, shares);
        _withdraw(_msgSender(), receiver, owner, assets, shares);
        _afterWithdraw(assets, shares);
    }

    /// @notice Change the batch size value (maximum number of minions to be created or called in one transaction) of MinionCoordinator
    /// @dev It delegates the change to the contract, once the MinionCoordinator contract does not have admin functions
    /// @param newBatchSize The new value of the batch size
    function updateBatchSize(uint256 newBatchSize) external onlyOwner {
        minionCoordinator.updateBatchSize(newBatchSize);
    }

    /// @notice Adjusts the base time frame adopted to calculate time lock from deposits
    /// @dev Accessible only by admin/owner
    /// @param newBaseTimeFrame The new value that should be passed
    function updateBaseTimeFrame(uint256 newBaseTimeFrame) external onlyOwner {
        baseTimeFrame = newBaseTimeFrame;
    }

    /// @notice Overrided withdraw function from the parent ERC4626 contract
    /// @dev It just includes the hooks called before and after the whole operation
    /// @param assets The withdraw amount in terms of assets
    /// @param receiver The address that will receive the assets withdrawn
    /// @param owner The address owner of the vWORK tokens
    /// @return shares The withdraw amount in terms of shares (confirmed after withdrawn)
    function withdraw(uint256 assets, address receiver, address owner) public override nonReentrant onlyOncePerBlock returns (uint256 shares) {
        uint256 maxAssets = maxWithdraw(owner);
        if (assets > maxAssets) {
            revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);
        }
        shares = previewWithdraw(assets);
        _beforeWithdraw(assets, shares);
        _withdraw(_msgSender(), receiver, owner, assets, shares);
        _afterWithdraw(assets, shares);
    }
}

File 2 of 21 : ERC4626.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/ERC4626.sol)

pragma solidity ^0.8.20;

import {IERC20, IERC20Metadata, ERC20} from "../ERC20.sol";
import {SafeERC20} from "../utils/SafeERC20.sol";
import {IERC4626} from "../../../interfaces/IERC4626.sol";
import {Math} from "../../../utils/math/Math.sol";

/**
 * @dev Implementation of the ERC4626 "Tokenized Vault Standard" as defined in
 * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626].
 *
 * This extension allows the minting and burning of "shares" (represented using the ERC20 inheritance) in exchange for
 * underlying "assets" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends
 * the ERC20 standard. Any additional extensions included along it would affect the "shares" token represented by this
 * contract and not the "assets" token which is an independent contract.
 *
 * [CAUTION]
 * ====
 * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning
 * with a "donation" to the vault that inflates the price of a share. This is variously known as a donation or inflation
 * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial
 * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may
 * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by
 * verifying the amount received is as expected, using a wrapper that performs these checks such as
 * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].
 *
 * Since v4.9, this implementation uses virtual assets and shares to mitigate that risk. The `_decimalsOffset()`
 * corresponds to an offset in the decimal representation between the underlying asset's decimals and the vault
 * decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which itself
 * determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default offset
 * (0) makes it non-profitable, as a result of the value being captured by the virtual shares (out of the attacker's
 * donation) matching the attacker's expected gains. With a larger offset, the attack becomes orders of magnitude more
 * expensive than it is profitable. More details about the underlying math can be found
 * xref:erc4626.adoc#inflation-attack[here].
 *
 * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued
 * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets
 * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience
 * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the
 * `_convertToShares` and `_convertToAssets` functions.
 *
 * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].
 * ====
 */
abstract contract ERC4626 is ERC20, IERC4626 {
    using Math for uint256;

    IERC20 private immutable _asset;
    uint8 private immutable _underlyingDecimals;

    /**
     * @dev Attempted to deposit more assets than the max amount for `receiver`.
     */
    error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);

    /**
     * @dev Attempted to mint more shares than the max amount for `receiver`.
     */
    error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);

    /**
     * @dev Attempted to withdraw more assets than the max amount for `receiver`.
     */
    error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);

    /**
     * @dev Attempted to redeem more shares than the max amount for `receiver`.
     */
    error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);

    /**
     * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777).
     */
    constructor(IERC20 asset_) {
        (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);
        _underlyingDecimals = success ? assetDecimals : 18;
        _asset = asset_;
    }

    /**
     * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.
     */
    function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool, uint8) {
        (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(
            abi.encodeCall(IERC20Metadata.decimals, ())
        );
        if (success && encodedDecimals.length >= 32) {
            uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));
            if (returnedDecimals <= type(uint8).max) {
                return (true, uint8(returnedDecimals));
            }
        }
        return (false, 0);
    }

    /**
     * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This
     * "original" value is cached during construction of the vault contract. If this read operation fails (e.g., the
     * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.
     *
     * See {IERC20Metadata-decimals}.
     */
    function decimals() public view virtual override(IERC20Metadata, ERC20) returns (uint8) {
        return _underlyingDecimals + _decimalsOffset();
    }

    /** @dev See {IERC4626-asset}. */
    function asset() public view virtual returns (address) {
        return address(_asset);
    }

    /** @dev See {IERC4626-totalAssets}. */
    function totalAssets() public view virtual returns (uint256) {
        return _asset.balanceOf(address(this));
    }

    /** @dev See {IERC4626-convertToShares}. */
    function convertToShares(uint256 assets) public view virtual returns (uint256) {
        return _convertToShares(assets, Math.Rounding.Floor);
    }

    /** @dev See {IERC4626-convertToAssets}. */
    function convertToAssets(uint256 shares) public view virtual returns (uint256) {
        return _convertToAssets(shares, Math.Rounding.Floor);
    }

    /** @dev See {IERC4626-maxDeposit}. */
    function maxDeposit(address) public view virtual returns (uint256) {
        return type(uint256).max;
    }

    /** @dev See {IERC4626-maxMint}. */
    function maxMint(address) public view virtual returns (uint256) {
        return type(uint256).max;
    }

    /** @dev See {IERC4626-maxWithdraw}. */
    function maxWithdraw(address owner) public view virtual returns (uint256) {
        return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);
    }

    /** @dev See {IERC4626-maxRedeem}. */
    function maxRedeem(address owner) public view virtual returns (uint256) {
        return balanceOf(owner);
    }

    /** @dev See {IERC4626-previewDeposit}. */
    function previewDeposit(uint256 assets) public view virtual returns (uint256) {
        return _convertToShares(assets, Math.Rounding.Floor);
    }

    /** @dev See {IERC4626-previewMint}. */
    function previewMint(uint256 shares) public view virtual returns (uint256) {
        return _convertToAssets(shares, Math.Rounding.Ceil);
    }

    /** @dev See {IERC4626-previewWithdraw}. */
    function previewWithdraw(uint256 assets) public view virtual returns (uint256) {
        return _convertToShares(assets, Math.Rounding.Ceil);
    }

    /** @dev See {IERC4626-previewRedeem}. */
    function previewRedeem(uint256 shares) public view virtual returns (uint256) {
        return _convertToAssets(shares, Math.Rounding.Floor);
    }

    /** @dev See {IERC4626-deposit}. */
    function deposit(uint256 assets, address receiver) public virtual returns (uint256) {
        uint256 maxAssets = maxDeposit(receiver);
        if (assets > maxAssets) {
            revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);
        }

        uint256 shares = previewDeposit(assets);
        _deposit(_msgSender(), receiver, assets, shares);

        return shares;
    }

    /** @dev See {IERC4626-mint}.
     *
     * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero.
     * In this case, the shares will be minted without requiring any assets to be deposited.
     */
    function mint(uint256 shares, address receiver) public virtual returns (uint256) {
        uint256 maxShares = maxMint(receiver);
        if (shares > maxShares) {
            revert ERC4626ExceededMaxMint(receiver, shares, maxShares);
        }

        uint256 assets = previewMint(shares);
        _deposit(_msgSender(), receiver, assets, shares);

        return assets;
    }

    /** @dev See {IERC4626-withdraw}. */
    function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {
        uint256 maxAssets = maxWithdraw(owner);
        if (assets > maxAssets) {
            revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);
        }

        uint256 shares = previewWithdraw(assets);
        _withdraw(_msgSender(), receiver, owner, assets, shares);

        return shares;
    }

    /** @dev See {IERC4626-redeem}. */
    function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {
        uint256 maxShares = maxRedeem(owner);
        if (shares > maxShares) {
            revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);
        }

        uint256 assets = previewRedeem(shares);
        _withdraw(_msgSender(), receiver, owner, assets, shares);

        return assets;
    }

    /**
     * @dev Internal conversion function (from assets to shares) with support for rounding direction.
     */
    function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {
        return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);
    }

    /**
     * @dev Internal conversion function (from shares to assets) with support for rounding direction.
     */
    function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {
        return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);
    }

    /**
     * @dev Deposit/mint common workflow.
     */
    function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {
        // If _asset is ERC777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the
        // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,
        // calls the vault, which is assumed not malicious.
        //
        // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the
        // assets are transferred and before the shares are minted, which is a valid state.
        // slither-disable-next-line reentrancy-no-eth
        SafeERC20.safeTransferFrom(_asset, caller, address(this), assets);
        _mint(receiver, shares);

        emit Deposit(caller, receiver, assets, shares);
    }

    /**
     * @dev Withdraw/redeem common workflow.
     */
    function _withdraw(
        address caller,
        address receiver,
        address owner,
        uint256 assets,
        uint256 shares
    ) internal virtual {
        if (caller != owner) {
            _spendAllowance(owner, caller, shares);
        }

        // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the
        // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,
        // calls the vault, which is assumed not malicious.
        //
        // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the
        // shares are burned and after the assets are transferred, which is a valid state.
        _burn(owner, shares);
        SafeERC20.safeTransfer(_asset, receiver, assets);

        emit Withdraw(caller, receiver, owner, assets, shares);
    }

    function _decimalsOffset() internal view virtual returns (uint8) {
        return 0;
    }
}

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

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error ERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

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

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

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `requestedDecrease`.
     *
     * NOTE: Although this function is designed to avoid double spending with {approval},
     * it can still be frontrunned, preventing any attempt of allowance reduction.
     */
    function decreaseAllowance(address spender, uint256 requestedDecrease) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance < requestedDecrease) {
            revert ERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
        }
        unchecked {
            _approve(owner, spender, currentAllowance - requestedDecrease);
        }

        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` (or `to`) is
     * the zero address. All customizations to transfers, mints, and burns should be done by overriding this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, by transferring it to address(0).
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

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

    /**
     * @dev Alternative version of {_approve} with an optional flag that can enable or disable the Approval event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to true
     * using the following override:
     * ```
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

File 4 of 21 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // 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 (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

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

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

File 6 of 21 : IEmployer.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IEmployer {
    function DEVELOPER_ADDRESS() external returns (address);
    function TIME_TOKEN_ADDRESS() external returns (address);
    function D() external returns (uint256);
    function FACTOR() external returns (uint256);
    function FIRST_BLOCK() external returns (uint256);
    function ONE_YEAR() external returns (uint256);
    function availableNative() external returns (uint256);
    function currentDepositedNative() external returns (uint256);
    function totalAnticipatedTime() external returns (uint256);
    function totalBurnedTime() external returns (uint256);
    function totalDepositedNative() external returns (uint256);
    function totalDepositedTime() external returns (uint256);
    function totalEarnedNative() external returns (uint256);
    function totalTimeSaved() external returns (uint256);
    function anticipationEnabled(address account) external returns (bool);
    function deposited(address account) external returns (uint256);
    function earned(address account) external view returns (uint256);
    function lastBlock(address account) external returns (uint256);
    function remainingTime(address account) external returns (uint256);
    function anticipate(uint256 timeAmount) external payable;
    function anticipationFee() external view returns (uint256);
    function compound(uint256 timeAmount, bool mustAnticipateTime) external;
    function deposit(uint256 timeAmount, bool mustAnticipateTime) external payable;
    function earn() external;
    function enableAnticipation() external payable;
    function getCurrentROI() external view returns (uint256);
    function getCurrentROIPerBlock() external view returns (uint256);
    function getROI() external view returns (uint256);
    function getROIPerBlock() external view returns (uint256);
    function queryAnticipatedEarnings(address depositant, uint256 anticipatedTime) external view returns (uint256);
    function queryEarnings(address depositant) external view returns (uint256);
    function withdrawEarnings() external;
    function withdrawDeposit() external;
    function withdrawDepositEmergency() external;
    receive() external payable;
}

File 7 of 21 : InvestmentCoordinator.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import { ERC4626 } from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
import { ERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

import { IWorker } from "./IWorker.sol";

/// @title InvestmentCoordinator contract
/// @author Einar Cesar - TIME Token Finance - https://timetoken.finance
/// @notice Coordinates the allocation of resources coming from the Worker vault and returns the profit in terms of TUP and TIME tokens
/// @dev It is attached and managed by the WorkerVault
contract InvestmentCoordinator is Ownable {
    using Math for uint256;

    error AddressNotAllowed(address sender);

    IWorker public worker;

    ERC4626[] public vaults;

    mapping(address => uint256) private _amountOnVault;
    mapping(address => uint256) private _assetCount;
    mapping(address => uint256) private _assetAmountPerVault;

    /// @notice Instantiates the contract
    /// @dev It is automatically instantiated by the WorkerVault contract
    /// @param _worker The address of the WorkerVault contract main instance
    /// @param _owner The address of the admin
    constructor(address _worker, address _owner) Ownable(_owner) {
        worker = IWorker(payable(_worker));
    }

    /// @notice Modifier used to allow function calling only by IWorker contract
    modifier onlyWorker() {
        _checkWorker();
        _;
    }

    /// @notice Verifies if the sender of a call is the WorkerVault contract
    function _checkWorker() private view {
        if (_msgSender() != address(worker)) {
            revert AddressNotAllowed(_msgSender());
        }
    }

    /// @notice Withdraw all the funds from an informed vault registered
    /// @dev It redeems all shares from the vault passed as parameter
    /// @param vault The instance of the vault contract
    /// @param receiver The address of the receiver of funds
    function _withdrawAllFromVault(ERC4626 vault, address receiver) private {
        try vault.redeem(vault.balanceOf(address(this)), receiver, address(this)) {
            _amountOnVault[address(vault)] = 0;
        } catch { }
    }

    /// @notice Add a new vault onto the InvestmentCoordinator
    /// @dev It pushes the new vault into the vault stack
    /// @param newVault The address of the new vault contract
    function addVault(address newVault) external onlyOwner {
        bool found;
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            if (newVault == address(vaults[i])) {
                found = true;
                break;
            }
        }
        if (!found) {
            vaults.push(ERC4626(newVault));
        }
    }

    /// @notice Verifies if vaults have profit and withdraw assets to the Worker vault
    /// @dev It iterates over the vaults stack, check if each has profit, and then withdraw to the WorkerVault address
    function checkProfitAndWithdraw() external {
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            uint256 updatedAmount = vaults[i].previewRedeem(vaults[i].balanceOf(address(this)));
            if (_amountOnVault[address(vaults[i])] < updatedAmount) {
                vaults[i].withdraw(updatedAmount - _amountOnVault[address(vaults[i])], address(worker), address(this));
            }
        }
    }

    /// @notice Sometimes, the Investor coordinator has most than one vault which operates with the same asset. In this case, this function distributes the asset equally among these vaults
    /// @dev Check which vaults operates in the asset informed and deposit what it has in balance
    /// @param asset The address of asset informed to be deposited
    function depositAssetOnVault(address asset) public onlyWorker {
        uint256 numberOfVaultsFound;
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            if (vaults[i].asset() == asset) {
                numberOfVaultsFound++;
            }
        }
        if (numberOfVaultsFound > 0) {
            IERC20 token = IERC20(asset);
            uint256 shares = token.balanceOf(address(this)) / numberOfVaultsFound;
            for (uint256 i = 0; i < numberOfVaults(); i++) {
                if (vaults[i].asset() == asset) {
                    if (token.allowance(address(this), address(vaults[i])) < shares) {
                        token.approve(address(vaults[i]), shares);
                    }
                    vaults[i].deposit(shares, address(this));
                    _amountOnVault[address(vaults[i])] += shares;
                }
            }
        }
    }

    /// @notice Deposit all assets in all registered vaults
    /// @dev It iterates over all vaults and all assets in order to deposit everything it has as balance
    function depositOnAllVaults() public {
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            _assetCount[vaults[i].asset()]++;
        }
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            if (_assetAmountPerVault[vaults[i].asset()] == 0 && _assetCount[vaults[i].asset()] > 0) {
                uint256 tokenBalance = IERC20(vaults[i].asset()).balanceOf(address(this));
                if (tokenBalance > 0) {
                    _assetAmountPerVault[vaults[i].asset()] = tokenBalance / _assetCount[vaults[i].asset()];
                }
            }
        }
        bool[] memory isDeposited = new bool[](numberOfVaults());
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            if (_assetAmountPerVault[vaults[i].asset()] > 0) {
                if (IERC20(vaults[i].asset()).allowance(address(this), address(vaults[i])) < _assetAmountPerVault[vaults[i].asset()]) {
                    IERC20(vaults[i].asset()).approve(address(vaults[i]), _assetAmountPerVault[vaults[i].asset()]);
                }
                try vaults[i].deposit(_assetAmountPerVault[vaults[i].asset()], address(this)) {
                    _amountOnVault[address(vaults[i])] += _assetAmountPerVault[vaults[i].asset()];
                    isDeposited[i] = true;
                } catch { }
            }
        }
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            _assetCount[vaults[i].asset()] = 0;
            if (_assetAmountPerVault[vaults[i].asset()] > 0 && isDeposited[i]) {
                _assetAmountPerVault[vaults[i].asset()] = 0;
            }
        }
    }

    /// @notice Informs the number of vaults registered in the contract
    /// @dev It just returns the length/size of the vaults stack
    function numberOfVaults() public view returns (uint256) {
        return vaults.length;
    }

    /// @notice Query the total amount invested for a given asset
    /// @dev It just query for the amount registered for the informed asset address
    /// @param asset The address of the asset
    /// @return totalAmount The total amount returned after query
    function queryTotalInvestedAmountForAsset(address asset) external view onlyWorker returns (uint256 totalAmount) {
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            if (vaults[i].asset() == asset) {
                totalAmount += _amountOnVault[address(vaults[i])];
            }
        }
    }

    /// @notice Removes an ERC-4626 vault from the Investment coordinator contract
    /// @dev It pushes part of the stack away when it founds the correct index of the contract
    /// @param vaultToRemove The address of the vault which will be removed
    function removeVault(address vaultToRemove) external onlyOwner {
        bool found;
        for (uint256 i = 0; i < numberOfVaults(); i++) {
            if (vaultToRemove == address(vaults[i])) {
                for (uint256 j = i; j < numberOfVaults() - 1; j++) {
                    vaults[j] = vaults[j + 1];
                }
                _withdrawAllFromVault(vaults[i], address(this));
                found = true;
                break;
            }
        }
        if (found) {
            vaults.pop();
        }
    }
}

File 8 of 21 : ITimeIsUp.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface ITimeIsUp {
    function FLASH_MINT_FEE() external view returns (uint256);
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
    function accountShareBalance(address account) external view returns (uint256);
    function burn(uint256 amount) external;
    function mint(uint256 timeAmount) external payable;
    function queryAmountExternalLP(uint256 amountNative) external view returns (uint256);
    function queryAmountInternalLP(uint256 amountNative) external view returns (uint256);
    function queryAmountOptimal(uint256 amountNative) external view returns (uint256);
    function queryNativeAmount(uint256 tupAmount) external view returns (uint256);
    function queryNativeFromTimeAmount(uint256 timeAmount) external view returns (uint256);
    function queryPriceNative(uint256 amountNative) external view returns (uint256);
    function queryPriceInverse(uint256 tupAmount) external view returns (uint256);
    function queryRate() external view returns (uint256);
    function queryPublicReward() external view returns (uint256);
    function returnNative() external payable returns (bool);
    function splitSharesWithReward() external;
    function buy() external payable returns (bool success);
    function sell(uint256 tupAmount) external returns (bool success);
    function flashMint(uint256 tupAmountToBorrow, bytes calldata data) external;
    function payFlashMintFee() external payable;
    function poolBalance() external view returns (uint256);
    function toBeShared() external view returns (uint256);
    function receiveProfit() external payable;
}

File 9 of 21 : ITimeToken.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface ITimeToken {
    function DEVELOPER_ADDRESS() external view returns (address);
    function BASE_FEE() external view returns (uint256);
    function COMISSION_RATE() external view returns (uint256);
    function SHARE_RATE() external view returns (uint256);
    function TIME_BASE_LIQUIDITY() external view returns (uint256);
    function TIME_BASE_FEE() external view returns (uint256);
    function TOLERANCE() external view returns (uint256);
    function dividendPerToken() external view returns (uint256);
    function firstBlock() external view returns (uint256);
    function isMiningAllowed(address account) external view returns (bool);
    function liquidityFactorNative() external view returns (uint256);
    function liquidityFactorTime() external view returns (uint256);
    function numberOfHolders() external view returns (uint256);
    function numberOfMiners() external view returns (uint256);
    function sharedBalance() external view returns (uint256);
    function poolBalance() external view returns (uint256);
    function totalMinted() external view returns (uint256);
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function burn(uint256 amount) external;
    function transfer(address to, uint256 amount) external returns (bool success);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool success);
    function averageMiningRate() external view returns (uint256);
    function donateEth() external payable;
    function enableMining() external payable;
    function enableMiningWithTimeToken() external;
    function fee() external view returns (uint256);
    function feeInTime() external view returns (uint256);
    function mining() external;
    function saveTime() external payable returns (bool success);
    function spendTime(uint256 timeAmount) external returns (bool success);
    function swapPriceNative(uint256 amountNative) external view returns (uint256);
    function swapPriceTimeInverse(uint256 amountTime) external view returns (uint256);
    function accountShareBalance(address account) external view returns (uint256);
    function withdrawableShareBalance(address account) external view returns (uint256);
    function withdrawShare() external;
    receive() external payable;
}

File 10 of 21 : IWorker.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import { ITVault } from "./ITVault.sol";
import { MinionCoordinator } from "./MinionCoordinator.sol";

interface IWorker is ITVault {
    function minionCoordinator() external view returns (MinionCoordinator);
    function DONATION_ADDRESS() external view returns (address);
    function DONATION_FEE() external view returns (uint256);
    function CALLER_FEE() external view returns (uint256);
    function FACTOR() external view returns (uint256);
    function INVESTMENT_FEE() external view returns (uint256);
    function MAX_PERCENTAGE_ALLOCATION_OF_TIME() external view returns (uint256);
    function MINION_CREATION_FEE() external view returns (uint256);
    function baseTimeFrame() external view returns (uint256);
    function earnedAmount() external view returns (uint256);
    function availableTimeAsCaller(address depositant) external view returns (uint256);
    function blockToUnlock(address depositant) external view returns (uint256);
    function calculateTimeToLock(uint256 amountTup) external view returns (uint256);
    function callToProduction(address callerAddress) external;
    function createMinions() external payable returns (uint256);
    function investWithNoCapital() external;
    function mintTupAsDepositant(bool reinvestTup) external payable;
    function mintTupAsThirdParty(address minter, bool reinvestTup) external payable;
    function queryAvailableTimeForDepositant(address depositant) external view returns (uint256);
    function queryAvailableTimeForTupMint(uint256 amountNative) external view returns (uint256);
    function queryFeeAmountToActivateMinions(uint256 numberOfMinions) external view returns (uint256);
    function queryMinNativeAmountToMintTup() external view returns (uint256);
    function queryNumberOfMinionsToActivateFromAmount(uint256 amount) external view returns (uint256);
    function updateBatchSize(uint256 newBatchSize) external;
    function updateBaseTimeFrame(uint256 newBaseTimeFrame) external;
}

File 11 of 21 : MinionCoordinator.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import { Minion, ITimeToken } from "./Minion.sol";
import { ITVault } from "./ITVault.sol";

/// @title MinionCoordinator contract
/// @author Einar Cesar - TIME Token Finance - https://timetoken.finance
/// @notice Coordinates the creation and calling of Minions in order to produce TIME in a larger scale
/// @dev It is attached and managed by the WorkerVault
contract MinionCoordinator {
    struct MinionInstance {
        address prevInstance;
        address nextInstance;
    }

    bool private _isOperationLocked;

    ITVault private _worker;

    address public currentMinionInstance;
    address public firstMinionInstance;
    address public lastMinionInstance;

    uint256 public constant MAX_NUMBER_OF_MINIONS = 300_000;

    uint256 public activeMinions;
    uint256 public batchSize;
    uint256 public dedicatedAmount;
    uint256 public timeProduced;

    mapping(address => uint256) private _currentBlock;

    mapping(address => MinionInstance instance) public minions;
    mapping(address => uint256) public blockToUnlock;

    /// @notice Instantiates the contract
    /// @dev It is automatically instantiated by the WorkerVault contract
    /// @param worker The main instance of the WorkerVault contract
    constructor(ITVault worker) {
        _worker = worker;
        batchSize = 15;
    }

    receive() external payable {
        if (msg.value > 0) {
            dedicatedAmount += msg.value;
        }
    }

    fallback() external payable {
        require(msg.data.length == 0);
        if (msg.value > 0) {
            dedicatedAmount += msg.value;
        }
    }

    /// @notice Modifier used to avoid reentrancy attacks
    modifier nonReentrant() {
        require(!_isOperationLocked, "Coordinator: this operation is locked for security reasons");
        _isOperationLocked = true;
        _;
        _isOperationLocked = false;
    }

    /// @notice Modifier to make a function runs only once per block (also avoids reentrancy, but in a different way)
    modifier onlyOncePerBlock() {
        require(block.number != _currentBlock[tx.origin], "Coordinator: you cannot perform this operation again in this block");
        _currentBlock[tx.origin] = block.number;
        _;
    }

    /// @notice Modifier used to allow function calling only by ITVault contract
    modifier onlyWorker() {
        require(msg.sender == address(_worker), "Coordinator: only ITVault contract can perform this operation");
        _;
    }

    /// @notice Registers a Minion in the contract
    /// @dev Add an instance of the Minion contract into the internal linked list of the ITVault contract. It also adjusts information about previous instances registered
    /// @param minion The instance of the recently created Minion contract
    function _addMinionInstance(Minion minion) private {
        if (lastMinionInstance != address(0)) {
            minions[lastMinionInstance].nextInstance = address(minion);
        }
        minions[address(minion)].prevInstance = lastMinionInstance;
        minions[address(minion)].nextInstance = address(0);
        if (firstMinionInstance == address(0)) {
            firstMinionInstance = address(minion);
            if (currentMinionInstance == address(0)) {
                currentMinionInstance = firstMinionInstance;
            }
        }
        lastMinionInstance = address(minion);
    }

    /// @notice Creates one Minion given a dedicated amount provided
    /// @dev Creates an instance of the Minion contract, registers it into the contract, and activates it for TIME token production
    /// @param dedicatedAmountForFee The dedicated amount for creation of the new Minion instance
    /// @return newDedicatedAmountForFee The remaining from dedicated amount after Minion creation
    /// @return success Returns true if the Minion was created correctly
    function _createMinionInstance(uint256 dedicatedAmountForFee) private returns (uint256 newDedicatedAmountForFee, bool success) {
        uint256 fee = ITimeToken(_worker.timeToken()).fee();
        if (fee <= dedicatedAmountForFee && activeMinions < MAX_NUMBER_OF_MINIONS) {
            Minion minionInstance = new Minion(address(this), _worker.timeToken());
            try minionInstance.enableMining{ value: fee }() returns (bool enableSuccess) {
                _addMinionInstance(minionInstance);
                activeMinions++;
                newDedicatedAmountForFee = dedicatedAmountForFee - fee;
                success = enableSuccess;
            } catch { }
        }
    }

    /// @notice Creates several Minions from a given amount of fee dedicated for the task
    /// @dev It iterates over the amount of fee dedicated for Minion activation until this value goes to zero, the number of active Minions reach the maximum level, or it reverts for some cause
    /// @param totalFeeForCreation The native amount dedicated for Minion activation for TIME production
    function _createMinions(uint256 totalFeeForCreation) private {
        require(
            totalFeeForCreation <= address(this).balance, "Coordinator: there is no enough amount for enabling minion activation for TIME production"
        );
        bool success;
        uint256 count;
        do {
            (totalFeeForCreation, success) = _createMinionInstance(totalFeeForCreation);
            count++;
        } while (totalFeeForCreation > 0 && success && count < batchSize);
    }

    /// @notice Performs production of TIME token
    /// @dev It calls the mining() function of TIME token from all active Minions' instances
    /// @return amountTime The amount of TIME tokens produced
    function _work() private returns (uint256 amountTime) {
        if (activeMinions > 0) {
            uint256 timeBalanceBeforeWork = ITimeToken(_worker.timeToken()).balanceOf(address(this));
            uint256 count;
            do {
                Minion(currentMinionInstance).produceTime();
                currentMinionInstance = minions[currentMinionInstance].nextInstance;
                count++;
            } while (currentMinionInstance != address(0) && count < batchSize);
            if (currentMinionInstance == address(0)) {
                currentMinionInstance = firstMinionInstance;
            }
            uint256 timeBalanceAfterWork = ITimeToken(_worker.timeToken()).balanceOf(address(this));
            amountTime = (timeBalanceAfterWork - timeBalanceBeforeWork);
            timeProduced += amountTime;
            ITimeToken(_worker.timeToken()).transfer(address(_worker), amountTime);
        }
    }

    /// @notice Receive specific resources coming from ITVault to create new Minions
    /// @dev It should be called only by the ITVault contract
    /// @return success Informs if the function was called and executed correctly
    function addResourcesForMinionCreation() external payable onlyWorker returns (bool success) {
        if (msg.value > 0) {
            dedicatedAmount += msg.value;
            success = true;
        }
    }

    /// @notice The ITVault contract calls this function to create Minions on demand given some amount of native tokens paid/passed (msg.value parameter)
    /// @dev It performs some additional checks and redirects to the _createMinions() function
    /// @param addressToSendRebate The address that should receive the remaining value after Minions are created
    /// @return numberOfMinionsCreated The number of active Minions created for TIME production
    function createMinions(address addressToSendRebate) external payable onlyWorker returns (uint256 numberOfMinionsCreated) {
        require(msg.value > 0, "Coordinator: please send some native tokens to create minions");
        numberOfMinionsCreated = activeMinions;
        _createMinions(msg.value);
        numberOfMinionsCreated = activeMinions - numberOfMinionsCreated;
        if (numberOfMinionsCreated == 0) {
            revert("Coordinator: the amount sent is not enough to create and activate new minions for TIME production");
        }
        if (address(this).balance > dedicatedAmount) {
            payable(addressToSendRebate).transfer(address(this).balance - dedicatedAmount);
        }
    }

    /// @notice Create Minions on demand given the dedicated amount inside the contract
    /// @dev Its behaviour is similar as the createMinions() function with some differences
    /// @return numberOfMinionsCreated The number of active Minions created for TIME production
    function createMinionsForFree() external nonReentrant onlyOncePerBlock returns (uint256 numberOfMinionsCreated) {
        if (dedicatedAmount > 0 && dedicatedAmount <= address(this).balance) {
            numberOfMinionsCreated = activeMinions;
            _createMinions(dedicatedAmount);
            numberOfMinionsCreated = activeMinions - numberOfMinionsCreated;
            dedicatedAmount = address(this).balance;
        }
    }

    /// @notice Change the batch size value (maximum number of minions to be created in one transaction)
    /// @dev It can only be called by ITVault contract, by delegation
    /// @param newBatchSize The new value of the batch size
    function updateBatchSize(uint256 newBatchSize) external onlyWorker {
        batchSize = newBatchSize;
    }
    
    /// @notice Call the Coordinator contract to produce TIME tokens
    /// @dev Can be called only by the ITVault contract
    function work() external onlyWorker returns (uint256) {
        return _work();
    }
}

File 12 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

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

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        if (nonceAfter != nonceBefore + 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

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

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 13 of 21 : IERC4626.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4626.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";
import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol";

/**
 * @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in
 * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
 */
interface IERC4626 is IERC20, IERC20Metadata {
    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);

    event Withdraw(
        address indexed sender,
        address indexed receiver,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /**
     * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
     *
     * - MUST be an ERC-20 token contract.
     * - MUST NOT revert.
     */
    function asset() external view returns (address assetTokenAddress);

    /**
     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.
     *
     * - SHOULD include any compounding that occurs from yield.
     * - MUST be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT revert.
     */
    function totalAssets() external view returns (uint256 totalManagedAssets);

    /**
     * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToShares(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToAssets(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
     * through a deposit call.
     *
     * - MUST return a limited value if receiver is subject to some deposit limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
     * - MUST NOT revert.
     */
    function maxDeposit(address receiver) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
     *   in the same transaction.
     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewDeposit(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
     *
     * - MUST emit the Deposit event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   deposit execution, and are accounted for during deposit.
     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
     *   approving enough underlying tokens to the Vault contract, etc).
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
     */
    function deposit(uint256 assets, address receiver) external returns (uint256 shares);

    /**
     * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
     * - MUST return a limited value if receiver is subject to some mint limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
     * - MUST NOT revert.
     */
    function maxMint(address receiver) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
     *   same transaction.
     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
     *   would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by minting.
     */
    function previewMint(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
     *
     * - MUST emit the Deposit event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
     *   execution, and are accounted for during mint.
     * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
     *   approving enough underlying tokens to the Vault contract, etc).
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
     */
    function mint(uint256 shares, address receiver) external returns (uint256 assets);

    /**
     * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
     * Vault, through a withdraw call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxWithdraw(address owner) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
     *   called
     *   in the same transaction.
     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewWithdraw(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
     *
     * - MUST emit the Withdraw event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   withdraw execution, and are accounted for during withdraw.
     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);

    /**
     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
     * through a redeem call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxRedeem(address owner) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
     *   same transaction.
     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
     *   redemption would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.
     */
    function previewRedeem(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
     *
     * - MUST emit the Withdraw event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   redeem execution, and are accounted for during redeem.
     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
}

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

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

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

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

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

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

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

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

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

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

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

pragma solidity ^0.8.20;

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

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

File 17 of 21 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

File 18 of 21 : ITVault.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import { ITimeToken } from "./ITimeToken.sol";

interface ITVault {
    function timeToken() external view returns (ITimeToken);
}

File 19 of 21 : Minion.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import { ITimeToken } from "./ITimeToken.sol";

/// @title Minion contract
/// @author Einar Cesar - TIME Token Finance - https://timetoken.finance
/// @notice Has the ability to produce TIME tokens for any contract which extends its behavior
/// @dev It should have being enabled to produce TIME before or it will not work as desired. Sometimes, the coordinator address is the contract itself
contract Minion {
    ITimeToken internal immutable _timeToken;
    address internal _coordinator;

    constructor(address coordinatorAddress, ITimeToken timeToken) {
        _coordinator = coordinatorAddress;
        _timeToken = timeToken;
    }

    /// @notice Produce TIME tokens and transfer them to the registered coordinator, if it has one
    /// @dev If the coordinator is an external contract, it maintains a fraction of the produced TIME as incentive for the protocol (which increases the number of token holders)
    function _produceTime() internal {
        _timeToken.mining();
        if (_coordinator != address(this)) {
            uint256 amountToTransfer = (_timeToken.balanceOf(address(this)) * 9_999) / 10_000;
            if (amountToTransfer > 0) {
                _timeToken.transfer(_coordinator, amountToTransfer);
            }
        }
    }

    /// @notice Enables the contract to produce TIME tokens
    /// @dev It should be called right after the creation of the contract
    /// @return success Informs if the operation was carried correctly
    function enableMining() external payable returns (bool success) {
        require(msg.value > 0);
        try _timeToken.enableMining{ value: msg.value }() {
            success = true;
        } catch { }
        return success;
    }

    /// @notice External call for the _produceTime() function
    /// @dev Sometimes, when the Minion contract is inherited from another contract, it can calls the private function. Otherwise, the external function should exist in order to produce TIME for the contract
    function produceTime() external {
        _produceTime();
    }

    /// @notice Alters the coordinator address
    /// @dev Depending on the strategy, a new coordinator may be necessary for the Minion... Only the old coordinator must be responsible to designate the new one
    /// @param newCoordinator The new coordinator address
    function updateCoordinator(address newCoordinator) external {
        require(msg.sender == _coordinator, "Minion: only coordinator can call this function");
        _coordinator = newCoordinator;
    }
}

File 20 of 21 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

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

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

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

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

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

Settings
{
  "remappings": [
    "@layerzerolabs/=lib/solidity-examples/",
    "@aave/core-v3/=lib/aave-v3-core/",
    "@chainlink/=lib/chainlink/",
    "@0x/contracts-utils/=lib/0xprotocol/utils/",
    "@0x/zero-ex/=lib/0xprotocol/zero-ex/",
    "@0x/contracts-erc20/=lib/0xprotocol/erc20/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@superform-core/=lib/superform-core/",
    "@uniswap/v3-periphery/=lib/v3-periphery/",
    "@uniswap/v3-core/=lib/v3-core/",
    "@uniswap/swap-router-contracts/=lib/swap-router-contracts/",
    "0xprotocol/=lib/0xprotocol/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@prb/test/=lib/pt-v5-vault/lib/pt-v5-prize-pool/lib/prb-math/lib/prb-test/src/",
    "ERC1155A/=lib/superform-core/lib/ERC1155A/",
    "aave-v3-core/=lib/aave-v3-core/",
    "brokentoken/=lib/pt-v5-vault/lib/brokentoken/src/",
    "chainlink/=lib/chainlink/",
    "ds-test/=lib/superform-core/lib/ds-test/src/",
    "erc4626-tests/=lib/pt-v5-vault/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "layerzero/=lib/layerzero/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/pt-v5-vault/lib/openzeppelin-contracts/contracts/",
    "owner-manager-contracts/=lib/pt-v5-vault/lib/owner-manager-contracts/contracts/",
    "pigeon/=lib/superform-core/lib/pigeon/src/",
    "prb-math/=lib/pt-v5-vault/lib/pt-v5-prize-pool/lib/prb-math/src/",
    "prb-test/=lib/pt-v5-vault/lib/pt-v5-prize-pool/lib/prb-math/lib/prb-test/src/",
    "pt-v5-claimable-interface/=lib/pt-v5-vault/lib/pt-v5-claimable-interface/src/",
    "pt-v5-liquidator-interfaces/=lib/pt-v5-vault/lib/pt-v5-liquidator-interfaces/src/",
    "pt-v5-prize-pool/=lib/pt-v5-vault/lib/pt-v5-prize-pool/src/",
    "pt-v5-twab-controller/=lib/pt-v5-vault/lib/pt-v5-twab-controller/src/",
    "pt-v5-vault/=lib/pt-v5-vault/src/",
    "ring-buffer-lib/=lib/pt-v5-vault/lib/pt-v5-twab-controller/lib/ring-buffer-lib/src/",
    "solady/=lib/superform-core/lib/pigeon/lib/solady/",
    "solidity-examples/=lib/solidity-examples/contracts/",
    "solidity-stringutils/=lib/superform-core/lib/surl/lib/solidity-stringutils/",
    "solmate/=lib/superform-core/lib/ERC1155A/lib/solmate/src/",
    "super-vaults/=lib/superform-core/lib/super-vaults/src/",
    "superform-core/=lib/superform-core/",
    "surl/=lib/superform-core/lib/surl/",
    "swap-router-contracts/=lib/swap-router-contracts/contracts/",
    "uniform-random-number/=lib/pt-v5-vault/lib/pt-v5-prize-pool/lib/uniform-random-number/src/",
    "v2-core/=lib/superform-core/lib/super-vaults/lib/v2-core/contracts/",
    "v2-periphery/=lib/superform-core/lib/super-vaults/lib/v2-periphery/contracts/",
    "v3-core/=lib/v3-core/",
    "v3-periphery/=lib/v3-periphery/contracts/",
    "v4-core/=lib/v4-core/contracts/",
    "weird-erc20/=lib/pt-v5-vault/lib/brokentoken/lib/weird-erc20/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 2000000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"_timeTokenAddress","type":"address"},{"internalType":"address","name":"_employerAddress","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"DepositEqualsToZero","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"currentAllowance","type":"uint256"},{"internalType":"uint256","name":"requestedDecrease","type":"uint256"}],"name":"ERC20FailedDecreaseAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxDeposit","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxMint","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxRedeem","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxWithdraw","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"MathOverflowedMulDiv","type":"error"},{"inputs":[],"name":"NoTupMinted","type":"error"},{"inputs":[{"internalType":"string","name":"message","type":"string"}],"name":"NotAllowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountAsked","type":"uint256"},{"internalType":"uint256","name":"amountAvailable","type":"uint256"}],"name":"NotHaveEnoughBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"timeAsked","type":"uint256"},{"internalType":"uint256","name":"balanceInTime","type":"uint256"}],"name":"NotHaveEnoughTime","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"OperationLocked","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"uint256","name":"timeValue","type":"uint256"},{"internalType":"uint256","name":"native","type":"uint256"}],"name":"TimeValueConsumedGreaterThanNative","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentBlock","type":"uint256"},{"internalType":"uint256","name":"blockToWithdraw","type":"uint256"}],"name":"WithdrawLocked","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"CALLER_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DONATION_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DONATION_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INVESTMENT_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PERCENTAGE_ALLOCATION_OF_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINION_CREATION_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"availableTimeAsCaller","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTimeFrame","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"blockToUnlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountTup","type":"uint256"}],"name":"calculateTimeToLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"callerAddress","type":"address"}],"name":"callToProduction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"consumedShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createMinions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"requestedDecrease","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"earnedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"investWithNoCapital","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"investmentCoordinator","outputs":[{"internalType":"contract InvestmentCoordinator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEmergencyWithdrawEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minionCoordinator","outputs":[{"internalType":"contract MinionCoordinator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"reinvestTup","type":"bool"}],"name":"mintTupAsDepositant","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bool","name":"reinvestTup","type":"bool"}],"name":"mintTupAsThirdParty","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"depositant","type":"address"}],"name":"queryAvailableTimeForDepositant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountNative","type":"uint256"}],"name":"queryAvailableTimeForTupMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfMinions","type":"uint256"}],"name":"queryFeeAmountToActivateMinions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"queryInvestedAmountForAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"queryMinNativeAmountToMintTup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"queryNumberOfMinionsToActivateFromAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeToken","outputs":[{"internalType":"contract ITimeToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBaseTimeFrame","type":"uint256"}],"name":"updateBaseTimeFrame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBatchSize","type":"uint256"}],"name":"updateBatchSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040523480156200001157600080fd5b506040516200a1533803806200a1538339810160408190526200003491620004d5565b80846040518060400160405280600c81526020016b15dbdc9ad95c8815985d5b1d60a21b8152506040518060400160405280600581526020016476574f524b60d81b81525081600390816200008a9190620005d9565b506004620000998282620005d9565b505050600080620000b0836200029a60201b60201c565b9150915081620000c2576012620000c4565b805b60ff1660a05250506001600160a01b0316608052620000e3816200037f565b50600780546001600160a01b0319166001600160a01b0385161790556040518290309062000111906200049c565b6001600160a01b039091168152602001604051809103906000f0801580156200013e573d6000803e3d6000fd5b50600860006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620002246001620001e361016d6001856001600160a01b0316630f529ba26040518163ffffffff1660e01b81526004016020604051808303816000875af1158015620001b5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001db9190620006a5565b9190620003d1565b836001600160a01b03166316d3bfbb6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015620001b5573d6000803e3d6000fd5b600c55604051309083906200023990620004aa565b6001600160a01b03928316815291166020820152604001604051809103906000f0801580156200026d573d6000803e3d6000fd5b50600680546001600160a01b0319166001600160a01b039290921691909117905550620007069350505050565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000918291829182916001600160a01b03871691620002e391620006bf565b600060405180830381855afa9150503d806000811462000320576040519150601f19603f3d011682016040523d82523d6000602084013e62000325565b606091505b50915091508180156200033a57506020815110155b156200037257600081806020019051810190620003589190620006a5565b905060ff811162000370576001969095509350505050565b505b5060009485945092505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008383028160001985870982811083820303915050806000036200040d57838281620004025762000402620006f0565b049250505062000495565b8084116200042e5760405163227bc15360e01b815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b611d788062005ca883390190565b6127338062007a2083390190565b80516001600160a01b0381168114620004d057600080fd5b919050565b60008060008060808587031215620004ec57600080fd5b620004f785620004b8565b93506200050760208601620004b8565b92506200051760408601620004b8565b91506200052760608601620004b8565b905092959194509250565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200055d57607f821691505b6020821081036200057e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005d4576000816000526020600020601f850160051c81016020861015620005af5750805b601f850160051c820191505b81811015620005d057828155600101620005bb565b5050505b505050565b81516001600160401b03811115620005f557620005f562000532565b6200060d8162000606845462000548565b8462000584565b602080601f8311600181146200064557600084156200062c5750858301515b600019600386901b1c1916600185901b178555620005d0565b600085815260208120601f198616915b82811015620006765788860151825594840194600190910190840162000655565b5085821015620006955787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620006b857600080fd5b5051919050565b6000825160005b81811015620006e25760208186018101518583015201620006c6565b506000920191825250919050565b634e487b7160e01b600052601260045260246000fd5b60805160a0516154fe620007aa6000396000610e130152600081816105e401528181610b8901528181610cd701528181611ad701528181612c0601528181612cbb01528181612f2c01528181612fe60152818161309701528181613197015281816131fc015281816132b0015281816134d30152818161364201528181613d1601528181613de401528181613f260152818161474f015261486601526154fe6000f3fe6080604052600436106103b05760003560e01c8063715018a6116101e7578063b460af941161010d578063dd62ed3e116100a0578063ef8b30f71161006f578063ef8b30f7146109fd578063f2fde38b14610b1d578063f8e726d114610b3d578063fddc76de14610b65576103b7565b8063dd62ed3e14610a73578063de4e5a4514610ac6578063e27af3b914610adb578063eee1ddc814610b08576103b7565b8063c6e6f592116100dc578063c6e6f592146109fd578063cc50bd7614610a1d578063ce96cb7714610a33578063d905777e14610a53576103b7565b8063b460af941461099d578063b70139ac146109bd578063ba087652146109dd578063c63d75b614610628576103b7565b806394bf804d11610185578063a457c2d711610154578063a457c2d714610935578063a9059cbb14610955578063b2f6adf014610975578063b3d7f6b91461097d576103b7565b806394bf804d146108c057806395d89b41146108e05780639a1e1caa146108f55780639bae11f214610915576103b7565b806383922a3c116101c157806383922a3c14610835578063870cfa40146108625780638da5cb5b146108955780638e8f9d0d14610713576103b7565b8063715018a6146107de578063734531c9146107f35780637ddb2c4c14610820576103b7565b806338d52e0f116102d75780635f98783f1161026a578063677a085411610239578063677a08541461073b5780636db5967b1461074e5780636e553f651461077b57806370a082311461079b576103b7565b80635f98783f146106dd57806360e883a9146106f357806364a4f07814610713578063651b172814610728576103b7565b806347e0b32b116102a657806347e0b32b146106885780634cdad506146104235780634f6f73c0146106a8578063514fe007146106c8576103b7565b806338d52e0f146105d55780633950935114610608578063402d267d146106285780634689864a14610668576103b7565b806314c144191161034f578063313ce5671161031e578063313ce5671461055d578063327052031461058457806335815b95146105a457806336301533146105c0576103b7565b806314c14419146104a957806318160ddd146104d657806323b872dd146104eb5780632ae8115c1461050b576103b7565b806307a2d13a1161038b57806307a2d13a14610423578063095ea7b3146104435780630a28a477146104735780630e62546a14610493576103b7565b8062e950f2146103c457806301e1d114146103ec57806306fdde0314610401576103b7565b366103b757005b36156103c257600080fd5b005b3480156103d057600080fd5b506103d9610b85565b6040519081526020015b60405180910390f35b3480156103f857600080fd5b506103d9610ca6565b34801561040d57600080fd5b50610416610d1b565b6040516103e39190614fb9565b34801561042f57600080fd5b506103d961043e36600461500a565b610dad565b34801561044f57600080fd5b5061046361045e366004615045565b610dc0565b60405190151581526020016103e3565b34801561047f57600080fd5b506103d961048e36600461500a565b610dd8565b34801561049f57600080fd5b506103d9600d5481565b3480156104b557600080fd5b506103d96104c4366004615071565b60116020526000908152604090205481565b3480156104e257600080fd5b506002546103d9565b3480156104f757600080fd5b5061046361050636600461508e565b610de5565b34801561051757600080fd5b506006546105389073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103e3565b34801561056957600080fd5b50610572610e0b565b60405160ff90911681526020016103e3565b34801561059057600080fd5b506103c261059f36600461500a565b610e37565b3480156105b057600080fd5b506103d9670de0b6b3a764000081565b3480156105cc57600080fd5b506103c2610ec6565b3480156105e157600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610538565b34801561061457600080fd5b50610463610623366004615045565b610f10565b34801561063457600080fd5b506103d9610643366004615071565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90565b34801561067457600080fd5b506103c261068336600461500a565b610f5c565b34801561069457600080fd5b506103d96106a336600461500a565b610f69565b3480156106b457600080fd5b506103d96106c336600461500a565b611013565b3480156106d457600080fd5b506103d9601981565b3480156106e957600080fd5b506103d9600c5481565b3480156106ff57600080fd5b506103d961070e36600461500a565b6110be565b34801561071f57600080fd5b506103d9603281565b6103c26107363660046150dd565b61115e565b6103c2610749366004615116565b611550565b34801561075a57600080fd5b506103d9610769366004615071565b60126020526000908152604090205481565b34801561078757600080fd5b506103d9610796366004615133565b61180b565b3480156107a757600080fd5b506103d96107b6366004615071565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3480156107ea57600080fd5b506103c2611954565b3480156107ff57600080fd5b506008546105389073ffffffffffffffffffffffffffffffffffffffff1681565b34801561082c57600080fd5b506103c2611968565b34801561084157600080fd5b506103d9610850366004615071565b60106020526000908152604090205481565b34801561086e57600080fd5b50600554610463907501000000000000000000000000000000000000000000900460ff1681565b3480156108a157600080fd5b5060055473ffffffffffffffffffffffffffffffffffffffff16610538565b3480156108cc57600080fd5b506103d96108db366004615133565b611c02565b3480156108ec57600080fd5b50610416611d1c565b34801561090157600080fd5b506103d961091036600461500a565b611d2b565b34801561092157600080fd5b506103c2610930366004615071565b611d3e565b34801561094157600080fd5b50610463610950366004615045565b611f52565b34801561096157600080fd5b50610463610970366004615045565b611ffe565b6103d961200c565b34801561098957600080fd5b506103d961099836600461500a565b6121b5565b3480156109a957600080fd5b506103d96109b8366004615158565b6121c2565b3480156109c957600080fd5b506103d96109d8366004615071565b612356565b3480156109e957600080fd5b506103d96109f8366004615158565b6124c2565b348015610a0957600080fd5b506103d9610a1836600461500a565b612626565b348015610a2957600080fd5b506103d961132481565b348015610a3f57600080fd5b506103d9610a4e366004615071565b612633565b348015610a5f57600080fd5b506103d9610a6e366004615071565b612664565b348015610a7f57600080fd5b506103d9610a8e36600461519a565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b348015610ad257600080fd5b506103c261268f565b348015610ae757600080fd5b506007546105389073ffffffffffffffffffffffffffffffffffffffff1681565b348015610b1457600080fd5b506103d9604b81565b348015610b2957600080fd5b506103c2610b38366004615071565b6126c1565b348015610b4957600080fd5b5061053873731591207791a93fb0ec481186fb086e16a7d6d081565b348015610b7157600080fd5b506103d9610b80366004615071565b612725565b60007f00000000000000000000000000000000000000000000000000000000000000006007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff9283169263a1bbf1619216906370a0823190602401602060405180830381865afa158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4291906151c8565b6040518263ffffffff1660e01b8152600401610c6091815260200190565b602060405180830381865afa158015610c7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca191906151c8565b905090565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401610c60565b606060038054610d2a906151e1565b80601f0160208091040260200160405190810160405280929190818152602001828054610d56906151e1565b8015610da35780601f10610d7857610100808354040283529160200191610da3565b820191906000526020600020905b815481529060010190602001808311610d8657829003601f168201915b5050505050905090565b6000610dba8260006127ba565b92915050565b600033610dce8185856127f4565b5060019392505050565b6000610dba826001612806565b600033610df3858285612836565b610dfe858585612905565b60019150505b9392505050565b6000610ca1817f000000000000000000000000000000000000000000000000000000000000000061525d565b610e3f6129b0565b6008546040517f327052030000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690633270520390602401600060405180830381600087803b158015610eab57600080fd5b505af1158015610ebf573d6000803e3d6000fd5b5050505050565b610ece6129b0565b600580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000179055565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610dce9082908690610f57908790615276565b6127f4565b610f646129b0565b600c55565b6007546040517f8faefa4200000000000000000000000000000000000000000000000000000000815260048101839052600091610dba9173ffffffffffffffffffffffffffffffffffffffff90911690638faefa4290602401602060405180830381865afa158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100391906151c8565b8390670de0b6b3a7640000612a03565b6000610dba6001600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ab91906151c8565b6110b6906001615276565b849190612a03565b6000610dba826001600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611133573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115791906151c8565b9190612a03565b60055474010000000000000000000000000000000000000000900460ff16156111d957335b6040517fab4a606c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201524360248201526044015b60405180910390fd5b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611268576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e602052604081204390553490036112b3576040517f23d0f33100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006112c434611324612710612a03565b905060006112d182610f69565b905060006112e76112e28434615289565b612afe565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291925073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137a91906151c8565b821115611416576007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa1580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141391906151c8565b91505b61142285828487612bc0565b80600d60008282546114349190615289565b909155505073ffffffffffffffffffffffffffffffffffffffff8516600090815260106020526040902054156114f75773ffffffffffffffffffffffffffffffffffffffff85166000908152601060205260409020548211156114bc5773ffffffffffffffffffffffffffffffffffffffff85166000908152601060205260408120556114f7565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260106020526040812080548492906114f1908490615289565b90915550505b6000611501613599565b11156115215761151b30611513613599565b600080612bc0565b6000600d555b5050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055505050565b60055474010000000000000000000000000000000000000000900460ff16156115795733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611608576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e60205260408120439055349003611653576040517f23d0f33100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61165f61043e336107b6565b600003611714576040517f367dccf700000000000000000000000000000000000000000000000000000000815260206004820152605460248201527f576f726b65723a20706c6561736520726566657220746865206465706f73697460448201527f616e742073686f756c64206861766520736f6d65206465706f7369746564205460648201527f555020746f6b656e7320696e20616476616e6365000000000000000000000000608482015260a4016111d0565b600061171f34612afe565b9050600061172c33612356565b9050600061173983610f69565b9050808210156117465750805b336000908152601060205260409020548111156117725733600090815260106020526040812055611797565b3360009081526010602052604081208054839290611791908490615289565b90915550505b6117a333848387612bc0565b82600d60008282546117b59190615289565b90915550600090506117c5613599565b11156117dd576117d730611513613599565b6000600d555b5050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050565b60055460009074010000000000000000000000000000000000000000900460ff16156118375733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e602052604090205443036118c6576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e602052604090204390556118e283826135e8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61190c84612626565b915061191a3384868561363d565b6119258385846136e9565b50600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905592915050565b61195c6129b0565b6119666000613a09565b565b60055474010000000000000000000000000000000000000000900460ff16156119915733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611a20576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e60205260409020439055611a3c6001613a80565b3360009081526010602052604081208054909190611a5b908490615276565b90915550611a699050613bdf565b60095415611bd8576000611a7e600954610f69565b336000908152601060205260408082205490517fa1bbf16100000000000000000000000000000000000000000000000000000000815260048101919091529192509073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a1bbf16190602401602060405180830381865afa158015611b1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4291906151c8565b90508060095410611b855760095433600081815260106020526040902054611b6c92906001612bc0565b6000600981905533815260106020526040812055611bd5565b336000908152601060205260409020548211611bd5573360009081526010602052604081208054849290611bba908490615289565b90915550611bcf905033600954846001612bc0565b60006009555b50505b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b60055460009074010000000000000000000000000000000000000000900460ff1615611c2e5733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611cbd576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e60205260409020439055611cd981846135e8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611d03846121b5565b9150611d113384848761363d565b6119258383866136e9565b606060048054610d2a906151e1565b6000610dba600c54600a61115785613dd0565b60055474010000000000000000000000000000000000000000900460ff1615611d675733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611df6576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040902043905573ffffffffffffffffffffffffffffffffffffffff811615611e2a5780611ebb565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663454e66c86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebb919061529c565b9050611ec76001613a80565b73ffffffffffffffffffffffffffffffffffffffff821660009081526010602052604081208054909190611efc908490615276565b90915550611f0a9050613bdf565b60095415611f2757611f2181600954600080612bc0565b60006009555b50600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015611fe6576040517fa60f030c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616600482015260248101829052604481018590526064016111d0565b611ff382868684036127f4565b506001949350505050565b600033610dce818585612905565b60055460009074010000000000000000000000000000000000000000900460ff16156120385733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e602052604090205443036120c7576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040902043905560085473ffffffffffffffffffffffffffffffffffffffff1663f99dcce034336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038185885af1158015612163573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061218891906151c8565b9050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905590565b6000610dba8260016127ba565b60055460009074010000000000000000000000000000000000000000900460ff16156121ee5733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e6020526040902054430361227d576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040812043905561229883612633565b9050808511156122fa576040517ffe9cceec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101869052604481018290526064016111d0565b61230385610dd8565b915061230f8583613e4d565b61231c3385858886613ed9565b6123268583613fda565b50600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690559392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526020818152604080832054601290925282205481116123b557505073ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152601060205260409020546124b26123e9603280615276565b6123f590612710615289565b73ffffffffffffffffffffffffffffffffffffffff861660009081526012602052604090205461271090611157906124319061043e9088615289565b612439610ca6565b612444906001615276565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015611133573d6000803e3d6000fd5b610e049190615276565b50919050565b60055460009074010000000000000000000000000000000000000000900460ff16156124ee5733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e6020526040902054430361257d576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040812043905561259883612664565b9050808511156125fa576040517fb94abeec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101869052604481018290526064016111d0565b61260385610dad565b915061260f8286613e4d565b61261c3385858589613ed9565b6123268286613fda565b6000610dba826000612806565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812054610dba9060006127ba565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812054610dba565b6126976129b0565b600580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055565b6126c96129b0565b73ffffffffffffffffffffffffffffffffffffffff8116612719576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b61272281613a09565b50565b6006546040517f8f019c4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526000921690638f019c4d90602401602060405180830381865afa158015612796573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dba91906151c8565b6000610e046127c7610ca6565b6127d2906001615276565b6127de6000600a6153d9565b6002546127eb9190615276565b85919085614281565b61280183838360016142d2565b505050565b6000610e0461281682600a6153d9565b6002546128239190615276565b61282b610ca6565b6127eb906001615276565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146128ff57818110156128f0576040517ffb8f41b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101829052604481018390526064016111d0565b6128ff848484840360006142d2565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612955576040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b73ffffffffffffffffffffffffffffffffffffffff82166129a5576040517fec442f05000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b61280183838361440c565b60055473ffffffffffffffffffffffffffffffffffffffff163314611966576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016111d0565b6000838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8587098281108382030391505080600003612a5857838281612a4e57612a4e6153e8565b0492505050610e04565b808411612a91576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b600080612b0f836032612710612a03565b90506000612b21846019612710612a03565b90506000612b3385604b612710612a03565b905081600a6000828254612b479190615276565b9250508190555080600b6000828254612b609190615276565b925050819055508260096000828254612b799190615276565b90915550839050612b8a8284615276565b612b949190615276565b612b9e9086615289565b945084600d6000828254612bb29190615276565b909155509495945050505050565b6040517fa1bbf16100000000000000000000000000000000000000000000000000000000815260048101839052839073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a1bbf16190602401602060405180830381865afa158015612c4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c7191906151c8565b1115612d63576040517fa1bbf1610000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a1bbf16190602401602060405180830381865afa158015612d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d2691906151c8565b6040517f374db78f0000000000000000000000000000000000000000000000000000000081526004810191909152602481018490526044016111d0565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015612dd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df591906151c8565b821115612ec9576007546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152839173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015612e6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e8e91906151c8565b6040517f0d7aed96000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016111d0565b47831115612f0c576040517f8a8b3734000000000000000000000000000000000000000000000000000000008152600481018490524760248201526044016111d0565b60075473ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f00000000000000000000000000000000000000000000000000000000000000006040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018590526044016020604051808303816000875af1158015612fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fe19190615417565b5060007f00000000000000000000000000000000000000000000000000000000000000006040517fa88f713300000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063a88f713390602401602060405180830381865afa158015613071573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061309591906151c8565b7f00000000000000000000000000000000000000000000000000000000000000006040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015613122573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061314691906151c8565b6131509190615289565b6040517fa0712d680000000000000000000000000000000000000000000000000000000081526004810185905290915073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a0712d689086906024016000604051808303818588803b1580156131dc57600080fd5b505af11580156131f0573d6000803e3d6000fd5b5050505050600061321e7f000000000000000000000000000000000000000000000000000000000000000090565b6040517fa88f713300000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063a88f713390602401602060405180830381865afa15801561328a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132ae91906151c8565b7f00000000000000000000000000000000000000000000000000000000000000006040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa15801561333b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061335f91906151c8565b6133699190615289565b905060006133778383615289565b9050806000036133b3576040517f47407e9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006133be82612626565b905060006133ee8973ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b1180156134035750600061340189612356565b115b156134435773ffffffffffffffffffffffffffffffffffffffff88166000908152601260205260408120805483929061343d908490615276565b90915550505b84156134b45761345388826144f8565b61345c88614554565b604080518381526020810183905273ffffffffffffffffffffffffffffffffffffffff8a169182917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a361358f565b73ffffffffffffffffffffffffffffffffffffffff8816301461358f577f00000000000000000000000000000000000000000000000000000000000000006040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015260248201859052919091169063a9059cbb906044016020604051808303816000875af1158015613569573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061358d9190615417565b505b5050505050505050565b600080600b54600a54600954600d546135b29190615276565b6135bc9190615276565b6135c69190615276565b9050804711156135e0576135da8147615289565b91505090565b600091505090565b81156135f457816135fd565b6135fd81610dad565b915081600003613639576040517f23d0f33100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6136697f00000000000000000000000000000000000000000000000000000000000000008530856146be565b61367383826144f8565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516136db929190918252602082015260400190565b60405180910390a350505050565b81156136f557816136fe565b6136fe81610dad565b915061370983614554565b613711613bdf565b600b54156137b657600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e649e5d2600b546040518263ffffffff1660e01b815260040160206040518083038185885af115801561378a573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906137af9190615417565b506000600b555b600a541561382257600a5460405173731591207791a93fb0ec481186fb086e16a7d6d09190600081818185875af1925050503d8060008114613814576040519150601f19603f3d011682016040523d82523d6000602084013e613819565b606091505b50506000600a55505b600854604080517ff9908595000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163f99085959160048083019260209291908290030181865afa158015613892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b691906151c8565b111561396c57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c517a5976040518163ffffffff1660e01b81526004016020604051808303816000875af1925050508015613965575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252613962918101906151c8565b60015b1561396c57505b6139766000613a80565b50600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd2ed7246040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156139e157600080fd5b505af19250505080156139f2575060015b50612801613a04836032612710612a03565b614747565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008115613b0657613aff6032612710600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663322e9f046040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611133573d6000803e3d6000fd5b9050613bbe565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663322e9f046040518163ffffffff1660e01b81526004016020604051808303816000875af1925050508015613baf575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252613bac918101906151c8565b60015b613bbb57506000613bbe565b90505b8015613bda57613bda613bd5826032612710612a03565b6148cd565b919050565b6007546040517f901362bd00000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff169063901362bd90602401602060405180830381865afa158015613c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c7291906151c8565b1115613d1257600754604080517f243496710000000000000000000000000000000000000000000000000000000081529051479273ffffffffffffffffffffffffffffffffffffffff1691632434967191600480830192600092919082900301818387803b158015613ce357600080fd5b505af1925050508015613cf4575060015b15613d105780471115613d1057613d0e6112e28247615289565b505b505b60007f00000000000000000000000000000000000000000000000000000000000000006040517fa88f713300000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063a88f713390602401602060405180830381865afa158015613da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dc591906151c8565b905061272281614747565b6000610dba600a613de2846001615276565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611133573d6000803e3d6000fd5b3360009081526011602052604090205443108015613e8757506005547501000000000000000000000000000000000000000000900460ff16155b156136395733600090815260116020526040908190205490517fd1eb70ad00000000000000000000000000000000000000000000000000000000815243600482015260248101919091526044016111d0565b8273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614613f1757613f17838683612836565b613f2183826149e8565b613f4c7f00000000000000000000000000000000000000000000000000000000000000008584614a44565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051613fcb929190918252602082015260400190565b60405180910390a45050505050565b613fe2613bdf565b600b541561408757600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e649e5d2600b546040518263ffffffff1660e01b815260040160206040518083038185885af115801561405b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906140809190615417565b506000600b555b600a54156140f357600a5460405173731591207791a93fb0ec481186fb086e16a7d6d09190600081818185875af1925050503d80600081146140e5576040519150601f19603f3d011682016040523d82523d6000602084013e6140ea565b606091505b50506000600a55505b600854604080517ff9908595000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163f99085959160048083019260209291908290030181865afa158015614163573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061418791906151c8565b111561423d57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c517a5976040518163ffffffff1660e01b81526004016020604051808303816000875af1925050508015614236575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252614233918101906151c8565b60015b1561423d57505b6142476000613a80565b506000614253336107b6565b3360009081526012602052604090205490915081101561280157336000908152601260205260409020555050565b60008061428f868686612a03565b905061429a83614a82565b80156142b65750600084806142b1576142b16153e8565b868809115b156142c9576142c6600182615276565b90505b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416614322576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b73ffffffffffffffffffffffffffffffffffffffff8316614372576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020908152604080832093871683529290522082905580156128ff578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516136db91815260200190565b614417838383614aaf565b61442083614554565b61442982614554565b614434838383614c5a565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020546000036144955773ffffffffffffffffffffffffffffffffffffffff83166000908152601160209081526040808320839055600f9091528120555b73ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054600003612801575073ffffffffffffffffffffffffffffffffffffffff166000908152601160209081526040808320839055600f90915281205550565b73ffffffffffffffffffffffffffffffffffffffff8216614548576040517fec442f05000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b6136396000838361440c565b73ffffffffffffffffffffffffffffffffffffffff8116156127225760006145a461091061043e8473ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b905060006145b28243615276565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600f602052604090205490915082101561466b5773ffffffffffffffffffffffffffffffffffffffff8316600090815260116020526040902054811080614638575073ffffffffffffffffffffffffffffffffffffffff8316600090815260116020526040902054155b156146665773ffffffffffffffffffffffffffffffffffffffff831660009081526011602052604090208190555b614694565b73ffffffffffffffffffffffffffffffffffffffff831660009081526011602052604090208190555b5073ffffffffffffffffffffffffffffffffffffffff82166000908152600f602052604090205550565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526128ff9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614d9f565b8015612722577f00000000000000000000000000000000000000000000000000000000000000006006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af1925050508015614820575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261481d91810190615417565b60015b1561272257506006546040517fe9f0b7a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301529091169063e9f0b7a4906024015b600060405180830381600087803b1580156148b457600080fd5b505af19250505080156148c5575060015b156127225750565b8015612722576007546006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af1925050508015614988575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261498591810190615417565b60015b1561272257506006546007546040517fe9f0b7a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015291169063e9f0b7a49060240161489a565b73ffffffffffffffffffffffffffffffffffffffff8216614a38576040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b6136398260008361440c565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261280191859182169063a9059cbb90606401614700565b60006002826003811115614a9857614a98615434565b614aa29190615463565b60ff166001149050919050565b73ffffffffffffffffffffffffffffffffffffffff8316614ae7578060026000828254614adc9190615276565b90915550614b999050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015614b6d576040517fe450d38c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260248101829052604481018390526064016111d0565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090209082900390555b73ffffffffffffffffffffffffffffffffffffffff8216614bc257600280548290039055614bee565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090208054820190555b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051614c4d91815260200190565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff831615801590614c94575073ffffffffffffffffffffffffffffffffffffffff821615155b156128015773ffffffffffffffffffffffffffffffffffffffff8316600090815260126020526040812054821180614cef575073ffffffffffffffffffffffffffffffffffffffff8416600090815260126020526040902054155b614cf95781614d20565b73ffffffffffffffffffffffffffffffffffffffff84166000908152601260205260409020545b73ffffffffffffffffffffffffffffffffffffffff8416600090815260126020526040812080549293508392909190614d5a908490615276565b909155505073ffffffffffffffffffffffffffffffffffffffff841660009081526012602052604081208054839290614d94908490615289565b909155505050505050565b6000614dc173ffffffffffffffffffffffffffffffffffffffff841683614e35565b90508051600014158015614de6575080806020019051810190614de49190615417565b155b15612801576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016111d0565b6060610e0483836000846000808573ffffffffffffffffffffffffffffffffffffffff168486604051614e6891906154ac565b60006040518083038185875af1925050503d8060008114614ea5576040519150601f19603f3d011682016040523d82523d6000602084013e614eaa565b606091505b5091509150614eba868383614ec4565b9695505050505050565b606082614ed957614ed482614f53565b610e04565b8151158015614efd575073ffffffffffffffffffffffffffffffffffffffff84163b155b15614f4c576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016111d0565b5080610e04565b805115614f635780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015614fb0578181015183820152602001614f98565b50506000910152565b6020815260008251806020840152614fd8816040850160208701614f95565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561501c57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461272257600080fd5b6000806040838503121561505857600080fd5b823561506381615023565b946020939093013593505050565b60006020828403121561508357600080fd5b8135610e0481615023565b6000806000606084860312156150a357600080fd5b83356150ae81615023565b925060208401356150be81615023565b929592945050506040919091013590565b801515811461272257600080fd5b600080604083850312156150f057600080fd5b82356150fb81615023565b9150602083013561510b816150cf565b809150509250929050565b60006020828403121561512857600080fd5b8135610e04816150cf565b6000806040838503121561514657600080fd5b82359150602083013561510b81615023565b60008060006060848603121561516d57600080fd5b83359250602084013561517f81615023565b9150604084013561518f81615023565b809150509250925092565b600080604083850312156151ad57600080fd5b82356151b881615023565b9150602083013561510b81615023565b6000602082840312156151da57600080fd5b5051919050565b600181811c908216806151f557607f821691505b6020821081036124bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115610dba57610dba61522e565b80820180821115610dba57610dba61522e565b81810381811115610dba57610dba61522e565b6000602082840312156152ae57600080fd5b8151610e0481615023565b600181815b8085111561531257817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156152f8576152f861522e565b8085161561530557918102915b93841c93908002906152be565b509250929050565b60008261532957506001610dba565b8161533657506000610dba565b816001811461534c576002811461535657615372565b6001915050610dba565b60ff8411156153675761536761522e565b50506001821b610dba565b5060208310610133831016604e8410600b8410161715615395575081810a610dba565b61539f83836152b9565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156153d1576153d161522e565b029392505050565b6000610e0460ff84168361531a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006020828403121561542957600080fd5b8151610e04816150cf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600060ff83168061549d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160691505092915050565b600082516154be818460208701614f95565b919091019291505056fea2646970667358221220369be63f96f1d5142e72aa0f779daec722d1a28118bfad2bb4cdda7772d3011664736f6c63430008180033608060405234801561001057600080fd5b50604051611d78380380611d7883398101604081905261002f9161005f565b600080546001600160a01b0390921661010002610100600160a81b0319909216919091179055600f60055561008f565b60006020828403121561007157600080fd5b81516001600160a01b038116811461008857600080fd5b9392505050565b611cda8061009e6000396000f3fe6080604052600436106100ec5760003560e01c8063c8e68fae1161008a578063ed8d597511610059578063ed8d597514610313578063f4daaba114610340578063f990859514610356578063f99dcce01461036c57610111565b8063c8e68fae14610253578063d67014df14610269578063da8887c9146102e4578063e649e5d2146102fb57610111565b806332705203116100c657806332705203146101db57806346c5bf03146101fb5780635e9433b114610211578063c517a5971461023e57610111565b806314c14419146101345780631f938a2714610174578063322e9f04146101c657610111565b3661011157341561010f5734600660008282546101099190611531565b90915550505b005b361561011c57600080fd5b341561010f5734600660008282546101099190611531565b34801561014057600080fd5b5061016161014f36600461156f565b600a6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561018057600080fd5b506003546101a19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b3480156101d257600080fd5b5061016161037f565b3480156101e757600080fd5b5061010f6101f6366004611593565b61043f565b34801561020757600080fd5b5061016160075481565b34801561021d57600080fd5b506002546101a19073ffffffffffffffffffffffffffffffffffffffff1681565b34801561024a57600080fd5b506101616104f0565b34801561025f57600080fd5b5061016160045481565b34801561027557600080fd5b506102b761028436600461156f565b6009602052600090815260409020805460019091015473ffffffffffffffffffffffffffffffffffffffff918216911682565b6040805173ffffffffffffffffffffffffffffffffffffffff93841681529290911660208301520161016b565b3480156102f057600080fd5b50610161620493e081565b6103036106ea565b604051901515815260200161016b565b34801561031f57600080fd5b506001546101a19073ffffffffffffffffffffffffffffffffffffffff1681565b34801561034c57600080fd5b5061016160055481565b34801561036257600080fd5b5061016160065481565b61016161037a36600461156f565b6107bb565b60008054610100900473ffffffffffffffffffffffffffffffffffffffff163314610431576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f436f6f7264696e61746f723a206f6e6c792049545661756c7420636f6e74726160448201527f63742063616e20706572666f726d2074686973206f7065726174696f6e00000060648201526084015b60405180910390fd5b610439610a52565b90505b90565b600054610100900473ffffffffffffffffffffffffffffffffffffffff1633146104eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f436f6f7264696e61746f723a206f6e6c792049545661756c7420636f6e74726160448201527f63742063616e20706572666f726d2074686973206f7065726174696f6e0000006064820152608401610428565b600555565b6000805460ff1615610584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f436f6f7264696e61746f723a2074686973206f7065726174696f6e206973206c60448201527f6f636b656420666f7220736563757269747920726561736f6e730000000000006064820152608401610428565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001178155328152600860205260409020544303610670576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f436f6f7264696e61746f723a20796f752063616e6e6f7420706572666f726d2060448201527f74686973206f7065726174696f6e20616761696e20696e207468697320626c6f60648201527f636b000000000000000000000000000000000000000000000000000000000000608482015260a401610428565b3260009081526008602052604090204390556006541580159061069557504760065411155b156106bf5760045490506106aa600654610f7d565b806004546106b891906115ac565b4760065590505b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905590565b60008054610100900473ffffffffffffffffffffffffffffffffffffffff163314610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f436f6f7264696e61746f723a206f6e6c792049545661756c7420636f6e74726160448201527f63742063616e20706572666f726d2074686973206f7065726174696f6e0000006064820152608401610428565b341561043c5734600660008282546107af9190611531565b90915550600191505090565b60008054610100900473ffffffffffffffffffffffffffffffffffffffff163314610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f436f6f7264696e61746f723a206f6e6c792049545661756c7420636f6e74726160448201527f63742063616e20706572666f726d2074686973206f7065726174696f6e0000006064820152608401610428565b600034116108f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f436f6f7264696e61746f723a20706c656173652073656e6420736f6d65206e6160448201527f7469766520746f6b656e7320746f20637265617465206d696e696f6e730000006064820152608401610428565b5060045461090534610f7d565b8060045461091391906115ac565b9050806000036109f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152606160248201527f436f6f7264696e61746f723a2074686520616d6f756e742073656e742069732060448201527f6e6f7420656e6f75676820746f2063726561746520616e64206163746976617460648201527f65206e6577206d696e696f6e7320666f722054494d452070726f64756374696f60848201527f6e0000000000000000000000000000000000000000000000000000000000000060a482015260c401610428565b600654471115610a4d578173ffffffffffffffffffffffffffffffffffffffff166108fc60065447610a2391906115ac565b6040518115909202916000818181858888f19350505050158015610a4b573d6000803e3d6000fd5b505b919050565b6004546000901561043c5760008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e27af3b96040518163ffffffff1660e01b8152600401602060405180830381865afa158015610acb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aef91906115bf565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7f91906115dc565b905060005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634eb747e66040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610bee57600080fd5b505af1158015610c02573d6000803e3d6000fd5b50506001805473ffffffffffffffffffffffffffffffffffffffff8082166000908152600960205260409020830154167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617905550819050610c66816115f5565b60015490925073ffffffffffffffffffffffffffffffffffffffff161580159150610c92575060055481105b610b845760015473ffffffffffffffffffffffffffffffffffffffff16610cfb57600254600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790555b60008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e27af3b96040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8d91906115bf565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906115dc565b9050610e2983826115ac565b93508360076000828254610e3d9190611531565b92505081905550600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e27af3b96040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed591906115bf565b6000546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff610100909204821660048201526024810187905291169063a9059cbb906044016020604051808303816000875af1158015610f52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f76919061162d565b5050505090565b47811115611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605960248201527f436f6f7264696e61746f723a207468657265206973206e6f20656e6f7567682060448201527f616d6f756e7420666f7220656e61626c696e67206d696e696f6e20616374697660648201527f6174696f6e20666f722054494d452070726f64756374696f6e00000000000000608482015260a401610428565b6000805b61104083611075565b90935091508061104f816115f5565b91505060008311801561105f5750815b801561106c575060055481105b61103757505050565b60008060008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e27af3b96040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110a91906115bf565b73ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611154573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117891906115dc565b905083811115801561118e5750620493e0600454105b1561133357600030600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e27af3b96040518163ffffffff1660e01b8152600401602060405180830381865afa158015611203573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122791906115bf565b604051611233906114f5565b73ffffffffffffffffffffffffffffffffffffffff928316815291166020820152604001604051809103906000f080158015611273573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff1663a3e7f6dd836040518263ffffffff1660e01b815260040160206040518083038185885af1935050505080156112fe575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526112fb9181019061162d565b60015b156113315761130c82611339565b6004805490600061131c836115f5565b9091555061132c905083876115ac565b945092505b505b50915091565b60035473ffffffffffffffffffffffffffffffffffffffff16156113b15760035473ffffffffffffffffffffffffffffffffffffffff908116600090815260096020526040902060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169183169190911790555b60035473ffffffffffffffffffffffffffffffffffffffff828116600090815260096020526040902080549282167fffffffffffffffffffffffff00000000000000000000000000000000000000009384161781556001018054909216909155600254166114ae57600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117909155600154166114ae57600254600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790555b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6106558061165083390190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561154457611544611502565b92915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461156c57600080fd5b50565b60006020828403121561158157600080fd5b813561158c8161154a565b9392505050565b6000602082840312156115a557600080fd5b5035919050565b8181038181111561154457611544611502565b6000602082840312156115d157600080fd5b815161158c8161154a565b6000602082840312156115ee57600080fd5b5051919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361162657611626611502565b5060010190565b60006020828403121561163f57600080fd5b8151801515811461158c57600080fdfe60a060405234801561001057600080fd5b5060405161065538038061065583398101604081905261002f9161006c565b600080546001600160a01b0319166001600160a01b03938416179055166080526100a6565b6001600160a01b038116811461006957600080fd5b50565b6000806040838503121561007f57600080fd5b825161008a81610054565b602084015190925061009b81610054565b809150509250929050565b6080516105806100d56000396000818160a60152818161021e0152818161030701526103df01526105806000f3fe6080604052600436106100345760003560e01c80634eb747e614610039578063a3e7f6dd14610050578063f9f94e341461006c575b600080fd5b34801561004557600080fd5b5061004e61008c565b005b610058610096565b604051901515815260200160405180910390f35b34801561007857600080fd5b5061004e610087366004610453565b61012a565b61009461021c565b565b60008034116100a457600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a3e7f6dd346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561010c57600080fd5b505af19350505050801561011e575060015b15610127575060015b90565b60005473ffffffffffffffffffffffffffffffffffffffff1633146101d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4d696e696f6e3a206f6e6c7920636f6f7264696e61746f722063616e2063616c60448201527f6c20746869732066756e6374696f6e0000000000000000000000000000000000606482015260840160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663662fac396040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561028457600080fd5b505af1158015610298573d6000803e3d6000fd5b505060005473ffffffffffffffffffffffffffffffffffffffff16301491506100949050576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906127109073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610490565b61037e9061270f6104a9565b61038891906104ed565b90508015610450576000546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af115801561042a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044e9190610528565b505b50565b60006020828403121561046557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461048957600080fd5b9392505050565b6000602082840312156104a257600080fd5b5051919050565b80820281158282048414176104e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b600082610523577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561053a57600080fd5b8151801515811461048957600080fdfea2646970667358221220f5697db98bec1c120f5b72b34213658658cbdd9c7f0d5ee02df1a00ff6b05d5164736f6c63430008180033a2646970667358221220569e3f5b27313a71e176ce136cd75c3a25c3b3d1f70ce7e4001f5d890909bdc764736f6c6343000818003360806040523480156200001157600080fd5b5060405162002733380380620027338339810160408190526200003491620000d5565b80620000408162000068565b5050600180546001600160a01b0319166001600160a01b03929092169190911790556200010d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000d057600080fd5b919050565b60008060408385031215620000e957600080fd5b620000f483620000b8565b91506200010460208401620000b8565b90509250929050565b612616806200011d6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638f019c4d11610081578063d543fe871161005b578063d543fe87146101b1578063e9f0b7a4146101b9578063f2fde38b146101cc57600080fd5b80638f019c4d14610183578063cd2ed72414610196578063ceb68c231461019e57600080fd5b80637a32af78116100b25780637a32af78146101405780638c64ea4a146101525780638da5cb5b1461016557600080fd5b8063256b5a02146100d95780634d547ada146100ee578063715018a614610138575b600080fd5b6100ec6100e73660046123f0565b6101df565b005b60015461010e9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100ec6102c0565b6002545b60405190815260200161012f565b61010e610160366004612414565b6102d4565b60005473ffffffffffffffffffffffffffffffffffffffff1661010e565b6101446101913660046123f0565b61030b565b6100ec610463565b6100ec6101ac3660046123f0565b61074e565b6100ec610931565b6100ec6101c73660046123f0565b611b56565b6100ec6101da3660046123f0565b6120c1565b6101e7612127565b6000805b60025481101561024557600281815481106102085761020861242d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff9081169084160361023d5760019150610245565b6001016101eb565b50806102bc57600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790555b5050565b6102c8612127565b6102d2600061217a565b565b600281815481106102e457600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60006103156121ef565b60005b60025481101561045d578273ffffffffffffffffffffffffffffffffffffffff166002828154811061034c5761034c61242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa1580156103c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e4919061245c565b73ffffffffffffffffffffffffffffffffffffffff16036104555760036000600283815481106104165761041661242d565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205461045290836124a8565b91505b600101610318565b50919050565b60005b60025481101561074b576000600282815481106104855761048561242d565b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff90921691634cdad5069190859081106104c5576104c561242d565b6000918252602090912001546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa15801561053c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056091906124c1565b6040518263ffffffff1660e01b815260040161057e91815260200190565b602060405180830381865afa15801561059b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bf91906124c1565b90508060036000600285815481106105d9576105d961242d565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902054101561074257600282815481106106245761062461242d565b60009182526020822001546002805473ffffffffffffffffffffffffffffffffffffffff9092169263b460af949260039290879081106106665761066661242d565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020546106a290846124da565b60015460405160e084901b7fffffffff00000000000000000000000000000000000000000000000000000000168152600481019290925273ffffffffffffffffffffffffffffffffffffffff1660248201523060448201526064016020604051808303816000875af115801561071c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074091906124c1565b505b50600101610466565b50565b610756612127565b6000805b6002548110156108bd57600281815481106107775761077761242d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff908116908416036108b557805b60016107b060025490565b6107ba91906124da565b81101561086d5760026107ce8260016124a8565b815481106107de576107de61242d565b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff90921691839081106108175761081761242d565b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556001016107a5565b506108ac600282815481106108845761088461242d565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1630612258565b600191506108bd565b60010161075a565b5080156102bc5760028054806108d5576108d56124ed565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690550190555050565b60005b600254811015610a2e5760046000600283815481106109555761095561242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa1580156109c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ed919061245c565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000908120805491610a218361251c565b9091555050600101610934565b5060005b600254811015610f13576005600060028381548110610a5357610a5361242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015610ac7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aeb919061245c565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002054158015610c08575060006004600060028481548110610b3357610b3361242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015610ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcb919061245c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610f0b57600060028281548110610c2257610c2261242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015610c96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cba919061245c565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4a91906124c1565b90508015610f09576004600060028481548110610d6957610d6961242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015610ddd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e01919061245c565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002054610e329082612554565b6005600060028581548110610e4957610e4961242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015610ebd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee1919061245c565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b505b600101610a32565b506000610f1f60025490565b67ffffffffffffffff811115610f3757610f3761258f565b604051908082528060200260200182016040528015610f60578160200160208202803683370190505b50905060005b6002548110156118645760006005600060028481548110610f8957610f8961242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015610ffd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611021919061245c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561185c5760056000600283815481106110795761107961242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa1580156110ed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611111919061245c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546002828154811061115f5761115f61242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa1580156111d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f7919061245c565b73ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600285815481106112265761122661242d565b60009182526020909120015460405160e084901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401602060405180830381865afa1580156112a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c691906124c1565b101561153d57600281815481106112df576112df61242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611377919061245c565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600283815481106113a5576113a561242d565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660056000600286815481106113e7576113e761242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa15801561145b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147f919061245c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b81526004016114f892919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b6020604051808303816000875af1158015611517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153b91906125be565b505b600281815481106115505761155061242d565b60009182526020822001546002805473ffffffffffffffffffffffffffffffffffffffff90921692636e553f659260059290869081106115925761159261242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015611606573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162a919061245c565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260409081016000205490517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260048101919091523060248201526044016020604051808303816000875af19250505080156116e8575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526116e5918101906124c1565b60015b1561185c575060056000600283815481106117055761170561242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015611779573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179d919061245c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460036000600284815481106117ef576117ef61242d565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080549091906118309084906124a8565b92505081905550600182828151811061184b5761184b61242d565b911515602092830291909101909101525b600101610f66565b5060005b6002548110156102bc576000600460006002848154811061188b5761188b61242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa1580156118ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611923919061245c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560006002848154811061197a5761197a61242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa1580156119ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a12919061245c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015611a705750818181518110611a6757611a6761242d565b60200260200101515b15611b4e5760006005600060028481548110611a8e57611a8e61242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015611b02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b26919061245c565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b600101611868565b611b5e6121ef565b6000805b600254811015611c5f578273ffffffffffffffffffffffffffffffffffffffff1660028281548110611b9657611b9661242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015611c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2e919061245c565b73ffffffffffffffffffffffffffffffffffffffff1603611c575781611c538161251c565b9250505b600101611b62565b5080156102bc576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201528290600090839073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015611cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfb91906124c1565b611d059190612554565b905060005b6002548110156120ba578473ffffffffffffffffffffffffffffffffffffffff1660028281548110611d3e57611d3e61242d565b60009182526020918290200154604080517f38d52e0f000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff909216926338d52e0f926004808401938290030181865afa158015611db2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd6919061245c565b73ffffffffffffffffffffffffffffffffffffffff16036120b257818373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e3060028581548110611e2257611e2261242d565b60009182526020909120015460405160e084901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401602060405180830381865afa158015611e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec291906124c1565b1015611f9b578273ffffffffffffffffffffffffffffffffffffffff1663095ea7b360028381548110611ef757611ef761242d565b60009182526020909120015460405160e083901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018590526044016020604051808303816000875af1158015611f75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9991906125be565b505b60028181548110611fae57611fae61242d565b6000918252602090912001546040517f6e553f650000000000000000000000000000000000000000000000000000000081526004810184905230602482015273ffffffffffffffffffffffffffffffffffffffff90911690636e553f65906044016020604051808303816000875af115801561202e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205291906124c1565b5081600360006002848154811061206b5761206b61242d565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080549091906120ac9084906124a8565b90915550505b600101611d0a565b5050505050565b6120c9612127565b73ffffffffffffffffffffffffffffffffffffffff811661211e576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b61074b8161217a565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102d2576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401612115565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60015473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102d2576040517f51ee5ed5000000000000000000000000000000000000000000000000000000008152336004820152602401612115565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83169063ba0876529082906370a0823190602401602060405180830381865afa1580156122ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ee91906124c1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b168152600481019190915273ffffffffffffffffffffffffffffffffffffffff841660248201523060448201526064016020604051808303816000875af19250505080156123a0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261239d918101906124c1565b60015b156102bc57505073ffffffffffffffffffffffffffffffffffffffff16600090815260036020526040812055565b73ffffffffffffffffffffffffffffffffffffffff8116811461074b57600080fd5b60006020828403121561240257600080fd5b813561240d816123ce565b9392505050565b60006020828403121561242657600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561246e57600080fd5b815161240d816123ce565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156124bb576124bb612479565b92915050565b6000602082840312156124d357600080fd5b5051919050565b818103818111156124bb576124bb612479565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361254d5761254d612479565b5060010190565b60008261258a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156125d057600080fd5b8151801515811461240d57600080fdfea26469706673582212207ccc42c82f8147248d0a12ad2626deab2feaa672b620acefc2b6ad9b1da7d93364736f6c6343000818003300000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916880000000000000000000000001666cf136d89ba9071c476eaf23035bccd7f3a36000000000000000000000000496ebdb161a87feda58f7efff4b2b94e10a1b655000000000000000000000000123e587f469fcb3c5992793d081be8d643fd78e1

Deployed Bytecode

0x6080604052600436106103b05760003560e01c8063715018a6116101e7578063b460af941161010d578063dd62ed3e116100a0578063ef8b30f71161006f578063ef8b30f7146109fd578063f2fde38b14610b1d578063f8e726d114610b3d578063fddc76de14610b65576103b7565b8063dd62ed3e14610a73578063de4e5a4514610ac6578063e27af3b914610adb578063eee1ddc814610b08576103b7565b8063c6e6f592116100dc578063c6e6f592146109fd578063cc50bd7614610a1d578063ce96cb7714610a33578063d905777e14610a53576103b7565b8063b460af941461099d578063b70139ac146109bd578063ba087652146109dd578063c63d75b614610628576103b7565b806394bf804d11610185578063a457c2d711610154578063a457c2d714610935578063a9059cbb14610955578063b2f6adf014610975578063b3d7f6b91461097d576103b7565b806394bf804d146108c057806395d89b41146108e05780639a1e1caa146108f55780639bae11f214610915576103b7565b806383922a3c116101c157806383922a3c14610835578063870cfa40146108625780638da5cb5b146108955780638e8f9d0d14610713576103b7565b8063715018a6146107de578063734531c9146107f35780637ddb2c4c14610820576103b7565b806338d52e0f116102d75780635f98783f1161026a578063677a085411610239578063677a08541461073b5780636db5967b1461074e5780636e553f651461077b57806370a082311461079b576103b7565b80635f98783f146106dd57806360e883a9146106f357806364a4f07814610713578063651b172814610728576103b7565b806347e0b32b116102a657806347e0b32b146106885780634cdad506146104235780634f6f73c0146106a8578063514fe007146106c8576103b7565b806338d52e0f146105d55780633950935114610608578063402d267d146106285780634689864a14610668576103b7565b806314c144191161034f578063313ce5671161031e578063313ce5671461055d578063327052031461058457806335815b95146105a457806336301533146105c0576103b7565b806314c14419146104a957806318160ddd146104d657806323b872dd146104eb5780632ae8115c1461050b576103b7565b806307a2d13a1161038b57806307a2d13a14610423578063095ea7b3146104435780630a28a477146104735780630e62546a14610493576103b7565b8062e950f2146103c457806301e1d114146103ec57806306fdde0314610401576103b7565b366103b757005b36156103c257600080fd5b005b3480156103d057600080fd5b506103d9610b85565b6040519081526020015b60405180910390f35b3480156103f857600080fd5b506103d9610ca6565b34801561040d57600080fd5b50610416610d1b565b6040516103e39190614fb9565b34801561042f57600080fd5b506103d961043e36600461500a565b610dad565b34801561044f57600080fd5b5061046361045e366004615045565b610dc0565b60405190151581526020016103e3565b34801561047f57600080fd5b506103d961048e36600461500a565b610dd8565b34801561049f57600080fd5b506103d9600d5481565b3480156104b557600080fd5b506103d96104c4366004615071565b60116020526000908152604090205481565b3480156104e257600080fd5b506002546103d9565b3480156104f757600080fd5b5061046361050636600461508e565b610de5565b34801561051757600080fd5b506006546105389073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103e3565b34801561056957600080fd5b50610572610e0b565b60405160ff90911681526020016103e3565b34801561059057600080fd5b506103c261059f36600461500a565b610e37565b3480156105b057600080fd5b506103d9670de0b6b3a764000081565b3480156105cc57600080fd5b506103c2610ec6565b3480156105e157600080fd5b507f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d91688610538565b34801561061457600080fd5b50610463610623366004615045565b610f10565b34801561063457600080fd5b506103d9610643366004615071565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90565b34801561067457600080fd5b506103c261068336600461500a565b610f5c565b34801561069457600080fd5b506103d96106a336600461500a565b610f69565b3480156106b457600080fd5b506103d96106c336600461500a565b611013565b3480156106d457600080fd5b506103d9601981565b3480156106e957600080fd5b506103d9600c5481565b3480156106ff57600080fd5b506103d961070e36600461500a565b6110be565b34801561071f57600080fd5b506103d9603281565b6103c26107363660046150dd565b61115e565b6103c2610749366004615116565b611550565b34801561075a57600080fd5b506103d9610769366004615071565b60126020526000908152604090205481565b34801561078757600080fd5b506103d9610796366004615133565b61180b565b3480156107a757600080fd5b506103d96107b6366004615071565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3480156107ea57600080fd5b506103c2611954565b3480156107ff57600080fd5b506008546105389073ffffffffffffffffffffffffffffffffffffffff1681565b34801561082c57600080fd5b506103c2611968565b34801561084157600080fd5b506103d9610850366004615071565b60106020526000908152604090205481565b34801561086e57600080fd5b50600554610463907501000000000000000000000000000000000000000000900460ff1681565b3480156108a157600080fd5b5060055473ffffffffffffffffffffffffffffffffffffffff16610538565b3480156108cc57600080fd5b506103d96108db366004615133565b611c02565b3480156108ec57600080fd5b50610416611d1c565b34801561090157600080fd5b506103d961091036600461500a565b611d2b565b34801561092157600080fd5b506103c2610930366004615071565b611d3e565b34801561094157600080fd5b50610463610950366004615045565b611f52565b34801561096157600080fd5b50610463610970366004615045565b611ffe565b6103d961200c565b34801561098957600080fd5b506103d961099836600461500a565b6121b5565b3480156109a957600080fd5b506103d96109b8366004615158565b6121c2565b3480156109c957600080fd5b506103d96109d8366004615071565b612356565b3480156109e957600080fd5b506103d96109f8366004615158565b6124c2565b348015610a0957600080fd5b506103d9610a1836600461500a565b612626565b348015610a2957600080fd5b506103d961132481565b348015610a3f57600080fd5b506103d9610a4e366004615071565b612633565b348015610a5f57600080fd5b506103d9610a6e366004615071565b612664565b348015610a7f57600080fd5b506103d9610a8e36600461519a565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b348015610ad257600080fd5b506103c261268f565b348015610ae757600080fd5b506007546105389073ffffffffffffffffffffffffffffffffffffffff1681565b348015610b1457600080fd5b506103d9604b81565b348015610b2957600080fd5b506103c2610b38366004615071565b6126c1565b348015610b4957600080fd5b5061053873731591207791a93fb0ec481186fb086e16a7d6d081565b348015610b7157600080fd5b506103d9610b80366004615071565b612725565b60007f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff9283169263a1bbf1619216906370a0823190602401602060405180830381865afa158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4291906151c8565b6040518263ffffffff1660e01b8152600401610c6091815260200190565b602060405180830381865afa158015610c7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca191906151c8565b905090565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d9168873ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401610c60565b606060038054610d2a906151e1565b80601f0160208091040260200160405190810160405280929190818152602001828054610d56906151e1565b8015610da35780601f10610d7857610100808354040283529160200191610da3565b820191906000526020600020905b815481529060010190602001808311610d8657829003601f168201915b5050505050905090565b6000610dba8260006127ba565b92915050565b600033610dce8185856127f4565b5060019392505050565b6000610dba826001612806565b600033610df3858285612836565b610dfe858585612905565b60019150505b9392505050565b6000610ca1817f000000000000000000000000000000000000000000000000000000000000001261525d565b610e3f6129b0565b6008546040517f327052030000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690633270520390602401600060405180830381600087803b158015610eab57600080fd5b505af1158015610ebf573d6000803e3d6000fd5b5050505050565b610ece6129b0565b600580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000179055565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610dce9082908690610f57908790615276565b6127f4565b610f646129b0565b600c55565b6007546040517f8faefa4200000000000000000000000000000000000000000000000000000000815260048101839052600091610dba9173ffffffffffffffffffffffffffffffffffffffff90911690638faefa4290602401602060405180830381865afa158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100391906151c8565b8390670de0b6b3a7640000612a03565b6000610dba6001600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ab91906151c8565b6110b6906001615276565b849190612a03565b6000610dba826001600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611133573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115791906151c8565b9190612a03565b60055474010000000000000000000000000000000000000000900460ff16156111d957335b6040517fab4a606c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201524360248201526044015b60405180910390fd5b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611268576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e602052604081204390553490036112b3576040517f23d0f33100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006112c434611324612710612a03565b905060006112d182610f69565b905060006112e76112e28434615289565b612afe565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291925073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137a91906151c8565b821115611416576007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa1580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141391906151c8565b91505b61142285828487612bc0565b80600d60008282546114349190615289565b909155505073ffffffffffffffffffffffffffffffffffffffff8516600090815260106020526040902054156114f75773ffffffffffffffffffffffffffffffffffffffff85166000908152601060205260409020548211156114bc5773ffffffffffffffffffffffffffffffffffffffff85166000908152601060205260408120556114f7565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260106020526040812080548492906114f1908490615289565b90915550505b6000611501613599565b11156115215761151b30611513613599565b600080612bc0565b6000600d555b5050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055505050565b60055474010000000000000000000000000000000000000000900460ff16156115795733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611608576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e60205260408120439055349003611653576040517f23d0f33100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61165f61043e336107b6565b600003611714576040517f367dccf700000000000000000000000000000000000000000000000000000000815260206004820152605460248201527f576f726b65723a20706c6561736520726566657220746865206465706f73697460448201527f616e742073686f756c64206861766520736f6d65206465706f7369746564205460648201527f555020746f6b656e7320696e20616476616e6365000000000000000000000000608482015260a4016111d0565b600061171f34612afe565b9050600061172c33612356565b9050600061173983610f69565b9050808210156117465750805b336000908152601060205260409020548111156117725733600090815260106020526040812055611797565b3360009081526010602052604081208054839290611791908490615289565b90915550505b6117a333848387612bc0565b82600d60008282546117b59190615289565b90915550600090506117c5613599565b11156117dd576117d730611513613599565b6000600d555b5050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050565b60055460009074010000000000000000000000000000000000000000900460ff16156118375733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e602052604090205443036118c6576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e602052604090204390556118e283826135e8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61190c84612626565b915061191a3384868561363d565b6119258385846136e9565b50600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905592915050565b61195c6129b0565b6119666000613a09565b565b60055474010000000000000000000000000000000000000000900460ff16156119915733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611a20576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e60205260409020439055611a3c6001613a80565b3360009081526010602052604081208054909190611a5b908490615276565b90915550611a699050613bdf565b60095415611bd8576000611a7e600954610f69565b336000908152601060205260408082205490517fa1bbf16100000000000000000000000000000000000000000000000000000000815260048101919091529192509073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d91688169063a1bbf16190602401602060405180830381865afa158015611b1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4291906151c8565b90508060095410611b855760095433600081815260106020526040902054611b6c92906001612bc0565b6000600981905533815260106020526040812055611bd5565b336000908152601060205260409020548211611bd5573360009081526010602052604081208054849290611bba908490615289565b90915550611bcf905033600954846001612bc0565b60006009555b50505b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b60055460009074010000000000000000000000000000000000000000900460ff1615611c2e5733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611cbd576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e60205260409020439055611cd981846135e8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611d03846121b5565b9150611d113384848761363d565b6119258383866136e9565b606060048054610d2a906151e1565b6000610dba600c54600a61115785613dd0565b60055474010000000000000000000000000000000000000000900460ff1615611d675733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e60205260409020544303611df6576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040902043905573ffffffffffffffffffffffffffffffffffffffff811615611e2a5780611ebb565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663454e66c86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebb919061529c565b9050611ec76001613a80565b73ffffffffffffffffffffffffffffffffffffffff821660009081526010602052604081208054909190611efc908490615276565b90915550611f0a9050613bdf565b60095415611f2757611f2181600954600080612bc0565b60006009555b50600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015611fe6576040517fa60f030c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616600482015260248101829052604481018590526064016111d0565b611ff382868684036127f4565b506001949350505050565b600033610dce818585612905565b60055460009074010000000000000000000000000000000000000000900460ff16156120385733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e602052604090205443036120c7576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040902043905560085473ffffffffffffffffffffffffffffffffffffffff1663f99dcce034336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038185885af1158015612163573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061218891906151c8565b9050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905590565b6000610dba8260016127ba565b60055460009074010000000000000000000000000000000000000000900460ff16156121ee5733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e6020526040902054430361227d576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040812043905561229883612633565b9050808511156122fa576040517ffe9cceec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101869052604481018290526064016111d0565b61230385610dd8565b915061230f8583613e4d565b61231c3385858886613ed9565b6123268583613fda565b50600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690559392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526020818152604080832054601290925282205481116123b557505073ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152601060205260409020546124b26123e9603280615276565b6123f590612710615289565b73ffffffffffffffffffffffffffffffffffffffff861660009081526012602052604090205461271090611157906124319061043e9088615289565b612439610ca6565b612444906001615276565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015611133573d6000803e3d6000fd5b610e049190615276565b50919050565b60055460009074010000000000000000000000000000000000000000900460ff16156124ee5733611183565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055326000908152600e6020526040902054430361257d576040517fab4a606c0000000000000000000000000000000000000000000000000000000081523260048201524360248201526044016111d0565b326000908152600e6020526040812043905561259883612664565b9050808511156125fa576040517fb94abeec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101869052604481018290526064016111d0565b61260385610dad565b915061260f8286613e4d565b61261c3385858589613ed9565b6123268286613fda565b6000610dba826000612806565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812054610dba9060006127ba565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812054610dba565b6126976129b0565b600580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff169055565b6126c96129b0565b73ffffffffffffffffffffffffffffffffffffffff8116612719576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b61272281613a09565b50565b6006546040517f8f019c4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526000921690638f019c4d90602401602060405180830381865afa158015612796573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dba91906151c8565b6000610e046127c7610ca6565b6127d2906001615276565b6127de6000600a6153d9565b6002546127eb9190615276565b85919085614281565b61280183838360016142d2565b505050565b6000610e0461281682600a6153d9565b6002546128239190615276565b61282b610ca6565b6127eb906001615276565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146128ff57818110156128f0576040517ffb8f41b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101829052604481018390526064016111d0565b6128ff848484840360006142d2565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612955576040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b73ffffffffffffffffffffffffffffffffffffffff82166129a5576040517fec442f05000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b61280183838361440c565b60055473ffffffffffffffffffffffffffffffffffffffff163314611966576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016111d0565b6000838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8587098281108382030391505080600003612a5857838281612a4e57612a4e6153e8565b0492505050610e04565b808411612a91576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b600080612b0f836032612710612a03565b90506000612b21846019612710612a03565b90506000612b3385604b612710612a03565b905081600a6000828254612b479190615276565b9250508190555080600b6000828254612b609190615276565b925050819055508260096000828254612b799190615276565b90915550839050612b8a8284615276565b612b949190615276565b612b9e9086615289565b945084600d6000828254612bb29190615276565b909155509495945050505050565b6040517fa1bbf16100000000000000000000000000000000000000000000000000000000815260048101839052839073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d91688169063a1bbf16190602401602060405180830381865afa158015612c4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c7191906151c8565b1115612d63576040517fa1bbf1610000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d91688169063a1bbf16190602401602060405180830381865afa158015612d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d2691906151c8565b6040517f374db78f0000000000000000000000000000000000000000000000000000000081526004810191909152602481018490526044016111d0565b6007546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015612dd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df591906151c8565b821115612ec9576007546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152839173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015612e6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e8e91906151c8565b6040517f0d7aed96000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016111d0565b47831115612f0c576040517f8a8b3734000000000000000000000000000000000000000000000000000000008152600481018490524760248201526044016111d0565b60075473ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018590526044016020604051808303816000875af1158015612fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fe19190615417565b5060007f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886040517fa88f713300000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063a88f713390602401602060405180830381865afa158015613071573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061309591906151c8565b7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015613122573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061314691906151c8565b6131509190615289565b6040517fa0712d680000000000000000000000000000000000000000000000000000000081526004810185905290915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d91688169063a0712d689086906024016000604051808303818588803b1580156131dc57600080fd5b505af11580156131f0573d6000803e3d6000fd5b5050505050600061321e7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d9168890565b6040517fa88f713300000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063a88f713390602401602060405180830381865afa15801561328a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132ae91906151c8565b7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa15801561333b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061335f91906151c8565b6133699190615289565b905060006133778383615289565b9050806000036133b3576040517f47407e9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006133be82612626565b905060006133ee8973ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b1180156134035750600061340189612356565b115b156134435773ffffffffffffffffffffffffffffffffffffffff88166000908152601260205260408120805483929061343d908490615276565b90915550505b84156134b45761345388826144f8565b61345c88614554565b604080518381526020810183905273ffffffffffffffffffffffffffffffffffffffff8a169182917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a361358f565b73ffffffffffffffffffffffffffffffffffffffff8816301461358f577f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015260248201859052919091169063a9059cbb906044016020604051808303816000875af1158015613569573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061358d9190615417565b505b5050505050505050565b600080600b54600a54600954600d546135b29190615276565b6135bc9190615276565b6135c69190615276565b9050804711156135e0576135da8147615289565b91505090565b600091505090565b81156135f457816135fd565b6135fd81610dad565b915081600003613639576040517f23d0f33100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6136697f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916888530856146be565b61367383826144f8565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516136db929190918252602082015260400190565b60405180910390a350505050565b81156136f557816136fe565b6136fe81610dad565b915061370983614554565b613711613bdf565b600b54156137b657600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e649e5d2600b546040518263ffffffff1660e01b815260040160206040518083038185885af115801561378a573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906137af9190615417565b506000600b555b600a541561382257600a5460405173731591207791a93fb0ec481186fb086e16a7d6d09190600081818185875af1925050503d8060008114613814576040519150601f19603f3d011682016040523d82523d6000602084013e613819565b606091505b50506000600a55505b600854604080517ff9908595000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163f99085959160048083019260209291908290030181865afa158015613892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b691906151c8565b111561396c57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c517a5976040518163ffffffff1660e01b81526004016020604051808303816000875af1925050508015613965575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252613962918101906151c8565b60015b1561396c57505b6139766000613a80565b50600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd2ed7246040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156139e157600080fd5b505af19250505080156139f2575060015b50612801613a04836032612710612a03565b614747565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008115613b0657613aff6032612710600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663322e9f046040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611133573d6000803e3d6000fd5b9050613bbe565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663322e9f046040518163ffffffff1660e01b81526004016020604051808303816000875af1925050508015613baf575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252613bac918101906151c8565b60015b613bbb57506000613bbe565b90505b8015613bda57613bda613bd5826032612710612a03565b6148cd565b919050565b6007546040517f901362bd00000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff169063901362bd90602401602060405180830381865afa158015613c4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c7291906151c8565b1115613d1257600754604080517f243496710000000000000000000000000000000000000000000000000000000081529051479273ffffffffffffffffffffffffffffffffffffffff1691632434967191600480830192600092919082900301818387803b158015613ce357600080fd5b505af1925050508015613cf4575060015b15613d105780471115613d1057613d0e6112e28247615289565b505b505b60007f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886040517fa88f713300000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063a88f713390602401602060405180830381865afa158015613da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dc591906151c8565b905061272281614747565b6000610dba600a613de2846001615276565b7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d9168873ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611133573d6000803e3d6000fd5b3360009081526011602052604090205443108015613e8757506005547501000000000000000000000000000000000000000000900460ff16155b156136395733600090815260116020526040908190205490517fd1eb70ad00000000000000000000000000000000000000000000000000000000815243600482015260248101919091526044016111d0565b8273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614613f1757613f17838683612836565b613f2183826149e8565b613f4c7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916888584614a44565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051613fcb929190918252602082015260400190565b60405180910390a45050505050565b613fe2613bdf565b600b541561408757600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e649e5d2600b546040518263ffffffff1660e01b815260040160206040518083038185885af115801561405b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906140809190615417565b506000600b555b600a54156140f357600a5460405173731591207791a93fb0ec481186fb086e16a7d6d09190600081818185875af1925050503d80600081146140e5576040519150601f19603f3d011682016040523d82523d6000602084013e6140ea565b606091505b50506000600a55505b600854604080517ff9908595000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163f99085959160048083019260209291908290030181865afa158015614163573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061418791906151c8565b111561423d57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c517a5976040518163ffffffff1660e01b81526004016020604051808303816000875af1925050508015614236575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252614233918101906151c8565b60015b1561423d57505b6142476000613a80565b506000614253336107b6565b3360009081526012602052604090205490915081101561280157336000908152601260205260409020555050565b60008061428f868686612a03565b905061429a83614a82565b80156142b65750600084806142b1576142b16153e8565b868809115b156142c9576142c6600182615276565b90505b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416614322576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b73ffffffffffffffffffffffffffffffffffffffff8316614372576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020908152604080832093871683529290522082905580156128ff578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516136db91815260200190565b614417838383614aaf565b61442083614554565b61442982614554565b614434838383614c5a565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020546000036144955773ffffffffffffffffffffffffffffffffffffffff83166000908152601160209081526040808320839055600f9091528120555b73ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054600003612801575073ffffffffffffffffffffffffffffffffffffffff166000908152601160209081526040808320839055600f90915281205550565b73ffffffffffffffffffffffffffffffffffffffff8216614548576040517fec442f05000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b6136396000838361440c565b73ffffffffffffffffffffffffffffffffffffffff8116156127225760006145a461091061043e8473ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b905060006145b28243615276565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600f602052604090205490915082101561466b5773ffffffffffffffffffffffffffffffffffffffff8316600090815260116020526040902054811080614638575073ffffffffffffffffffffffffffffffffffffffff8316600090815260116020526040902054155b156146665773ffffffffffffffffffffffffffffffffffffffff831660009081526011602052604090208190555b614694565b73ffffffffffffffffffffffffffffffffffffffff831660009081526011602052604090208190555b5073ffffffffffffffffffffffffffffffffffffffff82166000908152600f602052604090205550565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526128ff9186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614d9f565b8015612722577f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916886006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af1925050508015614820575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261481d91810190615417565b60015b1561272257506006546040517fe9f0b7a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d91688811660048301529091169063e9f0b7a4906024015b600060405180830381600087803b1580156148b457600080fd5b505af19250505080156148c5575060015b156127225750565b8015612722576007546006546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af1925050508015614988575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261498591810190615417565b60015b1561272257506006546007546040517fe9f0b7a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015291169063e9f0b7a49060240161489a565b73ffffffffffffffffffffffffffffffffffffffff8216614a38576040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600060048201526024016111d0565b6136398260008361440c565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261280191859182169063a9059cbb90606401614700565b60006002826003811115614a9857614a98615434565b614aa29190615463565b60ff166001149050919050565b73ffffffffffffffffffffffffffffffffffffffff8316614ae7578060026000828254614adc9190615276565b90915550614b999050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015614b6d576040517fe450d38c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260248101829052604481018390526064016111d0565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090209082900390555b73ffffffffffffffffffffffffffffffffffffffff8216614bc257600280548290039055614bee565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090208054820190555b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051614c4d91815260200190565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff831615801590614c94575073ffffffffffffffffffffffffffffffffffffffff821615155b156128015773ffffffffffffffffffffffffffffffffffffffff8316600090815260126020526040812054821180614cef575073ffffffffffffffffffffffffffffffffffffffff8416600090815260126020526040902054155b614cf95781614d20565b73ffffffffffffffffffffffffffffffffffffffff84166000908152601260205260409020545b73ffffffffffffffffffffffffffffffffffffffff8416600090815260126020526040812080549293508392909190614d5a908490615276565b909155505073ffffffffffffffffffffffffffffffffffffffff841660009081526012602052604081208054839290614d94908490615289565b909155505050505050565b6000614dc173ffffffffffffffffffffffffffffffffffffffff841683614e35565b90508051600014158015614de6575080806020019051810190614de49190615417565b155b15612801576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016111d0565b6060610e0483836000846000808573ffffffffffffffffffffffffffffffffffffffff168486604051614e6891906154ac565b60006040518083038185875af1925050503d8060008114614ea5576040519150601f19603f3d011682016040523d82523d6000602084013e614eaa565b606091505b5091509150614eba868383614ec4565b9695505050505050565b606082614ed957614ed482614f53565b610e04565b8151158015614efd575073ffffffffffffffffffffffffffffffffffffffff84163b155b15614f4c576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016111d0565b5080610e04565b805115614f635780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015614fb0578181015183820152602001614f98565b50506000910152565b6020815260008251806020840152614fd8816040850160208701614f95565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561501c57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461272257600080fd5b6000806040838503121561505857600080fd5b823561506381615023565b946020939093013593505050565b60006020828403121561508357600080fd5b8135610e0481615023565b6000806000606084860312156150a357600080fd5b83356150ae81615023565b925060208401356150be81615023565b929592945050506040919091013590565b801515811461272257600080fd5b600080604083850312156150f057600080fd5b82356150fb81615023565b9150602083013561510b816150cf565b809150509250929050565b60006020828403121561512857600080fd5b8135610e04816150cf565b6000806040838503121561514657600080fd5b82359150602083013561510b81615023565b60008060006060848603121561516d57600080fd5b83359250602084013561517f81615023565b9150604084013561518f81615023565b809150509250925092565b600080604083850312156151ad57600080fd5b82356151b881615023565b9150602083013561510b81615023565b6000602082840312156151da57600080fd5b5051919050565b600181811c908216806151f557607f821691505b6020821081036124bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60ff8181168382160190811115610dba57610dba61522e565b80820180821115610dba57610dba61522e565b81810381811115610dba57610dba61522e565b6000602082840312156152ae57600080fd5b8151610e0481615023565b600181815b8085111561531257817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156152f8576152f861522e565b8085161561530557918102915b93841c93908002906152be565b509250929050565b60008261532957506001610dba565b8161533657506000610dba565b816001811461534c576002811461535657615372565b6001915050610dba565b60ff8411156153675761536761522e565b50506001821b610dba565b5060208310610133831016604e8410600b8410161715615395575081810a610dba565b61539f83836152b9565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156153d1576153d161522e565b029392505050565b6000610e0460ff84168361531a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006020828403121561542957600080fd5b8151610e04816150cf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600060ff83168061549d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b8060ff84160691505092915050565b600082516154be818460208701614f95565b919091019291505056fea2646970667358221220369be63f96f1d5142e72aa0f779daec722d1a28118bfad2bb4cdda7772d3011664736f6c63430008180033

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

00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d916880000000000000000000000001666cf136d89ba9071c476eaf23035bccd7f3a36000000000000000000000000496ebdb161a87feda58f7efff4b2b94e10a1b655000000000000000000000000123e587f469fcb3c5992793d081be8d643fd78e1

-----Decoded View---------------
Arg [0] : _asset (address): 0x57685Ddbc1498f7873963CEE5C186C7D95D91688
Arg [1] : _timeTokenAddress (address): 0x1666Cf136d89Ba9071C476eaF23035Bccd7f3A36
Arg [2] : _employerAddress (address): 0x496ebDb161a87FeDa58f7EFFf4b2B94E10a1b655
Arg [3] : _owner (address): 0x123E587F469fCB3c5992793d081bE8D643FD78e1

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000057685ddbc1498f7873963cee5c186c7d95d91688
Arg [1] : 0000000000000000000000001666cf136d89ba9071c476eaf23035bccd7f3a36
Arg [2] : 000000000000000000000000496ebdb161a87feda58f7efff4b2b94e10a1b655
Arg [3] : 000000000000000000000000123e587f469fcb3c5992793d081be8d643fd78e1


Block Transaction 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
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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