Contract 0xF6d5137CfA2C5f23530a0FCe66056B12B985554d

 
Txn Hash Method
Block
From
To
Value
0x8270183266f539671880001b717be187c7c34346094682ae0c231761c45bd70e0x61024060111141892020-10-23 18:24:56330 days 22 hrs ago0xd680b01503cf95a489010da7409980060991d096 IN  Create: StakingEscrow0 Ether0.212531497239.6
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingEscrow

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license

Contract Source Code (Solidity Multiple files format)

File 14 of 15: StakingEscrow.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.7.0;


import "IERC900History.sol";
import "Issuer.sol";
import "Bits.sol";
import "Snapshot.sol";
import "SafeMath.sol";
import "SafeERC20.sol";


/**
* @notice PolicyManager interface
*/
interface PolicyManagerInterface {
    function register(address _node, uint16 _period) external;
    function escrow() external view returns (address);
    function ping(
        address _node,
        uint16 _processedPeriod1,
        uint16 _processedPeriod2,
        uint16 _periodToSetDefault
    ) external;
}


/**
* @notice Adjudicator interface
*/
interface AdjudicatorInterface {
    function escrow() external view returns (address);
}


/**
* @notice WorkLock interface
*/
interface WorkLockInterface {
    function escrow() external view returns (address);
}


/**
* @notice Contract holds and locks stakers tokens.
* Each staker that locks their tokens will receive some compensation
* @dev |v5.5.1|
*/
contract StakingEscrow is Issuer, IERC900History {

    using AdditionalMath for uint256;
    using AdditionalMath for uint16;
    using Bits for uint256;
    using SafeMath for uint256;
    using Snapshot for uint128[];
    using SafeERC20 for NuCypherToken;

    event Deposited(address indexed staker, uint256 value, uint16 periods);
    event Locked(address indexed staker, uint256 value, uint16 firstPeriod, uint16 periods);
    event Divided(
        address indexed staker,
        uint256 oldValue,
        uint16 lastPeriod,
        uint256 newValue,
        uint16 periods
    );
    event Merged(address indexed staker, uint256 value1, uint256 value2, uint16 lastPeriod);
    event Prolonged(address indexed staker, uint256 value, uint16 lastPeriod, uint16 periods);
    event Withdrawn(address indexed staker, uint256 value);
    event CommitmentMade(address indexed staker, uint16 indexed period, uint256 value);
    event Minted(address indexed staker, uint16 indexed period, uint256 value);
    event Slashed(address indexed staker, uint256 penalty, address indexed investigator, uint256 reward);
    event ReStakeSet(address indexed staker, bool reStake);
    event ReStakeLocked(address indexed staker, uint16 lockUntilPeriod);
    event WorkerBonded(address indexed staker, address indexed worker, uint16 indexed startPeriod);
    event WorkMeasurementSet(address indexed staker, bool measureWork);
    event WindDownSet(address indexed staker, bool windDown);
    event SnapshotSet(address indexed staker, bool snapshotsEnabled);

    struct SubStakeInfo {
        uint16 firstPeriod;
        uint16 lastPeriod;
        uint16 periods;
        uint128 lockedValue;
    }

    struct Downtime {
        uint16 startPeriod;
        uint16 endPeriod;
    }

    struct StakerInfo {
        uint256 value;
        /*
        * Stores periods that are committed but not yet rewarded.
        * In order to optimize storage, only two values are used instead of an array.
        * commitToNextPeriod() method invokes mint() method so there can only be two committed
        * periods that are not yet rewarded: the current and the next periods.
        */
        uint16 currentCommittedPeriod;
        uint16 nextCommittedPeriod;
        uint16 lastCommittedPeriod;
        uint16 lockReStakeUntilPeriod;
        uint256 completedWork;
        uint16 workerStartPeriod; // period when worker was bonded
        address worker;
        uint256 flags; // uint256 to acquire whole slot and minimize operations on it

        uint256 reservedSlot1;
        uint256 reservedSlot2;
        uint256 reservedSlot3;
        uint256 reservedSlot4;
        uint256 reservedSlot5;

        Downtime[] pastDowntime;
        SubStakeInfo[] subStakes;
        uint128[] history;

    }

    // used only for upgrading
    uint16 internal constant RESERVED_PERIOD = 0;
    uint16 internal constant MAX_CHECKED_VALUES = 5;
    // to prevent high gas consumption in loops for slashing
    uint16 public constant MAX_SUB_STAKES = 30;
    uint16 internal constant MAX_UINT16 = 65535;

    // indices for flags
    uint8 internal constant RE_STAKE_DISABLED_INDEX = 0;
    uint8 internal constant WIND_DOWN_INDEX = 1;
    uint8 internal constant MEASURE_WORK_INDEX = 2;
    uint8 internal constant SNAPSHOTS_DISABLED_INDEX = 3;

    uint16 public immutable minLockedPeriods;
    uint16 public immutable minWorkerPeriods;
    uint256 public immutable minAllowableLockedTokens;
    uint256 public immutable maxAllowableLockedTokens;
    bool public immutable isTestContract;

    mapping (address => StakerInfo) public stakerInfo;
    address[] public stakers;
    mapping (address => address) public stakerFromWorker;

    mapping (uint16 => uint256) public lockedPerPeriod;
    uint128[] public balanceHistory;

    PolicyManagerInterface public policyManager;
    AdjudicatorInterface public adjudicator;
    WorkLockInterface public workLock;

    /**
    * @notice Constructor sets address of token contract and coefficients for minting
    * @param _token Token contract
    * @param _hoursPerPeriod Size of period in hours
    * @param _issuanceDecayCoefficient (d) Coefficient which modifies the rate at which the maximum issuance decays,
    * only applicable to Phase 2. d = 365 * half-life / LOG2 where default half-life = 2.
    * See Equation 10 in Staking Protocol & Economics paper
    * @param _lockDurationCoefficient1 (k1) Numerator of the coefficient which modifies the extent
    * to which a stake's lock duration affects the subsidy it receives. Affects stakers differently.
    * Applicable to Phase 1 and Phase 2. k1 = k2 * small_stake_multiplier where default small_stake_multiplier = 0.5.
    * See Equation 8 in Staking Protocol & Economics paper.
    * @param _lockDurationCoefficient2 (k2) Denominator of the coefficient which modifies the extent
    * to which a stake's lock duration affects the subsidy it receives. Affects stakers differently.
    * Applicable to Phase 1 and Phase 2. k2 = maximum_rewarded_periods / (1 - small_stake_multiplier)
    * where default maximum_rewarded_periods = 365 and default small_stake_multiplier = 0.5.
    * See Equation 8 in Staking Protocol & Economics paper.
    * @param _maximumRewardedPeriods (kmax) Number of periods beyond which a stake's lock duration
    * no longer increases the subsidy it receives. kmax = reward_saturation * 365 where default reward_saturation = 1.
    * See Equation 8 in Staking Protocol & Economics paper.
    * @param _firstPhaseTotalSupply Total supply for the first phase
    * @param _firstPhaseMaxIssuance (Imax) Maximum number of new tokens minted per period during Phase 1.
    * See Equation 7 in Staking Protocol & Economics paper.
    * @param _minLockedPeriods Min amount of periods during which tokens can be locked
    * @param _minAllowableLockedTokens Min amount of tokens that can be locked
    * @param _maxAllowableLockedTokens Max amount of tokens that can be locked
    * @param _minWorkerPeriods Min amount of periods while a worker can't be changed
    * @param _isTestContract True if contract is only for tests
    */
    constructor(
        NuCypherToken _token,
        uint32 _hoursPerPeriod,
        uint256 _issuanceDecayCoefficient,
        uint256 _lockDurationCoefficient1,
        uint256 _lockDurationCoefficient2,
        uint16 _maximumRewardedPeriods,
        uint256 _firstPhaseTotalSupply,
        uint256 _firstPhaseMaxIssuance,
        uint16 _minLockedPeriods,
        uint256 _minAllowableLockedTokens,
        uint256 _maxAllowableLockedTokens,
        uint16 _minWorkerPeriods,
        bool _isTestContract
    )
        Issuer(
            _token,
            _hoursPerPeriod,
            _issuanceDecayCoefficient,
            _lockDurationCoefficient1,
            _lockDurationCoefficient2,
            _maximumRewardedPeriods,
            _firstPhaseTotalSupply,
            _firstPhaseMaxIssuance
        )
    {
        // constant `1` in the expression `_minLockedPeriods > 1` uses to simplify the `lock` method
        require(_minLockedPeriods > 1 && _maxAllowableLockedTokens != 0);
        minLockedPeriods = _minLockedPeriods;
        minAllowableLockedTokens = _minAllowableLockedTokens;
        maxAllowableLockedTokens = _maxAllowableLockedTokens;
        minWorkerPeriods = _minWorkerPeriods;
        isTestContract = _isTestContract;
    }

    /**
    * @dev Checks the existence of a staker in the contract
    */
    modifier onlyStaker()
    {
        StakerInfo storage info = stakerInfo[msg.sender];
        require(info.value > 0 || info.nextCommittedPeriod != 0);
        _;
    }

    //------------------------Initialization------------------------
    /**
    * @notice Set policy manager address
    */
    function setPolicyManager(PolicyManagerInterface _policyManager) external onlyOwner {
        // Policy manager can be set only once
        require(address(policyManager) == address(0));
        // This escrow must be the escrow for the new policy manager
        require(_policyManager.escrow() == address(this));
        policyManager = _policyManager;
    }

    /**
    * @notice Set adjudicator address
    */
    function setAdjudicator(AdjudicatorInterface _adjudicator) external onlyOwner {
        // Adjudicator can be set only once
        require(address(adjudicator) == address(0));
        // This escrow must be the escrow for the new adjudicator
        require(_adjudicator.escrow() == address(this));
        adjudicator = _adjudicator;
    }

    /**
    * @notice Set worklock address
    */
    function setWorkLock(WorkLockInterface _workLock) external onlyOwner {
        // WorkLock can be set only once
        require(address(workLock) == address(0) || isTestContract);
        // This escrow must be the escrow for the new worklock
        require(_workLock.escrow() == address(this));
        workLock = _workLock;
    }

    //------------------------Main getters------------------------
    /**
    * @notice Get all tokens belonging to the staker
    */
    function getAllTokens(address _staker) external view returns (uint256) {
        return stakerInfo[_staker].value;
    }

    /**
    * @notice Get all flags for the staker
    */
    function getFlags(address _staker)
        external view returns (
            bool windDown,
            bool reStake,
            bool measureWork,
            bool snapshots
        )
    {
        StakerInfo storage info = stakerInfo[_staker];
        windDown = info.flags.bitSet(WIND_DOWN_INDEX);
        reStake = !info.flags.bitSet(RE_STAKE_DISABLED_INDEX);
        measureWork = info.flags.bitSet(MEASURE_WORK_INDEX);
        snapshots = !info.flags.bitSet(SNAPSHOTS_DISABLED_INDEX);
    }

    /**
    * @notice Get the start period. Use in the calculation of the last period of the sub stake
    * @param _info Staker structure
    * @param _currentPeriod Current period
    */
    function getStartPeriod(StakerInfo storage _info, uint16 _currentPeriod)
        internal view returns (uint16)
    {
        // if the next period (after current) is committed
        if (_info.flags.bitSet(WIND_DOWN_INDEX) && _info.nextCommittedPeriod > _currentPeriod) {
            return _currentPeriod + 1;
        }
        return _currentPeriod;
    }

    /**
    * @notice Get the last period of the sub stake
    * @param _subStake Sub stake structure
    * @param _startPeriod Pre-calculated start period
    */
    function getLastPeriodOfSubStake(SubStakeInfo storage _subStake, uint16 _startPeriod)
        internal view returns (uint16)
    {
        if (_subStake.lastPeriod != 0) {
            return _subStake.lastPeriod;
        }
        uint32 lastPeriod = uint32(_startPeriod) + _subStake.periods;
        if (lastPeriod > uint32(MAX_UINT16)) {
            return MAX_UINT16;
        }
        return uint16(lastPeriod);
    }

    /**
    * @notice Get the last period of the sub stake
    * @param _staker Staker
    * @param _index Stake index
    */
    function getLastPeriodOfSubStake(address _staker, uint256 _index)
        public view returns (uint16)
    {
        StakerInfo storage info = stakerInfo[_staker];
        SubStakeInfo storage subStake = info.subStakes[_index];
        uint16 startPeriod = getStartPeriod(info, getCurrentPeriod());
        return getLastPeriodOfSubStake(subStake, startPeriod);
    }


    /**
    * @notice Get the value of locked tokens for a staker in a specified period
    * @dev Information may be incorrect for rewarded or not committed surpassed period
    * @param _info Staker structure
    * @param _currentPeriod Current period
    * @param _period Next period
    */
    function getLockedTokens(StakerInfo storage _info, uint16 _currentPeriod, uint16 _period)
        internal view returns (uint256 lockedValue)
    {
        lockedValue = 0;
        uint16 startPeriod = getStartPeriod(_info, _currentPeriod);
        for (uint256 i = 0; i < _info.subStakes.length; i++) {
            SubStakeInfo storage subStake = _info.subStakes[i];
            if (subStake.firstPeriod <= _period &&
                getLastPeriodOfSubStake(subStake, startPeriod) >= _period) {
                lockedValue += subStake.lockedValue;
            }
        }
    }

    /**
    * @notice Get the value of locked tokens for a staker in a future period
    * @dev This function is used by PreallocationEscrow so its signature can't be updated.
    * @param _staker Staker
    * @param _periods Amount of periods that will be added to the current period
    */
    function getLockedTokens(address _staker, uint16 _periods)
        external view returns (uint256 lockedValue)
    {
        StakerInfo storage info = stakerInfo[_staker];
        uint16 currentPeriod = getCurrentPeriod();
        uint16 nextPeriod = currentPeriod.add16(_periods);
        return getLockedTokens(info, currentPeriod, nextPeriod);
    }

    /**
    * @notice Get the last committed staker's period
    * @param _staker Staker
    */
    function getLastCommittedPeriod(address _staker) public view returns (uint16) {
        StakerInfo storage info = stakerInfo[_staker];
        return info.nextCommittedPeriod != 0 ? info.nextCommittedPeriod : info.lastCommittedPeriod;
    }

    /**
    * @notice Get the value of locked tokens for active stakers in (getCurrentPeriod() + _periods) period
    * as well as stakers and their locked tokens
    * @param _periods Amount of periods for locked tokens calculation
    * @param _startIndex Start index for looking in stakers array
    * @param _maxStakers Max stakers for looking, if set 0 then all will be used
    * @return allLockedTokens Sum of locked tokens for active stakers
    * @return activeStakers Array of stakers and their locked tokens. Stakers addresses stored as uint256
    * @dev Note that activeStakers[0] in an array of uint256, but you want addresses. Careful when used directly!
    */
    function getActiveStakers(uint16 _periods, uint256 _startIndex, uint256 _maxStakers)
        external view returns (uint256 allLockedTokens, uint256[2][] memory activeStakers)
    {
        require(_periods > 0);

        uint256 endIndex = stakers.length;
        require(_startIndex < endIndex);
        if (_maxStakers != 0 && _startIndex + _maxStakers < endIndex) {
            endIndex = _startIndex + _maxStakers;
        }
        activeStakers = new uint256[2][](endIndex - _startIndex);
        allLockedTokens = 0;

        uint256 resultIndex = 0;
        uint16 currentPeriod = getCurrentPeriod();
        uint16 nextPeriod = currentPeriod.add16(_periods);

        for (uint256 i = _startIndex; i < endIndex; i++) {
            address staker = stakers[i];
            StakerInfo storage info = stakerInfo[staker];
            if (info.currentCommittedPeriod != currentPeriod &&
                info.nextCommittedPeriod != currentPeriod) {
                continue;
            }
            uint256 lockedTokens = getLockedTokens(info, currentPeriod, nextPeriod);
            if (lockedTokens != 0) {
                activeStakers[resultIndex][0] = uint256(staker);
                activeStakers[resultIndex++][1] = lockedTokens;
                allLockedTokens += lockedTokens;
            }
        }
        assembly {
            mstore(activeStakers, resultIndex)
        }
    }

    /**
    * @notice Checks if `reStake` parameter is available for changing
    * @param _staker Staker
    */
    function isReStakeLocked(address _staker) public view returns (bool) {
        return getCurrentPeriod() < stakerInfo[_staker].lockReStakeUntilPeriod;
    }

    /**
    * @notice Get worker using staker's address
    */
    function getWorkerFromStaker(address _staker) external view returns (address) {
        return stakerInfo[_staker].worker;
    }

    /**
    * @notice Get work that completed by the staker
    */
    function getCompletedWork(address _staker) external view returns (uint256) {
        return stakerInfo[_staker].completedWork;
    }

    /**
    * @notice Find index of downtime structure that includes specified period
    * @dev If specified period is outside all downtime periods, the length of the array will be returned
    * @param _staker Staker
    * @param _period Specified period number
    */
    function findIndexOfPastDowntime(address _staker, uint16 _period) external view returns (uint256 index) {
        StakerInfo storage info = stakerInfo[_staker];
        for (index = 0; index < info.pastDowntime.length; index++) {
            if (_period <= info.pastDowntime[index].endPeriod) {
                return index;
            }
        }
    }

    //------------------------Main methods------------------------
    /**
    * @notice Start or stop measuring the work of a staker
    * @param _staker Staker
    * @param _measureWork Value for `measureWork` parameter
    * @return Work that was previously done
    */
    function setWorkMeasurement(address _staker, bool _measureWork) external returns (uint256) {
        require(msg.sender == address(workLock));
        StakerInfo storage info = stakerInfo[_staker];
        if (info.flags.bitSet(MEASURE_WORK_INDEX) == _measureWork) {
            return info.completedWork;
        }
        info.flags = info.flags.toggleBit(MEASURE_WORK_INDEX);
        emit WorkMeasurementSet(_staker, _measureWork);
        return info.completedWork;
    }

    /**
    * @notice Bond worker
    * @param _worker Worker address. Must be a real address, not a contract
    */
    function bondWorker(address _worker) external onlyStaker {
        StakerInfo storage info = stakerInfo[msg.sender];
        // Specified worker is already bonded with this staker
        require(_worker != info.worker);
        uint16 currentPeriod = getCurrentPeriod();
        if (info.worker != address(0)) { // If this staker had a worker ...
            // Check that enough time has passed to change it
            require(currentPeriod >= info.workerStartPeriod.add16(minWorkerPeriods));
            // Remove the old relation "worker->staker"
            stakerFromWorker[info.worker] = address(0);
        }

        if (_worker != address(0)) {
            // Specified worker is already in use
            require(stakerFromWorker[_worker] == address(0));
            // Specified worker is a staker
            require(stakerInfo[_worker].subStakes.length == 0 || _worker == msg.sender);
            // Set new worker->staker relation
            stakerFromWorker[_worker] = msg.sender;
        }

        // Bond new worker (or unbond if _worker == address(0))
        info.worker = _worker;
        info.workerStartPeriod = currentPeriod;
        emit WorkerBonded(msg.sender, _worker, currentPeriod);
    }

    /**
    * @notice Set `reStake` parameter. If true then all staking rewards will be added to locked stake
    * Only if this parameter is not locked
    * @param _reStake Value for parameter
    */
    function setReStake(bool _reStake) external {
        require(!isReStakeLocked(msg.sender));
        StakerInfo storage info = stakerInfo[msg.sender];
        if (info.flags.bitSet(RE_STAKE_DISABLED_INDEX) == !_reStake) {
            return;
        }
        info.flags = info.flags.toggleBit(RE_STAKE_DISABLED_INDEX);
        emit ReStakeSet(msg.sender, _reStake);
    }

    /**
    * @notice Lock `reStake` parameter. Only if this parameter is not locked
    * @param _lockReStakeUntilPeriod Can't change `reStake` value until this period
    */
    function lockReStake(uint16 _lockReStakeUntilPeriod) external {
        require(!isReStakeLocked(msg.sender) &&
            _lockReStakeUntilPeriod > getCurrentPeriod());
        stakerInfo[msg.sender].lockReStakeUntilPeriod = _lockReStakeUntilPeriod;
        emit ReStakeLocked(msg.sender, _lockReStakeUntilPeriod);
    }

    /**
    * @notice Deposit tokens from WorkLock contract
    * @param _staker Staker address
    * @param _value Amount of tokens to deposit
    * @param _periods Amount of periods during which tokens will be locked
    */
    function depositFromWorkLock(
        address _staker,
        uint256 _value,
        uint16 _periods
    )
        external
    {
        require(msg.sender == address(workLock));
        StakerInfo storage info = stakerInfo[_staker];
        if (!info.flags.bitSet(WIND_DOWN_INDEX) && info.subStakes.length == 0) {
            info.flags = info.flags.toggleBit(WIND_DOWN_INDEX);
            emit WindDownSet(_staker, true);
        }
        deposit(_staker, msg.sender, MAX_SUB_STAKES, _value, _periods);
    }

    /**
    * @notice Set `windDown` parameter.
    * If true then stake's duration will be decreasing in each period with `commitToNextPeriod()`
    * @param _windDown Value for parameter
    */
    function setWindDown(bool _windDown) external {
        StakerInfo storage info = stakerInfo[msg.sender];
        if (info.flags.bitSet(WIND_DOWN_INDEX) == _windDown) {
            return;
        }
        info.flags = info.flags.toggleBit(WIND_DOWN_INDEX);
        emit WindDownSet(msg.sender, _windDown);

        // duration adjustment if next period is committed
        uint16 nextPeriod = getCurrentPeriod() + 1;
        if (info.nextCommittedPeriod != nextPeriod) {
           return;
        }

        // adjust sub-stakes duration for the new value of winding down parameter
        for (uint256 index = 0; index < info.subStakes.length; index++) {
            SubStakeInfo storage subStake = info.subStakes[index];
            // sub-stake does not have fixed last period when winding down is disabled
            if (!_windDown && subStake.lastPeriod == nextPeriod) {
                subStake.lastPeriod = 0;
                subStake.periods = 1;
                continue;
            }
            // this sub-stake is no longer affected by winding down parameter
            if (subStake.lastPeriod != 0 || subStake.periods == 0) {
                continue;
            }

            subStake.periods = _windDown ? subStake.periods - 1 : subStake.periods + 1;
            if (subStake.periods == 0) {
                subStake.lastPeriod = nextPeriod;
            }
        }
    }

    /**
    * @notice Activate/deactivate taking snapshots of balances
    * @param _enableSnapshots True to activate snapshots, False to deactivate
    */
    function setSnapshots(bool _enableSnapshots) external {
        StakerInfo storage info = stakerInfo[msg.sender];
        if (info.flags.bitSet(SNAPSHOTS_DISABLED_INDEX) == !_enableSnapshots) {
            return;
        }

        uint256 lastGlobalBalance = uint256(balanceHistory.lastValue());
        if(_enableSnapshots){
            info.history.addSnapshot(info.value);
            balanceHistory.addSnapshot(lastGlobalBalance + info.value);
        } else {
            info.history.addSnapshot(0);
            balanceHistory.addSnapshot(lastGlobalBalance - info.value);
        }
        info.flags = info.flags.toggleBit(SNAPSHOTS_DISABLED_INDEX);

        emit SnapshotSet(msg.sender, _enableSnapshots);
    }

    /**
    * @notice Adds a new snapshot to both the staker and global balance histories,
    * assuming the staker's balance was already changed
    * @param _info Reference to affected staker's struct
    * @param _addition Variance in balance. It can be positive or negative.
    */
    function addSnapshot(StakerInfo storage _info, int256 _addition) internal {
        if(!_info.flags.bitSet(SNAPSHOTS_DISABLED_INDEX)){
            _info.history.addSnapshot(_info.value);
            uint256 lastGlobalBalance = uint256(balanceHistory.lastValue());
            balanceHistory.addSnapshot(lastGlobalBalance.addSigned(_addition));
        }
    }


    /**
    * @notice Batch deposit. Allowed only initial deposit for each staker
    * @param _stakers Stakers
    * @param _numberOfSubStakes Number of sub-stakes which belong to staker in _values and _periods arrays
    * @param _values Amount of tokens to deposit for each staker
    * @param _periods Amount of periods during which tokens will be locked for each staker
    */
    function batchDeposit(
        address[] calldata _stakers,
        uint256[] calldata _numberOfSubStakes,
        uint256[] calldata _values,
        uint16[] calldata _periods
    )
        external
    {
        uint256 subStakesLength = _values.length;
        require(_stakers.length != 0 &&
            _stakers.length == _numberOfSubStakes.length &&
            subStakesLength >= _stakers.length &&
            _periods.length == subStakesLength);
        uint16 previousPeriod = getCurrentPeriod() - 1;
        uint16 nextPeriod = previousPeriod + 2;
        uint256 sumValue = 0;

        uint256 j = 0;
        for (uint256 i = 0; i < _stakers.length; i++) {
            address staker = _stakers[i];
            uint256 numberOfSubStakes = _numberOfSubStakes[i];
            uint256 endIndex = j + numberOfSubStakes;
            require(numberOfSubStakes > 0 && subStakesLength >= endIndex);
            StakerInfo storage info = stakerInfo[staker];
            require(info.subStakes.length == 0 && !info.flags.bitSet(SNAPSHOTS_DISABLED_INDEX));
            // A staker can't be a worker for another staker
            require(stakerFromWorker[staker] == address(0));
            stakers.push(staker);
            policyManager.register(staker, previousPeriod);

            for (; j < endIndex; j++) {
                uint256 value =  _values[j];
                uint16 periods = _periods[j];
                require(value >= minAllowableLockedTokens && periods >= minLockedPeriods);
                info.value = info.value.add(value);
                info.subStakes.push(SubStakeInfo(nextPeriod, 0, periods, uint128(value)));
                sumValue = sumValue.add(value);
                emit Deposited(staker, value, periods);
                emit Locked(staker, value, nextPeriod, periods);
            }
            require(info.value <= maxAllowableLockedTokens);
            info.history.addSnapshot(info.value);
        }
        require(j == subStakesLength);
        uint256 lastGlobalBalance = uint256(balanceHistory.lastValue());
        balanceHistory.addSnapshot(lastGlobalBalance + sumValue);
        token.safeTransferFrom(msg.sender, address(this), sumValue);
    }

    /**
    * @notice Implementation of the receiveApproval(address,uint256,address,bytes) method
    * (see NuCypherToken contract). Deposit all tokens that were approved to transfer
    * @param _from Staker
    * @param _value Amount of tokens to deposit
    * @param _tokenContract Token contract address
    * @notice (param _extraData) Amount of periods during which tokens will be locked
    */
    function receiveApproval(
        address _from,
        uint256 _value,
        address _tokenContract,
        bytes calldata /* _extraData */
    )
        external
    {
        require(_tokenContract == address(token) && msg.sender == address(token));

        // Copy first 32 bytes from _extraData, according to calldata memory layout:
        //
        // 0x00: method signature      4 bytes
        // 0x04: _from                 32 bytes after encoding
        // 0x24: _value                32 bytes after encoding
        // 0x44: _tokenContract        32 bytes after encoding
        // 0x64: _extraData pointer    32 bytes. Value must be 0x80 (offset of _extraData wrt to 1st parameter)
        // 0x84: _extraData length     32 bytes
        // 0xA4: _extraData data       Length determined by previous variable
        //
        // See https://solidity.readthedocs.io/en/latest/abi-spec.html#examples

        uint256 payloadSize;
        uint256 payload;
        assembly {
            payloadSize := calldataload(0x84)
            payload := calldataload(0xA4)
        }
        payload = payload >> 8*(32 - payloadSize);
        deposit(_from, _from, MAX_SUB_STAKES, _value, uint16(payload));
    }

    /**
    * @notice Deposit tokens and create new sub-stake. Use this method to become a staker
    * @param _staker Staker
    * @param _value Amount of tokens to deposit
    * @param _periods Amount of periods during which tokens will be locked
    */
    function deposit(address _staker, uint256 _value, uint16 _periods) external {
        deposit(_staker, msg.sender, MAX_SUB_STAKES, _value, _periods);
    }

    /**
    * @notice Deposit tokens and increase lock amount of an existing sub-stake
    * @dev This is preferable way to stake tokens because will be fewer active sub-stakes in the result
    * @param _index Index of the sub stake
    * @param _value Amount of tokens which will be locked
    */
    function depositAndIncrease(uint256 _index, uint256 _value) external onlyStaker {
        require(_index < MAX_SUB_STAKES);
        deposit(msg.sender, msg.sender, _index, _value, 0);
    }

    /**
    * @notice Deposit tokens
    * @dev Specify either index and zero periods (for an existing sub-stake)
    * or index >= MAX_SUB_STAKES and real value for periods (for a new sub-stake), not both
    * @param _staker Staker
    * @param _payer Owner of tokens
    * @param _index Index of the sub stake
    * @param _value Amount of tokens to deposit
    * @param _periods Amount of periods during which tokens will be locked
    */
    function deposit(address _staker, address _payer, uint256 _index, uint256 _value, uint16 _periods) internal {
        require(_value != 0);
        StakerInfo storage info = stakerInfo[_staker];
        // A staker can't be a worker for another staker
        require(stakerFromWorker[_staker] == address(0) || stakerFromWorker[_staker] == info.worker);
        // initial stake of the staker
        if (info.subStakes.length == 0) {
            stakers.push(_staker);
            policyManager.register(_staker, getCurrentPeriod() - 1);
        }
        token.safeTransferFrom(_payer, address(this), _value);
        info.value += _value;
        lock(_staker, _index, _value, _periods);

        addSnapshot(info, int256(_value));
        if (_index >= MAX_SUB_STAKES) {
            emit Deposited(_staker, _value, _periods);
        } else {
            uint16 lastPeriod = getLastPeriodOfSubStake(_staker, _index);
            emit Deposited(_staker, _value, lastPeriod - getCurrentPeriod());
        }
    }

    /**
    * @notice Lock some tokens as a new sub-stake
    * @param _value Amount of tokens which will be locked
    * @param _periods Amount of periods during which tokens will be locked
    */
    function lockAndCreate(uint256 _value, uint16 _periods) external onlyStaker {
        lock(msg.sender, MAX_SUB_STAKES, _value, _periods);
    }

    /**
    * @notice Increase lock amount of an existing sub-stake
    * @param _index Index of the sub-stake
    * @param _value Amount of tokens which will be locked
    */
    function lockAndIncrease(uint256 _index, uint256 _value) external onlyStaker {
        require(_index < MAX_SUB_STAKES);
        lock(msg.sender, _index, _value, 0);
    }

    /**
    * @notice Lock some tokens as a stake
    * @dev Specify either index and zero periods (for an existing sub-stake)
    * or index >= MAX_SUB_STAKES and real value for periods (for a new sub-stake), not both
    * @param _staker Staker
    * @param _index Index of the sub stake
    * @param _value Amount of tokens which will be locked
    * @param _periods Amount of periods during which tokens will be locked
    */
    function lock(address _staker, uint256 _index, uint256 _value, uint16 _periods) internal {
        if (_index < MAX_SUB_STAKES) {
            require(_value > 0);
        } else {
            require(_value >= minAllowableLockedTokens && _periods >= minLockedPeriods);
        }

        uint16 currentPeriod = getCurrentPeriod();
        uint16 nextPeriod = currentPeriod + 1;
        StakerInfo storage info = stakerInfo[_staker];
        uint256 lockedTokens = getLockedTokens(info, currentPeriod, nextPeriod);
        uint256 requestedLockedTokens = _value.add(lockedTokens);
        require(requestedLockedTokens <= info.value && requestedLockedTokens <= maxAllowableLockedTokens);

        // next period is committed
        if (info.nextCommittedPeriod == nextPeriod) {
            lockedPerPeriod[nextPeriod] += _value;
            emit CommitmentMade(_staker, nextPeriod, _value);
        }

        // if index was provided then increase existing sub-stake
        if (_index < MAX_SUB_STAKES) {
            lockAndIncrease(info, currentPeriod, nextPeriod, _staker, _index, _value);
        // otherwise create new
        } else {
            lockAndCreate(info, nextPeriod, _staker, _value, _periods);
        }
    }

    /**
    * @notice Lock some tokens as a new sub-stake
    * @param _info Staker structure
    * @param _nextPeriod Next period
    * @param _staker Staker
    * @param _value Amount of tokens which will be locked
    * @param _periods Amount of periods during which tokens will be locked
    */
    function lockAndCreate(
        StakerInfo storage _info,
        uint16 _nextPeriod,
        address _staker,
        uint256 _value,
        uint16 _periods
    )
        internal
    {
        uint16 duration = _periods;
        // if winding down is enabled and next period is committed
        // then sub-stakes duration were decreased
        if (_info.nextCommittedPeriod == _nextPeriod && _info.flags.bitSet(WIND_DOWN_INDEX)) {
            duration -= 1;
        }
        saveSubStake(_info, _nextPeriod, 0, duration, _value);

        emit Locked(_staker, _value, _nextPeriod, _periods);
    }

    /**
    * @notice Increase lock amount of an existing sub-stake
    * @dev Probably will be created a new sub-stake but it will be active only one period
    * @param _info Staker structure
    * @param _currentPeriod Current period
    * @param _nextPeriod Next period
    * @param _staker Staker
    * @param _index Index of the sub-stake
    * @param _value Amount of tokens which will be locked
    */
    function lockAndIncrease(
        StakerInfo storage _info,
        uint16 _currentPeriod,
        uint16 _nextPeriod,
        address _staker,
        uint256 _index,
        uint256 _value
    )
        internal
    {
        SubStakeInfo storage subStake = _info.subStakes[_index];
        (, uint16 lastPeriod) = checkLastPeriodOfSubStake(_info, subStake, _currentPeriod);

        // create temporary sub-stake for current or previous committed periods
        // to leave locked amount in this period unchanged
        if (_info.currentCommittedPeriod != 0 &&
            _info.currentCommittedPeriod <= _currentPeriod ||
            _info.nextCommittedPeriod != 0 &&
            _info.nextCommittedPeriod <= _currentPeriod)
        {
            saveSubStake(_info, subStake.firstPeriod, _currentPeriod, 0, subStake.lockedValue);
        }

        subStake.lockedValue += uint128(_value);
        // all new locks should start from the next period
        subStake.firstPeriod = _nextPeriod;

        emit Locked(_staker, _value, _nextPeriod, lastPeriod - _currentPeriod);
    }

    /**
    * @notice Checks that last period of sub-stake is greater than the current period
    * @param _info Staker structure
    * @param _subStake Sub-stake structure
    * @param _currentPeriod Current period
    * @return startPeriod Start period. Use in the calculation of the last period of the sub stake
    * @return lastPeriod Last period of the sub stake
    */
    function checkLastPeriodOfSubStake(
        StakerInfo storage _info,
        SubStakeInfo storage _subStake,
        uint16 _currentPeriod
    )
        internal view returns (uint16 startPeriod, uint16 lastPeriod)
    {
        startPeriod = getStartPeriod(_info, _currentPeriod);
        lastPeriod = getLastPeriodOfSubStake(_subStake, startPeriod);
        // The sub stake must be active at least in the next period
        require(lastPeriod > _currentPeriod);
    }

    /**
    * @notice Save sub stake. First tries to override inactive sub stake
    * @dev Inactive sub stake means that last period of sub stake has been surpassed and already rewarded
    * @param _info Staker structure
    * @param _firstPeriod First period of the sub stake
    * @param _lastPeriod Last period of the sub stake
    * @param _periods Duration of the sub stake in periods
    * @param _lockedValue Amount of locked tokens
    */
    function saveSubStake(
        StakerInfo storage _info,
        uint16 _firstPeriod,
        uint16 _lastPeriod,
        uint16 _periods,
        uint256 _lockedValue
    )
        internal
    {
        for (uint256 i = 0; i < _info.subStakes.length; i++) {
            SubStakeInfo storage subStake = _info.subStakes[i];
            if (subStake.lastPeriod != 0 &&
                (_info.currentCommittedPeriod == 0 ||
                subStake.lastPeriod < _info.currentCommittedPeriod) &&
                (_info.nextCommittedPeriod == 0 ||
                subStake.lastPeriod < _info.nextCommittedPeriod))
            {
                subStake.firstPeriod = _firstPeriod;
                subStake.lastPeriod = _lastPeriod;
                subStake.periods = _periods;
                subStake.lockedValue = uint128(_lockedValue);
                return;
            }
        }
        require(_info.subStakes.length < MAX_SUB_STAKES);
        _info.subStakes.push(SubStakeInfo(_firstPeriod, _lastPeriod, _periods, uint128(_lockedValue)));
    }

    /**
    * @notice Divide sub stake into two parts
    * @param _index Index of the sub stake
    * @param _newValue New sub stake value
    * @param _periods Amount of periods for extending sub stake
    */
    function divideStake(uint256 _index, uint256 _newValue, uint16 _periods) external onlyStaker {
        StakerInfo storage info = stakerInfo[msg.sender];
        require(_newValue >= minAllowableLockedTokens && _periods > 0);
        SubStakeInfo storage subStake = info.subStakes[_index];
        uint16 currentPeriod = getCurrentPeriod();
        (, uint16 lastPeriod) = checkLastPeriodOfSubStake(info, subStake, currentPeriod);

        uint256 oldValue = subStake.lockedValue;
        subStake.lockedValue = uint128(oldValue.sub(_newValue));
        require(subStake.lockedValue >= minAllowableLockedTokens);
        uint16 requestedPeriods = subStake.periods.add16(_periods);
        saveSubStake(info, subStake.firstPeriod, 0, requestedPeriods, _newValue);
        emit Divided(msg.sender, oldValue, lastPeriod, _newValue, _periods);
        emit Locked(msg.sender, _newValue, subStake.firstPeriod, requestedPeriods);
    }

    /**
    * @notice Prolong active sub stake
    * @param _index Index of the sub stake
    * @param _periods Amount of periods for extending sub stake
    */
    function prolongStake(uint256 _index, uint16 _periods) external onlyStaker {
        StakerInfo storage info = stakerInfo[msg.sender];
        // Incorrect parameters
        require(_periods > 0);
        SubStakeInfo storage subStake = info.subStakes[_index];
        uint16 currentPeriod = getCurrentPeriod();
        (uint16 startPeriod, uint16 lastPeriod) = checkLastPeriodOfSubStake(info, subStake, currentPeriod);

        subStake.periods = subStake.periods.add16(_periods);
        // if the sub stake ends in the next committed period then reset the `lastPeriod` field
        if (lastPeriod == startPeriod) {
            subStake.lastPeriod = 0;
        }
        // The extended sub stake must not be less than the minimum value
        require(uint32(lastPeriod - currentPeriod) + _periods >= minLockedPeriods);
        emit Locked(msg.sender, subStake.lockedValue, lastPeriod + 1, _periods);
        emit Prolonged(msg.sender, subStake.lockedValue, lastPeriod, _periods);
    }

    /**
    * @notice Merge two sub-stakes into one if their last periods are equal
    * @dev It's possible that both sub-stakes will be active after this transaction.
    * But only one of them will be active until next call `commitToNextPeriod` (in the next period)
    * @param _index1 Index of the first sub-stake
    * @param _index2 Index of the second sub-stake
    */
    function mergeStake(uint256 _index1, uint256 _index2) external onlyStaker {
        require(_index1 != _index2); // must be different sub-stakes

        StakerInfo storage info = stakerInfo[msg.sender];
        SubStakeInfo storage subStake1 = info.subStakes[_index1];
        SubStakeInfo storage subStake2 = info.subStakes[_index2];
        uint16 currentPeriod = getCurrentPeriod();

        (, uint16 lastPeriod1) = checkLastPeriodOfSubStake(info, subStake1, currentPeriod);
        (, uint16 lastPeriod2) = checkLastPeriodOfSubStake(info, subStake2, currentPeriod);
        // both sub-stakes must have equal last period to be mergeable
        require(lastPeriod1 == lastPeriod2);
        emit Merged(msg.sender, subStake1.lockedValue, subStake2.lockedValue, lastPeriod1);

        if (subStake1.firstPeriod == subStake2.firstPeriod) {
            subStake1.lockedValue += subStake2.lockedValue;
            subStake2.lastPeriod = 1;
            subStake2.periods = 0;
        } else if (subStake1.firstPeriod > subStake2.firstPeriod) {
            subStake1.lockedValue += subStake2.lockedValue;
            subStake2.lastPeriod = subStake1.firstPeriod - 1;
            subStake2.periods = 0;
        } else {
            subStake2.lockedValue += subStake1.lockedValue;
            subStake1.lastPeriod = subStake2.firstPeriod - 1;
            subStake1.periods = 0;
        }
    }

    /**
    * @notice Remove unused sub-stake to decrease gas cost for several methods
    */
    function removeUnusedSubStake(uint16 _index) external onlyStaker {
        StakerInfo storage info = stakerInfo[msg.sender];

        uint256 lastIndex = info.subStakes.length - 1;
        SubStakeInfo storage subStake = info.subStakes[_index];
        require(subStake.lastPeriod != 0 &&
                (info.currentCommittedPeriod == 0 ||
                subStake.lastPeriod < info.currentCommittedPeriod) &&
                (info.nextCommittedPeriod == 0 ||
                subStake.lastPeriod < info.nextCommittedPeriod));

        if (_index != lastIndex) {
            SubStakeInfo storage lastSubStake = info.subStakes[lastIndex];
            subStake.firstPeriod = lastSubStake.firstPeriod;
            subStake.lastPeriod = lastSubStake.lastPeriod;
            subStake.periods = lastSubStake.periods;
            subStake.lockedValue = lastSubStake.lockedValue;
        }
        info.subStakes.pop();
    }

    /**
    * @notice Withdraw available amount of tokens to staker
    * @param _value Amount of tokens to withdraw
    */
    function withdraw(uint256 _value) external onlyStaker {
        uint16 currentPeriod = getCurrentPeriod();
        uint16 nextPeriod = currentPeriod + 1;
        StakerInfo storage info = stakerInfo[msg.sender];
        // the max locked tokens in most cases will be in the current period
        // but when the staker locks more then we should use the next period
        uint256 lockedTokens = Math.max(getLockedTokens(info, currentPeriod, nextPeriod),
            getLockedTokens(info, currentPeriod, currentPeriod));
        require(_value <= info.value.sub(lockedTokens));
        info.value -= _value;

        addSnapshot(info, - int256(_value));
        token.safeTransfer(msg.sender, _value);
        emit Withdrawn(msg.sender, _value);

        // unbond worker if staker withdraws last portion of NU
        if (info.value == 0 &&
            info.nextCommittedPeriod == 0 &&
            info.worker != address(0))
        {
            stakerFromWorker[info.worker] = address(0);
            info.worker = address(0);
            emit WorkerBonded(msg.sender, address(0), currentPeriod);
        }
    }

    /**
    * @notice Make a commitment to the next period and mint for the previous period
    */
    function commitToNextPeriod() external isInitialized {
        address staker = stakerFromWorker[msg.sender];
        StakerInfo storage info = stakerInfo[staker];
        // Staker must have a stake to make a commitment
        require(info.value > 0);
        // Only worker with real address can make a commitment
        require(msg.sender == tx.origin);

        uint16 lastCommittedPeriod = getLastCommittedPeriod(staker);
        (uint16 processedPeriod1, uint16 processedPeriod2) = mint(staker);
        uint16 currentPeriod = getCurrentPeriod();
        uint16 nextPeriod = currentPeriod + 1;

        // the period has already been committed
        if (info.nextCommittedPeriod == nextPeriod) {
            return;
        }

        uint256 lockedTokens = getLockedTokens(info, currentPeriod, nextPeriod);
        require(lockedTokens > 0);
        lockedPerPeriod[nextPeriod] += lockedTokens;

        info.currentCommittedPeriod = info.nextCommittedPeriod;
        info.nextCommittedPeriod = nextPeriod;

        decreaseSubStakesDuration(info, nextPeriod);

        // staker was inactive for several periods
        if (lastCommittedPeriod < currentPeriod) {
            info.pastDowntime.push(Downtime(lastCommittedPeriod + 1, currentPeriod));
        }

        policyManager.ping(staker, processedPeriod1, processedPeriod2, nextPeriod);
        emit CommitmentMade(staker, nextPeriod, lockedTokens);
    }

    /**
    * @notice Decrease sub-stakes duration if `windDown` is enabled
    */
    function decreaseSubStakesDuration(StakerInfo storage _info, uint16 _nextPeriod) internal {
        if (!_info.flags.bitSet(WIND_DOWN_INDEX)) {
            return;
        }
        for (uint256 index = 0; index < _info.subStakes.length; index++) {
            SubStakeInfo storage subStake = _info.subStakes[index];
            if (subStake.lastPeriod != 0 || subStake.periods == 0) {
                continue;
            }
            subStake.periods--;
            if (subStake.periods == 0) {
                subStake.lastPeriod = _nextPeriod;
            }
        }
    }

    /**
    * @notice Mint tokens for previous periods if staker locked their tokens and made a commitment
    */
    function mint() external onlyStaker {
        // save last committed period to the storage if both periods will be empty after minting
        // because we won't be able to calculate last committed period
        // see getLastCommittedPeriod(address)
        StakerInfo storage info = stakerInfo[msg.sender];
        uint16 previousPeriod = getCurrentPeriod() - 1;
        if (info.nextCommittedPeriod <= previousPeriod && info.nextCommittedPeriod != 0) {
            info.lastCommittedPeriod = info.nextCommittedPeriod;
        }
        (uint16 processedPeriod1, uint16 processedPeriod2) = mint(msg.sender);

        if (processedPeriod1 != 0 || processedPeriod2 != 0) {
            policyManager.ping(msg.sender, processedPeriod1, processedPeriod2, 0);
        }
    }

    /**
    * @notice Mint tokens for previous periods if staker locked their tokens and made a commitment
    * @param _staker Staker
    * @return processedPeriod1 Processed period: currentCommittedPeriod or zero
    * @return processedPeriod2 Processed period: nextCommittedPeriod or zero
    */
    function mint(address _staker) internal returns (uint16 processedPeriod1, uint16 processedPeriod2) {
        uint16 currentPeriod = getCurrentPeriod();
        uint16 previousPeriod = currentPeriod - 1;
        StakerInfo storage info = stakerInfo[_staker];

        if (info.nextCommittedPeriod == 0 ||
            info.currentCommittedPeriod == 0 &&
            info.nextCommittedPeriod > previousPeriod ||
            info.currentCommittedPeriod > previousPeriod) {
            return (0, 0);
        }

        uint16 startPeriod = getStartPeriod(info, currentPeriod);
        uint256 reward = 0;
        bool reStake = !info.flags.bitSet(RE_STAKE_DISABLED_INDEX);

        if (info.currentCommittedPeriod != 0) {
            reward = mint(info, info.currentCommittedPeriod, currentPeriod, startPeriod, reStake);
            processedPeriod1 = info.currentCommittedPeriod;
            info.currentCommittedPeriod = 0;
            if (reStake) {
                lockedPerPeriod[info.nextCommittedPeriod] += reward;
            }
        }
        if (info.nextCommittedPeriod <= previousPeriod) {
            reward += mint(info, info.nextCommittedPeriod, currentPeriod, startPeriod, reStake);
            processedPeriod2 = info.nextCommittedPeriod;
            info.nextCommittedPeriod = 0;
        }

        info.value += reward;
        if (info.flags.bitSet(MEASURE_WORK_INDEX)) {
            info.completedWork += reward;
        }

        addSnapshot(info, int256(reward));
        emit Minted(_staker, previousPeriod, reward);
    }

    /**
    * @notice Calculate reward for one period
    * @param _info Staker structure
    * @param _mintingPeriod Period for minting calculation
    * @param _currentPeriod Current period
    * @param _startPeriod Pre-calculated start period
    */
    function mint(
        StakerInfo storage _info,
        uint16 _mintingPeriod,
        uint16 _currentPeriod,
        uint16 _startPeriod,
        bool _reStake
    )
        internal returns (uint256 reward)
    {
        reward = 0;
        for (uint256 i = 0; i < _info.subStakes.length; i++) {
            SubStakeInfo storage subStake =  _info.subStakes[i];
            uint16 lastPeriod = getLastPeriodOfSubStake(subStake, _startPeriod);
            if (subStake.firstPeriod <= _mintingPeriod && lastPeriod >= _mintingPeriod) {
                uint256 subStakeReward = mint(
                    _currentPeriod,
                    subStake.lockedValue,
                    lockedPerPeriod[_mintingPeriod],
                    lastPeriod.sub16(_mintingPeriod));
                reward += subStakeReward;
                if (_reStake) {
                    subStake.lockedValue += uint128(subStakeReward);
                }
            }
        }
        return reward;
    }

    //-------------------------Slashing-------------------------
    /**
    * @notice Slash the staker's stake and reward the investigator
    * @param _staker Staker's address
    * @param _penalty Penalty
    * @param _investigator Investigator
    * @param _reward Reward for the investigator
    */
    function slashStaker(
        address _staker,
        uint256 _penalty,
        address _investigator,
        uint256 _reward
    )
        public isInitialized
    {
        require(msg.sender == address(adjudicator));
        require(_penalty > 0);
        StakerInfo storage info = stakerInfo[_staker];
        if (info.value <= _penalty) {
            _penalty = info.value;
        }
        info.value -= _penalty;
        if (_reward > _penalty) {
            _reward = _penalty;
        }

        uint16 currentPeriod = getCurrentPeriod();
        uint16 nextPeriod = currentPeriod + 1;
        uint16 startPeriod = getStartPeriod(info, currentPeriod);

        (uint256 currentLock, uint256 nextLock, uint256 currentAndNextLock, uint256 shortestSubStakeIndex) =
            getLockedTokensAndShortestSubStake(info, currentPeriod, nextPeriod, startPeriod);

        // Decrease the stake if amount of locked tokens in the current period more than staker has
        uint256 lockedTokens = currentLock + currentAndNextLock;
        if (info.value < lockedTokens) {
           decreaseSubStakes(info, lockedTokens - info.value, currentPeriod, startPeriod, shortestSubStakeIndex);
        }
        // Decrease the stake if amount of locked tokens in the next period more than staker has
        if (nextLock > 0) {
            lockedTokens = nextLock + currentAndNextLock -
                (currentAndNextLock > info.value ? currentAndNextLock - info.value : 0);
            if (info.value < lockedTokens) {
               decreaseSubStakes(info, lockedTokens - info.value, nextPeriod, startPeriod, MAX_SUB_STAKES);
            }
        }

        emit Slashed(_staker, _penalty, _investigator, _reward);
        if (_penalty > _reward) {
            unMint(_penalty - _reward);
        }
        // TODO change to withdrawal pattern (#1499)
        if (_reward > 0) {
            token.safeTransfer(_investigator, _reward);
        }

        addSnapshot(info, - int256(_penalty));

    }

    /**
    * @notice Get the value of locked tokens for a staker in the current and the next period
    * and find the shortest sub stake
    * @param _info Staker structure
    * @param _currentPeriod Current period
    * @param _nextPeriod Next period
    * @param _startPeriod Pre-calculated start period
    * @return currentLock Amount of tokens that locked in the current period and unlocked in the next period
    * @return nextLock Amount of tokens that locked in the next period and not locked in the current period
    * @return currentAndNextLock Amount of tokens that locked in the current period and in the next period
    * @return shortestSubStakeIndex Index of the shortest sub stake
    */
    function getLockedTokensAndShortestSubStake(
        StakerInfo storage _info,
        uint16 _currentPeriod,
        uint16 _nextPeriod,
        uint16 _startPeriod
    )
        internal view returns (
            uint256 currentLock,
            uint256 nextLock,
            uint256 currentAndNextLock,
            uint256 shortestSubStakeIndex
        )
    {
        uint16 minDuration = MAX_UINT16;
        uint16 minLastPeriod = MAX_UINT16;
        shortestSubStakeIndex = MAX_SUB_STAKES;
        currentLock = 0;
        nextLock = 0;
        currentAndNextLock = 0;

        for (uint256 i = 0; i < _info.subStakes.length; i++) {
            SubStakeInfo storage subStake = _info.subStakes[i];
            uint16 lastPeriod = getLastPeriodOfSubStake(subStake, _startPeriod);
            if (lastPeriod < subStake.firstPeriod) {
                continue;
            }
            if (subStake.firstPeriod <= _currentPeriod &&
                lastPeriod >= _nextPeriod) {
                currentAndNextLock += subStake.lockedValue;
            } else if (subStake.firstPeriod <= _currentPeriod &&
                lastPeriod >= _currentPeriod) {
                currentLock += subStake.lockedValue;
            } else if (subStake.firstPeriod <= _nextPeriod &&
                lastPeriod >= _nextPeriod) {
                nextLock += subStake.lockedValue;
            }
            uint16 duration = lastPeriod - subStake.firstPeriod;
            if (subStake.firstPeriod <= _currentPeriod &&
                lastPeriod >= _currentPeriod &&
                (lastPeriod < minLastPeriod ||
                lastPeriod == minLastPeriod && duration < minDuration))
            {
                shortestSubStakeIndex = i;
                minDuration = duration;
                minLastPeriod = lastPeriod;
            }
        }
    }

    /**
    * @notice Decrease short sub stakes
    * @param _info Staker structure
    * @param _penalty Penalty rate
    * @param _decreasePeriod The period when the decrease begins
    * @param _startPeriod Pre-calculated start period
    * @param _shortestSubStakeIndex Index of the shortest period
    */
    function decreaseSubStakes(
        StakerInfo storage _info,
        uint256 _penalty,
        uint16 _decreasePeriod,
        uint16 _startPeriod,
        uint256 _shortestSubStakeIndex
    )
        internal
    {
        SubStakeInfo storage shortestSubStake = _info.subStakes[0];
        uint16 minSubStakeLastPeriod = MAX_UINT16;
        uint16 minSubStakeDuration = MAX_UINT16;
        while(_penalty > 0) {
            if (_shortestSubStakeIndex < MAX_SUB_STAKES) {
                shortestSubStake = _info.subStakes[_shortestSubStakeIndex];
                minSubStakeLastPeriod = getLastPeriodOfSubStake(shortestSubStake, _startPeriod);
                minSubStakeDuration = minSubStakeLastPeriod - shortestSubStake.firstPeriod;
                _shortestSubStakeIndex = MAX_SUB_STAKES;
            } else {
                (shortestSubStake, minSubStakeDuration, minSubStakeLastPeriod) =
                    getShortestSubStake(_info, _decreasePeriod, _startPeriod);
            }
            if (minSubStakeDuration == MAX_UINT16) {
                break;
            }
            uint256 appliedPenalty = _penalty;
            if (_penalty < shortestSubStake.lockedValue) {
                shortestSubStake.lockedValue -= uint128(_penalty);
                saveOldSubStake(_info, shortestSubStake.firstPeriod, _penalty, _decreasePeriod);
                _penalty = 0;
            } else {
                shortestSubStake.lastPeriod = _decreasePeriod - 1;
                _penalty -= shortestSubStake.lockedValue;
                appliedPenalty = shortestSubStake.lockedValue;
            }
            if (_info.currentCommittedPeriod >= _decreasePeriod &&
                _info.currentCommittedPeriod <= minSubStakeLastPeriod)
            {
                lockedPerPeriod[_info.currentCommittedPeriod] -= appliedPenalty;
            }
            if (_info.nextCommittedPeriod >= _decreasePeriod &&
                _info.nextCommittedPeriod <= minSubStakeLastPeriod)
            {
                lockedPerPeriod[_info.nextCommittedPeriod] -= appliedPenalty;
            }
        }
    }

    /**
    * @notice Get the shortest sub stake
    * @param _info Staker structure
    * @param _currentPeriod Current period
    * @param _startPeriod Pre-calculated start period
    * @return shortestSubStake The shortest sub stake
    * @return minSubStakeDuration Duration of the shortest sub stake
    * @return minSubStakeLastPeriod Last period of the shortest sub stake
    */
    function getShortestSubStake(
        StakerInfo storage _info,
        uint16 _currentPeriod,
        uint16 _startPeriod
    )
        internal view returns (
            SubStakeInfo storage shortestSubStake,
            uint16 minSubStakeDuration,
            uint16 minSubStakeLastPeriod
        )
    {
        shortestSubStake = shortestSubStake;
        minSubStakeDuration = MAX_UINT16;
        minSubStakeLastPeriod = MAX_UINT16;
        for (uint256 i = 0; i < _info.subStakes.length; i++) {
            SubStakeInfo storage subStake = _info.subStakes[i];
            uint16 lastPeriod = getLastPeriodOfSubStake(subStake, _startPeriod);
            if (lastPeriod < subStake.firstPeriod) {
                continue;
            }
            uint16 duration = lastPeriod - subStake.firstPeriod;
            if (subStake.firstPeriod <= _currentPeriod &&
                lastPeriod >= _currentPeriod &&
                (lastPeriod < minSubStakeLastPeriod ||
                lastPeriod == minSubStakeLastPeriod && duration < minSubStakeDuration))
            {
                shortestSubStake = subStake;
                minSubStakeDuration = duration;
                minSubStakeLastPeriod = lastPeriod;
            }
        }
    }

    /**
    * @notice Save the old sub stake values to prevent decreasing reward for the previous period
    * @dev Saving happens only if the previous period is committed
    * @param _info Staker structure
    * @param _firstPeriod First period of the old sub stake
    * @param _lockedValue Locked value of the old sub stake
    * @param _currentPeriod Current period, when the old sub stake is already unlocked
    */
    function saveOldSubStake(
        StakerInfo storage _info,
        uint16 _firstPeriod,
        uint256 _lockedValue,
        uint16 _currentPeriod
    )
        internal
    {
        // Check that the old sub stake should be saved
        bool oldCurrentCommittedPeriod = _info.currentCommittedPeriod != 0 &&
            _info.currentCommittedPeriod < _currentPeriod;
        bool oldnextCommittedPeriod = _info.nextCommittedPeriod != 0 &&
            _info.nextCommittedPeriod < _currentPeriod;
        bool crosscurrentCommittedPeriod = oldCurrentCommittedPeriod && _info.currentCommittedPeriod >= _firstPeriod;
        bool crossnextCommittedPeriod = oldnextCommittedPeriod && _info.nextCommittedPeriod >= _firstPeriod;
        if (!crosscurrentCommittedPeriod && !crossnextCommittedPeriod) {
            return;
        }
        // Try to find already existent proper old sub stake
        uint16 previousPeriod = _currentPeriod - 1;
        for (uint256 i = 0; i < _info.subStakes.length; i++) {
            SubStakeInfo storage subStake = _info.subStakes[i];
            if (subStake.lastPeriod == previousPeriod &&
                ((crosscurrentCommittedPeriod ==
                (oldCurrentCommittedPeriod && _info.currentCommittedPeriod >= subStake.firstPeriod)) &&
                (crossnextCommittedPeriod ==
                (oldnextCommittedPeriod && _info.nextCommittedPeriod >= subStake.firstPeriod))))
            {
                subStake.lockedValue += uint128(_lockedValue);
                return;
            }
        }
        saveSubStake(_info, _firstPeriod, previousPeriod, 0, _lockedValue);
    }

    //-------------Additional getters for stakers info-------------
    /**
    * @notice Return the length of the array of stakers
    */
    function getStakersLength() external view returns (uint256) {
        return stakers.length;
    }

    /**
    * @notice Return the length of the array of sub stakes
    */
    function getSubStakesLength(address _staker) external view returns (uint256) {
        return stakerInfo[_staker].subStakes.length;
    }

    /**
    * @notice Return the information about sub stake
    */
    function getSubStakeInfo(address _staker, uint256 _index)
    // TODO change to structure when ABIEncoderV2 is released (#1501)
//        public view returns (SubStakeInfo)
        // TODO "virtual" only for tests, probably will be removed after #1512
        external view virtual returns (uint16 firstPeriod, uint16 lastPeriod, uint16 periods, uint128 lockedValue)
    {
        SubStakeInfo storage info = stakerInfo[_staker].subStakes[_index];
        firstPeriod = info.firstPeriod;
        lastPeriod = info.lastPeriod;
        periods = info.periods;
        lockedValue = info.lockedValue;
    }

    /**
    * @notice Return the length of the array of past downtime
    */
    function getPastDowntimeLength(address _staker) external view returns (uint256) {
        return stakerInfo[_staker].pastDowntime.length;
    }

    /**
    * @notice Return the information about past downtime
    */
    function  getPastDowntime(address _staker, uint256 _index)
    // TODO change to structure when ABIEncoderV2 is released (#1501)
//        public view returns (Downtime)
        external view returns (uint16 startPeriod, uint16 endPeriod)
    {
        Downtime storage downtime = stakerInfo[_staker].pastDowntime[_index];
        startPeriod = downtime.startPeriod;
        endPeriod = downtime.endPeriod;
    }

    //------------------ ERC900 connectors ----------------------

    function totalStakedForAt(address _owner, uint256 _blockNumber) public view override returns (uint256){
        return stakerInfo[_owner].history.getValueAt(_blockNumber);
    }

    function totalStakedAt(uint256 _blockNumber) public view override returns (uint256){
        return balanceHistory.getValueAt(_blockNumber);
    }

    function supportsHistory() external pure override returns (bool){
        return true;
    }

    //------------------------Upgradeable------------------------
    /**
    * @dev Get StakerInfo structure by delegatecall
    */
    function delegateGetStakerInfo(address _target, bytes32 _staker)
        internal returns (StakerInfo memory result)
    {
        bytes32 memoryAddress = delegateGetData(_target, this.stakerInfo.selector, 1, _staker, 0);
        assembly {
            result := memoryAddress
        }
    }

    /**
    * @dev Get SubStakeInfo structure by delegatecall
    */
    function delegateGetSubStakeInfo(address _target, bytes32 _staker, uint256 _index)
        internal returns (SubStakeInfo memory result)
    {
        bytes32 memoryAddress = delegateGetData(
            _target, this.getSubStakeInfo.selector, 2, _staker, bytes32(_index));
        assembly {
            result := memoryAddress
        }
    }

    /**
    * @dev Get Downtime structure by delegatecall
    */
    function delegateGetPastDowntime(address _target, bytes32 _staker, uint256 _index)
        internal returns (Downtime memory result)
    {
        bytes32 memoryAddress = delegateGetData(
            _target, this.getPastDowntime.selector, 2, _staker, bytes32(_index));
        assembly {
            result := memoryAddress
        }
    }

    /// @dev the `onlyWhileUpgrading` modifier works through a call to the parent `verifyState`
    function verifyState(address _testTarget) public override virtual {
        super.verifyState(_testTarget);
        require(address(delegateGet(_testTarget, this.policyManager.selector)) == address(policyManager));
        require(address(delegateGet(_testTarget, this.adjudicator.selector)) == address(adjudicator));
        require(address(delegateGet(_testTarget, this.workLock.selector)) == address(workLock));
        require(delegateGet(_testTarget, this.lockedPerPeriod.selector,
            bytes32(bytes2(RESERVED_PERIOD))) == lockedPerPeriod[RESERVED_PERIOD]);
        require(address(delegateGet(_testTarget, this.stakerFromWorker.selector, bytes32(0))) ==
            stakerFromWorker[address(0)]);

        require(delegateGet(_testTarget, this.getStakersLength.selector) == stakers.length);
        if (stakers.length == 0) {
            return;
        }
        address stakerAddress = stakers[0];
        require(address(uint160(delegateGet(_testTarget, this.stakers.selector, 0))) == stakerAddress);
        StakerInfo storage info = stakerInfo[stakerAddress];
        bytes32 staker = bytes32(uint256(stakerAddress));
        StakerInfo memory infoToCheck = delegateGetStakerInfo(_testTarget, staker);
        require(infoToCheck.value == info.value &&
            infoToCheck.currentCommittedPeriod == info.currentCommittedPeriod &&
            infoToCheck.nextCommittedPeriod == info.nextCommittedPeriod &&
            infoToCheck.flags == info.flags &&
            infoToCheck.lockReStakeUntilPeriod == info.lockReStakeUntilPeriod &&
            infoToCheck.lastCommittedPeriod == info.lastCommittedPeriod &&
            infoToCheck.completedWork == info.completedWork &&
            infoToCheck.worker == info.worker &&
            infoToCheck.workerStartPeriod == info.workerStartPeriod);

        require(delegateGet(_testTarget, this.getPastDowntimeLength.selector, staker) ==
            info.pastDowntime.length);
        for (uint256 i = 0; i < info.pastDowntime.length && i < MAX_CHECKED_VALUES; i++) {
            Downtime storage downtime = info.pastDowntime[i];
            Downtime memory downtimeToCheck = delegateGetPastDowntime(_testTarget, staker, i);
            require(downtimeToCheck.startPeriod == downtime.startPeriod &&
                downtimeToCheck.endPeriod == downtime.endPeriod);
        }

        require(delegateGet(_testTarget, this.getSubStakesLength.selector, staker) == info.subStakes.length);
        for (uint256 i = 0; i < info.subStakes.length && i < MAX_CHECKED_VALUES; i++) {
            SubStakeInfo storage subStakeInfo = info.subStakes[i];
            SubStakeInfo memory subStakeInfoToCheck = delegateGetSubStakeInfo(_testTarget, staker, i);
            require(subStakeInfoToCheck.firstPeriod == subStakeInfo.firstPeriod &&
                subStakeInfoToCheck.lastPeriod == subStakeInfo.lastPeriod &&
                subStakeInfoToCheck.periods == subStakeInfo.periods &&
                subStakeInfoToCheck.lockedValue == subStakeInfo.lockedValue);
        }

        // it's not perfect because checks not only slot value but also decoding
        // at least without additional functions
        require(delegateGet(_testTarget, this.totalStakedForAt.selector, staker, bytes32(block.number)) ==
            totalStakedForAt(stakerAddress, block.number));
        require(delegateGet(_testTarget, this.totalStakedAt.selector, bytes32(block.number)) ==
            totalStakedAt(block.number));

        if (info.worker != address(0)) {
            require(address(delegateGet(_testTarget, this.stakerFromWorker.selector, bytes32(uint256(info.worker)))) ==
                stakerFromWorker[info.worker]);
        }
    }

    /// @dev the `onlyWhileUpgrading` modifier works through a call to the parent `finishUpgrade`
    function finishUpgrade(address _target) public override virtual {
        super.finishUpgrade(_target);
        // Create fake period
        lockedPerPeriod[RESERVED_PERIOD] = 111;

        // Create fake worker
        stakerFromWorker[address(0)] = address(this);
    }
}

File 1 of 15: AdditionalMath.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.7.0;


import "SafeMath.sol";


/**
* @notice Additional math operations
*/
library AdditionalMath {
    using SafeMath for uint256;

    function max16(uint16 a, uint16 b) internal pure returns (uint16) {
        return a >= b ? a : b;
    }

    function min16(uint16 a, uint16 b) internal pure returns (uint16) {
        return a < b ? a : b;
    }

    /**
    * @notice Division and ceil
    */
    function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        return (a.add(b) - 1) / b;
    }

    /**
    * @dev Adds signed value to unsigned value, throws on overflow.
    */
    function addSigned(uint256 a, int256 b) internal pure returns (uint256) {
        if (b >= 0) {
            return a.add(uint256(b));
        } else {
            return a.sub(uint256(-b));
        }
    }

    /**
    * @dev Subtracts signed value from unsigned value, throws on overflow.
    */
    function subSigned(uint256 a, int256 b) internal pure returns (uint256) {
        if (b >= 0) {
            return a.sub(uint256(b));
        } else {
            return a.add(uint256(-b));
        }
    }

    /**
    * @dev Multiplies two numbers, throws on overflow.
    */
    function mul32(uint32 a, uint32 b) internal pure returns (uint32) {
        if (a == 0) {
            return 0;
        }
        uint32 c = a * b;
        assert(c / a == b);
        return c;
    }

    /**
    * @dev Adds two numbers, throws on overflow.
    */
    function add16(uint16 a, uint16 b) internal pure returns (uint16) {
        uint16 c = a + b;
        assert(c >= a);
        return c;
    }

    /**
    * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub16(uint16 a, uint16 b) internal pure returns (uint16) {
        assert(b <= a);
        return a - b;
    }

    /**
    * @dev Adds signed value to unsigned value, throws on overflow.
    */
    function addSigned16(uint16 a, int16 b) internal pure returns (uint16) {
        if (b >= 0) {
            return add16(a, uint16(b));
        } else {
            return sub16(a, uint16(-b));
        }
    }

    /**
    * @dev Subtracts signed value from unsigned value, throws on overflow.
    */
    function subSigned16(uint16 a, int16 b) internal pure returns (uint16) {
        if (b >= 0) {
            return sub16(a, uint16(b));
        } else {
            return add16(a, uint16(-b));
        }
    }
}

File 2 of 15: Bits.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.7.0;

/**
* @dev Taken from https://github.com/ethereum/solidity-examples/blob/master/src/bits/Bits.sol
*/
library Bits {

    uint256 internal constant ONE = uint256(1);

    /**
    * @notice Sets the bit at the given 'index' in 'self' to:
    *  '1' - if the bit is '0'
    *  '0' - if the bit is '1'
    * @return The modified value
    */
    function toggleBit(uint256 self, uint8 index) internal pure returns (uint256) {
        return self ^ ONE << index;
    }

    /**
    * @notice Get the value of the bit at the given 'index' in 'self'.
    */
    function bit(uint256 self, uint8 index) internal pure returns (uint8) {
        return uint8(self >> index & 1);
    }

    /**
    * @notice Check if the bit at the given 'index' in 'self' is set.
    * @return  'true' - if the value of the bit is '1',
    *          'false' - if the value of the bit is '0'
    */
    function bitSet(uint256 self, uint8 index) internal pure returns (bool) {
        return self >> index & 1 == 1;
    }

}

File 3 of 15: ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


import "IERC20.sol";
import "SafeMath.sol";


/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
 * Originally based on code by FirstBlood:
 * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 *
 * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
 * all accounts just by listening to said events. Note that this isn't required by the specification, and other
 * compliant implementations may not do it.
 */
contract ERC20 is IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    /**
     * @dev Total number of tokens in existence
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev Gets the balance of the specified address.
     * @param owner The address to query the balance of.
     * @return An uint256 representing the amount owned by the passed address.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        return _balances[owner];
    }

    /**
     * @dev Function to check the amount of tokens that an owner allowed to a spender.
     * @param owner address The address which owns the funds.
     * @param spender address The address which will spend the funds.
     * @return A uint256 specifying the amount of tokens still available for the spender.
     */
    function allowance(address owner, address spender) public view override returns (uint256) {
        return _allowed[owner][spender];
    }

    /**
     * @dev Transfer token for a specified address
     * @param to The address to transfer to.
     * @param value The amount to be transferred.
     */
    function transfer(address to, uint256 value) public override returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    /**
     * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
     * 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
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     */
    function approve(address spender, uint256 value) public override returns (bool) {

        // To change the approve amount you first have to reduce the addresses`
        //  allowance to zero by calling `approve(_spender, 0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        require(value == 0 || _allowed[msg.sender][spender] == 0);

        _approve(msg.sender, spender, value);
        return true;
    }

    /**
     * @dev Transfer tokens from one address to another.
     * Note that while this function emits an Approval event, this is not required as per the specification,
     * and other compliant implementations may not emit the event.
     * @param from address The address which you want to send tokens from
     * @param to address The address which you want to transfer to
     * @param value uint256 the amount of tokens to be transferred
     */
    function transferFrom(address from, address to, uint256 value) public override returns (bool) {
        _transfer(from, to, value);
        _approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
        return true;
    }

    /**
     * @dev Increase the amount of tokens that an owner allowed to a spender.
     * approve should be called when allowed_[_spender] == 0. To increment
     * allowed value is better to use this function to avoid 2 calls (and wait until
     * the first transaction is mined)
     * From MonolithDAO Token.sol
     * Emits an Approval event.
     * @param spender The address which will spend the funds.
     * @param addedValue The amount of tokens to increase the allowance by.
     */
    function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
        _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Decrease the amount of tokens that an owner allowed to a spender.
     * approve should be called when allowed_[_spender] == 0. To decrement
     * allowed value is better to use this function to avoid 2 calls (and wait until
     * the first transaction is mined)
     * From MonolithDAO Token.sol
     * Emits an Approval event.
     * @param spender The address which will spend the funds.
     * @param subtractedValue The amount of tokens to decrease the allowance by.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
        _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
        return true;
    }

    /**
     * @dev Transfer token for a specified addresses
     * @param from The address to transfer from.
     * @param to The address to transfer to.
     * @param value The amount to be transferred.
     */
    function _transfer(address from, address to, uint256 value) internal {
        require(to != address(0));

        _balances[from] = _balances[from].sub(value);
        _balances[to] = _balances[to].add(value);
        emit Transfer(from, to, value);
    }

    /**
     * @dev Internal function that mints an amount of the token and assigns it to
     * an account. This encapsulates the modification of balances such that the
     * proper events are emitted.
     * @param account The account that will receive the created tokens.
     * @param value The amount that will be created.
     */
    function _mint(address account, uint256 value) internal {
        require(account != address(0));

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

    /**
     * @dev Internal function that burns an amount of the token of a given
     * account.
     * @param account The account whose tokens will be burnt.
     * @param value The amount that will be burnt.
     */
    function _burn(address account, uint256 value) internal {
        require(account != address(0));

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

    /**
     * @dev Approve an address to spend another addresses' tokens.
     * @param owner The address that owns the tokens.
     * @param spender The address that will spend the tokens.
     * @param value The number of tokens that can be spent.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        require(spender != address(0));
        require(owner != address(0));

        _allowed[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    /**
     * @dev Internal function that burns an amount of the token of a given
     * account, deducting from the sender's allowance for said account. Uses the
     * internal burn function.
     * Emits an Approval event (reflecting the reduced allowance).
     * @param account The account whose tokens will be burnt.
     * @param value The amount that will be burnt.
     */
    function _burnFrom(address account, uint256 value) internal {
        _burn(account, value);
        _approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
    }

}

File 4 of 15: ERC20Detailed.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


import "IERC20.sol";


/**
 * @title ERC20Detailed token
 * @dev The decimals are only for visualization purposes.
 * All the operations are done using the smallest and indivisible token unit,
 * just as on Ethereum all the operations are done in wei.
 */
abstract contract ERC20Detailed is IERC20 {
    string private _name;
    string private _symbol;
    uint8 private _decimals;

    constructor (string memory name, string memory symbol, uint8 decimals) {
        _name = name;
        _symbol = symbol;
        _decimals = decimals;
    }

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

    /**
     * @return the symbol of the token.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @return the number of decimals of the token.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }
}

File 5 of 15: IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
    function transfer(address to, uint256 value) external returns (bool);

    function approve(address spender, uint256 value) external returns (bool);

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

    function totalSupply() external view returns (uint256);

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

    function allowance(address owner, address spender) external view returns (uint256);

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 6 of 15: IERC900History.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.7.0;


// Minimum interface to interact with Aragon's Aggregator
interface IERC900History {
    function totalStakedForAt(address addr, uint256 blockNumber) external view returns (uint256);
    function totalStakedAt(uint256 blockNumber) external view returns (uint256);
    function supportsHistory() external pure returns (bool);
}

File 7 of 15: Issuer.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.7.0;


import "NuCypherToken.sol";
import "Math.sol";
import "Upgradeable.sol";
import "AdditionalMath.sol";
import "SafeERC20.sol";


/**
* @notice Contract for calculation of issued tokens
* @dev |v3.3.1|
*/
abstract contract Issuer is Upgradeable {
    using SafeERC20 for NuCypherToken;
    using AdditionalMath for uint32;

    event Donated(address indexed sender, uint256 value);
    /// Issuer is initialized with a reserved reward
    event Initialized(uint256 reservedReward);

    uint128 constant MAX_UINT128 = uint128(0) - 1;

    NuCypherToken public immutable token;
    uint128 public immutable totalSupply;

    // d * k2
    uint256 public immutable mintingCoefficient;
    // k1
    uint256 public immutable lockDurationCoefficient1;
    // k2
    uint256 public immutable lockDurationCoefficient2;
    uint32 public immutable secondsPerPeriod;
    // kmax
    uint16 public immutable maximumRewardedPeriods;

    uint256 public immutable firstPhaseMaxIssuance;
    uint256 public immutable firstPhaseTotalSupply;

    /**
    * Current supply is used in the minting formula and is stored to prevent different calculation
    * for stakers which get reward in the same period. There are two values -
    * supply for previous period (used in formula) and supply for current period which accumulates value
    * before end of period.
    */
    uint128 public previousPeriodSupply;
    uint128 public currentPeriodSupply;
    uint16 public currentMintingPeriod;

    /**
    * @notice Constructor sets address of token contract and coefficients for minting
    * @dev Minting formula for one sub-stake in one period for the first phase
    firstPhaseMaxIssuance * (lockedValue / totalLockedValue) * (k1 + min(allLockedPeriods, kmax)) / k2
    * @dev Minting formula for one sub-stake in one period for the second phase
    (totalSupply - currentSupply) / d * (lockedValue / totalLockedValue) * (k1 + min(allLockedPeriods, kmax)) / k2
    if allLockedPeriods > maximumRewardedPeriods then allLockedPeriods = maximumRewardedPeriods
    * @param _token Token contract
    * @param _hoursPerPeriod Size of period in hours
    * @param _issuanceDecayCoefficient (d) Coefficient which modifies the rate at which the maximum issuance decays,
    * only applicable to Phase 2. d = 365 * half-life / LOG2 where default half-life = 2.
    * See Equation 10 in Staking Protocol & Economics paper
    * @param _lockDurationCoefficient1 (k1) Numerator of the coefficient which modifies the extent 
    * to which a stake's lock duration affects the subsidy it receives. Affects stakers differently. 
    * Applicable to Phase 1 and Phase 2. k1 = k2 * small_stake_multiplier where default small_stake_multiplier = 0.5.  
    * See Equation 8 in Staking Protocol & Economics paper.
    * @param _lockDurationCoefficient2 (k2) Denominator of the coefficient which modifies the extent
    * to which a stake's lock duration affects the subsidy it receives. Affects stakers differently.
    * Applicable to Phase 1 and Phase 2. k2 = maximum_rewarded_periods / (1 - small_stake_multiplier)
    * where default maximum_rewarded_periods = 365 and default small_stake_multiplier = 0.5.
    * See Equation 8 in Staking Protocol & Economics paper.
    * @param _maximumRewardedPeriods (kmax) Number of periods beyond which a stake's lock duration
    * no longer increases the subsidy it receives. kmax = reward_saturation * 365 where default reward_saturation = 1.
    * See Equation 8 in Staking Protocol & Economics paper.
    * @param _firstPhaseTotalSupply Total supply for the first phase
    * @param _firstPhaseMaxIssuance (Imax) Maximum number of new tokens minted per period during Phase 1.
    * See Equation 7 in Staking Protocol & Economics paper.
    */
    constructor(
        NuCypherToken _token,
        uint32 _hoursPerPeriod,
        uint256 _issuanceDecayCoefficient,
        uint256 _lockDurationCoefficient1,
        uint256 _lockDurationCoefficient2,
        uint16 _maximumRewardedPeriods,
        uint256 _firstPhaseTotalSupply,
        uint256 _firstPhaseMaxIssuance
    ) {
        uint256 localTotalSupply = _token.totalSupply();
        require(localTotalSupply > 0 &&
            _issuanceDecayCoefficient != 0 &&
            _hoursPerPeriod != 0 &&
            _lockDurationCoefficient1 != 0 &&
            _lockDurationCoefficient2 != 0 &&
            _maximumRewardedPeriods != 0);
        require(localTotalSupply <= uint256(MAX_UINT128), "Token contract has supply more than supported");

        uint256 maxLockDurationCoefficient = _maximumRewardedPeriods + _lockDurationCoefficient1;
        uint256 localMintingCoefficient = _issuanceDecayCoefficient * _lockDurationCoefficient2;
        require(maxLockDurationCoefficient > _maximumRewardedPeriods &&
            localMintingCoefficient / _issuanceDecayCoefficient ==  _lockDurationCoefficient2 &&
            // worst case for `totalLockedValue * d * k2`, when totalLockedValue == totalSupply
            localTotalSupply * localMintingCoefficient / localTotalSupply == localMintingCoefficient &&
            // worst case for `(totalSupply - currentSupply) * lockedValue * (k1 + min(allLockedPeriods, kmax))`,
            // when currentSupply == 0, lockedValue == totalSupply
            localTotalSupply * localTotalSupply * maxLockDurationCoefficient / localTotalSupply / localTotalSupply ==
                maxLockDurationCoefficient,
            "Specified parameters cause overflow");

        require(maxLockDurationCoefficient <= _lockDurationCoefficient2,
            "Resulting locking duration coefficient must be less than 1");
        require(_firstPhaseTotalSupply <= localTotalSupply, "Too many tokens for the first phase");
        require(_firstPhaseMaxIssuance <= _firstPhaseTotalSupply, "Reward for the first phase is too high");

        token = _token;
        secondsPerPeriod = _hoursPerPeriod.mul32(1 hours);
        lockDurationCoefficient1 = _lockDurationCoefficient1;
        lockDurationCoefficient2 = _lockDurationCoefficient2;
        maximumRewardedPeriods = _maximumRewardedPeriods;
        firstPhaseTotalSupply = _firstPhaseTotalSupply;
        firstPhaseMaxIssuance = _firstPhaseMaxIssuance;
        totalSupply = uint128(localTotalSupply);
        mintingCoefficient = localMintingCoefficient;
    }

    /**
    * @dev Checks contract initialization
    */
    modifier isInitialized()
    {
        require(currentMintingPeriod != 0);
        _;
    }

    /**
    * @return Number of current period
    */
    function getCurrentPeriod() public view returns (uint16) {
        return uint16(block.timestamp / secondsPerPeriod);
    }

    /**
    * @notice Initialize reserved tokens for reward
    */
    function initialize(uint256 _reservedReward, address _sourceOfFunds) external onlyOwner {
        require(currentMintingPeriod == 0);
        // Reserved reward must be sufficient for at least one period of the first phase
        require(firstPhaseMaxIssuance <= _reservedReward);
        currentMintingPeriod = getCurrentPeriod();
        currentPeriodSupply = totalSupply - uint128(_reservedReward);
        previousPeriodSupply = currentPeriodSupply;
        token.safeTransferFrom(_sourceOfFunds, address(this), _reservedReward);
        emit Initialized(_reservedReward);
    }

    /**
    * @notice Function to mint tokens for one period.
    * @param _currentPeriod Current period number.
    * @param _lockedValue The amount of tokens that were locked by user in specified period.
    * @param _totalLockedValue The amount of tokens that were locked by all users in specified period.
    * @param _allLockedPeriods The max amount of periods during which tokens will be locked after specified period.
    * @return amount Amount of minted tokens.
    */
    function mint(
        uint16 _currentPeriod,
        uint256 _lockedValue,
        uint256 _totalLockedValue,
        uint16 _allLockedPeriods
    )
        internal returns (uint256 amount)
    {
        if (currentPeriodSupply == totalSupply) {
            return 0;
        }

        if (_currentPeriod > currentMintingPeriod) {
            previousPeriodSupply = currentPeriodSupply;
            currentMintingPeriod = _currentPeriod;
        }

        uint256 currentReward;
        uint256 coefficient;

        // first phase
        // firstPhaseMaxIssuance * lockedValue * (k1 + min(allLockedPeriods, kmax)) / (totalLockedValue * k2)
        if (previousPeriodSupply + firstPhaseMaxIssuance <= firstPhaseTotalSupply) {
            currentReward = firstPhaseMaxIssuance;
            coefficient = lockDurationCoefficient2;
        // second phase
        // (totalSupply - currentSupply) * lockedValue * (k1 + min(allLockedPeriods, kmax)) / (totalLockedValue * d * k2)
        } else {
            currentReward = totalSupply - previousPeriodSupply;
            coefficient = mintingCoefficient;
        }

        uint256 allLockedPeriods =
            AdditionalMath.min16(_allLockedPeriods, maximumRewardedPeriods) + lockDurationCoefficient1;
        amount = (uint256(currentReward) * _lockedValue * allLockedPeriods) /
            (_totalLockedValue * coefficient);

        // rounding the last reward
        uint256 maxReward = getReservedReward();
        if (amount == 0) {
            amount = 1;
        } else if (amount > maxReward) {
            amount = maxReward;
        }

        currentPeriodSupply += uint128(amount);
    }

    /**
    * @notice Return tokens for future minting
    * @param _amount Amount of tokens
    */
    function unMint(uint256 _amount) internal {
        previousPeriodSupply -= uint128(_amount);
        currentPeriodSupply -= uint128(_amount);
    }

    /**
    * @notice Donate sender's tokens. Amount of tokens will be returned for future minting
    * @param _value Amount to donate
    */
    function donate(uint256 _value) external isInitialized {
        token.safeTransferFrom(msg.sender, address(this), _value);
        unMint(_value);
        emit Donated(msg.sender, _value);
    }

    /**
    * @notice Returns the number of tokens that can be minted
    */
    function getReservedReward() public view returns (uint256) {
        return totalSupply - currentPeriodSupply;
    }

    /// @dev the `onlyWhileUpgrading` modifier works through a call to the parent `verifyState`
    function verifyState(address _testTarget) public override virtual {
        super.verifyState(_testTarget);
        require(uint16(delegateGet(_testTarget, this.currentMintingPeriod.selector)) == currentMintingPeriod);
        require(uint128(delegateGet(_testTarget, this.previousPeriodSupply.selector)) == previousPeriodSupply);
        require(uint128(delegateGet(_testTarget, this.currentPeriodSupply.selector)) == currentPeriodSupply);
    }

}

File 8 of 15: Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


/**
 * @title Math
 * @dev Assorted math operations
 */
library Math {
    /**
     * @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 Calculates the average of two numbers. Since these are integers,
     * averages of an even and odd number cannot be represented, and will be
     * rounded down.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 9 of 15: NuCypherToken.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.7.0;


import "ERC20.sol";
import "ERC20Detailed.sol";


/**
* @title NuCypher token
* @notice ERC20 token
* @dev Optional approveAndCall() functionality to notify a contract if an approve() has occurred.
*/
contract NuCypherToken is ERC20, ERC20Detailed('NuCypher', 'NU', 18) {

    /**
    * @notice Set amount of tokens
    * @param _totalSupplyOfTokens Total number of tokens
    */
    constructor (uint256 _totalSupplyOfTokens) {
        _mint(msg.sender, _totalSupplyOfTokens);
    }

    /**
    * @notice Approves and then calls the receiving contract
    *
    * @dev call the receiveApproval function on the contract you want to be notified.
    * receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
    */
    function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData)
        external returns (bool success)
    {
        approve(_spender, _value);
        TokenRecipient(_spender).receiveApproval(msg.sender, _value, address(this), _extraData);
        return true;
    }

}


/**
* @dev Interface to use the receiveApproval method
*/
interface TokenRecipient {

    /**
    * @notice Receives a notification of approval of the transfer
    * @param _from Sender of approval
    * @param _value  The amount of tokens to be spent
    * @param _tokenContract Address of the token contract
    * @param _extraData Extra data
    */
    function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes calldata _extraData) external;

}

File 10 of 15: Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
abstract contract Ownable {
    address private _owner;

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

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor () {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

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

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

    /**
     * @return true if `msg.sender` is the owner of the contract.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _owner;
    }

    /**
     * @dev Allows the current owner to relinquish control of the contract.
     * @notice Renouncing to ownership will leave the contract without an owner.
     * It will not be possible to call the functions with the `onlyOwner`
     * modifier anymore.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0));
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 11 of 15: SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


import "IERC20.sol";
import "SafeMath.sol";


/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        require(token.transfer(to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        require(token.transferFrom(from, to, value));
    }

    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require((value == 0) || (token.allowance(msg.sender, spender) == 0));
        require(token.approve(spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        require(token.approve(spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value);
        require(token.approve(spender, newAllowance));
    }
}

File 12 of 15: SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 */
library SafeMath {
    /**
     * @dev Multiplies two unsigned integers, reverts on overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b);

        return c;
    }

    /**
     * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Adds two unsigned integers, reverts on overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
     * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
     * reverts when dividing by zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}

File 13 of 15: Snapshot.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.7.0;


/**
 * @title Snapshot
 * @notice Manages snapshots of size 128 bits (32 bits for timestamp, 96 bits for value)
 * 96 bits is enough for storing NU token values, and 32 bits should be OK for block numbers
 * @dev Since each storage slot can hold two snapshots, new slots are allocated every other TX. Thus, gas cost of adding snapshots is 51400 and 36400 gas, alternately.
 * Based on Aragon's Checkpointing (https://https://github.com/aragonone/voting-connectors/blob/master/shared/contract-utils/contracts/Checkpointing.sol)
 * On average, adding snapshots spends ~6500 less gas than the 256-bit checkpoints of Aragon's Checkpointing
 */
library Snapshot {

    function encodeSnapshot(uint32 _time, uint96 _value) internal pure returns(uint128) {
        return uint128(uint256(_time) << 96 | uint256(_value));
    }

    function decodeSnapshot(uint128 _snapshot) internal pure returns(uint32 time, uint96 value){
        time = uint32(bytes4(bytes16(_snapshot)));
        value = uint96(_snapshot);
    }

    function addSnapshot(uint128[] storage _self, uint256 _value) internal {
        addSnapshot(_self, block.number, _value);
    }

    function addSnapshot(uint128[] storage _self, uint256 _time, uint256 _value) internal {
        uint256 length = _self.length;
        if (length != 0) {
            (uint32 currentTime, ) = decodeSnapshot(_self[length - 1]);
            if (uint32(_time) == currentTime) {
                _self[length - 1] = encodeSnapshot(uint32(_time), uint96(_value));
                return;
            } else if (uint32(_time) < currentTime){
                revert();
            }
        }
        _self.push(encodeSnapshot(uint32(_time), uint96(_value)));
    }

    function lastSnapshot(uint128[] storage _self) internal view returns (uint32, uint96) {
        uint256 length = _self.length;
        if (length > 0) {
            return decodeSnapshot(_self[length - 1]);
        }

        return (0, 0);
    }

    function lastValue(uint128[] storage _self) internal view returns (uint96) {
        (, uint96 value) = lastSnapshot(_self);
        return value;
    }

    function getValueAt(uint128[] storage _self, uint256 _time256) internal view returns (uint96) {
        uint32 _time = uint32(_time256);
        uint256 length = _self.length;

        // Short circuit if there's no checkpoints yet
        // Note that this also lets us avoid using SafeMath later on, as we've established that
        // there must be at least one checkpoint
        if (length == 0) {
            return 0;
        }

        // Check last checkpoint
        uint256 lastIndex = length - 1;
        (uint32 snapshotTime, uint96 snapshotValue) = decodeSnapshot(_self[length - 1]);
        if (_time >= snapshotTime) {
            return snapshotValue;
        }

        // Check first checkpoint (if not already checked with the above check on last)
        (snapshotTime, snapshotValue) = decodeSnapshot(_self[0]);
        if (length == 1 || _time < snapshotTime) {
            return 0;
        }

        // Do binary search
        // As we've already checked both ends, we don't need to check the last checkpoint again
        uint256 low = 0;
        uint256 high = lastIndex - 1;
        uint32 midTime;
        uint96 midValue;

        while (high > low) {
            uint256 mid = (high + low + 1) / 2; // average, ceil round
            (midTime, midValue) = decodeSnapshot(_self[mid]);

            if (_time > midTime) {
                low = mid;
            } else if (_time < midTime) {
                // Note that we don't need SafeMath here because mid must always be greater than 0
                // from the while condition
                high = mid - 1;
            } else {
                // _time == midTime
                return midValue;
            }
        }

        (, snapshotValue) = decodeSnapshot(_self[low]);
        return snapshotValue;
    }
}

File 15 of 15: Upgradeable.sol
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.7.0;


import "Ownable.sol";


/**
* @notice Base contract for upgradeable contract
* @dev Inherited contract should implement verifyState(address) method by checking storage variables
* (see verifyState(address) in Dispatcher). Also contract should implement finishUpgrade(address)
* if it is using constructor parameters by coping this parameters to the dispatcher storage
*/
abstract contract Upgradeable is Ownable {

    event StateVerified(address indexed testTarget, address sender);
    event UpgradeFinished(address indexed target, address sender);

    /**
    * @dev Contracts at the target must reserve the same location in storage for this address as in Dispatcher
    * Stored data actually lives in the Dispatcher
    * However the storage layout is specified here in the implementing contracts
    */
    address public target;

    /**
    * @dev Previous contract address (if available). Used for rollback
    */
    address public previousTarget;

    /**
    * @dev Upgrade status. Explicit `uint8` type is used instead of `bool` to save gas by excluding 0 value
    */
    uint8 public isUpgrade;

    /**
    * @dev Guarantees that next slot will be separated from the previous
    */
    uint256 stubSlot;

    /**
    * @dev Constants for `isUpgrade` field
    */
    uint8 constant UPGRADE_FALSE = 1;
    uint8 constant UPGRADE_TRUE = 2;

    /**
    * @dev Checks that function executed while upgrading
    * Recommended to add to `verifyState` and `finishUpgrade` methods
    */
    modifier onlyWhileUpgrading()
    {
        require(isUpgrade == UPGRADE_TRUE);
        _;
    }

    /**
    * @dev Method for verifying storage state.
    * Should check that new target contract returns right storage value
    */
    function verifyState(address _testTarget) public virtual onlyWhileUpgrading {
        emit StateVerified(_testTarget, msg.sender);
    }

    /**
    * @dev Copy values from the new target to the current storage
    * @param _target New target contract address
    */
    function finishUpgrade(address _target) public virtual onlyWhileUpgrading {
        emit UpgradeFinished(_target, msg.sender);
    }

    /**
    * @dev Base method to get data
    * @param _target Target to call
    * @param _selector Method selector
    * @param _numberOfArguments Number of used arguments
    * @param _argument1 First method argument
    * @param _argument2 Second method argument
    * @return memoryAddress Address in memory where the data is located
    */
    function delegateGetData(
        address _target,
        bytes4 _selector,
        uint8 _numberOfArguments,
        bytes32 _argument1,
        bytes32 _argument2
    )
        internal returns (bytes32 memoryAddress)
    {
        assembly {
            memoryAddress := mload(0x40)
            mstore(memoryAddress, _selector)
            if gt(_numberOfArguments, 0) {
                mstore(add(memoryAddress, 0x04), _argument1)
            }
            if gt(_numberOfArguments, 1) {
                mstore(add(memoryAddress, 0x24), _argument2)
            }
            switch delegatecall(gas(), _target, memoryAddress, add(0x04, mul(0x20, _numberOfArguments)), 0, 0)
                case 0 {
                    revert(memoryAddress, 0)
                }
                default {
                    returndatacopy(memoryAddress, 0x0, returndatasize())
                }
        }
    }

    /**
    * @dev Call "getter" without parameters.
    * Result should not exceed 32 bytes
    */
    function delegateGet(address _target, bytes4 _selector)
        internal returns (uint256 result)
    {
        bytes32 memoryAddress = delegateGetData(_target, _selector, 0, 0, 0);
        assembly {
            result := mload(memoryAddress)
        }
    }

    /**
    * @dev Call "getter" with one parameter.
    * Result should not exceed 32 bytes
    */
    function delegateGet(address _target, bytes4 _selector, bytes32 _argument)
        internal returns (uint256 result)
    {
        bytes32 memoryAddress = delegateGetData(_target, _selector, 1, _argument, 0);
        assembly {
            result := mload(memoryAddress)
        }
    }

    /**
    * @dev Call "getter" with two parameters.
    * Result should not exceed 32 bytes
    */
    function delegateGet(
        address _target,
        bytes4 _selector,
        bytes32 _argument1,
        bytes32 _argument2
    )
        internal returns (uint256 result)
    {
        bytes32 memoryAddress = delegateGetData(_target, _selector, 2, _argument1, _argument2);
        assembly {
            result := mload(memoryAddress)
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract NuCypherToken","name":"_token","type":"address"},{"internalType":"uint32","name":"_hoursPerPeriod","type":"uint32"},{"internalType":"uint256","name":"_issuanceDecayCoefficient","type":"uint256"},{"internalType":"uint256","name":"_lockDurationCoefficient1","type":"uint256"},{"internalType":"uint256","name":"_lockDurationCoefficient2","type":"uint256"},{"internalType":"uint16","name":"_maximumRewardedPeriods","type":"uint16"},{"internalType":"uint256","name":"_firstPhaseTotalSupply","type":"uint256"},{"internalType":"uint256","name":"_firstPhaseMaxIssuance","type":"uint256"},{"internalType":"uint16","name":"_minLockedPeriods","type":"uint16"},{"internalType":"uint256","name":"_minAllowableLockedTokens","type":"uint256"},{"internalType":"uint256","name":"_maxAllowableLockedTokens","type":"uint256"},{"internalType":"uint16","name":"_minWorkerPeriods","type":"uint16"},{"internalType":"bool","name":"_isTestContract","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"uint16","name":"period","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CommitmentMade","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"periods","type":"uint16"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"lastPeriod","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"periods","type":"uint16"}],"name":"Divided","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Donated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reservedReward","type":"uint256"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"firstPeriod","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"periods","type":"uint16"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"value1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value2","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"lastPeriod","type":"uint16"}],"name":"Merged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"uint16","name":"period","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Minted","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":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"lastPeriod","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"periods","type":"uint16"}],"name":"Prolonged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint16","name":"lockUntilPeriod","type":"uint16"}],"name":"ReStakeLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"bool","name":"reStake","type":"bool"}],"name":"ReStakeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"penalty","type":"uint256"},{"indexed":true,"internalType":"address","name":"investigator","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"Slashed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"bool","name":"snapshotsEnabled","type":"bool"}],"name":"SnapshotSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"testTarget","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"StateVerified","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"UpgradeFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"bool","name":"windDown","type":"bool"}],"name":"WindDownSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"bool","name":"measureWork","type":"bool"}],"name":"WorkMeasurementSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"address","name":"worker","type":"address"},{"indexed":true,"internalType":"uint16","name":"startPeriod","type":"uint16"}],"name":"WorkerBonded","type":"event"},{"inputs":[],"name":"MAX_SUB_STAKES","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adjudicator","outputs":[{"internalType":"contract AdjudicatorInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"balanceHistory","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_stakers","type":"address[]"},{"internalType":"uint256[]","name":"_numberOfSubStakes","type":"uint256[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"},{"internalType":"uint16[]","name":"_periods","type":"uint16[]"}],"name":"batchDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_worker","type":"address"}],"name":"bondWorker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"commitToNextPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentMintingPeriod","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPeriodSupply","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint16","name":"_periods","type":"uint16"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"depositAndIncrease","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint16","name":"_periods","type":"uint16"}],"name":"depositFromWorkLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_newValue","type":"uint256"},{"internalType":"uint16","name":"_periods","type":"uint16"}],"name":"divideStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"donate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint16","name":"_period","type":"uint16"}],"name":"findIndexOfPastDowntime","outputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"}],"name":"finishUpgrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"firstPhaseMaxIssuance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstPhaseTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_periods","type":"uint16"},{"internalType":"uint256","name":"_startIndex","type":"uint256"},{"internalType":"uint256","name":"_maxStakers","type":"uint256"}],"name":"getActiveStakers","outputs":[{"internalType":"uint256","name":"allLockedTokens","type":"uint256"},{"internalType":"uint256[2][]","name":"activeStakers","type":"uint256[2][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getAllTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getCompletedWork","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPeriod","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getFlags","outputs":[{"internalType":"bool","name":"windDown","type":"bool"},{"internalType":"bool","name":"reStake","type":"bool"},{"internalType":"bool","name":"measureWork","type":"bool"},{"internalType":"bool","name":"snapshots","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getLastCommittedPeriod","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getLastPeriodOfSubStake","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint16","name":"_periods","type":"uint16"}],"name":"getLockedTokens","outputs":[{"internalType":"uint256","name":"lockedValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getPastDowntime","outputs":[{"internalType":"uint16","name":"startPeriod","type":"uint16"},{"internalType":"uint16","name":"endPeriod","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getPastDowntimeLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReservedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakersLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getSubStakeInfo","outputs":[{"internalType":"uint16","name":"firstPeriod","type":"uint16"},{"internalType":"uint16","name":"lastPeriod","type":"uint16"},{"internalType":"uint16","name":"periods","type":"uint16"},{"internalType":"uint128","name":"lockedValue","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getSubStakesLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getWorkerFromStaker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reservedReward","type":"uint256"},{"internalType":"address","name":"_sourceOfFunds","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"isReStakeLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTestContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isUpgrade","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint16","name":"_periods","type":"uint16"}],"name":"lockAndCreate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"lockAndIncrease","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockDurationCoefficient1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockDurationCoefficient2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_lockReStakeUntilPeriod","type":"uint16"}],"name":"lockReStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"lockedPerPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAllowableLockedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumRewardedPeriods","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index1","type":"uint256"},{"internalType":"uint256","name":"_index2","type":"uint256"}],"name":"mergeStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minAllowableLockedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minLockedPeriods","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minWorkerPeriods","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingCoefficient","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"policyManager","outputs":[{"internalType":"contract PolicyManagerInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousPeriodSupply","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousTarget","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"uint16","name":"_periods","type":"uint16"}],"name":"prolongStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"receiveApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"removeUnusedSubStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"secondsPerPeriod","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract AdjudicatorInterface","name":"_adjudicator","type":"address"}],"name":"setAdjudicator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract PolicyManagerInterface","name":"_policyManager","type":"address"}],"name":"setPolicyManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_reStake","type":"bool"}],"name":"setReStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enableSnapshots","type":"bool"}],"name":"setSnapshots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_windDown","type":"bool"}],"name":"setWindDown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract WorkLockInterface","name":"_workLock","type":"address"}],"name":"setWorkLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"bool","name":"_measureWork","type":"bool"}],"name":"setWorkMeasurement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_penalty","type":"uint256"},{"internalType":"address","name":"_investigator","type":"address"},{"internalType":"uint256","name":"_reward","type":"uint256"}],"name":"slashStaker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakerFromWorker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakerInfo","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint16","name":"currentCommittedPeriod","type":"uint16"},{"internalType":"uint16","name":"nextCommittedPeriod","type":"uint16"},{"internalType":"uint16","name":"lastCommittedPeriod","type":"uint16"},{"internalType":"uint16","name":"lockReStakeUntilPeriod","type":"uint16"},{"internalType":"uint256","name":"completedWork","type":"uint256"},{"internalType":"uint16","name":"workerStartPeriod","type":"uint16"},{"internalType":"address","name":"worker","type":"address"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"uint256","name":"reservedSlot1","type":"uint256"},{"internalType":"uint256","name":"reservedSlot2","type":"uint256"},{"internalType":"uint256","name":"reservedSlot3","type":"uint256"},{"internalType":"uint256","name":"reservedSlot4","type":"uint256"},{"internalType":"uint256","name":"reservedSlot5","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supportsHistory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"target","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract NuCypherToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blockNumber","type":"uint256"}],"name":"totalStakedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_blockNumber","type":"uint256"}],"name":"totalStakedForAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_testTarget","type":"address"}],"name":"verifyState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"workLock","outputs":[{"internalType":"contract WorkLockInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6102406040523480156200001257600080fd5b506040516200661b3803806200661b83398181016040526101a08110156200003957600080fd5b50805160208201516040808401516060850151608086015160a087015160c088015160e08901516101008a01516101208b01516101408c01516101608d0151610180909d0151600080546001600160a01b03191633178082559b519d9e9c9d9a9c999b989a97999698959794969395929491928f928f928f928f928f928f928f928f926001600160a01b039290921691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36000886001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200012b57600080fd5b505afa15801562000140573d6000803e3d6000fd5b505050506040513d60208110156200015757600080fd5b5051905080158015906200016a57508615155b80156200017c575063ffffffff881615155b80156200018857508515155b80156200019457508415155b8015620001a4575061ffff841615155b620001ae57600080fd5b6001600160801b03811115620001f65760405162461bcd60e51b815260040180806020018281038252602d81526020018062006548602d913960400191505060405180910390fd5b61ffff84168087019088870290821180156200021b5750868982816200021857fe5b04145b80156200023357508083828502816200023057fe5b04145b80156200025757508183848486870202816200024b57fe5b04816200025457fe5b04145b620002945760405162461bcd60e51b8152600401808060200182810382526023815260200180620065be6023913960400191505060405180910390fd5b86821115620002d55760405162461bcd60e51b815260040180806020018281038252603a815260200180620065e1603a913960400191505060405180910390fd5b82851115620003165760405162461bcd60e51b8152600401808060200182810382526023815260200180620065756023913960400191505060405180910390fd5b84841115620003575760405162461bcd60e51b8152600401808060200182810382526026815260200180620065986026913960400191505060405180910390fd5b60608b901b6001600160601b0319166080526200038963ffffffff8b16610e106200043b602090811b6200410c17901c565b60e090811b6001600160e01b0319166101205297909752506101009490945260f09290921b6001600160f01b03191661014052610180526101605260801b6001600160801b03191660a05260c0525050600161ffff87161190508015620003ef57508215155b620003f957600080fd5b6001600160f01b031960f095861b81166101a0526101e0949094526102009290925290921b166101c052151560f81b6102205250620004849650505050505050565b600063ffffffff831662000452575060006200047e565b82820263ffffffff80841690808616908316816200046c57fe5b0463ffffffff16146200047b57fe5b90505b92915050565b60805160601c60a05160801c60c05160e051610100516101205160e01c6101405160f01c61016051610180516101a05160f01c6101c05160f01c6101e051610200516102205160f81c615f75620005d3600039806117eb528061384f525080612371528061243352806142335250806121b1528061258f5280613681528061373d528061417f5250806135fc5280613cb452508061177f52806121dc5280612f5d52806141aa5250806117a35280615c475250806114b45280613b135280615c735280615c9b5250806124b75280615d605250806111ab52806118ba52508061409f5280615cbe5250806135bc5280615d3b5250806126ba5280615d1752508061146b5280611f9a5280613b715280615bb55280615cf452508061158c52806123f952806125d352806126185280612b425280613bb2528061401952806140c352806144475250615f756000f3fe608060405234801561001057600080fd5b506004361061048b5760003560e01c80638f32d59b11610262578063cd50f60111610151578063e38a303b116100ce578063ef95e0ba11610092578063ef95e0ba1461101d578063f14faf6f1461103e578063f2fde38b1461105b578063f6910cb814611081578063fc0c546a14611089578063fd5e6dd1146110915761048b565b8063e38a303b14610f69578063e8dccd0614610f87578063ede3842114610fad578063ee53c8fd14610fd9578063eef6e1f414610ffa5761048b565b8063d6ad945711610115578063d6ad945714610ecf578063d93886d814610ed7578063da35a26f14610efa578063dad6067614610f26578063dfee9e0d14610f4c5761048b565b8063cd50f60114610e36578063d094adbf14610e3e578063d122b79414610e64578063d2d0e06614610e91578063d4b8399214610ec75761048b565b80639fabeb00116101df578063b89f66ed116101a3578063b89f66ed14610d9e578063b9626d2114610dc5578063c2bc0ee614610deb578063c83d870814610e11578063c9c5323214610e195761048b565b80639fabeb0014610d1c578063a3ebc18214610d24578063ab3dbf3b14610d4a578063adde41e114610d52578063b2eeb36e14610d785761048b565b806393fe26d31161022657806393fe26d314610c5d5780639541c59814610c7e578063959f2bf214610c9d57806399cc218c14610cc35780639d6f2a0914610cfd5761048b565b80638f32d59b14610b495780638f4ffcb114610b515780638fa95a1514610bde578063909f7c8814610c2f57806390dcb51f14610c375761048b565b8063407f80011161037e5780636784c917116102fb5780637b3888ef116102bf5780637b3888ef14610ab1578063817ad5d314610ab957806384bed44c14610b095780638cab6c4f14610b395780638da5cb5b14610b415761048b565b80636784c9171461091f5780636b5bbc97146109275780636fb653a214610a855780637033e4a614610a8d578063715018a614610aa95761048b565b80634b2cd118116103425780634b2cd118146107cb5780634ce4dbba146107d35780634e745f1f146107ff578063521ca4da146108b357806353c2ed8e146109175761048b565b8063407f80011461069f57806341fe00a0146106c05780634789d02d146106c8578063494f994f146106f857806349e5add41461079d5761048b565b80631c7fd5321161040c5780633250843d116103d05780633250843d1461063b578063334987ab146106435780633ac5743d146106695780633ae10a1514610671578063405d220b146106795761048b565b80631c7fd532146105e2578063204612a8146106065780632d6214341461060e5780632e0abde3146106165780632e1a7d4d1461061e5761048b565b80630f64ab14116104535780630f64ab14146105525780631249c58b1461055a578063171f03c214610562578063178b6de61461059857806318160ddd146105be5761048b565b806303a944851461049057806303cfb9ed146104b157806304bcafe5146104d8578063086146d2146105105780630e3f43911461052f575b600080fd5b6104af600480360360208110156104a657600080fd5b503515156110ae565b005b6104af600480360360408110156104c757600080fd5b508035906020013561ffff16611143565b6104fe600480360360208110156104ee57600080fd5b50356001600160a01b0316611189565b60408051918252519081900360200190f35b6105186111a7565b6040805161ffff9092168252519081900360200190f35b6104af6004803603604081101561054557600080fd5b50803590602001356111de565b61051861122d565b6104af611237565b6104af6004803603606081101561057857600080fd5b5080356001600160a01b0316906020810135906040013561ffff16611391565b6104fe600480360360208110156105ae57600080fd5b50356001600160a01b031661144e565b6105c6611469565b604080516001600160801b039092168252519081900360200190f35b6105ea61148d565b604080516001600160a01b039092168252519081900360200190f35b6105c661149c565b6104fe6114b2565b6105186114d6565b6104af6004803603602081101561063457600080fd5b50356114db565b6105c66116a3565b6104af6004803603602081101561065957600080fd5b50356001600160a01b03166116b2565b61051861177d565b6104fe6117a1565b6104af6004803603602081101561068f57600080fd5b50356001600160a01b03166117c5565b6106a76118b8565b6040805163ffffffff9092168252519081900360200190f35b6104af6118dc565b6104fe600480360360408110156106de57600080fd5b5080356001600160a01b0316906020013561ffff16611b25565b6107256004803603606081101561070e57600080fd5b5061ffff8135169060208101359060400135611b92565b60405180838152602001806020018281038252838181518152602001915080516000925b8184101561078b57602080850284010151604080838360005b8381101561077a578181015183820152602001610762565b505050509050019260010192610749565b92505050935050505060405180910390f35b6104fe600480360360408110156107b357600080fd5b506001600160a01b0381351690602001351515611d55565b6105ea611e0f565b610518600480360360408110156107e957600080fd5b506001600160a01b038135169060200135611e1e565b6108256004803603602081101561081557600080fd5b50356001600160a01b0316611e7e565b604051808f81526020018e61ffff1681526020018d61ffff1681526020018c61ffff1681526020018b61ffff1681526020018a81526020018961ffff168152602001886001600160a01b031681526020018781526020018681526020018581526020018481526020018381526020018281526020019e50505050505050505050505050505060405180910390f35b6108df600480360360408110156108c957600080fd5b506001600160a01b038135169060200135611f02565b6040805161ffff9586168152938516602085015291909316828201526001600160801b03909216606082015290519081900360800190f35b6105ea611f74565b6104fe611f83565b6104af6004803603608081101561093d57600080fd5b810190602081018135600160201b81111561095757600080fd5b82018360208201111561096957600080fd5b803590602001918460208302840111600160201b8311171561098a57600080fd5b919390929091602081019035600160201b8111156109a757600080fd5b8201836020820111156109b957600080fd5b803590602001918460208302840111600160201b831117156109da57600080fd5b919390929091602081019035600160201b8111156109f757600080fd5b820183602082011115610a0957600080fd5b803590602001918460208302840111600160201b83111715610a2a57600080fd5b919390929091602081019035600160201b811115610a4757600080fd5b820183602082011115610a5957600080fd5b803590602001918460208302840111600160201b83111715610a7a57600080fd5b509092509050611fbe565b6104fe612431565b610a95612455565b604080519115158252519081900360200190f35b6104af61245a565b6105186124b5565b610adf60048036036020811015610acf57600080fd5b50356001600160a01b03166124d9565b60408051941515855292151560208501529015158383015215156060830152519081900360800190f35b6104fe60048036036040811015610b1f57600080fd5b5080356001600160a01b0316906020013561ffff1661254d565b6104fe61258d565b6105ea6125b1565b610a956125c0565b6104af60048036036080811015610b6757600080fd5b6001600160a01b038235811692602081013592604082013590921691810190608081016060820135600160201b811115610ba057600080fd5b820183602082011115610bb257600080fd5b803590602001918460018302840111600160201b83111715610bd357600080fd5b5090925090506125d1565b610c0a60048036036040811015610bf457600080fd5b506001600160a01b038135169060200135612669565b604051808361ffff1681526020018261ffff1681526020019250505060405180910390f35b6104fe6126b8565b6104fe60048036036020811015610c4d57600080fd5b50356001600160a01b03166126dc565b6104af60048036036020811015610c7357600080fd5b503561ffff166126fa565b6104af60048036036020811015610c9457600080fd5b503515156128bb565b6105ea60048036036020811015610cb357600080fd5b50356001600160a01b031661299d565b6104af60048036036080811015610cd957600080fd5b506001600160a01b03813581169160208101359160408201351690606001356129c4565b6104af60048036036020811015610d1357600080fd5b50351515612b85565b6104fe612d34565b61051860048036036020811015610d3a57600080fd5b50356001600160a01b0316612d3a565b6105ea612d91565b6104af60048036036020811015610d6857600080fd5b50356001600160a01b0316612da0565b6105ea60048036036020811015610d8e57600080fd5b50356001600160a01b0316612e6b565b6104af60048036036040811015610db457600080fd5b508035906020013561ffff16612e86565b6104af60048036036020811015610ddb57600080fd5b50356001600160a01b031661304f565b610a9560048036036020811015610e0157600080fd5b50356001600160a01b0316613580565b6104fe6135ba565b6104fe60048036036020811015610e2f57600080fd5b50356135de565b6105186135fa565b6104fe60048036036020811015610e5457600080fd5b50356001600160a01b031661361e565b6104af60048036036060811015610e7a57600080fd5b508035906020810135906040013561ffff1661363c565b6104af60048036036060811015610ea757600080fd5b5080356001600160a01b0316906020810135906040013561ffff16613830565b6105ea61383e565b610a9561384d565b6104af60048036036040811015610eed57600080fd5b5080359060200135613871565b6104af60048036036040811015610f1057600080fd5b50803590602001356001600160a01b0316613aee565b6104af60048036036020811015610f3c57600080fd5b50356001600160a01b0316613c19565b6105c660048036036020811015610f6257600080fd5b5035613e1b565b610f71613e55565b6040805160ff9092168252519081900360200190f35b6104af60048036036020811015610f9d57600080fd5b50356001600160a01b0316613e65565b6104fe60048036036040811015610fc357600080fd5b506001600160a01b038135169060200135613ecf565b6104af60048036036020811015610fef57600080fd5b503561ffff16613f04565b6104af6004803603604081101561101057600080fd5b5080359060200135613f9c565b6104fe6004803603602081101561103357600080fd5b503561ffff16613fea565b6104af6004803603602081101561105457600080fd5b5035613ffc565b6104af6004803603602081101561107157600080fd5b50356001600160a01b0316614083565b6104fe61409d565b6105ea6140c1565b6105ea600480360360208110156110a757600080fd5b50356140e5565b6110b733613580565b156110c157600080fd5b336000908152600660205260408120600481015490918315916110e391614148565b151514156110f15750611140565b6004810154611101906000614155565b6004820155604080518315158152905133917fcb9d7989e6d845ab7f3f16f57405fb85976d320aa7c3ba2705eddd52ca09154e919081900360200190a2505b50565b336000908152600660205260409020805415158061116e5750600181015462010000900461ffff1615155b61117757600080fd5b61118433601e8585614162565b505050565b6001600160a01b03166000908152600660205260409020600b015490565b60007f000000000000000000000000000000000000000000000000000000000000000063ffffffff1642816111d857fe5b04905090565b33600090815260066020526040902080541515806112095750600181015462010000900461ffff1615155b61121257600080fd5b601e831061121f57600080fd5b6111843333858560006142fa565b60055461ffff1681565b33600090815260066020526040902080541515806112625750600181015462010000900461ffff1615155b61126b57600080fd5b3360009081526006602052604081209060016112856111a7565b6001840154919003915061ffff8083166201000090920416118015906112b85750600182015462010000900461ffff1615155b156112e157600182018054600160201b61ffff620100008304160261ffff60201b199091161790555b6000806112ed33614545565b915091508161ffff166000141580611308575061ffff811615155b1561138a57600b546040805163b46ffb4560e01b815233600482015261ffff80861660248301528416604482015260006064820181905291516001600160a01b039093169263b46ffb459260848084019391929182900301818387803b15801561137157600080fd5b505af1158015611385573d6000803e3d6000fd5b505050505b5050505050565b600d546001600160a01b031633146113a857600080fd5b6001600160a01b038316600090815260066020526040902060048101546113d0906001614148565b1580156113df5750600b810154155b1561143a5760048101546113f4906001614155565b6004820155604080516001815290516001600160a01b038616917f8e551784567ec4bbce5943250eaacd5afe82aef7a9b1dab3f899881f4eae93f0919081900360200190a25b6114488433601e86866142fa565b50505050565b6001600160a01b031660009081526006602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000081565b600d546001600160a01b031681565b600454600160801b90046001600160801b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b601e81565b33600090815260066020526040902080541515806115065750600181015462010000900461ffff1615155b61150f57600080fd5b60006115196111a7565b33600090815260066020526040812091925060018301919061154f61153f838686614743565b61154a848788614743565b6147d8565b825490915061155e90826147ef565b86111561156a57600080fd5b8154869003825561157f826000889003614804565b6115b36001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163388614858565b60408051878152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a281541580156116045750600182015462010000900461ffff16155b8015611622575060038201546201000090046001600160a01b031615155b1561169b576003820180546201000090046001600160a01b031660009081526008602052604080822080546001600160a01b0319169055825462010000600160b01b031916909255905161ffff8616919033907ff8090974dcc1dfc27f6b0617a0938ed403577a94639791db59cdcc9b52b8ea1f908390a45b505050505050565b6004546001600160801b031681565b6116ba6125c0565b6116c357600080fd5b600c546001600160a01b0316156116d957600080fd5b306001600160a01b0316816001600160a01b031663e2fdcc176040518163ffffffff1660e01b815260040160206040518083038186803b15801561171c57600080fd5b505afa158015611730573d6000803e3d6000fd5b505050506040513d602081101561174657600080fd5b50516001600160a01b03161461175b57600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6117cd6125c0565b6117d657600080fd5b600d546001600160a01b0316158061180b57507f00000000000000000000000000000000000000000000000000000000000000005b61181457600080fd5b306001600160a01b0316816001600160a01b031663e2fdcc176040518163ffffffff1660e01b815260040160206040518083038186803b15801561185757600080fd5b505afa15801561186b573d6000803e3d6000fd5b505050506040513d602081101561188157600080fd5b50516001600160a01b03161461189657600080fd5b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000000081565b60055461ffff166118ec57600080fd5b336000908152600860209081526040808320546001600160a01b03168084526006909252909120805461191e57600080fd5b33321461192a57600080fd5b600061193583612d3a565b905060008061194385614545565b9150915060006119516111a7565b60018681015491925082019061ffff8083166201000090920416141561197d5750505050505050611b23565b600061198a878484614743565b90506000811161199957600080fd5b61ffff82811660008181526009602052604090208054840190556001890180546201000080820490941661ffff199091161763ffff00001916929091029190911790556119e687836148e4565b8261ffff168661ffff161015611a56576040805180820190915261ffff6001808901821683528582166020808501918252600a8c0180549384018155600090815220935193909101805491518316620100000263ffff0000199490931661ffff1990921691909117929092161790555b600b546040805163b46ffb4560e01b81526001600160a01b038b8116600483015261ffff808a1660248401528089166044840152861660648301529151919092169163b46ffb4591608480830192600092919082900301818387803b158015611abe57600080fd5b505af1158015611ad2573d6000803e3d6000fd5b505060408051848152905161ffff861693506001600160a01b038c1692507f6e826cfd4b2f0d3e70085110ff45fc6023aaa1ef2cd87f58f574aee310489ebc9181900360200190a350505050505050505b565b6001600160a01b03821660009081526006602052604081205b600a810154821015611b8a5780600a018281548110611b5957fe5b60009182526020909120015461ffff62010000909104811690841611611b7f5750611b8c565b600190910190611b3e565b505b92915050565b6000606060008561ffff1611611ba757600080fd5b600754808510611bb657600080fd5b8315801590611bc6575080848601105b15611bd057508383015b84810367ffffffffffffffff81118015611be957600080fd5b50604051908082528060200260200182016040528015611c2357816020015b611c10615e22565b815260200190600190039081611c085790505b50915060009250600080611c356111a7565b90506000611c4761ffff83168a6149ab565b9050875b84811015611d4557600060078281548110611c6257fe5b60009182526020808320909101546001600160a01b03168083526006909152604090912060018101549192509061ffff90811690861614801590611cb75750600181015461ffff868116620100009092041614155b15611cc3575050611d3d565b6000611cd0828787614743565b90508015611d3957826001600160a01b0316898881518110611cee57fe5b6020026020010151600060028110611d0257fe5b60200201528851600188019782918b91908110611d1b57fe5b6020026020010151600160028110611d2f57fe5b6020020152988901985b5050505b600101611c4b565b5082855250505050935093915050565b600d546000906001600160a01b03163314611d6f57600080fd5b6001600160a01b0383166000908152600660205260409020600481015483151590611d9b906002614148565b15151415611dae57600201549050611b8c565b6004810154611dbe906002614155565b600482015560408051841515815290516001600160a01b038616917fdc3bbcef212790ff00528dc9ef9c9b7638f290efd77f50f50c067bb14d7f9c11919081900360200190a2600201549392505050565b6002546001600160a01b031681565b6001600160a01b0382166000908152600660205260408120600b8101805483919085908110611e4957fe5b9060005260206000200190506000611e6883611e636111a7565b6149c1565b9050611e748282614a05565b9695505050505050565b60066020819052600091825260409091208054600182015460028301546003840154600485015460058601549686015460078701546008880154600990980154969861ffff8088169962010000808a0483169a600160201b8b0484169a600160301b900484169998938416976001600160a01b03929094049190911695929491908e565b6001600160a01b0382166000908152600660205260408120600b018054829182918291829187908110611f3157fe5b60009182526020909120015461ffff8082169962010000830482169950600160201b83049091169750600160301b9091046001600160801b031695509350505050565b600c546001600160a01b031681565b6004546001600160801b03600160801b90910481167f0000000000000000000000000000000000000000000000000000000000000000031690565b828715801590611fcd57508786145b8015611fd95750878110155b8015611fe457508181145b611fed57600080fd5b60006001611ff96111a7565b03905060028101600080805b8c8110156123bb5760008e8e8381811061201b57fe5b905060200201356001600160a01b0316905060008d8d8481811061203b57fe5b602002919091013591505083810181158015906120585750808910155b61206157600080fd5b6001600160a01b0383166000908152600660205260409020600b81015415801561209857506004810154612096906003614148565b155b6120a157600080fd5b6001600160a01b0384811660009081526008602052604090205416156120c657600080fd5b6007805460018101825560009182527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319166001600160a01b03878116918217909255600b54604080516372be8d8d60e01b8152600481019390935261ffff8e166024840152519216926372be8d8d9260448084019382900301818387803b15801561215c57600080fd5b505af1158015612170573d6000803e3d6000fd5b505050505b8186101561236d5760008e8e8881811061218b57fe5b90506020020135905060008d8d898181106121a257fe5b9050602002013561ffff1690507f0000000000000000000000000000000000000000000000000000000000000000821015801561220757507f000000000000000000000000000000000000000000000000000000000000000061ffff168161ffff1610155b61221057600080fd5b825461221c9083614a57565b83556040805160808101825261ffff808d168252600060208084018281528684169585019586526001600160801b0380891660608701908152600b8b018054600181018255908652939094209551959092018054915196519351909216600160301b02600160301b600160b01b0319938516600160201b0261ffff60201b19978616620100000263ffff0000199790961661ffff199093169290921795909516939093179490941691909117161790556122d68983614a57565b6040805184815261ffff841660208201528151929b506001600160a01b038916927feef72c2775e4e59d04b76fe99649c70b0101dbc951ce46a5a6262a6cbc138e90929181900390910190a26040805183815261ffff808d16602083015283168183015290516001600160a01b03881691600080516020615f20833981519152919081900360600190a25050600190950194612175565b80547f0000000000000000000000000000000000000000000000000000000000000000101561239b57600080fd5b80546123ab90600c830190614a69565b5050600190920191506120059050565b508481146123c857600080fd5b60006123d4600a614a74565b6001600160601b031690506123ec600a848301614a69565b6124216001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086614a88565b5050505050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600190565b6124626125c0565b61246b57600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b0381166000908152600660205260408120600481015482918291829190612508906001614148565b600482015490955061251b906000614148565b60048201549015945061252f906002614148565b6004820154909350612542906003614148565b159150509193509193565b6001600160a01b03821660009081526006602052604081208161256e6111a7565b9050600061258061ffff8316866149ab565b9050611e74838383614743565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614801561263a5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b61264357600080fd5b60843560a43560086020839003021c6126608780601e89856142fa565b50505050505050565b6001600160a01b0382166000908152600660205260408120600a018054829182918590811061269457fe5b60009182526020909120015461ffff80821697620100009092041695509350505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b03166000908152600660205260409020600a015490565b33600090815260066020526040902080541515806127255750600181015462010000900461ffff1615155b61272e57600080fd5b336000908152600660205260408120600b81018054919260001983019290919061ffff871690811061275c57fe5b6000918252602090912001805490915062010000900461ffff16158015906127a85750600183015461ffff1615806127a857506001830154815461ffff91821662010000909104909116105b80156127e05750600183015462010000900461ffff1615806127e057506001830154815461ffff620100009283900481169290910416105b6127e957600080fd5b818561ffff161461288557600083600b01838154811061280557fe5b60009182526020909120018054835461ffff191661ffff918216178085558254620100009081900483160263ffff000019909116178085558254600160201b9081900490921690910261ffff60201b199091161780845590546001600160801b03600160301b918290041602600160301b600160b01b0319909116178255505b82600b0180548061289257fe5b600082815260209020810160001990810180546001600160b01b03191690550190555050505050565b33600090815260066020526040902060048101548215906128dd906003614148565b151514156128eb5750611140565b60006128f7600a614a74565b6001600160601b03169050821561292d57815461291890600c840190614a69565b815461292890600a908301614a69565b61294b565b61293b600c83016000614a69565b815461294b90600a908303614a69565b600482015461295b906003614155565b6004830155604080518415158152905133917f99113baa33c79a0d2753e314c495bcb33035f538edc07d4058823f431514cdae919081900360200190a2505050565b6001600160a01b039081166000908152600660205260409020600301546201000090041690565b60055461ffff166129d457600080fd5b600c546001600160a01b031633146129eb57600080fd5b600083116129f857600080fd5b6001600160a01b038416600090815260066020526040902080548410612a1d57805493505b8054849003815583821115612a30578391505b6000612a3a6111a7565b9050600181016000612a4c84846149c1565b9050600080600080612a6088888888614b25565b8b549397509195509350915084830190811115612a8a57612a8a898a6000015483038a8986614cc3565b8315612ac95788548311612a9f576000612aa4565b885483035b8385010390508089600001541015612ac9578854612ac9908a9083038989601e614cc3565b8a6001600160a01b03168d6001600160a01b03167f34040fa1c0549c8572589c39cb87ff7638286467446a4790971d58d931c654bb8e8d604051808381526020018281526020019250505060405180910390a3898c1115612b2f57612b2f8a8d03614ea1565b8915612b6957612b696001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168c8c614858565b612b76898d600003614804565b50505050505050505050505050565b336000908152600660205260409020600481015482151590612ba8906001614148565b15151415612bb65750611140565b6004810154612bc6906001614155565b6004820155604080518315158152905133917f8e551784567ec4bbce5943250eaacd5afe82aef7a9b1dab3f899881f4eae93f0919081900360200190a26000612c0d6111a7565b6001838101549101915061ffff808316620100009092041614612c31575050611140565b60005b600b83015481101561144857600083600b018281548110612c5157fe5b90600052602060002001905084158015612c785750805461ffff8481166201000090920416145b15612c9557805465ffffffff00001916600160201b179055612d2c565b805462010000900461ffff16151580612cb857508054600160201b900461ffff16155b15612cc35750612d2c565b84612cdd578054600160201b900461ffff16600101612cef565b8054600160201b900461ffff16600019015b815461ffff60201b1916600160201b61ffff9283168102919091178084550416612d2a57805463ffff000019166201000061ffff8516021781555b505b600101612c34565b60075490565b6001600160a01b0381166000908152600660205260408120600181015462010000900461ffff16612d7a576001810154600160201b900461ffff16612d8a565b600181015462010000900461ffff165b9392505050565b600b546001600160a01b031681565b612da86125c0565b612db157600080fd5b600b546001600160a01b031615612dc757600080fd5b306001600160a01b0316816001600160a01b031663e2fdcc176040518163ffffffff1660e01b815260040160206040518083038186803b158015612e0a57600080fd5b505afa158015612e1e573d6000803e3d6000fd5b505050506040513d6020811015612e3457600080fd5b50516001600160a01b031614612e4957600080fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6008602052600090815260409020546001600160a01b031681565b3360009081526006602052604090208054151580612eb15750600181015462010000900461ffff1615155b612eba57600080fd5b33600090815260066020526040902061ffff8316612ed757600080fd5b600081600b018581548110612ee857fe5b9060005260206000200190506000612efe6111a7565b9050600080612f0e858585614edf565b85549193509150612f2a90600160201b900461ffff16886149ab565b845461ffff60201b1916600160201b61ffff928316021785558281169082161415612f5b57835463ffff0000191684555b7f000000000000000000000000000000000000000000000000000000000000000061ffff168761ffff1684830361ffff160163ffffffff161015612f9e57600080fd5b8354604080516001600160801b03600160301b90930492909216825261ffff6001840181166020840152891682820152513391600080516020615f20833981519152919081900360600190a28354604080516001600160801b03600160301b90930492909216825261ffff80841660208401528916828201525133917f4a8002cb7d215ff46c882055a756942e088f67744d92308f58cd701109e9273b919081900360600190a25050505050505050565b61305881614f16565b600b546001600160a01b03166130758263ab3dbf3b60e01b614fac565b6001600160a01b03161461308857600080fd5b600c546001600160a01b03166130a5826329e176c760e11b614fac565b6001600160a01b0316146130b857600080fd5b600d546001600160a01b03166130d582630e3fea9960e11b614fac565b6001600160a01b0316146130e857600080fd5b600080805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b54906131299083906377caf05d60e11b90614fc5565b1461313357600080fd5b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7546001600160a01b03169061317d90839063597759b760e11b90614fc5565b6001600160a01b03161461319057600080fd5b6007546131a382629fabeb60e81b614fac565b146131ad57600080fd5b6007546131b957611140565b600060076000815481106131c957fe5b60009182526020822001546001600160a01b0316915081906131f590849063fd5e6dd160e01b90614fc5565b6001600160a01b03161461320857600080fd5b6001600160a01b038116600081815260066020526040902090613229615e40565b6132338583614fe0565b8354815191925014801561325657506001830154602082015161ffff9081169116145b801561327757506001830154604082015161ffff9081166201000090920416145b801561328b57508260040154816101000151145b80156132ad57506001830154608082015161ffff908116600160301b90920416145b80156132cf57506001830154606082015161ffff908116600160201b90920416145b80156132e2575082600201548160a00151145b80156133085750600383015460e08201516001600160a01b039081166201000090920416145b80156133235750600383015460c082015161ffff9081169116145b61332c57600080fd5b600a830154613343866390dcb51f60e01b85614fc5565b1461334d57600080fd5b60005b600a840154811080156133635750600581105b156133d957600084600a01828154811061337957fe5b90600052602060002001905061338d615ee1565b613398888685614fff565b8254815191925061ffff91821691161480156133c657508154602082015161ffff9081166201000090920416145b6133cf57600080fd5b5050600101613350565b50600b8301546133f1866304bcafe560e01b85614fc5565b146133fb57600080fd5b60005b600b840154811080156134115750600581105b156134ca57600084600b01828154811061342757fe5b90600052602060002001905061343b615ef8565b613446888685615027565b8254815191925061ffff918216911614801561347457508154602082015161ffff9081166201000090920416145b801561349357508154604082015161ffff908116600160201b90920416145b80156134b75750815460608201516001600160801b03908116600160301b90920416145b6134c057600080fd5b50506001016133fe565b506134d58443613ecf565b6134e88663ede3842160e01b8543615046565b146134f257600080fd5b6134fb436135de565b61350d866364e2991960e11b43614fc5565b1461351757600080fd5b60038301546201000090046001600160a01b03161561138a5760038301546001600160a01b036201000090910481166000818152600860205260409020549091169061356d90879063597759b760e11b90614fc5565b6001600160a01b03161461138a57600080fd5b6001600160a01b038116600090815260066020526040812060010154600160301b900461ffff166135af6111a7565b61ffff161092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006135eb600a83615062565b6001600160601b031692915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b031660009081526006602052604090206002015490565b33600090815260066020526040902080541515806136675750600181015462010000900461ffff1615155b61367057600080fd5b3360009081526006602052604090207f000000000000000000000000000000000000000000000000000000000000000084108015906136b3575060008361ffff16115b6136bc57600080fd5b600081600b0186815481106136cd57fe5b90600052602060002001905060006136e36111a7565b905060006136f2848484614edf565b8454909250600160301b90046001600160801b0316905061371381896147ef565b8454600160301b600160b01b031916600160301b6001600160801b039283168102919091178087557f0000000000000000000000000000000000000000000000000000000000000000919004909116101561376d57600080fd5b835460009061378790600160201b900461ffff16896149ab565b855490915061379f90879061ffff166000848d6151cb565b6040805183815261ffff80861660208301528183018c90528a166060820152905133917f3a1fb040a51f7112d001cd86cbb247fc8b9694d0ad1c5d3583b76cd7a9c43f75919081900360800190a28454604080518b815261ffff928316602082015291831682820152513391600080516020615f20833981519152919081900360600190a250505050505050505050565b6111848333601e85856142fa565b6001546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b336000908152600660205260409020805415158061389c5750600181015462010000900461ffff1615155b6138a557600080fd5b818314156138b257600080fd5b336000908152600660205260408120600b81018054919291869081106138d457fe5b906000526020600020019050600082600b0185815481106138f157fe5b90600052602060002001905060006139076111a7565b90506000613916858584614edf565b9150506000613926868585614edf565b9150508061ffff168261ffff161461393d57600080fd5b84548454604080516001600160801b03600160301b948590048116825293909204909216602082015261ffff841681830152905133917ff0ae9078263964c285b59932f650d10fd02e6e9a583146c22b746ec1d36d3e36919081900360600190a28354855461ffff90811691161415613a085783548554600160301b8082046001600160801b0390811693829004811693909301909216909102600160301b600160b01b0319909116178555835461ffff60201b1963ffff0000199091166201000017168455611385565b8354855461ffff91821691161115613a815783548554600160301b8082046001600160801b0390811693829004811693909301909216909102600160301b600160b01b031990911617808655845461ffff60201b1960001961ffff93841601909216620100000263ffff00001990911617168455611385565b84548454600160301b8082046001600160801b0390811693829004811693909301909216909102600160301b600160b01b031990911617808555855461ffff60201b1960001961ffff93841601909216620100000263ffff00001990911617168555505050505050505050565b613af66125c0565b613aff57600080fd5b60055461ffff1615613b1057600080fd5b817f00000000000000000000000000000000000000000000000000000000000000001115613b3d57600080fd5b613b456111a7565b6005805461ffff191661ffff9290921691909117905560048054600160801b6001600160801b039182167f000000000000000000000000000000000000000000000000000000000000000086900383168202179081049091166001600160801b0319909116179055613be27f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316823085614a88565b6040805183815290517fbe9b076dc5b65990cca9dd9d7366682482e7817a6f6bc7f4faf4dc32af497f329181900360200190a15050565b3360009081526006602052604090208054151580613c445750600181015462010000900461ffff1615155b613c4d57600080fd5b33600090815260066020526040902060038101546001600160a01b0384811662010000909204161415613c7f57600080fd5b6000613c896111a7565b60038301549091506201000090046001600160a01b031615613d1d576003820154613cd89061ffff167f00000000000000000000000000000000000000000000000000000000000000006149ab565b61ffff168161ffff161015613cec57600080fd5b60038201546201000090046001600160a01b0316600090815260086020526040902080546001600160a01b03191690555b6001600160a01b03841615613db3576001600160a01b038481166000908152600860205260409020541615613d5157600080fd5b6001600160a01b0384166000908152600660205260409020600b01541580613d8157506001600160a01b03841633145b613d8a57600080fd5b6001600160a01b038416600090815260086020526040902080546001600160a01b031916331790555b60038201805461ffff831661ffff196001600160a01b03881662010000810262010000600160b01b03199094169390931716811790925560405133907ff8090974dcc1dfc27f6b0617a0938ed403577a94639791db59cdcc9b52b8ea1f90600090a450505050565b600a8181548110613e2857fe5b9060005260206000209060029182820401919006601002915054906101000a90046001600160801b031681565b600254600160a01b900460ff1681565b613e6e816153a2565b5060008052606f7fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b5560086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c780546001600160a01b03191630179055565b6001600160a01b0382166000908152600660205260408120613ef490600c0183615062565b6001600160601b03169392505050565b613f0d33613580565b158015613f285750613f1d6111a7565b61ffff168161ffff16115b613f3157600080fd5b33600081815260066020908152604091829020600101805467ffff0000000000001916600160301b61ffff871690810291909117909155825190815291517f290a5b657c05aec4c02fb52b21644f6470bb4c6d37831f2295c247452a2074899281900390910190a250565b3360009081526006602052604090208054151580613fc75750600181015462010000900461ffff1615155b613fd057600080fd5b601e8310613fdd57600080fd5b6111843384846000614162565b60096020526000908152604090205481565b60055461ffff1661400c57600080fd5b6140416001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084614a88565b61404a81614ea1565b60408051828152905133917f2a01595cddf097c90216094025db714da3f4e5bd8877b56ba86a24ecead8e543919081900360200190a250565b61408b6125c0565b61409457600080fd5b611140816153fc565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600781815481106140f257fe5b6000918252602090912001546001600160a01b0316905081565b600063ffffffff831661412157506000611b8c565b82820263ffffffff808416908086169083168161413a57fe5b0463ffffffff1614612d8a57fe5b60ff161c60019081161490565b600160ff919091161b1890565b601e83101561417d576000821161417857600080fd5b6141de565b7f000000000000000000000000000000000000000000000000000000000000000082101580156141d557507f000000000000000000000000000000000000000000000000000000000000000061ffff168161ffff1610155b6141de57600080fd5b60006141e86111a7565b6001600160a01b0386166000908152600660205260408120919250600183019190614214828585614743565b905060006142228783614a57565b8354909150811180159061425657507f00000000000000000000000000000000000000000000000000000000000000008111155b61425f57600080fd5b600183015461ffff858116620100009092041614156142d15761ffff841660008181526009602090815260409182902080548b01905581518a815291516001600160a01b038d16927f6e826cfd4b2f0d3e70085110ff45fc6023aaa1ef2cd87f58f574aee310489ebc92908290030190a35b601e8810156142ed576142e88386868c8c8c61546a565b611385565b61138583858b8a8a6155a1565b8161430457600080fd5b6001600160a01b038086166000908152600660209081526040808320600890925290912054909116158061435e575060038101546001600160a01b0387811660009081526008602052604090205481166201000090920416145b61436757600080fd5b600b81015461443a5760078054600180820183556000929092527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319166001600160a01b0389811691909117909155600b5416906372be8d8d9088906143d66111a7565b036040518363ffffffff1660e01b815260040180836001600160a01b031681526020018261ffff16815260200192505050600060405180830381600087803b15801561442157600080fd5b505af1158015614435573d6000803e3d6000fd5b505050505b61446f6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016863086614a88565b80548301815561448186858585614162565b61448b8184614804565b601e84106144de576040805184815261ffff8416602082015281516001600160a01b038916927feef72c2775e4e59d04b76fe99649c70b0101dbc951ce46a5a6262a6cbc138e90928290030190a261169b565b60006144ea8786611e1e565b9050866001600160a01b03167feef72c2775e4e59d04b76fe99649c70b0101dbc951ce46a5a6262a6cbc138e90856145206111a7565b6040805192835290850361ffff1660208301528051918290030190a250505050505050565b60008060006145526111a7565b6001600160a01b0385166000908152600660205260409020600181015491925060001983019162010000900461ffff1615806145af5750600181015461ffff161580156145af5750600181015461ffff8084166201000090920416115b806145c45750600181015461ffff8084169116115b156145d8576000809450945050505061473e565b60006145e482856149c1565b90506000806146016000856004015461414890919063ffffffff16565b60018501549015915061ffff161561466b57600184015461462a90859061ffff1688868561562c565b60018501805461ffff19811690915561ffff1698509150801561466b57600184015462010000900461ffff1660009081526009602052604090208054830190555b600184015461ffff8087166201000090920416116146c35760018401546146a090859062010000900461ffff1688868561562c565b60018501805463ffff000019811690915561ffff62010000909104169750909101905b83548201845560048401546146d9906002614148565b156146e957600284018054830190555b6146f38483614804565b60408051838152905161ffff8716916001600160a01b038c16917f262ab020cb638b76c90ba54ebb8ec0a4ff4412b8d6777f1edc4c23d6644a88cd9181900360200190a35050505050505b915091565b60008061475085856149c1565b905060005b600b8601548110156147cf57600086600b01828154811061477257fe5b6000918252602090912001805490915061ffff8087169116118015906147a957508461ffff166147a28285614a05565b61ffff1610155b156147c6578054600160301b90046001600160801b031693909301925b50600101614755565b50509392505050565b6000818310156147e85781612d8a565b5090919050565b6000828211156147fe57600080fd5b50900390565b6004820154614814906003614148565b61485457815461482890600c840190614a69565b6000614834600a614a74565b6001600160601b0316905061118461484c828461571f565b600a90614a69565b5050565b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156148af57600080fd5b505af11580156148c3573d6000803e3d6000fd5b505050506040513d60208110156148d957600080fd5b505161118457600080fd5b60048201546148f4906001614148565b6148fd57614854565b60005b600b83015481101561118457600083600b01828154811061491d57fe5b6000918252602090912001805490915062010000900461ffff1615158061494e57508054600160201b900461ffff16155b1561495957506149a3565b805460001961ffff600160201b8084048216929092018116820261ffff60201b199093169290921780845504166149a157805463ffff000019166201000061ffff8516021781555b505b600101614900565b600082820161ffff8085169082161015612d8a57fe5b60048201546000906149d4906001614148565b80156149f05750600183015461ffff8084166201000090920416115b156149ff575060018101611b8c565b50919050565b815460009062010000900461ffff1615614a2b5750815462010000900461ffff16611b8c565b8254600160201b900461ffff908116838216019063ffffffff82161115612d8a5761ffff915050611b8c565b600082820183811015612d8a57600080fd5b614854824383615747565b600080614a808361583e565b949350505050565b836001600160a01b03166323b872dd8484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b158015614af057600080fd5b505af1158015614b04573d6000803e3d6000fd5b505050506040513d6020811015614b1a57600080fd5b505161144857600080fd5b60008080601e61ffff80835b600b8b0154811015614cb55760008b600b018281548110614b4e57fe5b9060005260206000200190506000614b66828b614a05565b825490915061ffff9081169082161015614b81575050614cad565b815461ffff808e16911611801590614ba157508a61ffff168161ffff1610155b15614bc2578154600160301b90046001600160801b03169690960195614c40565b815461ffff808e16911611801590614be257508b61ffff168161ffff1610155b15614c03578154600160301b90046001600160801b03169890980197614c40565b815461ffff808d16911611801590614c2357508a61ffff168161ffff1610155b15614c40578154600160301b90046001600160801b031697909701965b815461ffff908116808303918e1610801590614c6457508c61ffff168261ffff1610155b8015614c9a57508461ffff168261ffff161080614c9a57508461ffff168261ffff16148015614c9a57508561ffff168161ffff16105b15614ca9578396508095508194505b5050505b600101614b31565b505050945094509450949050565b600085600b01600081548110614cd557fe5b6000918252602090912001905061ffff805b8615614e9757601e841015614d315787600b018481548110614d0557fe5b906000526020600020019250614d1b8386614a05565b8354601e955090925061ffff1682039050614d45565b614d3c888787615873565b91945090925090505b61ffff8181161415614d5657614e97565b82548790600160301b90046001600160801b0316811015614db95783546001600160801b03600160301b80830482168b900390911602600160301b600160b01b031990911617808555614db0908a9061ffff168a8a61594a565b60009750614deb565b50825463ffff0000191662010000600019880161ffff160217808455600160301b90046001600160801b031696879003965b600189015461ffff808916911610801590614e115750600189015461ffff808516911611155b15614e3557600189015461ffff166000908152600960205260409020805482900390555b600189015461ffff808916620100009092041610801590614e675750600189015461ffff808516620100009092041611155b15614e9157600189015462010000900461ffff166000908152600960205260409020805482900390555b50614ce7565b5050505050505050565b600480546001600160801b031981166001600160801b03918216849003821617808216600160801b9182900483169490940390911602919091179055565b600080614eec85846149c1565b9150614ef88483614a05565b90508261ffff168161ffff1611614f0e57600080fd5b935093915050565b614f1f81615aeb565b60055461ffff16614f37826303d92ac560e21b614fac565b61ffff1614614f4557600080fd5b6004546001600160801b0316614f6282633250843d60e01b614fac565b6001600160801b031614614f7557600080fd5b600454600160801b90046001600160801b0316614f9982630408c25560e31b614fac565b6001600160801b03161461114057600080fd5b600080614fbc8484838080615b45565b51949350505050565b600080614fd6858560018685615b45565b5195945050505050565b614fe8615e40565b6000614a8084634e745f1f60e01b60018685615b45565b615007615ee1565b600061501e85638fa95a1560e01b60028787615b45565b95945050505050565b61502f615ef8565b600061501e8563290e526d60e11b60028787615b45565b600080615057868660028787615b45565b519695505050505050565b815460009082908061507957600092505050611b8c565b60006001820390506000806150c488600186038154811061509657fe5b90600052602060002090600291828204019190066010029054906101000a90046001600160801b0316615b8b565b915091508163ffffffff168563ffffffff16106150e7579450611b8c9350505050565b6150f78860008154811061509657fe5b9092509050600184148061511657508163ffffffff168563ffffffff16105b1561512957600095505050505050611b8c565b6000600019840181805b838311156151ab57600060026001858701010490506151578d828154811061509657fe5b909350915063ffffffff808416908b161115615175578094506151a5565b8263ffffffff168a63ffffffff161015615194576001810393506151a5565b509850611b8c975050505050505050565b50615133565b6151ba8c858154811061509657fe5b9d9c50505050505050505050505050565b60005b600b8601548110156152d957600086600b0182815481106151eb57fe5b6000918252602090912001805490915062010000900461ffff16158015906152375750600187015461ffff16158061523757506001870154815461ffff91821662010000909104909116105b801561526f5750600187015462010000900461ffff16158061526f57506001870154815461ffff620100009283900481169290910416105b156152d057805461ffff191661ffff8781169190911763ffff0000191662010000878316021761ffff60201b1916600160201b9186169190910217600160301b600160b01b031916600160301b6001600160801b038516021790555061138a565b506001016151ce565b50600b850154601e116152eb57600080fd5b6040805160808101825261ffff808716825285811660208084019182528683169484019485526001600160801b0380871660608601908152600b8c01805460018101825560009182529390209551959092018054935196519251909116600160301b02600160301b600160b01b0319928516600160201b0261ffff60201b19978616620100000263ffff0000199790961661ffff199095169490941795909516939093179490941617929092161790555050505050565b60028054600160a01b900460ff16146153ba57600080fd5b6040805133815290516001600160a01b038316917fd55ec27c5c6316913ed8803c18cfd1bfefea953db909dcba6140744a9d8b0d1f919081900360200190a250565b6001600160a01b03811661540f57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600086600b01838154811061547b57fe5b9060005260206000200190506000615494888389614edf565b60018a015490925061ffff1615801591506154ba5750600188015461ffff808916911611155b806154ee5750600188015462010000900461ffff16158015906154ee5750600188015461ffff808916620100009092041611155b1561551b57815461551b90899061ffff8116908a90600090600160301b90046001600160801b03166151cb565b8154600160301b600160b01b03198116600160301b918290046001600160801b039081168601169091021761ffff191661ffff878116918217845560408051868152602081019390935289840390911682820152516001600160a01b03871691600080516020615f20833981519152916060918190039190910190a25050505050505050565b6001850154819061ffff86811662010000909204161480156155ce575060048601546155ce906001614148565b156155d857600019015b6155e68686600084876151cb565b6040805184815261ffff808816602083015284168183015290516001600160a01b03861691600080516020615f20833981519152919081900360600190a2505050505050565b6000805b600b87015481101561571557600087600b01828154811061564d57fe5b90600052602060002001905060006156658287614a05565b825490915061ffff808a1691161180159061568857508761ffff168161ffff1610155b1561570b57815461ffff89811660009081526009602052604081205490926156d0928b92600160301b9092046001600160801b031691906156cb9087168e615b99565b615bad565b94850194905085156157095782546001600160801b03600160301b8083048216840190911602600160301b600160b01b03199091161783555b505b5050600101615630565b5095945050505050565b6000808212615739576157328383614a57565b9050611b8c565b6157328360008490036147ef565b825480156157ee57600061576385600184038154811061509657fe5b5090508063ffffffff168463ffffffff1614156157d3576157848484615def565b85600184038154811061579357fe5b90600052602060002090600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b031602179055505050611184565b8063ffffffff168463ffffffff1610156157ec57600080fd5b505b836157f98484615def565b81546001818101845560009384526020909320600282040180546001600160801b03938416601093909516929092026101000a93840292909302191617905550505050565b8054600090819080156158675761585d84600183038154811061509657fe5b925092505061473e565b50600093849350915050565b600061ffff80825b600b87015481101561594057600087600b01828154811061589857fe5b90600052602060002001905060006158b08288614a05565b825490915061ffff90811690821610156158cb575050615938565b815461ffff908116808303918a16108015906158ef57508861ffff168261ffff1610155b801561592557508461ffff168261ffff16108061592557508461ffff168261ffff1614801561592557508561ffff168161ffff16105b15615934578296508095508194505b5050505b60010161587b565b5093509350939050565b600184015460009061ffff161580159061596e5750600185015461ffff8084169116105b600186015490915060009062010000900461ffff16158015906159a15750600186015461ffff8085166201000090920416105b905060008280156159bd5750600187015461ffff808816911610155b905060008280156159df5750600188015461ffff808916620100009092041610155b9050811580156159ed575080155b156159fb5750505050611448565b600019850160005b600b8a0154811015615adc5760008a600b018281548110615a2057fe5b6000918252602090912001805490915061ffff8481166201000090920416148015615a965750868015615a605750805460018c015461ffff918216911610155b1515851515148015615a965750858015615a8f5750805460018c015461ffff9182166201000090910490911610155b1515841515145b15615ad35780546001600160801b03600160301b80830482168c0190911602600160301b600160b01b031990911617905550611448945050505050565b50600101615a03565b5061138589898360008b6151cb565b60028054600160a01b900460ff1614615b0357600080fd5b6040805133815290516001600160a01b038316917f1e8d98c1b4a0d9bd2e2371026b632eb2773fcce41742e41f02f574ab69868d4c919081900360200190a250565b6040518481528315615b58578260048201525b6001841115615b68578160248201525b6000808560200260040183895af48015615b86573d6000833e615715565b600082fd5b63ffffffff606082901c1691565b60008261ffff168261ffff1611156147fe57fe5b6004546000907f00000000000000000000000000000000000000000000000000000000000000006001600160801b03908116600160801b909204161415615bf657506000614a80565b60055461ffff9081169086161115615c3d5760048054600160801b81046001600160801b03166001600160801b03199091161790556005805461ffff191661ffff87161790555b60045460009081907f00000000000000000000000000000000000000000000000000000000000000006001600160801b039091167f00000000000000000000000000000000000000000000000000000000000000000111615ce257507f000000000000000000000000000000000000000000000000000000000000000090507f0000000000000000000000000000000000000000000000000000000000000000615d37565b50506004546001600160801b039081167f000000000000000000000000000000000000000000000000000000000000000003167f00000000000000000000000000000000000000000000000000000000000000005b60007f0000000000000000000000000000000000000000000000000000000000000000615d84867f0000000000000000000000000000000000000000000000000000000000000000615e0b565b61ffff16019050818602818885020281615d9a57fe5b0493506000615da7611f83565b905084615db75760019450615dc3565b80851115615dc3578094505b5050600480546001600160801b03600160801b8083048216870182160291161790555050949350505050565b6001600160601b031660609190911b63ffffffff60601b161790565b60008161ffff168361ffff16106147e85781612d8a565b60405180604001604052806002906020820280368337509192915050565b60405180610220016040528060008152602001600061ffff168152602001600061ffff168152602001600061ffff168152602001600061ffff16815260200160008152602001600061ffff16815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016060815260200160608152602001606081525090565b604080518082019091526000808252602082015290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe5c82b27ca454d536b55df10a5a7cbf8ceab76ccf7d614a04668ee4990c872638a26469706673582212205af8317972ec65416224a84d62b1c62eafe441b073d4d63e3171cd287104955764736f6c63430007030033546f6b656e20636f6e74726163742068617320737570706c79206d6f7265207468616e20737570706f72746564546f6f206d616e7920746f6b656e7320666f722074686520666972737420706861736552657761726420666f722074686520666972737420706861736520697320746f6f206869676853706563696669656420706172616d6574657273206361757365206f766572666c6f77526573756c74696e67206c6f636b696e67206475726174696f6e20636f656666696369656e74206d757374206265206c657373207468616e20310000000000000000000000004fe83213d56308330ec302a8bd641f1d0113a4cc0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000041d000000000000000000000000000000000000000000000000000000000000016d00000000000000000000000000000000000000000000000000000000000002da000000000000000000000000000000000000000000000000000000000000016d0000000000000000000000000000000000000000092492d451ad95edc960000000000000000000000000000000000000000000000000d44a25d4c6c7b4efc7e3000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000032d26d12e980b60000000000000000000000000000000000000000000000018d0bf423c03d8de00000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000

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

0000000000000000000000004fe83213d56308330ec302a8bd641f1d0113a4cc0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000041d000000000000000000000000000000000000000000000000000000000000016d00000000000000000000000000000000000000000000000000000000000002da000000000000000000000000000000000000000000000000000000000000016d0000000000000000000000000000000000000000092492d451ad95edc960000000000000000000000000000000000000000000000000d44a25d4c6c7b4efc7e3000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000032d26d12e980b60000000000000000000000000000000000000000000000018d0bf423c03d8de00000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _token (address): 0x4fe83213d56308330ec302a8bd641f1d0113a4cc
Arg [1] : _hoursPerPeriod (uint32): 24
Arg [2] : _issuanceDecayCoefficient (uint256): 1053
Arg [3] : _lockDurationCoefficient1 (uint256): 365
Arg [4] : _lockDurationCoefficient2 (uint256): 730
Arg [5] : _maximumRewardedPeriods (uint16): 365
Arg [6] : _firstPhaseTotalSupply (uint256): 2829579800000000000000000000
Arg [7] : _firstPhaseMaxIssuance (uint256): 1002509479452054794520547
Arg [8] : _minLockedPeriods (uint16): 30
Arg [9] : _minAllowableLockedTokens (uint256): 15000000000000000000000
Arg [10] : _maxAllowableLockedTokens (uint256): 30000000000000000000000000
Arg [11] : _minWorkerPeriods (uint16): 2
Arg [12] : _isTestContract (bool): False

-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000004fe83213d56308330ec302a8bd641f1d0113a4cc
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000018
Arg [2] : 000000000000000000000000000000000000000000000000000000000000041d
Arg [3] : 000000000000000000000000000000000000000000000000000000000000016d
Arg [4] : 00000000000000000000000000000000000000000000000000000000000002da
Arg [5] : 000000000000000000000000000000000000000000000000000000000000016d
Arg [6] : 0000000000000000000000000000000000000000092492d451ad95edc9600000
Arg [7] : 00000000000000000000000000000000000000000000d44a25d4c6c7b4efc7e3
Arg [8] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [9] : 00000000000000000000000000000000000000000000032d26d12e980b600000
Arg [10] : 00000000000000000000000000000000000000000018d0bf423c03d8de000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000000


Deployed ByteCode Sourcemap

972:68712:13:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19931:372;;;;;;;;;;;;;;;;-1:-1:-1;19931:372:13;;;;:::i;:::-;;31477:143;;;;;;;;;;;;;;;;-1:-1:-1;31477:143:13;;;;;;;;;:::i;62223:137::-;;;;;;;;;;;;;;;;-1:-1:-1;62223:137:13;-1:-1:-1;;;;;62223:137:13;;:::i;:::-;;;;;;;;;;;;;;;;6603:123:6;;;:::i;:::-;;;;;;;;;;;;;;;;;;;29621:189:13;;;;;;;;;;;;;;;;-1:-1:-1;29621:189:13;;;;;;;:::i;1510:34:6:-;;;:::i;47066:773:13:-;;;:::i;21039:514::-;;;;;;;;;;;;;;;;-1:-1:-1;21039:514:13;;-1:-1:-1;;;;;21039:514:13;;;;;;;;;;;;;:::i;10039:120::-;;;;;;;;;;;;;;;;-1:-1:-1;10039:120:13;-1:-1:-1;;;;;10039:120:13;;:::i;652:36:6:-;;;:::i;:::-;;;;-1:-1:-1;;;;;652:36:6;;;;;;;;;;;;;;4874:33:13;;;:::i;:::-;;;;-1:-1:-1;;;;;4874:33:13;;;;;;;;;;;;;;1470:34:6;;;:::i;999:46::-;;;:::i;3957:42:13:-;;;:::i;43633:1116::-;;;;;;;;;;;;;;;;-1:-1:-1;43633:1116:13;;:::i;1429:35:6:-;;;:::i;9169:341:13:-;;;;;;;;;;;;;;;;-1:-1:-1;9169:341:13;-1:-1:-1;;;;;9169:341:13;;:::i;4297:40::-;;;:::i;1051:46:6:-;;;:::i;9566:332:13:-;;;;;;;;;;;;;;;;-1:-1:-1;9566:332:13;-1:-1:-1;;;;;9566:332:13;;:::i;888:40:6:-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;44854:1424:13;;;:::i;17270:354::-;;;;;;;;;;;;;;;;-1:-1:-1;17270:354:13;;-1:-1:-1;;;;;17270:354:13;;;;;;;;:::i;14918:1398::-;;;;;;;;;;;;;;;;-1:-1:-1;14918:1398:13;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17903:475;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;17903:475:13;;;;;;;;;;:::i;1001:29:14:-;;;:::i;11997:367:13:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;11997:367:13;;;;;;;;:::i;4542:49::-;;;;;;;;;;;;;;;;-1:-1:-1;4542:49:13;-1:-1:-1;;;;;4542:49:13;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4542:49:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;62434:603;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;62434:603:13;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;62434:603:13;;;;;;;;;;;;;;;;;4829:39;;;:::i;10203:116:6:-;;;:::i;25075:2197:13:-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;25075:2197:13;;;;;;;;;;-1:-1:-1;25075:2197:13;;-1:-1:-1;25075:2197:13;-1:-1:-1;25075:2197:13;:::i;4444:49::-;;;:::i;64161:92::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;1381:137:9;;;:::i;946:46:6:-;;;:::i;10223:498:13:-;;;;;;;;;;;;;;;;-1:-1:-1;10223:498:13;-1:-1:-1;;;;;10223:498:13;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13541:352;;;;;;;;;;;;;;;;-1:-1:-1;13541:352:13;;-1:-1:-1;;;;;13541:352:13;;;;;;;;:::i;4389:49::-;;;:::i;693:77:9:-;;;:::i;1013:90::-;;;:::i;27680:1219:13:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;27680:1219:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;27680:1219:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;27680:1219:13;;;;;;;;;;-1:-1:-1;27680:1219:13;;-1:-1:-1;27680:1219:13;-1:-1:-1;27680:1219:13;:::i;63341:412::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;63341:412:13;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;709:43:6;;;:::i;63120:143:13:-;;;;;;;;;;;;;;;;-1:-1:-1;63120:143:13;-1:-1:-1;;;;;63120:143:13;;:::i;42585:918::-;;;;;;;;;;;;;;;;-1:-1:-1;42585:918:13;;;;:::i;23313:721::-;;;;;;;;;;;;;;;;-1:-1:-1;23313:721:13;;;;:::i;16660:128::-;;;;;;;;;;;;;;;;-1:-1:-1;16660:128:13;-1:-1:-1;;;;;16660:128:13;;:::i;51239:1999::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;51239:1999:13;;;;;;;;;;;;;;;;;;;;:::i;21755:1396::-;;;;;;;;;;;;;;;;-1:-1:-1;21755:1396:13;;;;:::i;62045:98::-;;;:::i;13995:240::-;;;;;;;;;;;;;;;;-1:-1:-1;13995:240:13;-1:-1:-1;;;;;13995:240:13;;:::i;4780:43::-;;;:::i;8749:361::-;;;;;;;;;;;;;;;;-1:-1:-1;8749:361:13;-1:-1:-1;;;;;8749:361:13;;:::i;4627:52::-;;;;;;;;;;;;;;;;-1:-1:-1;4627:52:13;-1:-1:-1;;;;;4627:52:13;;:::i;39721:991::-;;;;;;;;;;;;;;;;-1:-1:-1;39721:991:13;;;;;;;;;:::i;65616:3690::-;;;;;;;;;;;;;;;;-1:-1:-1;65616:3690:13;-1:-1:-1;;;;;65616:3690:13;;:::i;16435:156::-;;;;;;;;;;;;;;;;-1:-1:-1;16435:156:13;-1:-1:-1;;;;;16435:156:13;;:::i;768:49:6:-;;;:::i;64009:146:13:-;;;;;;;;;;;;;;;;-1:-1:-1;64009:146:13;;:::i;4343:40::-;;;:::i;16861:132::-;;;;;;;;;;;;;;;;-1:-1:-1;16861:132:13;-1:-1:-1;;;;;16861:132:13;;:::i;38626:928::-;;;;;;;;;;;;;;;;-1:-1:-1;38626:928:13;;;;;;;;;;;;;;:::i;29161:155::-;;;;;;;;;;;;;;;;-1:-1:-1;29161:155:13;;-1:-1:-1;;;;;29161:155:13;;;;;;;;;;;;;:::i;887:21:14:-;;;:::i;4499:36:13:-;;;:::i;41095:1390::-;;;;;;;;;;;;;;;;-1:-1:-1;41095:1390:13;;;;;;;:::i;6799:583:6:-;;;;;;;;;;;;;;;;-1:-1:-1;6799:583:6;;;;;;-1:-1:-1;;;;;6799:583:6;;:::i;18501:1222:13:-;;;;;;;;;;;;;;;;-1:-1:-1;18501:1222:13;-1:-1:-1;;;;;18501:1222:13;;:::i;4742:31::-;;;;;;;;;;;;;;;;-1:-1:-1;4742:31:13;;:::i;1160:22:14:-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;69410:272:13;;;;;;;;;;;;;;;;-1:-1:-1;69410:272:13;-1:-1:-1;;;;;69410:272:13;;:::i;63826:177::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;63826:177:13;;;;;;;;:::i;20485:322::-;;;;;;;;;;;;;;;;-1:-1:-1;20485:322:13;;;;:::i;31802:171::-;;;;;;;;;;;;;;;;-1:-1:-1;31802:171:13;;;;;;;:::i;4686:50::-;;;;;;;;;;;;;;;;-1:-1:-1;4686:50:13;;;;:::i;9925:195:6:-;;;;;;;;;;;;;;;;-1:-1:-1;9925:195:6;;:::i;1689:115:9:-;;;;;;;;;;;;;;;;-1:-1:-1;1689:115:9;-1:-1:-1;;;;;1689:115:9;;:::i;833:49:6:-;;;:::i;610:36::-;;;:::i;4597:24:13:-;;;;;;;;;;;;;;;;-1:-1:-1;4597:24:13;;:::i;19931:372::-;19994:27;20010:10;19994:15;:27::i;:::-;19993:28;19985:37;;;;;;20069:10;20032:23;20058:22;;;:10;:22;;;;;20094:10;;;;20058:22;;20140:9;;;20094:42;;:17;:42::i;:::-;:55;;;20090:92;;;20165:7;;;20090:92;20204:10;;;;:45;;4130:1;20204:20;:45::i;:::-;20191:10;;;:58;20264:32;;;;;;;;;;20275:10;;20264:32;;;;;;;;;;19931:372;;;:::o;31477:143::-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;31563:50:::1;31568:10;3997:2;31596:6:::0;31604:8;31563:4:::1;:50::i;:::-;31477:143:::0;;;:::o;62223:137::-;-1:-1:-1;;;;;62317:19:13;62291:7;62317:19;;;:10;:19;;;;;:29;;:36;;62223:137::o;6603:123:6:-;6652:6;6702:16;6684:34;;:15;:34;;;;;;6670:49;;6603:123;:::o;29621:189:13:-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;3997:2:::1;29719:23:::0;::::1;29711:32;;;::::0;::::1;;29753:50;29761:10;29773;29785:6;29793;29801:1;29753:7;:50::i;1510:34:6:-:0;;;;;;:::o;47066:773:13:-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;47364:10:::1;47327:23;47353:22:::0;;;:10:::1;:22;::::0;;;;;47430:1:::1;47409:18;:16;:18::i;:::-;47445:24;::::0;::::1;::::0;47409:22;;::::1;::::0;-1:-1:-1;47445:42:13::1;::::0;;::::1;:24:::0;;;::::1;;:42;::::0;::::1;::::0;:75:::1;;-1:-1:-1::0;47491:24:13::1;::::0;::::1;::::0;;;::::1;;;:29:::0;::::1;47445:75;47441:157;;;47563:24;::::0;::::1;::::0;;-1:-1:-1;;;47563:24:13::1;::::0;;::::1;;47536:51;-1:-1:-1::0;;;;47536:51:13;;::::1;;::::0;;47441:157:::1;47608:23;47633::::0;47660:16:::1;47665:10;47660:4;:16::i;:::-;47607:69;;;;47691:16;:21;;47711:1;47691:21;;:46;;;-1:-1:-1::0;47716:21:13::1;::::0;::::1;::::0;::::1;47691:46;47687:146;;;47753:13;::::0;:69:::1;::::0;;-1:-1:-1;;;47753:69:13;;47772:10:::1;47753:69;::::0;::::1;::::0;::::1;::::0;;::::1;::::0;;;;;::::1;::::0;;;;:13:::1;:69:::0;;;;;;;;-1:-1:-1;;;;;47753:13:13;;::::1;::::0;:18:::1;::::0;:69;;;;;:13;;:69;;;;;;:13;;:69;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;47687:146;8610:1;;;;47066:773:::0;:::o;21039:514::-;21209:8;;-1:-1:-1;;;;;21209:8:13;21187:10;:31;21179:40;;;;;;-1:-1:-1;;;;;21255:19:13;;21229:23;21255:19;;;:10;:19;;;;;21289:10;;;;:34;;4179:1;21289:17;:34::i;:::-;21288:35;:65;;;;-1:-1:-1;21327:14:13;;;:21;:26;21288:65;21284:191;;;21382:10;;;;:37;;4179:1;21382:20;:37::i;:::-;21369:10;;;:50;21438:26;;;21459:4;21438:26;;;;-1:-1:-1;;;;;21438:26:13;;;;;;;;;;;;;21284:191;21484:62;21492:7;21501:10;3997:2;21529:6;21537:8;21484:7;:62::i;:::-;21039:514;;;;:::o;10039:120::-;-1:-1:-1;;;;;10127:19:13;10101:7;10127:19;;;:10;:19;;;;;:25;;10039:120::o;652:36:6:-;;;:::o;4874:33:13:-;;;-1:-1:-1;;;;;4874:33:13;;:::o;1470:34:6:-;;;-1:-1:-1;;;1470:34:6;;-1:-1:-1;;;;;1470:34:6;;:::o;999:46::-;;;:::o;3957:42:13:-;3997:2;3957:42;:::o;43633:1116::-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;43697:20:::1;43720:18;:16;:18::i;:::-;43832:10;43748:17;43821:22:::0;;;:10:::1;:22;::::0;;;;43697:41;;-1:-1:-1;43784:1:13::1;43768:17:::0;::::1;::::0;43821:22;44030:123:::1;44039:48;43821:22:::0;43697:41;43768:17;44039:15:::1;:48::i;:::-;44101:51;44117:4;44123:13;44138;44101:15;:51::i;:::-;44030:8;:123::i;:::-;44181:10:::0;;44007:146;;-1:-1:-1;44181:28:13::1;::::0;44007:146;44181:14:::1;:28::i;:::-;44171:6;:38;;44163:47;;;::::0;::::1;;44220:20:::0;;;;::::1;::::0;;44251:35:::1;44220:4:::0;:10:::1;44269:16:::0;;::::1;44251:11;:35::i;:::-;44296:38;-1:-1:-1::0;;;;;44296:5:13::1;:18;44315:10;44327:6:::0;44296:18:::1;:38::i;:::-;44349:29;::::0;;;;;;;44359:10:::1;::::0;44349:29:::1;::::0;;;;;::::1;::::0;;::::1;44457:10:::0;;:15;:60;::::1;;;-1:-1:-1::0;44488:24:13::1;::::0;::::1;::::0;;;::::1;;;:29:::0;44457:60:::1;:101;;;;-1:-1:-1::0;44533:11:13::1;::::0;::::1;::::0;;;::::1;-1:-1:-1::0;;;;;44533:11:13::1;:25:::0;::::1;44457:101;44453:290;;;44599:11;::::0;::::1;::::0;;;;::::1;-1:-1:-1::0;;;;;44599:11:13::1;44622:1;44582:29:::0;;;:16:::1;:29;::::0;;;;;:42;;-1:-1:-1;;;;;;44582:42:13::1;::::0;;44638:24;;-1:-1:-1;;;;;;44638:24:13::1;::::0;;;44681:51;;::::1;::::0;::::1;::::0;44622:1;44694:10:::1;::::0;44681:51:::1;::::0;44622:1;;44681:51:::1;44453:290;8610:1;;;;43633:1116:::0;;:::o;1429:35:6:-;;;-1:-1:-1;;;;;1429:35:6;;:::o;9169:341:13:-;897:9:9;:7;:9::i;:::-;889:18;;;;;;9317:11:13::1;::::0;-1:-1:-1;;;;;9317:11:13::1;9309:34:::0;9301:43:::1;;;::::0;::::1;;9461:4;-1:-1:-1::0;;;;;9428:38:13::1;:12;-1:-1:-1::0;;;;;9428:19:13::1;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;9428:21:13;-1:-1:-1;;;;;9428:38:13::1;;9420:47;;;::::0;::::1;;9477:11;:26:::0;;-1:-1:-1;;;;;;9477:26:13::1;-1:-1:-1::0;;;;;9477:26:13;;;::::1;::::0;;;::::1;::::0;;9169:341::o;4297:40::-;;;:::o;1051:46:6:-;;;:::o;9566:332:13:-;897:9:9;:7;:9::i;:::-;889:18;;;;;;9702:8:13::1;::::0;-1:-1:-1;;;;;9702:8:13::1;9694:31:::0;;:49:::1;;;9729:14;9694:49;9686:58;;;::::0;::::1;;9855:4;-1:-1:-1::0;;;;;9825:35:13::1;:9;-1:-1:-1::0;;;;;9825:16:13::1;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;9825:18:13;-1:-1:-1;;;;;9825:35:13::1;;9817:44;;;::::0;::::1;;9871:8;:20:::0;;-1:-1:-1;;;;;;9871:20:13::1;-1:-1:-1::0;;;;;9871:20:13;;;::::1;::::0;;;::::1;::::0;;9566:332::o;888:40:6:-;;;:::o;44854:1424:13:-;6499:20:6;;;;6491:34;;;;;;44951:10:13::1;44917:14;44934:28:::0;;;:16:::1;:28;::::0;;;;;;;;-1:-1:-1;;;;;44934:28:13::1;44998:18:::0;;;:10:::1;:18:::0;;;;;;45091:10;;45083:23:::1;;;::::0;::::1;;45187:10;45201:9;45187:23;45179:32;;;::::0;::::1;;45222:26;45251:30;45274:6;45251:22;:30::i;:::-;45222:59;;45292:23;45317::::0;45344:12:::1;45349:6;45344:4;:12::i;:::-;45291:65;;;;45366:20;45389:18;:16;:18::i;:::-;45453:1;45518:24:::0;;::::1;::::0;45366:41;;-1:-1:-1;45437:17:13;::::1;::::0;45518:38:::1;::::0;;::::1;:24:::0;;;::::1;;:38;45514:75;;;45572:7;;;;;;;;;45514:75;45599:20;45622:48;45638:4;45644:13;45659:10;45622:15;:48::i;:::-;45599:71;;45703:1;45688:12;:16;45680:25;;;::::0;::::1;;45715:27;::::0;;::::1;;::::0;;;:15:::1;:27;::::0;;;;:43;;;::::1;::::0;;-1:-1:-1;45799:24:13;::::1;::::0;;;;;::::1;::::0;;::::1;-1:-1:-1::0;;45769:54:13;;::::1;;-1:-1:-1::0;;45833:37:13::1;::::0;;;::::1;::::0;;;::::1;::::0;;45881:43:::1;45799:24:::0;45715:27;45881:25:::1;:43::i;:::-;46012:13;45990:35;;:19;:35;;;45986:138;;;46064:48;::::0;;;;::::1;::::0;;;::::1;46095:1;46073:23:::0;;::::1;46064:48:::0;::::1;::::0;;;;::::1;;::::0;;::::1;::::0;;;46041:17:::1;::::0;::::1;:72:::0;;;;::::1;::::0;;-1:-1:-1;46041:72:13;;;;;;;;;::::1;::::0;;;;;::::1;::::0;::::1;-1:-1:-1::0;;46041:72:13;;;::::1;-1:-1:-1::0;;46041:72:13;;::::1;::::0;;;::::1;::::0;;;::::1;;::::0;;45986:138:::1;46134:13;::::0;:74:::1;::::0;;-1:-1:-1;;;46134:74:13;;-1:-1:-1;;;;;46134:74:13;;::::1;;::::0;::::1;::::0;::::1;::::0;;::::1;::::0;;;;;;::::1;::::0;;;;;::::1;::::0;;;;;;:13;;;::::1;::::0;:18:::1;::::0;:74;;;;;:13:::1;::::0;:74;;;;;;;:13;;:74;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;46223:48:13::1;::::0;;;;;;;::::1;::::0;::::1;::::0;-1:-1:-1;;;;;;46223:48:13;::::1;::::0;-1:-1:-1;46223:48:13::1;::::0;;;;::::1;::::0;;::::1;6535:1:6;;;;;;;;;44854:1424:13:o:0;17270:354::-;-1:-1:-1;;;;;17410:19:13;;17359:13;17410:19;;;:10;:19;;;;;17439:179;17463:17;;;:24;17455:32;;17439:179;;;17527:4;:17;;17545:5;17527:24;;;;;;;;;;;;;;;;;:34;;;;;;;;17516:45;;;;17512:96;;17581:12;;;17512:96;17489:7;;;;;17439:179;;;17270:354;;;;;;:::o;14918:1398::-;15034:23;15059:33;15127:1;15116:8;:12;;;15108:21;;;;;;15159:7;:14;15191:22;;;15183:31;;;;;;15228:16;;;;;:56;;;15276:8;15262:11;15248;:25;:36;15228:56;15224:123;;;-1:-1:-1;15311:25:13;;;15224:123;15400:11;15389:8;:22;15372:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;15356:56;;15440:1;15422:19;;15452;15485:20;15508:18;:16;:18::i;:::-;15485:41;-1:-1:-1;15536:17:13;15556:29;:19;;;15576:8;15556:19;:29::i;:::-;15536:49;-1:-1:-1;15613:11:13;15596:638;15630:8;15626:1;:12;15596:638;;;15659:14;15676:7;15684:1;15676:10;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;15676:10:13;15726:18;;;:10;:18;;;;;;;15676:10;15762:27;;;15676:10;;-1:-1:-1;15726:18:13;15762:44;:27;;;:44;;;;;;;:105;;-1:-1:-1;15826:24:13;;;;:41;;;;:24;;;;;:41;;15762:105;15758:152;;;15887:8;;;;15758:152;15923:20;15946:48;15962:4;15968:13;15983:10;15946:15;:48::i;:::-;15923:71;-1:-1:-1;16012:17:13;;16008:216;;16089:6;-1:-1:-1;;;;;16081:15:13;16049:13;16063:11;16049:26;;;;;;;;;;;;;;16076:1;16049:29;;;;;;;;;;:47;16114:28;;16128:13;;;;16148:12;;16114:13;;16128;16114:28;;;;;;;;;;;;16143:1;16114:31;;;;;;;;;;:46;16178:31;;;;16008:216;15596:638;;;;15640:3;;15596:638;;;;16288:11;16273:13;16266:34;16252:58;;;;;;;;;;:::o;17903:475::-;18034:8;;17985:7;;-1:-1:-1;;;;;18034:8:13;18012:10;:31;18004:40;;;;;;-1:-1:-1;;;;;18080:19:13;;18054:23;18080:19;;;:10;:19;;;;;18113:10;;;;:53;;;;:37;;4231:1;18113:17;:37::i;:::-;:53;;;18109:109;;;18189:18;;;;-1:-1:-1;18182:25:13;;18109:109;18240:10;;;;:40;;4231:1;18240:20;:40::i;:::-;18227:10;;;:53;18295:41;;;;;;;;;;-1:-1:-1;;;;;18295:41:13;;;;;;;;;;;;;18353:18;;;;17903:475;-1:-1:-1;;;17903:475:13:o;1001:29:14:-;;;-1:-1:-1;;;;;1001:29:14;;:::o;11997:367:13:-;-1:-1:-1;;;;;12140:19:13;;12092:6;12140:19;;;:10;:19;;;;;12201:14;;;:22;;12092:6;;12201:14;12216:6;;12201:22;;;;;;;;;;;;;12169:54;;12233:18;12254:40;12269:4;12275:18;:16;:18::i;:::-;12254:14;:40::i;:::-;12233:61;;12311:46;12335:8;12345:11;12311:23;:46::i;:::-;12304:53;11997:367;-1:-1:-1;;;;;;11997:367:13:o;4542:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;4542:49:13;;;;;-1:-1:-1;;;4542:49:13;;;;;;;;;;-1:-1:-1;;;;;4542:49:13;;;;;;;;;;;;;;:::o;62434:603::-;-1:-1:-1;;;;;62843:19:13;;62725:18;62843:19;;;:10;:19;;;;;:29;;:37;;62725:18;;;;;;;;62873:6;;62843:37;;;;;;;;;;;;;;;62904:16;;;;;;62943:15;;;;;;-1:-1:-1;;;;62978:12:13;;;;;;-1:-1:-1;;;;63014:16:13;;;-1:-1:-1;;;;;63014:16:13;;-1:-1:-1;62904:16:13;-1:-1:-1;;;;62434:603:13:o;4829:39::-;;;-1:-1:-1;;;;;4829:39:13;;:::o;10203:116:6:-;10293:19;;-1:-1:-1;;;;;;;;10293:19:6;;;;;10279:11;:33;10272:40;10203:116;:::o;25075:2197:13:-;25316:7;25348:20;;;;;:80;;-1:-1:-1;25384:44:13;;;25348:80;:130;;;;-1:-1:-1;25444:34:13;;;;25348:130;:180;;;;-1:-1:-1;25494:34:13;;;25348:180;25340:189;;;;;;25539:21;25584:1;25563:18;:16;:18::i;:::-;:22;;-1:-1:-1;25632:1:13;25615:18;;25595:17;;;25697:1322;25717:19;;;25697:1322;;;25757:14;25774:8;;25783:1;25774:11;;;;;;;;;;;;;-1:-1:-1;;;;;25774:11:13;25757:28;;25799:25;25827:18;;25846:1;25827:21;;;;;;;;;;;;;;;-1:-1:-1;;25881:21:13;;;25924;;;;;:52;;;25968:8;25949:15;:27;;25924:52;25916:61;;;;;;-1:-1:-1;;;;;26017:18:13;;25991:23;26017:18;;;:10;:18;;;;;26057:14;;;:21;:26;:74;;;;-1:-1:-1;26088:10:13;;;;:43;;4289:1;26088:17;:43::i;:::-;26087:44;26057:74;26049:83;;;;;;-1:-1:-1;;;;;26215:24:13;;;26251:1;26215:24;;;:16;:24;;;;;;;:38;26207:47;;;;;;26268:7;:20;;;;;;;-1:-1:-1;26268:20:13;;;;;;;-1:-1:-1;;;;;;26268:20:13;-1:-1:-1;;;;;26268:20:13;;;;;;;;;26302:13;;:46;;;-1:-1:-1;;;26302:46:13;;;;;;;;;;;;;;;;;:13;;;:22;;:46;;;;;;;;;;-1:-1:-1;26302:13:13;:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26363:535;26374:8;26370:1;:12;26363:535;;;26407:13;26424:7;;26432:1;26424:10;;;;;;;;;;;;;26407:27;;26452:14;26469:8;;26478:1;26469:11;;;;;;;;;;;;;;;26452:28;;26515:24;26506:5;:33;;:64;;;;;26554:16;26543:27;;:7;:27;;;;26506:64;26498:73;;;;;;26602:10;;:21;;26617:5;26602:14;:21::i;:::-;26589:34;;26661:52;;;;;;;;;;;;;;26589:10;26661:52;;;;;;;;;;;;;;;;-1:-1:-1;;;;;26661:52:13;;;;;;;;;26641:14;;;:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;26641:73:13;-1:-1:-1;;;;;;;;26641:73:13;;;-1:-1:-1;;;26641:73:13;-1:-1:-1;;;;26641:73:13;;;;;-1:-1:-1;;26641:73:13;;;;-1:-1:-1;;26641:73:13;;;;;;;;;;;;;;;;;;;;;;;;;;;26743:19;:8;26706:5;26743:12;:19::i;:::-;26785:33;;;;;;;;;;;;;;;26732:30;;-1:-1:-1;;;;;;26785:33:13;;;;;;;;;;;;;;26841:42;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;26841:42:13;;;-1:-1:-1;;;;;;;;;;;26841:42:13;;;;;;;;;-1:-1:-1;;26384:3:13;;;;;26363:535;;;26919:10;;26933:24;-1:-1:-1;26919:38:13;26911:47;;;;;;26997:10;;26972:36;;:12;;;;:24;:36::i;:::-;-1:-1:-1;;25738:3:13;;;;;-1:-1:-1;25697:1322:13;;-1:-1:-1;25697:1322:13;;;27041:15;27036:1;:20;27028:29;;;;;;27067:25;27103:26;:14;:24;:26::i;:::-;-1:-1:-1;;;;;27095:35:13;;-1:-1:-1;27140:56:13;:14;27167:28;;;27140:26;:56::i;:::-;27206:59;-1:-1:-1;;;;;27206:5:13;:22;27229:10;27249:4;27256:8;27206:22;:59::i;:::-;25075:2197;;;;;;;;;;;;;;:::o;4444:49::-;;;:::o;64161:92::-;64242:4;64161:92;:::o;1381:137:9:-;897:9;:7;:9::i;:::-;889:18;;;;;;1479:1:::1;1463:6:::0;;1442:40:::1;::::0;-1:-1:-1;;;;;1463:6:9;;::::1;::::0;1442:40:::1;::::0;1479:1;;1442:40:::1;1509:1;1492:19:::0;;-1:-1:-1;;;;;;1492:19:9::1;::::0;;1381:137::o;946:46:6:-;;;:::o;10223:498:13:-;-1:-1:-1;;;;;10450:19:13;;10302:13;10450:19;;;:10;:19;;;;;10490:10;;;;10302:13;;;;;;10450:19;10490:34;;4179:1;10490:17;:34::i;:::-;10545:10;;;;10479:45;;-1:-1:-1;10545:42:13;;4130:1;10545:17;:42::i;:::-;10611:10;;;;10544:43;;;-1:-1:-1;10611:37:13;;4231:1;10611:17;:37::i;:::-;10671:10;;;;10597:51;;-1:-1:-1;10671:43:13;;4289:1;10671:17;:43::i;:::-;10670:44;10658:56;;10223:498;;;;;;:::o;13541:352::-;-1:-1:-1;;;;;13692:19:13;;13631;13692;;;:10;:19;;;;;13631;13744:18;:16;:18::i;:::-;13721:41;-1:-1:-1;13772:17:13;13792:29;:19;;;13812:8;13792:19;:29::i;:::-;13772:49;;13838:48;13854:4;13860:13;13875:10;13838:15;:48::i;4389:49::-;;;:::o;693:77:9:-;731:7;757:6;-1:-1:-1;;;;;757:6:9;693:77;:::o;1013:90::-;1053:4;1090:6;-1:-1:-1;;;;;1090:6:9;1076:10;:20;;1013:90::o;27680:1219:13:-;27896:5;-1:-1:-1;;;;;27870:32:13;:14;-1:-1:-1;;;;;27870:32:13;;:64;;;;-1:-1:-1;27906:10:13;-1:-1:-1;;;;;27928:5:13;27906:28;;27870:64;27862:73;;;;;;28713:4;28700:18;28755:4;28742:18;28800:1;28803:2;:16;;;28800:20;28789:31;28830:62;28838:5;;3997:2;28868:6;28789:31;28830:7;:62::i;:::-;27680:1219;;;;;;;:::o;63341:412::-;-1:-1:-1;;;;;63622:19:13;;63542:18;63622:19;;;:10;:19;;;;;:32;;:40;;63542:18;;;;63655:6;;63622:40;;;;;;;;;;;;;;;63686:20;;;;;;63728:18;;;;;;-1:-1:-1;63341:412:13;-1:-1:-1;;;;63341:412:13:o;709:43:6:-;;;:::o;63120:143:13:-;-1:-1:-1;;;;;63217:19:13;63191:7;63217:19;;;:10;:19;;;;;:32;;:39;;63120:143::o;42585:918::-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;42697:10:::1;42660:23;42686:22:::0;;;:10:::1;:22;::::0;;;;42739:14:::1;::::0;::::1;:21:::0;;42686:22;;-1:-1:-1;;42739:25:13;;;42660:23;;42739:14;42806:22:::1;::::0;::::1;::::0;;::::1;;;;;;::::0;;;::::1;::::0;;;::::1;42846:19:::0;;42806:22;;-1:-1:-1;42846:19:13;;::::1;;;:24:::0;;::::1;::::0;:147:::1;;-1:-1:-1::0;42891:27:13::1;::::0;::::1;::::0;::::1;;:32:::0;;:101:::1;;-1:-1:-1::0;42965:27:13::1;::::0;::::1;::::0;42943:19;;42965:27:::1;::::0;;::::1;42943:19:::0;;;::::1;::::0;;::::1;:49;42891:101;42846:264;;;;-1:-1:-1::0;43014:24:13::1;::::0;::::1;::::0;;;::::1;;;:29:::0;;:95:::1;;-1:-1:-1::0;43085:24:13::1;::::0;::::1;::::0;43063:19;;43085:24:::1;::::0;;;;::::1;::::0;::::1;43063:19:::0;;;::::1;;:46;43014:95;42838:273;;;::::0;::::1;;43136:9;43126:6;:19;;;43122:345;;43161:33;43197:4;:14;;43212:9;43197:25;;;;;;;;;::::0;;;::::1;::::0;;;::::1;43259:24:::0;;43236:47;;-1:-1:-1;;43236:47:13::1;43259:24;::::0;;::::1;43236:47;::::0;;;43319:23;;;;;;::::1;::::0;::::1;43297:45;-1:-1:-1::0;;43297:45:13;;::::1;;::::0;;;43375:20;;-1:-1:-1;;;43375:20:13;;;::::1;::::0;;::::1;43356:39:::0;;::::1;-1:-1:-1::0;;;;43356:39:13;;::::1;;::::0;;;43432:24;;-1:-1:-1;;;;;;;;43432:24:13;;;::::1;;43409:47;-1:-1:-1::0;;;;;;;;43409:47:13;;::::1;;::::0;;-1:-1:-1;43122:345:13::1;43476:4;:14;;:20;;;;;;;;::::0;;;::::1;::::0;;;;-1:-1:-1;;43476:20:13;;;;;-1:-1:-1;;;;;;43476:20:13;;;;;;-1:-1:-1;;;;;42585:918:13:o;23313:721::-;23414:10;23377:23;23403:22;;;:10;:22;;;;;23439:10;;;;23486:17;;;23439:43;;4289:1;23439:17;:43::i;:::-;:64;;;23435:101;;;23519:7;;;23435:101;23546:25;23582:26;:14;:24;:26::i;:::-;-1:-1:-1;;;;;23574:35:13;23546:63;;23622:16;23619:283;;;23678:10;;23653:36;;:12;;;;:24;:36::i;:::-;23750:10;;23703:58;;:14;;23730:30;;23703:26;:58::i;:::-;23619:283;;;23792:27;:12;;;23817:1;23792:24;:27::i;:::-;23880:10;;23833:58;;:14;;23860:30;;23833:26;:58::i;:::-;23924:10;;;;:46;;4289:1;23924:20;:46::i;:::-;23911:10;;;:59;23986:41;;;;;;;;;;23998:10;;23986:41;;;;;;;;;;23313:721;;;:::o;16660:128::-;-1:-1:-1;;;;;16755:19:13;;;16729:7;16755:19;;;:10;:19;;;;;:26;;;;;;;;16660:128::o;51239:1999::-;6499:20:6;;;;6491:34;;;;;;51446:11:13::1;::::0;-1:-1:-1;;;;;51446:11:13::1;51424:10;:34;51416:43;;;::::0;::::1;;51488:1;51477:8;:12;51469:21;;;::::0;::::1;;-1:-1:-1::0;;;;;51526:19:13;::::1;51500:23;51526:19:::0;;;:10:::1;:19;::::0;;;;51559:10;;:22;-1:-1:-1;51555:74:13::1;;51608:10:::0;;;-1:-1:-1;51555:74:13::1;51638:22:::0;;;;::::1;::::0;;51674:18;;::::1;51670:67;;;51718:8;51708:18;;51670:67;51747:20;51770:18;:16;:18::i;:::-;51747:41:::0;-1:-1:-1;51834:1:13::1;51818:17:::0;::::1;51798;51866:35;51881:4:::0;51747:41;51866:14:::1;:35::i;:::-;51845:56;;51913:19;51934:16:::0;51952:26:::1;51980:29:::0;52025:80:::1;52060:4;52066:13;52081:10;52093:11;52025:34;:80::i;:::-;52285:10:::0;;51912:193;;-1:-1:-1;51912:193:13;;-1:-1:-1;51912:193:13;-1:-1:-1;51912:193:13;-1:-1:-1;52239:32:13;;::::1;::::0;52285:25;-1:-1:-1;52281:156:13::1;;;52325:101;52343:4;52364;:10;;;52349:12;:25;52376:13;52391:11;52404:21;52325:17;:101::i;:::-;52547:12:::0;;52543:344:::1;;52660:10:::0;;52639:31;::::1;:69;;52707:1;52639:69;;;52694:10:::0;;52673:31;::::1;52639:69;52601:18;52590:8;:29;:119;52575:134;;52740:12;52727:4;:10;;;:25;52723:154;;;52810:10:::0;;52771:91:::1;::::0;52789:4;;52795:25;::::1;52822:10:::0;52834:11;3997:2:::1;52771:17;:91::i;:::-;52929:13;-1:-1:-1::0;;;;;52902:50:13::1;52910:7;-1:-1:-1::0;;;;;52902:50:13::1;;52919:8;52944:7;52902:50;;;;;;;;;;;;;;;;;;;;;;;;52977:7;52966:8;:18;52962:75;;;53000:26;53018:7;53007:8;:18;53000:6;:26::i;:::-;53103:11:::0;;53099:84:::1;;53130:42;-1:-1:-1::0;;;;;53130:5:13::1;:18;53149:13:::0;53164:7;53130:18:::1;:42::i;:::-;53193:37;53205:4;53220:8;53211:18;;53193:11;:37::i;:::-;6535:1:6;;;;;;;;;51239:1999:13::0;;;;:::o;21755:1396::-;21848:10;21811:23;21837:22;;;:10;:22;;;;;21873:10;;;;:47;;;;:34;;4179:1;21873:17;:34::i;:::-;:47;;;21869:84;;;21936:7;;;21869:84;21975:10;;;;:37;;4179:1;21975:20;:37::i;:::-;21962:10;;;:50;22027:34;;;;;;;;;;22039:10;;22027:34;;;;;;;;;;22131:17;22151:18;:16;:18::i;:::-;22172:1;22187:24;;;;22151:22;;;-1:-1:-1;22187:38:13;;;;:24;;;;;:38;22183:74;;22240:7;;;;22183:74;22354:13;22349:796;22381:14;;;:21;22373:29;;22349:796;;;22427:29;22459:4;:14;;22474:5;22459:21;;;;;;;;;;;;;;;22427:53;;22586:9;22585:10;:47;;;;-1:-1:-1;22599:19:13;;:33;;;;:19;;;;;:33;22585:47;22581:173;;;22652:23;;-1:-1:-1;;22693:20:13;-1:-1:-1;;;22693:20:13;;;22731:8;;22581:173;22849:19;;;;;;;:24;;;:49;;-1:-1:-1;22877:16:13;;-1:-1:-1;;;22877:16:13;;;;:21;22849:49;22845:96;;;22918:8;;;22845:96;22974:9;:55;;23009:16;;-1:-1:-1;;;23009:16:13;;;;23028:1;23009:20;22974:55;;;22986:16;;-1:-1:-1;;;22986:16:13;;;;-1:-1:-1;;22986:20:13;22974:55;22955:74;;-1:-1:-1;;;;22955:74:13;-1:-1:-1;;;22955:74:13;;;;;;;;;;;;;23047:16;;23043:92;;23088:32;;-1:-1:-1;;23088:32:13;;;;;;;;;23043:92;22349:796;;22404:7;;22349:796;;62045:98;62122:7;:14;62045:98;:::o;13995:240::-;-1:-1:-1;;;;;14109:19:13;;14065:6;14109:19;;;:10;:19;;;;;14145:24;;;;;;;;;:83;;14204:24;;;;-1:-1:-1;;;14204:24:13;;;;14145:83;;;14177:24;;;;;;;;;14145:83;14138:90;13995:240;-1:-1:-1;;;13995:240:13:o;4780:43::-;;;-1:-1:-1;;;;;4780:43:13;;:::o;8749:361::-;897:9:9;:7;:9::i;:::-;889:18;;;;;;8906:13:13::1;::::0;-1:-1:-1;;;;;8906:13:13::1;8898:36:::0;8890:45:::1;;;::::0;::::1;;9057:4;-1:-1:-1::0;;;;;9022:40:13::1;:14;-1:-1:-1::0;;;;;9022:21:13::1;;:23;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;9022:23:13;-1:-1:-1;;;;;9022:40:13::1;;9014:49;;;::::0;::::1;;9073:13;:30:::0;;-1:-1:-1;;;;;;9073:30:13::1;-1:-1:-1::0;;;;;9073:30:13;;;::::1;::::0;;;::::1;::::0;;8749:361::o;4627:52::-;;;;;;;;;;;;-1:-1:-1;;;;;4627:52:13;;:::o;39721:991::-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;39843:10:::1;39806:23;39832:22:::0;;;:10:::1;:22;::::0;;;;39904:12:::1;::::0;::::1;39896:21;;;::::0;::::1;;39927:29;39959:4;:14;;39974:6;39959:22;;;;;;;;;;;;;;;39927:54;;39991:20;40014:18;:16;:18::i;:::-;39991:41;;40043:18;40063:17:::0;40084:56:::1;40110:4;40116:8;40126:13;40084:25;:56::i;:::-;40170:16:::0;;40042:98;;-1:-1:-1;40042:98:13;-1:-1:-1;40170:32:13::1;::::0;-1:-1:-1;;;40170:16:13;::::1;;;40193:8:::0;40170:22:::1;:32::i;:::-;40151:51:::0;;-1:-1:-1;;;;40151:51:13::1;-1:-1:-1::0;;;40151:51:13::1;::::0;;::::1;;;::::0;;40312:25;;::::1;::::0;;::::1;;40308:79;;;40353:23:::0;;-1:-1:-1;;40353:23:13::1;::::0;;40308:79:::1;40527:16;40478:65;;40515:8;40478:45;;40498:13;40485:10;:26;40478:34;;:45;:65;;;;40470:74;;;::::0;::::1;;40578:20:::0;;40559:66:::1;::::0;;-1:-1:-1;;;;;;;;40578:20:13;;::::1;::::0;;;::::1;40559:66:::0;;::::1;40613:1;40600:14:::0;::::1;40559:66:::0;::::1;;::::0;::::1;::::0;;::::1;::::0;;;;;40566:10:::1;::::0;-1:-1:-1;;;;;;;;;;;40559:66:13;;;;;;;;::::1;40662:20:::0;;40640:65:::1;::::0;;-1:-1:-1;;;;;;;;40662:20:13;;::::1;::::0;;;::::1;40640:65:::0;;::::1;::::0;;::::1;;::::0;::::1;::::0;;::::1;::::0;;;;;40650:10:::1;::::0;40640:65:::1;::::0;;;;;;;;::::1;8610:1;;;;;39721:991:::0;;;:::o;65616:3690::-;65692:30;65710:11;65692:17;:30::i;:::-;65814:13;;-1:-1:-1;;;;;65814:13:13;65748:53;65760:11;-1:-1:-1;;;65748:11:13;:53::i;:::-;-1:-1:-1;;;;;65740:88:13;;65732:97;;;;;;65919:11;;-1:-1:-1;;;;;65919:11:13;65855:51;65867:11;-1:-1:-1;;;65855:11:13;:51::i;:::-;-1:-1:-1;;;;;65847:84:13;;65839:93;;;;;;66019:8;;-1:-1:-1;;;;;66019:8:13;65958:48;65970:11;-1:-1:-1;;;65958:11:13;:48::i;:::-;-1:-1:-1;;;;;65950:78:13;;65942:87;;;;;;66152:32;;;;:15;:32;;;;;66047:101;;66059:11;;-1:-1:-1;;;66072:29:13;66047:11;:101::i;:::-;:137;66039:146;;;;;;66296:28;;;;:16;:28;;;;-1:-1:-1;;;;;66296:28:13;;66211:68;;66223:11;;-1:-1:-1;;;66236:30:13;66211:11;:68::i;:::-;-1:-1:-1;;;;;66203:121:13;;66195:130;;;;;;66404:7;:14;66344:56;66356:11;-1:-1:-1;;;66344:11:13;:56::i;:::-;:74;66336:83;;;;;;66433:7;:14;66429:56;;66468:7;;66429:56;66494:21;66518:7;66526:1;66518:10;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;66518:10:13;;-1:-1:-1;66518:10:13;;66562:50;;66574:11;;-1:-1:-1;;;66587:21:13;66562:11;:50::i;:::-;-1:-1:-1;;;;;66546:85:13;;66538:94;;;;;;-1:-1:-1;;;;;66668:25:13;;66642:23;66668:25;;;:10;:25;;;;;;66761:29;;:::i;:::-;66793:42;66815:11;66828:6;66793:21;:42::i;:::-;66874:10;;66853:17;;66761:74;;-1:-1:-1;66853:31:13;:112;;;;-1:-1:-1;66938:27:13;;;;66900:34;;;;66938:27;66900:65;;;66938:27;;66900:65;66853:112;:187;;;;-1:-1:-1;67016:24:13;;;;66981:31;;;;67016:24;66981:59;;;67016:24;;;;;66981:59;66853:187;:234;;;;;67077:4;:10;;;67056:11;:17;;;:31;66853:234;:315;;;;-1:-1:-1;67141:27:13;;;;67103:34;;;;67141:27;67103:65;;;-1:-1:-1;;;67141:27:13;;;;67103:65;66853:315;:390;;;;-1:-1:-1;67219:24:13;;;;67184:31;;;;67219:24;67184:59;;;-1:-1:-1;;;67219:24:13;;;;67184:59;66853:390;:453;;;;;67288:4;:18;;;67259:11;:25;;;:47;66853:453;:502;;;;-1:-1:-1;67344:11:13;;;;67322:18;;;;-1:-1:-1;;;;;67322:33:13;;;67344:11;;;;;67322:33;66853:502;:573;;;;-1:-1:-1;67404:22:13;;;;67371:29;;;;67404:22;67371:55;;;67404:22;;67371:55;66853:573;66845:582;;;;;;67531:17;;;:24;67446:69;67458:11;-1:-1:-1;;;67508:6:13;67446:11;:69::i;:::-;:109;67438:118;;;;;;67571:9;67566:390;67590:17;;;:24;67586:28;;:54;;;;-1:-1:-1;3889:1:13;67618:22;;67586:54;67566:390;;;67661:25;67689:4;:17;;67707:1;67689:20;;;;;;;;;;;;;;;67661:48;;67723:31;;:::i;:::-;67757:47;67781:11;67794:6;67802:1;67757:23;:47::i;:::-;67857:20;;67826:27;;67723:81;;-1:-1:-1;67857:20:13;67826:51;;;67857:20;;67826:51;:118;;;;-1:-1:-1;67926:18:13;;67897:25;;;;67926:18;67897:47;;;67926:18;;;;;67897:47;67826:118;67818:127;;;;;;-1:-1:-1;;67642:3:13;;67566:390;;;-1:-1:-1;68044:14:13;;;:21;67974:66;67986:11;-1:-1:-1;;;68033:6:13;67974:11;:66::i;:::-;:91;67966:100;;;;;;68081:9;68076:568;68100:14;;;:21;68096:25;;:51;;;;-1:-1:-1;3889:1:13;68125:22;;68096:51;68076:568;;;68168:33;68204:4;:14;;68219:1;68204:17;;;;;;;;;;;;;;;68168:53;;68235:39;;:::i;:::-;68277:47;68301:11;68314:6;68322:1;68277:23;:47::i;:::-;68381:24;;68346:31;;68235:89;;-1:-1:-1;68381:24:13;68346:59;;;68381:24;;68346:59;:136;;;;-1:-1:-1;68459:23:13;;68425:30;;;;68459:23;68425:57;;;68459:23;;;;;68425:57;68346:136;:207;;;;-1:-1:-1;68533:20:13;;68502:27;;;;68533:20;68502:51;;;-1:-1:-1;;;68533:20:13;;;;68502:51;68346:207;:286;;;;-1:-1:-1;68608:24:13;;68573:31;;;;-1:-1:-1;;;;;68573:59:13;;;-1:-1:-1;;;68608:24:13;;;;68573:59;68346:286;68338:295;;;;;;-1:-1:-1;;68149:3:13;;68076:568;;;;68895:45;68912:13;68927:12;68895:16;:45::i;:::-;68792:87;68804:11;-1:-1:-1;;;68849:6:13;68865:12;68792:11;:87::i;:::-;:148;68784:157;;;;;;69051:27;69065:12;69051:13;:27::i;:::-;68959:76;68971:11;-1:-1:-1;;;69021:12:13;68959:11;:76::i;:::-;:119;68951:128;;;;;;69094:11;;;;;;;-1:-1:-1;;;;;69094:11:13;:25;69090:210;;69276:11;;;;-1:-1:-1;;;;;69276:11:13;;;;;;69259:29;;;;:16;:29;;;;;;;;;;69151:87;;69163:11;;-1:-1:-1;;;69176:30:13;69151:11;:87::i;:::-;-1:-1:-1;;;;;69143:145:13;;69135:154;;;;;16435:156;-1:-1:-1;;;;;16542:19:13;;16498:4;16542:19;;;:10;:19;;;;;:42;;;-1:-1:-1;;;16542:42:13;;;;16521:18;:16;:18::i;:::-;:63;;;;16435:156;-1:-1:-1;;16435:156:13:o;768:49:6:-;;;:::o;64009:146:13:-;64084:7;64109:39;:14;64135:12;64109:25;:39::i;:::-;-1:-1:-1;;;;;64102:46:13;;64009:146;-1:-1:-1;;64009:146:13:o;4343:40::-;;;:::o;16861:132::-;-1:-1:-1;;;;;16953:19:13;16927:7;16953:19;;;:10;:19;;;;;:33;;;;16861:132::o;38626:928::-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;38766:10:::1;38729:23;38755:22:::0;;;:10:::1;:22;::::0;;;;38808:24:::1;38795:37:::0;::::1;::::0;::::1;::::0;:53:::1;;;38847:1;38836:8;:12;;;38795:53;38787:62;;;::::0;::::1;;38859:29;38891:4;:14;;38906:6;38891:22;;;;;;;;;;;;;;;38859:54;;38923:20;38946:18;:16;:18::i;:::-;38923:41;;38977:17;38998:56;39024:4;39030:8;39040:13;38998:25;:56::i;:::-;39084:20:::0;;38974:80;;-1:-1:-1;;;;39084:20:13;::::1;-1:-1:-1::0;;;;;39084:20:13::1;::::0;-1:-1:-1;39145:23:13::1;39084:20:::0;39158:9;39145:12:::1;:23::i;:::-;39114:55:::0;;-1:-1:-1;;;;;;;;39114:55:13::1;-1:-1:-1::0;;;;;;;;39114:55:13;;::::1;::::0;::::1;::::0;;;::::1;::::0;;;39211:24:::1;39187:20:::0;;::::1;::::0;;::::1;:48;;39179:57;;;::::0;::::1;;39272:16:::0;;39246:23:::1;::::0;39272:32:::1;::::0;-1:-1:-1;;;39272:16:13;::::1;;;39295:8:::0;39272:22:::1;:32::i;:::-;39333:20:::0;;39246:58;;-1:-1:-1;39314:72:13::1;::::0;39327:4;;39333:20:::1;;;39246:58:::0;39376:9;39314:12:::1;:72::i;:::-;39401:62;::::0;;;;;::::1;::::0;;::::1;;::::0;::::1;::::0;;;;;;;;::::1;::::0;;;;;;39409:10:::1;::::0;39401:62:::1;::::0;;;;;;;;::::1;39508:20:::0;;39478:69:::1;::::0;;;;;39508:20:::1;::::0;;::::1;39478:69;::::0;::::1;::::0;;;::::1;::::0;;;;;39485:10:::1;::::0;-1:-1:-1;;;;;;;;;;;39478:69:13;;;;;;;;::::1;8610:1;;;;;;38626:928:::0;;;;:::o;29161:155::-;29247:62;29255:7;29264:10;3997:2;29292:6;29300:8;29247:7;:62::i;887:21:14:-;;;-1:-1:-1;;;;;887:21:14;;:::o;4499:36:13:-;;;:::o;41095:1390::-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;41198:7:::1;41187;:18;;41179:27;;;::::0;::::1;;41286:10;41249:23;41275:22:::0;;;:10:::1;:22;::::0;;;;41340:14:::1;::::0;::::1;:23:::0;;41275:22;;41249:23;41355:7;;41340:23;::::1;;;;;;;;;;;;41307:56;;41373:30;41406:4;:14;;41421:7;41406:23;;;;;;;;;;;;;;;41373:56;;41439:20;41462:18;:16;:18::i;:::-;41439:41;;41494:18;41516:57;41542:4;41548:9;41559:13;41516:25;:57::i;:::-;41491:82;;;41586:18;41608:57;41634:4;41640:9;41651:13;41608:25;:57::i;:::-;41583:82;;;41769:11;41754:26;;:11;:26;;;41746:35;;;::::0;::::1;;41815:21:::0;;41838;;41796:77:::1;::::0;;-1:-1:-1;;;;;;;;41815:21:13;;;::::1;::::0;::::1;41796:77:::0;;41838:21;;;::::1;::::0;;::::1;41796:77;::::0;::::1;::::0;::::1;::::0;::::1;::::0;;;;;;41803:10:::1;::::0;41796:77:::1;::::0;;;;;;;;::::1;41913:21:::0;;41888;;41913::::1;41888::::0;;::::1;41913::::0;::::1;41888:46;41884:595;;;41975:21:::0;;41950:46;;-1:-1:-1;;;41950:46:13;;::::1;-1:-1:-1::0;;;;;41950:46:13;;::::1;41975:21:::0;;;::::1;::::0;::::1;41950:46:::0;;;::::1;::::0;;::::1;::::0;;::::1;-1:-1:-1::0;;;;;;;;41950:46:13;;::::1;;::::0;;42010:24;;-1:-1:-1;;;;;;42010:24:13;;::::1;::::0;::::1;42048:21;::::0;;41884:595:::1;;;42114:21:::0;;42090;;42114::::1;::::0;;::::1;42090::::0;::::1;:45;42086:393;;;42176:21:::0;;42151:46;;-1:-1:-1;;;42151:46:13;;::::1;-1:-1:-1::0;;;;;42151:46:13;;::::1;42176:21:::0;;;::::1;::::0;::::1;42151:46:::0;;;::::1;::::0;;::::1;::::0;;::::1;-1:-1:-1::0;;;;;;;;42151:46:13;;::::1;;::::0;;;42211:48;;-1:-1:-1;;;;;;42234:21:13::1;::::0;;::::1;:25:::0;42211:48;;::::1;::::0;::::1;-1:-1:-1::0;;42211:48:13;;::::1;;42273:21;::::0;;42086:393:::1;;;42350:21:::0;;42325:46;;-1:-1:-1;;;42325:46:13;;::::1;-1:-1:-1::0;;;;;42325:46:13;;::::1;42350:21:::0;;;::::1;::::0;::::1;42325:46:::0;;;::::1;::::0;;::::1;::::0;;::::1;-1:-1:-1::0;;;;;;;;42325:46:13;;::::1;;::::0;;;42385:48;;-1:-1:-1;;;;;;42408:21:13::1;::::0;;::::1;:25:::0;42385:48;;::::1;::::0;::::1;-1:-1:-1::0;;42385:48:13;;::::1;;42447:21;::::0;;8610:1:::1;;;;;;41095:1390:::0;;;:::o;6799:583:6:-;897:9:9;:7;:9::i;:::-;889:18;;;;;;6905:20:6::1;::::0;::::1;;:25:::0;6897:34:::1;;;::::0;::::1;;7063:15;7038:21;:40;;7030:49;;;::::0;::::1;;7112:18;:16;:18::i;:::-;7089:20;:41:::0;;-1:-1:-1;;7089:41:6::1;;::::0;;;::::1;::::0;;;::::1;::::0;;7140:19:::1;:60:::0;;-1:-1:-1;;;;;;;;7140:60:6;;::::1;7162:11;:38:::0;;::::1;7140:60:::0;::::1;::::0;::::1;;7233:19:::0;;::::1;::::0;;::::1;-1:-1:-1::0;;;;;;7210:42:6;;::::1;;::::0;;7262:70:::1;:5;-1:-1:-1::0;;;;;7262:22:6::1;7285:14:::0;7309:4:::1;7162:38:::0;7262:22:::1;:70::i;:::-;7347:28;::::0;;;;;;;::::1;::::0;;;;::::1;::::0;;::::1;6799:583:::0;;:::o;18501:1222:13:-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;18605:10:::1;18568:23;18594:22:::0;;;:10:::1;:22;::::0;;;;18708:11:::1;::::0;::::1;::::0;-1:-1:-1;;;;;18697:22:13;;::::1;18708:11:::0;;;::::1;;18697:22;;18689:31;;;::::0;::::1;;18730:20;18753:18;:16;:18::i;:::-;18785:11;::::0;::::1;::::0;18730:41;;-1:-1:-1;18785:11:13;;::::1;-1:-1:-1::0;;;;;18785:11:13::1;:25:::0;18781:337:::1;;18948:22;::::0;::::1;::::0;:46:::1;::::0;:22:::1;;18977:16;18948:28;:46::i;:::-;18931:63;;:13;:63;;;;18923:72;;;::::0;::::1;;19082:11;::::0;::::1;::::0;;;::::1;-1:-1:-1::0;;;;;19082:11:13::1;19105:1;19065:29:::0;;;:16:::1;:29;::::0;;;;:42;;-1:-1:-1;;;;;;19065:42:13::1;::::0;;18781:337:::1;-1:-1:-1::0;;;;;19132:21:13;::::1;::::0;19128:382:::1;;-1:-1:-1::0;;;;;19227:25:13;;::::1;19264:1;19227:25:::0;;;:16:::1;:25;::::0;;;;;::::1;:39:::0;19219:48:::1;;;::::0;::::1;;-1:-1:-1::0;;;;;19333:19:13;::::1;;::::0;;;:10:::1;:19;::::0;;;;:29:::1;;:36:::0;:41;;:66:::1;;-1:-1:-1::0;;;;;;19378:21:13;::::1;19389:10;19378:21;19333:66;19325:75;;;::::0;::::1;;-1:-1:-1::0;;;;;19461:25:13;::::1;;::::0;;;:16:::1;:25;::::0;;;;:38;;-1:-1:-1;;;;;;19461:38:13::1;19489:10;19461:38;::::0;;19128:382:::1;19584:11;::::0;::::1;:21:::0;;19615:38:::1;::::0;::::1;-1:-1:-1::0;;;;;;;19584:21:13;::::1;::::0;;::::1;-1:-1:-1::0;;;;;;19584:21:13;;::::1;::::0;;;::::1;19615:38;::::0;::::1;::::0;;;19668:48:::1;::::0;19681:10:::1;::::0;19668:48:::1;::::0;-1:-1:-1;;19668:48:13::1;8610:1;;18501:1222:::0;;:::o;4742:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4742:31:13;;:::o;1160:22:14:-;;;-1:-1:-1;;;1160:22:14;;;;;:::o;69410:272:13:-;69484:28;69504:7;69484:19;:28::i;:::-;-1:-1:-1;69552:32:13;;;69587:3;69552:32;:38;69631:16;69552:32;69631:28;;:44;;-1:-1:-1;;;;;;69631:44:13;69670:4;69631:44;;;69410:272::o;63826:177::-;-1:-1:-1;;;;;63945:18:13;;63920:7;63945:18;;;:10;:18;;;;;:51;;:26;;63983:12;63945:37;:51::i;:::-;-1:-1:-1;;;;;63938:58:13;;63826:177;-1:-1:-1;;;63826:177:13:o;20485:322::-;20566:27;20582:10;20566:15;:27::i;:::-;20565:28;:88;;;;;20635:18;:16;:18::i;:::-;20609:44;;:23;:44;;;20565:88;20557:97;;;;;;20675:10;20664:22;;;;:10;:22;;;;;;;;;:45;;:71;;-1:-1:-1;;20664:71:13;-1:-1:-1;;;20664:71:13;;;;;;;;;;;;;20750:50;;;;;;;;;;;;;;;;;20485:322;:::o;31802:171::-;8523:10;8486:23;8512:22;;;:10;:22;;;;;8552:10;;:14;;;:47;;-1:-1:-1;8570:24:13;;;;;;;;;:29;;8552:47;8544:56;;;;;;3997:2:::1;31897:23:::0;::::1;31889:32;;;::::0;::::1;;31931:35;31936:10;31948:6;31956;31964:1;31931:4;:35::i;4686:50::-:0;;;;;;;;;;;;;:::o;9925:195:6:-;6499:20;;;;6491:34;;;;;;9990:57:::1;-1:-1:-1::0;;;;;9990:5:6::1;:22;10013:10;10033:4;10040:6:::0;9990:22:::1;:57::i;:::-;10057:14;10064:6;10057;:14::i;:::-;10086:27;::::0;;;;;;;10094:10:::1;::::0;10086:27:::1;::::0;;;;;::::1;::::0;;::::1;9925:195:::0;:::o;1689:115:9:-;897:9;:7;:9::i;:::-;889:18;;;;;;1769:28:::1;1788:8;1769:18;:28::i;833:49:6:-:0;;;:::o;610:36::-;;;:::o;4597:24:13:-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4597:24:13;;-1:-1:-1;4597:24:13;:::o;1254:199:0:-;1312:6;1334;;;1330:45;;-1:-1:-1;1363:1:0;1356:8;;1330:45;1395:5;;;1417:10;;;;;:5;;;;;;;;;;;;:10;;;1410:18;;;948:118:1;1037:13;;;1053:1;1037:17;;;:22;;948:118::o;414:121::-;233:1;516:12;;;;;;509:19;;414:121::o;32409:1230:13:-;3997:2;32512:23;;32508:179;;;32568:1;32559:6;:10;32551:19;;;;;;32508:179;;;32619:24;32609:6;:34;;:66;;;;;32659:16;32647:28;;:8;:28;;;;32609:66;32601:75;;;;;;32697:20;32720:18;:16;:18::i;:::-;-1:-1:-1;;;;;32821:19:13;;32748:17;32821:19;;;:10;:19;;;;;32697:41;;-1:-1:-1;32784:1:13;32768:17;;;32821:19;32873:48;32821:19;32697:41;32768:17;32873:15;:48::i;:::-;32850:71;-1:-1:-1;32931:29:13;32963:24;:6;32850:71;32963:10;:24::i;:::-;33030:10;;32931:56;;-1:-1:-1;33005:35:13;;;;;:88;;;33069:24;33044:21;:49;;33005:88;32997:97;;;;;;33145:24;;;;:38;;;;:24;;;;;:38;33141:168;;;33199:27;;;;;;;:15;:27;;;;;;;;;:37;;;;;;33255:43;;;;;;;-1:-1:-1;;;;;33255:43:13;;;;;;;;;;;;33141:168;3997:2;33389:23;;33385:248;;;33428:73;33444:4;33450:13;33465:10;33477:7;33486:6;33494;33428:15;:73::i;:::-;33385:248;;;33564:58;33578:4;33584:10;33596:7;33605:6;33613:8;33564:13;:58::i;30259:1014::-;30385:11;30377:20;;;;;;-1:-1:-1;;;;;30433:19:13;;;30407:23;30433:19;;;:10;:19;;;;;;;;30527:16;:25;;;;;;;30433:19;;30527:25;:39;;:83;;-1:-1:-1;30599:11:13;;;;-1:-1:-1;;;;;30570:25:13;;;;;;;:16;:25;;;;;;;;30599:11;;;;;30570:40;30527:83;30519:92;;;;;;30664:14;;;:21;30660:147;;30706:7;:21;;;;;;;;-1:-1:-1;30706:21:13;;;;;;;;-1:-1:-1;;;;;;30706:21:13;-1:-1:-1;;;;;30706:21:13;;;;;;;;;;30741:13;;;;:22;;30706:21;;30773:18;:16;:18::i;:::-;:22;30741:55;;;;;;;;;;;;;-1:-1:-1;;;;;30741:55:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30660:147;30816:53;-1:-1:-1;;;;;30816:5:13;:22;30839:6;30855:4;30862:6;30816:22;:53::i;:::-;30879:20;;;;;;30909:39;30914:7;30923:6;30893;30939:8;30909:4;:39::i;:::-;30959:33;30971:4;30984:6;30959:11;:33::i;:::-;3997:2;31006:24;;31002:265;;31051:36;;;;;;;;;;;;;;;-1:-1:-1;;;;;31051:36:13;;;;;;;;;;;31002:265;;;31118:17;31138:40;31162:7;31171:6;31138:23;:40::i;:::-;31118:60;;31207:7;-1:-1:-1;;;;;31197:59:13;;31216:6;31237:18;:16;:18::i;:::-;31197:59;;;;;;31224:31;;;31197:59;;;;;;;;;;;;;;;31002:265;30259:1014;;;;;;:::o;48144:1545::-;48193:23;48218;48253:20;48276:18;:16;:18::i;:::-;-1:-1:-1;;;;;48381:19:13;;48304:21;48381:19;;;:10;:19;;;;;48344:1;48415:24;;;48253:41;;-1:-1:-1;;;48328:17:13;;;48415:24;;;;;:29;;:134;;-1:-1:-1;48460:27:13;;;;;;:32;:89;;;;-1:-1:-1;48508:24:13;;;;:41;;;;:24;;;;;:41;48460:89;48415:194;;;-1:-1:-1;48565:27:13;;;;:44;;;;:27;;:44;48415:194;48411:238;;;48633:1;48636;48625:13;;;;;;;;;48411:238;48659:18;48680:35;48695:4;48701:13;48680:14;:35::i;:::-;48659:56;;48725:14;48753:12;48769:42;4130:1;48769:4;:10;;;:17;;:42;;;;:::i;:::-;48826:27;;;;48768:43;;;-1:-1:-1;48826:27:13;;:32;48822:363;;48894:27;;;;48883:76;;48888:4;;48894:27;;48923:13;48938:11;48951:7;48883:4;:76::i;:::-;48992:27;;;;;-1:-1:-1;;49033:31:13;;;;;48992:27;;;-1:-1:-1;48874:85:13;-1:-1:-1;49078:97:13;;;;49125:24;;;;;;;;;49109:41;;;;:15;:41;;;;;:51;;;;;;49078:97;49198:24;;;;:42;;;;:24;;;;;:42;49194:255;;49277:24;;;;49266:73;;49277:24;;;;;;;49303:13;49318:11;49331:7;49266:4;:73::i;:::-;49372:24;;;;;-1:-1:-1;;49410:28:13;;;;;49372:24;;;;;;;-1:-1:-1;49256:83:13;;;;49194:255;49459:20;;;;;;49493:10;;;;:37;;4231:1;49493:17;:37::i;:::-;49489:96;;;49546:18;;;:28;;;;;;49489:96;49595:33;49607:4;49620:6;49595:11;:33::i;:::-;49643:39;;;;;;;;;;;;-1:-1:-1;;;;;49643:39:13;;;;;;;;;;;;48144:1545;;;;;;;;;;:::o;12665:578::-;12786:19;12846:18;12867:37;12882:5;12889:14;12867;:37::i;:::-;12846:58;;12919:9;12914:323;12938:15;;;:22;12934:26;;12914:323;;;12981:29;13013:5;:15;;13029:1;13013:18;;;;;;;;;;;;;;;;;13049:20;;13013:18;;-1:-1:-1;13049:31:13;;;;:20;;:31;;;;:108;;;13150:7;13100:57;;:46;13124:8;13134:11;13100:23;:46::i;:::-;:57;;;;13049:108;13045:182;;;13192:20;;-1:-1:-1;;;13192:20:13;;-1:-1:-1;;;;;13192:20:13;13177:35;;;;;13045:182;-1:-1:-1;12962:3:13;;12914:323;;;;12665:578;;;;;;:::o;198:105:7:-;256:7;287:1;282;:6;;:14;;295:1;282:14;;;-1:-1:-1;291:1:7;;275:21;-1:-1:-1;198:105:7:o;1245:145:11:-;1303:7;1335:1;1330;:6;;1322:15;;;;;;-1:-1:-1;1359:5:11;;;1245:145::o;24327:359:13:-;24415:11;;;;:44;;4289:1;24415:18;:44::i;:::-;24411:269;;24500:11;;24474:38;;:13;;;;:25;:38::i;:::-;24526:25;24562:26;:14;:24;:26::i;:::-;-1:-1:-1;;;;;24554:35:13;;-1:-1:-1;24603:66:13;24630:38;24554:35;24658:9;24630:27;:38::i;:::-;24603:14;;:26;:66::i;24411:269::-;24327:359;;:::o;431:123:10:-;521:5;-1:-1:-1;;;;;521:14:10;;536:2;540:5;521:25;;;;;;;;;;;;;-1:-1:-1;;;;;521:25:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;521:25:10;513:34;;;;;46367:579:13;46472:11;;;;:35;;4179:1;46472:18;:35::i;:::-;46467:73;;46523:7;;46467:73;46554:13;46549:391;46581:15;;;:22;46573:30;;46549:391;;;46628:29;46660:5;:15;;46676:5;46660:22;;;;;;;;;;;;;;;;;46700:19;;46660:22;;-1:-1:-1;46700:19:13;;;;;:24;;;:49;;-1:-1:-1;46728:16:13;;-1:-1:-1;;;46728:16:13;;;;:21;46700:49;46696:96;;;46769:8;;;46696:96;46805:18;;-1:-1:-1;;46805:18:13;-1:-1:-1;;;46805:18:13;;;;;;;;;;;;;-1:-1:-1;;;;46805:18:13;;;;;;;;;;46841:16;;46837:93;;46882:33;;-1:-1:-1;;46882:33:13;;;;;;;;;46837:93;46549:391;;46605:7;;46549:391;;1523:141:0;1581:6;1610:5;;;1632:6;;;;;;;;;1625:14;;;10916:359:13;11105:11;;;;11020:6;;11105:35;;4179:1;11105:18;:35::i;:::-;:81;;;;-1:-1:-1;11144:25:13;;;;:42;;;;:25;;;;;:42;11105:81;11101:137;;;-1:-1:-1;11226:1:13;11209:18;;11202:25;;11101:137;-1:-1:-1;11254:14:13;10916:359;-1:-1:-1;10916:359:13:o;11444:421::-;11587:20;;11561:6;;11587:20;;;;;:25;11583:83;;-1:-1:-1;11635:20:13;;;;;;;11628:27;;11583:83;11718:17;;-1:-1:-1;;;11718:17:13;;;;;;11695:20;;;:40;;11749:31;;;;11745:79;;;4043:5;11796:17;;;;;1473:145:11;1531:7;1562:5;;;1585:6;;;;1577:15;;;;;1088:128:12;1169:40;1181:5;1188:12;1202:6;1169:11;:40::i;2036:152::-;2103:6;2124:12;2140:19;2153:5;2140:12;:19::i;:::-;2121:38;2036:152;-1:-1:-1;;;;2036:152:12:o;560:151:10:-;668:5;-1:-1:-1;;;;;668:18:10;;687:4;693:2;697:5;668:35;;;;;;;;;;;;;-1:-1:-1;;;;;668:35:10;;;;;;-1:-1:-1;;;;;668:35:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;668:35:10;660:44;;;;;53952:1838:13;54168:19;;;3997:2;4043:5;;54168:19;54537:1247;54561:15;;;:22;54557:26;;54537:1247;;;54604:29;54636:5;:15;;54652:1;54636:18;;;;;;;;;;;;;;;54604:50;;54668:17;54688:47;54712:8;54722:12;54688:23;:47::i;:::-;54766:20;;54668:67;;-1:-1:-1;54766:20:13;;;;54753:33;;;;54749:80;;;54806:8;;;;54749:80;54846:20;;:38;;;;:20;;:38;;;;:83;;;54918:11;54904:25;;:10;:25;;;;54846:83;54842:487;;;54971:20;;-1:-1:-1;;;54971:20:13;;-1:-1:-1;;;;;54971:20:13;54949:42;;;;;54842:487;;;55016:20;;:38;;;;:20;;:38;;;;:86;;;55088:14;55074:28;;:10;:28;;;;55016:86;55012:317;;;55137:20;;-1:-1:-1;;;55137:20:13;;-1:-1:-1;;;;;55137:20:13;55122:35;;;;;55012:317;;;55182:20;;:35;;;;:20;;:35;;;;:80;;;55251:11;55237:25;;:10;:25;;;;55182:80;55178:151;;;55294:20;;-1:-1:-1;;;55294:20:13;;-1:-1:-1;;;;;55294:20:13;55282:32;;;;;55178:151;55373:20;;;;;;55360:33;;;;55411:38;;-1:-1:-1;55411:38:13;;;:86;;;55483:14;55469:28;;:10;:28;;;;55411:86;:207;;;;;55531:13;55518:26;;:10;:26;;;:99;;;;55578:13;55564:27;;:10;:27;;;:53;;;;;55606:11;55595:22;;:8;:22;;;55564:53;55407:367;;;55674:1;55650:25;;55707:8;55693:22;;55749:10;55733:26;;55407:367;54537:1247;;;;54585:3;;54537:1247;;;;53952:1838;;;;;;;;;;;:::o;56106:2104::-;56331:37;56371:5;:15;;56387:1;56371:18;;;;;;;;;;;;;;;;;;-1:-1:-1;4043:5:13;;56499:1705;56505:12;;56499:1705;;3997:2;56537:39;;56533:563;;;56615:5;:15;;56631:22;56615:39;;;;;;;;;;;;;;;56596:58;;56696:55;56720:16;56738:12;56696:23;:55::i;:::-;56815:28;;3997:2;;-1:-1:-1;56672:79:13;;-1:-1:-1;56815:28:13;;56791:52;;;-1:-1:-1;56533:563:13;;;57024:57;57044:5;57051:15;57068:12;57024:19;:57::i;:::-;56939:142;;-1:-1:-1;56939:142:13;;-1:-1:-1;56939:142:13;-1:-1:-1;56533:563:13;4043:5;57113:33;;;;57109:77;;;57166:5;;57109:77;57261:28;;57224:8;;-1:-1:-1;;;57261:28:13;;-1:-1:-1;;;;;57261:28:13;57250:39;;57246:463;;;57309:49;;-1:-1:-1;;;;;;;;57309:49:13;;;;;;;;;;;;-1:-1:-1;;;;;;;;57309:49:13;;;;;;;57376:79;;57392:5;;57399:28;;57349:8;57439:15;57376;:79::i;:::-;57484:1;57473:12;;57246:463;;;-1:-1:-1;57524:49:13;;-1:-1:-1;;57524:49:13;;-1:-1:-1;;57554:19:13;;57524:49;;;;;;;-1:-1:-1;;;57603:28:13;;-1:-1:-1;;;;;57603:28:13;57591:40;;;;;57246:463;57726:28;;;;:47;;;;:28;;:47;;;;:120;;-1:-1:-1;57793:28:13;;;;:53;;;;:28;;:53;;57726:120;57722:234;;;57894:28;;;;;;57878:45;;;;:15;:45;;;;;:63;;;;;;;57722:234;57973:25;;;;:44;;;;:25;;;;;:44;;;;:114;;-1:-1:-1;58037:25:13;;;;:50;;;;:25;;;;;:50;;57973:114;57969:225;;;58135:25;;;;;;;;;58119:42;;;;:15;:42;;;;;:60;;;;;;;57969:225;56499:1705;;;;56106:2104;;;;;;;;:::o;9628:148:6:-;9680:20;:40;;-1:-1:-1;;;;;;9680:40:6;;-1:-1:-1;;;;;9680:40:6;;;;;;;;;9730:39;;;-1:-1:-1;;;9730:39:6;;;;;;;;;;;;;;;;;;;;9628:148::o;36432:472:13:-;36609:18;36629:17;36676:37;36691:5;36698:14;36676;:37::i;:::-;36662:51;;36736:47;36760:9;36771:11;36736:23;:47::i;:::-;36723:60;;36882:14;36869:27;;:10;:27;;;36861:36;;;;;;36432:472;;;;;;:::o;10421:446:6:-;10497:30;10515:11;10497:17;:30::i;:::-;10617:20;;;;10552:60;10564:11;-1:-1:-1;;;10552:11:6;:60::i;:::-;10545:92;;;10537:101;;;;;;10729:20;;-1:-1:-1;;;;;10729:20:6;10664:60;10676:11;-1:-1:-1;;;10664:11:6;:60::i;:::-;-1:-1:-1;;;;;10656:93:6;;10648:102;;;;;;10840:19;;-1:-1:-1;;;10840:19:6;;-1:-1:-1;;;;;10840:19:6;10776:59;10788:11;-1:-1:-1;;;10776:11:6;:59::i;:::-;-1:-1:-1;;;;;10768:91:6;;10760:100;;;;;3574:259:14;3656:14;;3710:44;3726:7;3735:9;3656:14;;;3710:15;:44::i;:::-;3797:20;;3773:54;-1:-1:-1;;;;3773:54:14:o;3939:286::-;4040:14;;4094:52;4110:7;4119:9;4130:1;4133:9;4040:14;4094:15;:52::i;:::-;4189:20;;4165:54;-1:-1:-1;;;;;4165:54:14:o;64392:292:13:-;64483:24;;:::i;:::-;64523:21;64547:65;64563:7;-1:-1:-1;;;64598:1:13;64601:7;64523:21;64547:15;:65::i;65174:340::-;65283:22;;:::i;:::-;65321:21;65345:97;65374:7;-1:-1:-1;;;65414:1:13;65417:7;65434:6;65345:15;:97::i;:::-;65321:121;65461:47;-1:-1:-1;;;;;65461:47:13:o;64759:344::-;64868:26;;:::i;:::-;64910:21;64934:97;64963:7;-1:-1:-1;;;65003:1:13;65006:7;65023:6;64934:15;:97::i;4332:355:14:-;4492:14;4522:21;4546:62;4562:7;4571:9;4582:1;4585:10;4597;4546:15;:62::i;:::-;4651:20;;4627:54;-1:-1:-1;;;;;;4627:54:14:o;2194:1804:12:-;2356:12;;2280:6;;2320:8;;2583:11;2579:50;;2617:1;2610:8;;;;;;2579:50;2672:17;2701:1;2692:6;:10;2672:30;;2713:19;2734:20;2758:33;2773:5;2788:1;2779:6;:10;2773:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2773:17:12;2758:14;:33::i;:::-;2712:79;;;;2814:12;2805:21;;:5;:21;;;2801:72;;2849:13;-1:-1:-1;2842:20:12;;-1:-1:-1;;;;2842:20:12;2801:72;3003:24;3018:5;3024:1;3018:8;;;;;;;3003:24;2971:56;;-1:-1:-1;2971:56:12;-1:-1:-1;3051:1:12;3041:11;;;:35;;;3064:12;3056:20;;:5;:20;;;3041:35;3037:74;;;3099:1;3092:8;;;;;;;;;3037:74;3245:11;-1:-1:-1;;3285:13:12;;3245:11;;3358:547;3372:3;3365:4;:10;3358:547;;;3391:11;3424:1;3419;3406:10;;;:14;3405:20;3391:34;;3484:26;3499:5;3505:3;3499:10;;;;;;;3484:26;3462:48;;-1:-1:-1;3462:48:12;-1:-1:-1;3529:15:12;;;;;;;;3525:370;;;3570:3;3564:9;;3525:370;;;3606:7;3598:15;;:5;:15;;;3594:301;;;3789:1;3783:3;:7;3776:14;;3594:301;;;-1:-1:-1;3872:8:12;-1:-1:-1;3865:15:12;;-1:-1:-1;;;;;;;;3865:15:12;3594:301;3358:547;;;;3935:26;3950:5;3956:3;3950:10;;;;;;;3935:26;3915:46;2194:1804;-1:-1:-1;;;;;;;;;;;;;2194:1804:12:o;37359:1050:13:-;37569:9;37564:677;37588:15;;;:22;37584:26;;37564:677;;;37631:29;37663:5;:15;;37679:1;37663:18;;;;;;;;;;;;;;;;;37699:19;;37663:18;;-1:-1:-1;37699:19:13;;;;;:24;;;;:149;;-1:-1:-1;37744:28:13;;;;;;:33;;:103;;-1:-1:-1;37819:28:13;;;;37797:19;;37819:28;;;;37797:19;;;;;;;:50;37744:103;37699:268;;;;-1:-1:-1;37869:25:13;;;;;;;;;:30;;:97;;-1:-1:-1;37941:25:13;;;;37919:19;;37941:25;;;;;;;;37919:19;;;;;:47;37869:97;37695:536;;;37999:35;;-1:-1:-1;;37999:35:13;;;;;;;;;-1:-1:-1;;38052:33:13;;;;;;;-1:-1:-1;;;;38103:27:13;-1:-1:-1;;;38103:27:13;;;;;;;;-1:-1:-1;;;;;;;;38148:44:13;-1:-1:-1;;;;;;;;38148:44:13;;;;;;-1:-1:-1;38210:7:13;;37695:536;-1:-1:-1;37612:3:13;;37564:677;;;-1:-1:-1;38258:15:13;;;:22;3997:2;-1:-1:-1;38250:48:13;;;;;;38329:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;38329:72:13;;;;;;;;;38308:15;;;:94;;;;;;;-1:-1:-1;38308:94:13;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;38308:94:13;-1:-1:-1;;;;;;;;38308:94:13;;;-1:-1:-1;;;38308:94:13;-1:-1:-1;;;;38308:94:13;;;;;-1:-1:-1;;38308:94:13;;;;-1:-1:-1;;38308:94:13;;;;;;;;;;;;;;;;;;;;;;;;;;;37359:1050;;;;;:::o;2084:132:14:-;1426:1;1628:9;;-1:-1:-1;;;1628:9:14;;:25;:9;:25;1620:34;;;;;;2173:36:::1;::::0;;2198:10:::1;2173:36:::0;;;;-1:-1:-1;;;;;2173:36:14;::::1;::::0;::::1;::::0;;;;;::::1;::::0;;::::1;2084:132:::0;:::o;1948:183:9:-;-1:-1:-1;;;;;2021:22:9;;2013:31;;;;;;2080:6;;;2059:38;;-1:-1:-1;;;;;2059:38:9;;;;2080:6;;;2059:38;;;2107:6;:17;;-1:-1:-1;;;;;;2107:17:9;-1:-1:-1;;;;;2107:17:9;;;;;;;;;;1948:183::o;34964:1086:13:-;35192:29;35224:5;:15;;35240:6;35224:23;;;;;;;;;;;;;;;35192:55;;35260:17;35281:58;35307:5;35314:8;35324:14;35281:25;:58::i;:::-;35493:28;;;;35257:82;;-1:-1:-1;35493:28:13;;:33;;;;-1:-1:-1;35493:95:13;;-1:-1:-1;35542:28:13;;;;:46;;;;:28;;:46;;35493:95;:200;;;-1:-1:-1;35604:25:13;;;;;;;;;:30;;;;:89;;-1:-1:-1;35650:25:13;;;;:43;;;;:25;;;;;:43;;35604:89;35489:321;;;35737:20;;35717:82;;35730:5;;35737:20;;;;35759:14;;35737:20;;-1:-1:-1;;;35778:20:13;;-1:-1:-1;;;;;35778:20:13;35717:12;:82::i;:::-;35820:39;;-1:-1:-1;;;;;;;;35820:39:13;;-1:-1:-1;;;35820:39:13;;;;-1:-1:-1;;;;;35820:39:13;;;;;;;;;;-1:-1:-1;;35928:34:13;;;;;;;;;;35978:65;;;;;;;;;;;;;36015:27;;;35978:65;;;;;;;;-1:-1:-1;;;;;35978:65:13;;;-1:-1:-1;;;;;;;;;;;35978:65:13;;;;;;;;;;;;34964:1086;;;;;;;;:::o;33944:604::-;34298:25;;;;34158:8;;34298:40;;;;:25;;;;;:40;:79;;;;-1:-1:-1;34342:11:13;;;;:35;;4179:1;34342:18;:35::i;:::-;34294:123;;;-1:-1:-1;;34393:13:13;34294:123;34426:53;34439:5;34446:11;34459:1;34462:8;34472:6;34426:12;:53::i;:::-;34495:46;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;34495:46:13;;;-1:-1:-1;;;;;;;;;;;34495:46:13;;;;;;;;;33944:604;;;;;;:::o;49948:981::-;50142:14;50197:9;50192:708;50216:15;;;:22;50212:26;;50192:708;;;50259:29;50292:5;:15;;50308:1;50292:18;;;;;;;;;;;;;;;50259:51;;50324:17;50344:47;50368:8;50378:12;50344:23;:47::i;:::-;50409:20;;50324:67;;-1:-1:-1;50409:38:13;;;;:20;;:38;;;;:70;;;50465:14;50451:28;;:10;:28;;;;50409:70;50405:485;;;50586:20;;50628:31;;;;50499:22;50628:31;;;:15;:31;;;;;;50499:22;;50524:190;;50550:14;;-1:-1:-1;;;50586:20:13;;;-1:-1:-1;;;;;50586:20:13;;50628:31;50681:32;;:16;;50628:31;50681:16;:32::i;:::-;50524:4;:190::i;:::-;50732:24;;;;50499:215;-1:-1:-1;50774:102:13;;;;50810:47;;-1:-1:-1;;;;;;;;50810:47:13;;;;;;;;;;;-1:-1:-1;;;;;;;;50810:47:13;;;;;;50774:102;50405:485;;-1:-1:-1;;50240:3:13;;50192:708;;;;49948:981;;;;;;;:::o;672:205:0:-;735:7;763:1;758;:6;754:117;;787:17;:1;801;787:5;:17::i;:::-;780:24;;;;754:117;842:18;:1;856:2;;;;842:5;:18::i;1222:556:12:-;1335:12;;1361:11;;1357:348;;1389:18;1413:33;1428:5;1443:1;1434:6;:10;1428:17;;;;;;;1413:33;1388:58;;;1481:11;1464:28;;1471:5;1464:28;;;1460:235;;;1532:45;1554:5;1569:6;1532:14;:45::i;:::-;1512:5;1527:1;1518:6;:10;1512:17;;;;;;;;;;;;;;;;;;;;;;;;;;:65;;;;;-1:-1:-1;;;;;1512:65:12;;;;;-1:-1:-1;;;;;1512:65:12;;;;;;1595:7;;;;1460:235;1642:11;1626:27;;1633:5;1626:27;;;1622:73;;;1672:8;;;1622:73;1357:348;;1714:5;1725:45;1747:5;1762:6;1725:14;:45::i;:::-;1714:57;;;;;;;;-1:-1:-1;1714:57:12;;;;;;;;;;;;;-1:-1:-1;;;;;1714:57:12;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1222:556:12;;;:::o;1784:246::-;1897:12;;1854:6;;;;1923:10;;1919:81;;1956:33;1971:5;1986:1;1977:6;:10;1971:17;;;;;;;1956:33;1949:40;;;;;;;1919:81;-1:-1:-1;2018:1:12;;;;-1:-1:-1;1784:246:12;-1:-1:-1;;1784:246:12:o;58602:1243:13:-;58775:37;4043:5;;58775:37;59050:789;59074:15;;;:22;59070:26;;59050:789;;;59117:29;59149:5;:15;;59165:1;59149:18;;;;;;;;;;;;;;;59117:50;;59181:17;59201:47;59225:8;59235:12;59201:23;:47::i;:::-;59279:20;;59181:67;;-1:-1:-1;59279:20:13;;;;59266:33;;;;59262:80;;;59319:8;;;;59262:80;59386:20;;;;;;59373:33;;;;59424:38;;-1:-1:-1;59424:38:13;;;:86;;;59496:14;59482:28;;:10;:28;;;;59424:86;:231;;;;;59544:21;59531:34;;:10;:34;;;:123;;;;59599:21;59585:35;;:10;:35;;;:69;;;;;59635:19;59624:30;;:8;:30;;;59585:69;59420:409;;;59706:8;59687:27;;59754:8;59732:30;;59804:10;59780:34;;59420:409;59050:789;;;;59098:3;;59050:789;;;;58602:1243;;;;;;;:::o;60273:1627::-;60548:28;;;;60515:30;;60548:28;;:33;;;;:94;;-1:-1:-1;60597:28:13;;;;:45;;;;:28;;:45;60548:94;60682:25;;;;60515:127;;-1:-1:-1;60652:27:13;;60682:25;;;;;:30;;;;:88;;-1:-1:-1;60728:25:13;;;;:42;;;;:25;;;;;:42;60682:88;60652:118;;60780:32;60815:25;:73;;;;-1:-1:-1;60844:28:13;;;;:44;;;;:28;;:44;;60815:73;60780:108;;60898:29;60930:22;:67;;;;-1:-1:-1;60956:25:13;;;;:41;;;;:25;;;;;:41;;60930:67;60898:99;;61012:27;61011:28;:57;;;;;61044:24;61043:25;61011:57;61007:94;;;61084:7;;;;;;61007:94;-1:-1:-1;;61195:18:13;;61171:21;61223:595;61247:15;;;:22;61243:26;;61223:595;;;61290:29;61322:5;:15;;61338:1;61322:18;;;;;;;;;;;;;;;;;61358:19;;61322:18;;-1:-1:-1;61358:37:13;;;;:19;;;;;:37;:334;;;;;61465:25;:81;;;;-1:-1:-1;61526:20:13;;;61494:28;;;61526:20;;;;61494:28;;:52;;61465:81;61417:130;;:27;:130;;;61416:275;;;;;61614:22;:75;;;;-1:-1:-1;61669:20:13;;;61640:25;;;61669:20;;;;61640:25;;;;;;;:49;;61614:75;61569:121;;:24;:121;;;61416:275;61354:454;;;61724:45;;-1:-1:-1;;;;;;;;61724:45:13;;;;;;;;;;;-1:-1:-1;;;;;;;;61724:45:13;;;;;;-1:-1:-1;61787:7:13;;-1:-1:-1;;;;;61787:7:13;61354:454;-1:-1:-1;61271:3:13;;61223:595;;;;61827:66;61840:5;61847:12;61861:14;61877:1;61880:12;61827;:66::i;1812:136:14:-;1426:1;1628:9;;-1:-1:-1;;;1628:9:14;;:25;:9;:25;1620:34;;;;;;1903:38:::1;::::0;;1930:10:::1;1903:38:::0;;;;-1:-1:-1;;;;;1903:38:14;::::1;::::0;::::1;::::0;;;;;::::1;::::0;;::::1;1812:136:::0;:::o;2569:899::-;2850:4;2844:11;2868:32;;;2916:25;;2913:2;;2993:10;2986:4;2971:13;2967:24;2960:44;2913:2;3057:1;3037:18;3034:25;3031:2;;;3111:10;3104:4;3089:13;3085:24;3078:44;3031:2;3245:1;3242;3220:18;3214:4;3210:29;3204:4;3200:40;3185:13;3176:7;3169:5;3156:91;3264:71;;;;3417:16;3412:3;3397:13;3382:52;3149:303;;3264:71;3315:1;3300:13;3293:24;898:184:12;1006:34;;;;;;;898:184::o;1784:119:0:-;1842:6;1872:1;1867:6;;:1;:6;;;;1860:14;;;7866:1656:6;8076:19;;8042:14;;8099:11;-1:-1:-1;;;;;8076:34:6;;;-1:-1:-1;;;8076:19:6;;;;:34;8072:73;;;-1:-1:-1;8133:1:6;8126:8;;8072:73;8176:20;;;;;;8159:37;;;;8155:161;;;8235:19;;;-1:-1:-1;;;8235:19:6;;-1:-1:-1;;;;;8235:19:6;-1:-1:-1;;;;;;8212:42:6;;;;;;8268:20;:37;;-1:-1:-1;;8268:37:6;;;;;;;8155:161;8524:20;;8326:21;;;;8572;-1:-1:-1;;;;;8524:20:6;;;8547:21;8524:44;:69;8520:462;;-1:-1:-1;8625:21:6;;-1:-1:-1;8674:24:6;8520:462;;;-1:-1:-1;;8905:20:6;;-1:-1:-1;;;;;8905:20:6;;;8891:11;:34;8875:50;8953:18;8520:462;8992:24;9097;9031:63;9052:17;9071:22;9031:20;:63::i;:::-;:90;;;8992:129;;9234:11;9214:17;:31;9181:16;9166:12;9149:13;9141:37;:56;9140:106;;;;;;9131:115;;9293:17;9313:19;:17;:19::i;:::-;9293:39;-1:-1:-1;9346:11:6;9342:125;;9382:1;9373:10;;9342:125;;;9413:9;9404:6;:18;9400:67;;;9447:9;9438:18;;9400:67;-1:-1:-1;;9477:19:6;:38;;-1:-1:-1;;;;;;;;9477:38:6;;;;;;;;;;;;;;;-1:-1:-1;;7866:1656:6;;;;;;:::o;737:155:12:-;-1:-1:-1;;;;;869:15:12;864:2;846:20;;;;-1:-1:-1;;;846:20:12;:38;;737:155::o;314:103:0:-;372:6;401:1;397:5;;:1;:5;;;:13;;409:1;397:13;;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o

Swarm Source

ipfs://5af8317972ec65416224a84d62b1c62eafe441b073d4d63e3171cd2871049557
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.