ETH Price: $2,382.25 (-1.13%)

Contract

0x175989c71Fd023D580C65F5dC214002687ff88B7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw201513542024-06-23 2:15:4775 days ago1719108947IN
Keep: TokenGrant
0 ETH0.000154631.99763818
Withdraw189299472024-01-03 22:58:23246 days ago1704322703IN
Keep: TokenGrant
0 ETH0.0035875241.40918023
Withdraw169375092023-03-30 3:52:47526 days ago1680148367IN
Keep: TokenGrant
0 ETH0.0022184127.10807369
Withdraw158988522022-11-04 19:50:23671 days ago1667591423IN
Keep: TokenGrant
0 ETH0.0017702517.89291618
Withdraw153259002022-08-12 8:16:34755 days ago1660292194IN
Keep: TokenGrant
0 ETH0.0010700810.81596858
Withdraw153107652022-08-09 22:52:50758 days ago1660085570IN
Keep: TokenGrant
0 ETH0.0030435835.1306714
Withdraw149669072022-06-15 10:04:09813 days ago1655287449IN
Keep: TokenGrant
0 ETH0.0051576674.1725393
Withdraw148810352022-05-31 21:29:49828 days ago1654032589IN
Keep: TokenGrant
0 ETH0.0055532267.85793177
Withdraw148810292022-05-31 21:28:33828 days ago1654032513IN
Keep: TokenGrant
0 ETH0.0072175169.57582006
Withdraw148427292022-05-25 15:51:49834 days ago1653493909IN
Keep: TokenGrant
0 ETH0.0065832863.46188602
Withdraw147829692022-05-15 23:57:40844 days ago1652659060IN
Keep: TokenGrant
0 ETH0.0011865317.06365596
Withdraw147771332022-05-15 1:38:13845 days ago1652578693IN
Keep: TokenGrant
0 ETH0.0033649134.01106741
Withdraw146884782022-04-30 23:26:56859 days ago1651361216IN
Keep: TokenGrant
0 ETH0.00824996127.44013548
Withdraw146819862022-04-29 22:54:45860 days ago1651272885IN
Keep: TokenGrant
0 ETH0.0051494252.04805641
Withdraw146819812022-04-29 22:53:42860 days ago1651272822IN
Keep: TokenGrant
0 ETH0.0060833361.48757471
Withdraw146515622022-04-25 3:56:59865 days ago1650859019IN
Keep: TokenGrant
0 ETH0.0037193242.73953379
Withdraw146328322022-04-22 5:33:28867 days ago1650605608IN
Keep: TokenGrant
0 ETH0.0023080733.00879512
Withdraw146218822022-04-20 12:24:23869 days ago1650457463IN
Keep: TokenGrant
0 ETH0.0035758151.13938055
Withdraw145869542022-04-15 1:16:28875 days ago1649985388IN
Keep: TokenGrant
0 ETH0.0033865534.22974807
Withdraw145771582022-04-13 12:41:27876 days ago1649853687IN
Keep: TokenGrant
0 ETH0.0025691536.74260527
Withdraw145625842022-04-11 5:43:10878 days ago1649655790IN
Keep: TokenGrant
0 ETH0.0018274721.09366161
Withdraw144590652022-03-26 2:06:55895 days ago1648260415IN
Keep: TokenGrant
0 ETH0.0041997160.06195142
Withdraw144583412022-03-25 23:23:54895 days ago1648250634IN
Keep: TokenGrant
0 ETH0.0033960248.56813479
Withdraw143336952022-03-06 13:50:28914 days ago1646574628IN
Keep: TokenGrant
0 ETH0.0014377817.56907346
Withdraw142934812022-02-28 8:12:45920 days ago1646035965IN
Keep: TokenGrant
0 ETH0.0023144226.59553656
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
148761582022-05-31 2:16:24829 days ago1653963384
Keep: TokenGrant
 Contract Creation0 ETH
148761332022-05-31 2:09:55829 days ago1653962995
Keep: TokenGrant
 Contract Creation0 ETH
146490192022-04-24 18:26:42865 days ago1650824802
Keep: TokenGrant
 Contract Creation0 ETH
145986602022-04-16 20:55:54873 days ago1650142554
Keep: TokenGrant
 Contract Creation0 ETH
143187702022-03-04 6:17:30916 days ago1646374650
Keep: TokenGrant
 Contract Creation0 ETH
142630682022-02-23 15:09:52925 days ago1645628992
Keep: TokenGrant
 Contract Creation0 ETH
137896082021-12-12 9:57:24998 days ago1639303044
Keep: TokenGrant
 Contract Creation0 ETH
137237252021-12-01 22:35:451009 days ago1638398145
Keep: TokenGrant
 Contract Creation0 ETH
134754872021-10-23 18:41:471048 days ago1635014507
Keep: TokenGrant
 Contract Creation0 ETH
134232422021-10-15 14:39:461056 days ago1634308786
Keep: TokenGrant
 Contract Creation0 ETH
131906212021-09-09 9:04:331092 days ago1631178273
Keep: TokenGrant
 Contract Creation0 ETH
130314222021-08-15 18:36:241117 days ago1629052584
Keep: TokenGrant
 Contract Creation0 ETH
129011332021-07-26 9:47:031137 days ago1627292823
Keep: TokenGrant
 Contract Creation0 ETH
127813262021-07-07 16:14:241156 days ago1625674464
Keep: TokenGrant
 Contract Creation0 ETH
127301212021-06-29 16:54:371164 days ago1624985677
Keep: TokenGrant
 Contract Creation0 ETH
126152622021-06-11 20:02:021182 days ago1623441722
Keep: TokenGrant
 Contract Creation0 ETH
126008162021-06-09 14:22:521184 days ago1623248572
Keep: TokenGrant
 Contract Creation0 ETH
125967482021-06-08 23:07:271185 days ago1623193647
Keep: TokenGrant
 Contract Creation0 ETH
125717452021-06-05 2:11:551189 days ago1622859115
Keep: TokenGrant
 Contract Creation0 ETH
125137152021-05-27 2:30:241198 days ago1622082624
Keep: TokenGrant
 Contract Creation0 ETH
123941532021-05-08 14:16:491216 days ago1620483409
Keep: TokenGrant
 Contract Creation0 ETH
123370742021-04-29 18:50:101225 days ago1619722210
Keep: TokenGrant
 Contract Creation0 ETH
123194172021-04-27 1:19:421228 days ago1619486382
Keep: TokenGrant
 Contract Creation0 ETH
122191882021-04-11 14:33:301243 days ago1618151610
Keep: TokenGrant
 Contract Creation0 ETH
121453212021-03-31 5:41:291254 days ago1617169289
Keep: TokenGrant
 Contract Creation0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenGrant

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 20 : TokenGrant.sol
pragma solidity 0.5.17;

import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./libraries/grant/UnlockingSchedule.sol";
import "./utils/BytesLib.sol";
import "./utils/AddressArrayUtils.sol";
import "./TokenStaking.sol";
import "./TokenGrantStake.sol";
import "./GrantStakingPolicy.sol";


/// @title TokenGrant
/// @notice A token grant contract for a specified standard ERC20Burnable token.
/// Has additional functionality to stake delegate/undelegate token grants.
/// Tokens are granted to the grantee via unlocking scheme and can be
/// withdrawn gradually based on the unlocking schedule cliff and unlocking duration.
/// Optionally grant can be revoked by the token grant manager.
contract TokenGrant {
    using SafeMath for uint256;
    using UnlockingSchedule for uint256;
    using SafeERC20 for ERC20Burnable;
    using BytesLib for bytes;
    using AddressArrayUtils for address[];

    event TokenGrantCreated(uint256 id);
    event TokenGrantWithdrawn(uint256 indexed grantId, uint256 amount);
    event TokenGrantStaked(uint256 indexed grantId, uint256 amount, address operator);
    event TokenGrantRevoked(uint256 id);

    event StakingContractAuthorized(address indexed grantManager, address stakingContract);

    struct Grant {
        address grantManager; // Token grant manager.
        address grantee; // Address to which granted tokens are going to be withdrawn.
        uint256 revokedAt; // Timestamp at which grant was revoked by the grant manager.
        uint256 revokedAmount; // The number of tokens revoked from the grantee.
        uint256 revokedWithdrawn; // The number of tokens returned to the grant creator.
        bool revocable; // Whether grant manager can revoke the grant.
        uint256 amount; // Amount of tokens to be granted.
        uint256 duration; // Duration in seconds of the period in which the granted tokens will unlock.
        uint256 start; // Timestamp at which the linear unlocking schedule will start.
        uint256 cliff; // Timestamp before which no tokens will be unlocked.
        uint256 withdrawn; // Amount that was withdrawn to the grantee.
        uint256 staked; // Amount that was staked by the grantee.
        GrantStakingPolicy stakingPolicy;
    }

    uint256 public numGrants;

    ERC20Burnable public token;

    // Staking contracts authorized by the given grant manager.
    // grant manager -> staking contract -> authorized?
    mapping(address => mapping (address => bool)) internal stakingContracts;

    // Token grants.
    mapping(uint256 => Grant) public grants;

    // Token grants stakes.
    mapping(address => TokenGrantStake) public grantStakes;

    // Mapping of token grant IDs per particular address
    // involved in a grant as a grantee or as a grant manager.
    mapping(address => uint256[]) public grantIndices;

    // Token grants balances. Sum of all granted tokens to a grantee.
    // This includes granted tokens that are already unlocked and
    // available to be withdrawn to the grantee
    mapping(address => uint256) public balances;

    // Mapping of operator addresses per particular grantee address.
    mapping(address => address[]) public granteesToOperators;

    /// @notice Creates a token grant contract for a provided Standard ERC20Burnable token.
    /// @param _tokenAddress address of a token that will be linked to this contract.
    constructor(address _tokenAddress) public {
        require(_tokenAddress != address(0x0), "Token address can't be zero.");
        token = ERC20Burnable(_tokenAddress);
    }

    /// @notice Used by grant manager to authorize staking contract with the given
    /// address.
    function authorizeStakingContract(address _stakingContract) public {
        require(
            _stakingContract != address(0x0),
            "Staking contract address can't be zero"
        );
        stakingContracts[msg.sender][_stakingContract] = true;
        emit StakingContractAuthorized(msg.sender, _stakingContract);
    }

    /// @notice Gets the amount of granted tokens to the specified address.
    /// @param _owner The address to query the grants balance of.
    /// @return An uint256 representing the grants balance owned by the passed address.
    function balanceOf(address _owner) public view returns (uint256 balance) {
        return balances[_owner];
    }

    /// @notice Gets the stake balance of the specified address.
    /// @param _address The address to query the balance of.
    /// @return An uint256 representing the amount staked by the passed address.
    function stakeBalanceOf(address _address) public view returns (uint256 balance) {
        for (uint i = 0; i < grantIndices[_address].length; i++) {
            uint256 id = grantIndices[_address][i];
            balance += grants[id].staked;
        }
        return balance;
    }

    /// @notice Gets grant by ID. Returns only basic grant data.
    /// If you need unlocking schedule for the grant you must call `getGrantUnlockingSchedule()`
    /// This is to avoid Ethereum `Stack too deep` issue described here:
    /// https://forum.ethereum.org/discussion/2400/error-stack-too-deep-try-removing-local-variables
    /// @param _id ID of the token grant.
    /// @return amount The amount of tokens the grant provides.
    /// @return withdrawn The amount of tokens that have already been withdrawn
    ///                   from the grant.
    /// @return staked The amount of tokens that have been staked from the grant.
    /// @return revoked A boolean indicating whether the grant has been revoked,
    ///                 which is to say that it is no longer unlocking.
    /// @return grantee The grantee of grant.
    function getGrant(uint256 _id) public view returns (
        uint256 amount,
        uint256 withdrawn,
        uint256 staked,
        uint256 revokedAmount,
        uint256 revokedAt,
        address grantee
    ) {
        return (
            grants[_id].amount,
            grants[_id].withdrawn,
            grants[_id].staked,
            grants[_id].revokedAmount,
            grants[_id].revokedAt,
            grants[_id].grantee
        );
    }

    /// @notice Gets grant unlocking schedule by grant ID.
    /// @param _id ID of the token grant.
    /// @return grantManager The address designated as the manager of the grant,
    ///                      which is the only address that can revoke this grant.
    /// @return duration The duration, in seconds, during which the tokens will
    ///                  unlocking linearly.
    /// @return start The start time, as a timestamp comparing to `now`.
    /// @return cliff The timestamp, before which none of the tokens in the grant
    ///               will be unlocked, and after which a linear amount based on
    ///               the time elapsed since the start will be unlocked.
    /// @return policy The address of the grant's staking policy.
    function getGrantUnlockingSchedule(
        uint256 _id
    ) public view returns (
        address grantManager,
        uint256 duration,
        uint256 start,
        uint256 cliff,
        address policy
    ) {
        return (
            grants[_id].grantManager,
            grants[_id].duration,
            grants[_id].start,
            grants[_id].cliff,
            address(grants[_id].stakingPolicy)
        );
    }

    /// @notice Gets grant ids of the specified address.
    /// @param _granteeOrGrantManager The address to query.
    /// @return An uint256 array of grant IDs.
    function getGrants(address _granteeOrGrantManager) public view returns (uint256[] memory) {
        return grantIndices[_granteeOrGrantManager];
    }

    /// @notice Gets operator addresses of the specified grantee address.
    /// @param grantee The grantee address.
    /// @return An array of all operators for a given grantee.
    function getGranteeOperators(address grantee) public view returns (address[] memory) {
        return granteesToOperators[grantee];
    }

    /// @notice Gets grant stake details of the given operator.
    /// @param operator The operator address.
    /// @return grantId ID of the token grant.
    /// @return amount The amount of tokens the given operator delegated.
    /// @return stakingContract The address of staking contract.
    function getGrantStakeDetails(address operator) public view returns (uint256 grantId, uint256 amount, address stakingContract) {
        return grantStakes[operator].getDetails();
    }


    /// @notice Receives approval of token transfer and creates a token grant with a unlocking
    /// schedule where balance withdrawn to the grantee gradually in a linear fashion until
    /// start + duration. By then all of the balance will have unlocked.
    /// @param _from The owner of the tokens who approved them to transfer.
    /// @param _amount Approved amount for the transfer to create token grant.
    /// @param _token Token contract address.
    /// @param _extraData This byte array must have the following values ABI encoded:
    /// grantManager (address) Address of the grant manager.
    /// grantee (address) Address of the grantee.
    /// duration (uint256) Duration in seconds of the unlocking period.
    /// start (uint256) Timestamp at which unlocking will start.
    /// cliffDuration (uint256) Duration in seconds of the cliff;
    ///               no tokens will be unlocked until the time `start + cliff`.
    /// revocable (bool) Whether the token grant is revocable or not (1 or 0).
    /// stakingPolicy (address) Address of the staking policy for the grant.
    function receiveApproval(address _from, uint256 _amount, address _token, bytes memory _extraData) public {
        require(ERC20Burnable(_token) == token, "Token contract must be the same one linked to this contract.");
        require(_amount <= token.balanceOf(_from), "Sender must have enough amount.");
        (address _grantManager,
         address _grantee,
         uint256 _duration,
         uint256 _start,
         uint256 _cliffDuration,
         bool _revocable,
         address _stakingPolicy) = abi.decode(
             _extraData,
             (address, address, uint256, uint256, uint256, bool, address)
        );

        require(_grantee != address(0), "Grantee address can't be zero.");
        require(
            _cliffDuration <= _duration,
            "Unlocking cliff duration must be less or equal total unlocking duration."
        );

        require(_stakingPolicy != address(0), "Staking policy can't be zero.");

        uint256 id = numGrants++;
        grants[id] = Grant(
            _grantManager,
            _grantee,
            0, 0, 0,
            _revocable,
            _amount,
            _duration,
            _start,
            _start.add(_cliffDuration),
            0, 0,
            GrantStakingPolicy(_stakingPolicy)
        );

        // Maintain a record to make it easier to query grants by grant manager.
        grantIndices[_from].push(id);

        // Maintain a record to make it easier to query grants by grantee.
        grantIndices[_grantee].push(id);

        token.safeTransferFrom(_from, address(this), _amount);

        // Maintain a record of the unlocked amount
        balances[_grantee] = balances[_grantee].add(_amount);
        emit TokenGrantCreated(id);
    }

    /// @notice Withdraws Token grant amount to grantee.
    /// @dev Transfers unlocked tokens of the token grant to grantee.
    /// @param _id Grant ID.
    function withdraw(uint256 _id) public {
        uint256 amount = withdrawable(_id);
        require(amount > 0, "Grant available to withdraw amount should be greater than zero.");

        // Update withdrawn amount.
        grants[_id].withdrawn = grants[_id].withdrawn.add(amount);

        // Update grantee grants balance.
        balances[grants[_id].grantee] = balances[grants[_id].grantee].sub(amount);

        // Transfer tokens from this contract balance to the grantee token balance.
        token.safeTransfer(grants[_id].grantee, amount);

        emit TokenGrantWithdrawn(_id, amount);
    }

    /// @notice Calculates and returns unlocked grant amount.
    /// @dev Calculates token grant amount that has already unlocked,
    /// including any tokens that have already been withdrawn by the grantee as well
    /// as any tokens that are available to withdraw but have not yet been withdrawn.
    /// @param _id Grant ID.
    function unlockedAmount(uint256 _id) public view returns (uint256) {
        Grant storage grant = grants[_id];
        return (grant.revokedAt != 0)
            // Grant revoked -> return what is remaining
            ? grant.amount.sub(grant.revokedAmount)
            // Not revoked -> calculate the unlocked amount normally
            : now.getUnlockedAmount(
                grant.amount,
                grant.duration,
                grant.start,
                grant.cliff
            );
    }

    /// @notice Calculates withdrawable granted amount.
    /// @dev Calculates the amount that has already unlocked but hasn't been withdrawn yet.
    /// @param _id Grant ID.
    function withdrawable(uint256 _id) public view returns (uint256) {
        uint256 unlocked = unlockedAmount(_id);
        uint256 withdrawn = grants[_id].withdrawn;
        uint256 staked = grants[_id].staked;

        if (withdrawn.add(staked) >= unlocked) {
            return 0;
        } else {
            return unlocked.sub(withdrawn).sub(staked);
        }
    }

    /// @notice Allows the grant manager to revoke the grant.
    /// @dev Granted tokens that are already unlocked (releasable amount)
    /// remain in the grant so grantee can still withdraw them
    /// the rest are revoked and withdrawable by token grant manager.
    /// @param _id Grant ID.
    function revoke(uint256 _id) public {
        require(grants[_id].grantManager == msg.sender, "Only grant manager can revoke.");
        require(grants[_id].revocable, "Grant must be revocable in the first place.");
        require(grants[_id].revokedAt == 0, "Grant must not be already revoked.");

        uint256 unlockedAmount = unlockedAmount(_id);
        uint256 revokedAmount = grants[_id].amount.sub(unlockedAmount);
        grants[_id].revokedAt = now;
        grants[_id].revokedAmount = revokedAmount;

        // Update grantee's grants balance.
        balances[grants[_id].grantee] = balances[grants[_id].grantee].sub(revokedAmount);
        emit TokenGrantRevoked(_id);
    }

    /// @notice Allows the grant manager to withdraw revoked tokens.
    /// @dev Will withdraw as many of the revoked tokens as possible
    /// without pushing the grant contract into a token deficit.
    /// If the grantee has staked more tokens than the unlocked amount,
    /// those tokens will remain in the grant until undelegated and returned,
    /// after which they can be withdrawn by calling `withdrawRevoked` again.
    /// @param _id Grant ID.
    function withdrawRevoked(uint256 _id) public {
        Grant storage grant = grants[_id];
        require(
            grant.grantManager == msg.sender,
            "Only grant manager can withdraw revoked tokens."
        );
        uint256 revoked = grant.revokedAmount;
        uint256 revokedWithdrawn = grant.revokedWithdrawn;
        require(revokedWithdrawn < revoked, "All revoked tokens withdrawn.");

        uint256 revokedRemaining = revoked.sub(revokedWithdrawn);

        uint256 totalAmount = grant.amount;
        uint256 staked = grant.staked;
        uint256 granteeWithdrawn = grant.withdrawn;
        uint256 remainingPresentInGrant =
            totalAmount.sub(staked).sub(revokedWithdrawn).sub(granteeWithdrawn);

        require(remainingPresentInGrant > 0, "No revoked tokens withdrawable.");

        uint256 amountToWithdraw = remainingPresentInGrant < revokedRemaining
            ? remainingPresentInGrant
            : revokedRemaining;
        token.safeTransfer(msg.sender, amountToWithdraw);
        grant.revokedWithdrawn += amountToWithdraw;
    }

    /// @notice Stake token grant.
    /// @dev Stakable token grant amount is determined
    /// by the grant's staking policy.
    /// @param _id Grant Id.
    /// @param _stakingContract Address of the staking contract.
    /// @param _amount Amount to stake.
    /// @param _extraData Data for stake delegation. This byte array must have
    /// the following values concatenated:
    /// - Beneficiary address (20 bytes)
    /// - Operator address (20 bytes)
    /// - Authorizer address (20 bytes)
    function stake(uint256 _id, address _stakingContract, uint256 _amount, bytes memory _extraData) public {
        require(grants[_id].grantee == msg.sender, "Only grantee of the grant can stake it.");
        require(grants[_id].revokedAt == 0, "Revoked grant can not be staked");
        require(
            stakingContracts[grants[_id].grantManager][_stakingContract],
            "Provided staking contract is not authorized."
        );

        // Expecting 60 bytes _extraData for stake delegation.
        require(_extraData.length == 60, "Stake delegation data must be provided.");
        address operator = _extraData.toAddress(20);

        // Calculate available amount. Amount of unlocked tokens minus what user already withdrawn and staked.
        require(_amount <= availableToStake(_id), "Must have available granted amount to stake.");

        // Keep staking record.
        TokenGrantStake grantStake = new TokenGrantStake(
            address(token),
            _id,
            _stakingContract
        );
        grantStakes[operator] = grantStake;
        granteesToOperators[grants[_id].grantee].push(operator);
        grants[_id].staked += _amount;

        token.transfer(address(grantStake), _amount);

        // Staking contract expects 40 bytes _extraData for stake delegation.
        // 20 bytes beneficiary's address + 20 bytes operator's address.
        grantStake.stake(_amount, _extraData);
        emit TokenGrantStaked(_id, _amount, operator);
    }

    ///  @notice Returns the amount of tokens available for staking from the grant.
    /// The stakeable amount is determined by the staking policy of the grant.
    /// If the grantee has withdrawn some tokens
    /// or the policy returns an erroneously high value,
    /// the stakeable amount is limited to the number of tokens remaining.
    /// @param _grantId Identifier of the grant
    function availableToStake(uint256 _grantId) public view returns (uint256) {
        Grant storage grant = grants[_grantId];
        // Revoked grants cannot be staked.
        // If the grant isn't revoked, the number of revoked tokens is 0.
        if (grant.revokedAt != 0) { return 0; }
        uint256 amount = grant.amount;
        uint256 withdrawn = grant.withdrawn;
        uint256 remaining = amount.sub(withdrawn);
        uint256 stakeable = grant.stakingPolicy.getStakeableAmount(
            now,
            amount,
            grant.duration,
            grant.start,
            grant.cliff,
            withdrawn
        );
        // Clamp the stakeable amount to what is left in the grant
        // in the case of a malfunctioning staking policy.
        if (stakeable > remaining) {
            stakeable = remaining;
        }

        return stakeable.sub(grant.staked);
    }

    /// @notice Cancels delegation within the operator initialization period
    /// without being subjected to the stake lockup for the undelegation period.
    /// This can be used to undo mistaken delegation to the wrong operator address.
    /// @param _operator Address of the stake operator.
    function cancelStake(address _operator) public {
        TokenGrantStake grantStake = grantStakes[_operator];
        uint256 grantId = grantStake.getGrantId();
        require(
            msg.sender == _operator || msg.sender == grants[grantId].grantee,
            "Only operator or grantee can cancel the delegation."
        );

        uint256 returned = grantStake.cancelStake();
        grants[grantId].staked = grants[grantId].staked.sub(returned);
    }

    /// @notice Undelegate the token grant.
    /// @param _operator Operator of the stake.
    function undelegate(address _operator) public {
        TokenGrantStake grantStake = grantStakes[_operator];
        uint256 grantId = grantStake.getGrantId();
        require(
            msg.sender == _operator || msg.sender == grants[grantId].grantee,
            "Only operator or grantee can undelegate."
        );

        grantStake.undelegate();
    }

    /// @notice Force cancellation of a revoked grant's stake.
    /// Can be used by the grant manager
    /// to immediately withdraw tokens back into the grant,
    /// from an operator still within the initialization period.
    /// These tokens can then be withdrawn
    /// if some revoked tokens haven't been withdrawn yet.
    function cancelRevokedStake(address _operator) public {
        TokenGrantStake grantStake = grantStakes[_operator];
        uint256 grantId = grantStake.getGrantId();
        require(
            grants[grantId].revokedAt != 0,
            "Grant must be revoked"
        );
        require(
            msg.sender == grants[grantId].grantManager,
            "Only grant manager can force cancellation of revoked grant stake."
        );

        uint256 returned = grantStake.cancelStake();
        grants[grantId].staked = grants[grantId].staked.sub(returned);
    }

    /// @notice Force undelegation of a revoked grant's stake.
    /// @dev Can be called by the grant manager once the grant is revoked.
    /// Has to be done this way, instead of undelegating all operators when the
    /// grant is revoked, because the latter method is vulnerable to DoS via
    /// out-of-gas.
    function undelegateRevoked(address _operator) public {
        TokenGrantStake grantStake = grantStakes[_operator];
        uint256 grantId = grantStake.getGrantId();
        require(
            grants[grantId].revokedAt != 0,
            "Grant must be revoked"
        );
        require(
            msg.sender == grants[grantId].grantManager,
            "Only grant manager can force undelegation of revoked grant stake"
        );

        grantStake.undelegate();
    }

    /// @notice Recover stake of the token grant.
    /// Recovers the tokens correctly
    /// even if they were earlier recovered directly in the staking contract.
    /// @param _operator Operator of the stake.
    function recoverStake(address _operator) public {
        TokenGrantStake grantStake = grantStakes[_operator];
        uint256 returned = grantStake.recoverStake();
        uint256 grantId = grantStake.getGrantId();
        grants[grantId].staked = grants[grantId].staked.sub(returned);

        delete grantStakes[_operator];
    }
}

File 2 of 20 : TokenStaking.sol
pragma solidity 0.5.17;

import "./StakeDelegatable.sol";
import "./utils/UintArrayUtils.sol";
import "./utils/PercentUtils.sol";
import "./utils/LockUtils.sol";
import "./KeepRegistry.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";

/// @title AuthorityDelegator
/// @notice An operator contract can delegate authority to other operator
/// contracts by implementing the AuthorityDelegator interface.
///
/// To delegate authority,
/// the recipient of delegated authority must call `claimDelegatedAuthority`,
/// specifying the contract it wants delegated authority from.
/// The staking contract calls `delegator.__isRecognized(recipient)`
/// and if the call returns `true`,
/// the named delegator contract is set as the recipient's authority delegator.
/// Any future checks of registry approval or per-operator authorization
/// will transparently mirror the delegator's status.
///
/// Authority can be delegated recursively;
/// an operator contract receiving delegated authority
/// can recognize other operator contracts as recipients of its authority.
interface AuthorityDelegator {
    function __isRecognized(address delegatedAuthorityRecipient) external returns (bool);
}

/// @title TokenStaking
/// @notice A token staking contract for a specified standard ERC20Burnable token.
/// A holder of the specified token can stake delegate its tokens to this contract
/// and recover the stake after undelegation period is over.
contract TokenStaking is StakeDelegatable {
    using UintArrayUtils for uint256[];
    using PercentUtils for uint256;
    using LockUtils for LockUtils.LockSet;
    using SafeERC20 for ERC20Burnable;

    // Minimum amount of KEEP that allows sMPC cluster client to participate in
    // the Keep network. Expressed as number with 18-decimal places.
    // Initial minimum stake is higher than the final and lowered periodically based
    // on the amount of steps and the length of the minimum stake schedule in seconds.
    uint256 public minimumStakeScheduleStart;
    uint256 public constant minimumStakeSchedule = 86400 * 365 * 2; // 2 years in seconds (seconds per day * days in a year * years)
    uint256 public constant minimumStakeSteps = 10;
    uint256 public constant minimumStakeBase = 10000 * 1e18;

    event Staked(address indexed from, uint256 value);
    event Undelegated(address indexed operator, uint256 undelegatedAt);
    event RecoveredStake(address operator, uint256 recoveredAt);
    event TokensSlashed(address indexed operator, uint256 amount);
    event TokensSeized(address indexed operator, uint256 amount);
    event StakeLocked(address indexed operator, address lockCreator, uint256 until);
    event LockReleased(address indexed operator, address lockCreator);
    event ExpiredLockReleased(address indexed operator, address lockCreator);

    // Registry contract with a list of approved operator contracts and upgraders.
    KeepRegistry public registry;

    // Authorized operator contracts.
    mapping(address => mapping (address => bool)) internal authorizations;

    // Locks placed on the operator.
    // `operatorLocks[operator]` returns all locks placed on the operator.
    // Each authorized operator contract can place one lock on an operator.
    mapping(address => LockUtils.LockSet) internal operatorLocks;
    uint256 public constant maximumLockDuration = 86400 * 200; // 200 days in seconds

    // Granters of delegated authority to operator contracts.
    // E.g. keep factories granting delegated authority to keeps.
    // `delegatedAuthority[keep] = factory`
    mapping(address => address) internal delegatedAuthority;

    modifier onlyApprovedOperatorContract(address operatorContract) {
        require(
            registry.isApprovedOperatorContract(getAuthoritySource(operatorContract)),
            "Operator contract is not approved"
        );
        _;
    }

    /// @notice Creates a token staking contract for a provided Standard ERC20Burnable token.
    /// @param _tokenAddress Address of a token that will be linked to this contract.
    /// @param _registry Address of a keep registry that will be linked to this contract.
    /// @param _initializationPeriod To avoid certain attacks on work selection, recently created
    /// operators must wait for a specific period of time before being eligible for work selection.
    /// @param _undelegationPeriod The staking contract guarantees that an undelegated operator’s
    /// stakes will stay locked for a period of time after undelegation, and thus available as
    /// collateral for any work the operator is engaged in.
    constructor(
        address _tokenAddress,
        address _registry,
        uint256 _initializationPeriod,
        uint256 _undelegationPeriod
    ) public {
        require(_tokenAddress != address(0x0), "Token address can't be zero.");
        token = ERC20Burnable(_tokenAddress);
        registry = KeepRegistry(_registry);
        initializationPeriod = _initializationPeriod;
        undelegationPeriod = _undelegationPeriod;
        minimumStakeScheduleStart = block.timestamp;
    }

    /// @notice Returns minimum amount of KEEP that allows sMPC cluster client to
    /// participate in the Keep network. Expressed as number with 18-decimal places.
    /// Initial minimum stake is higher than the final and lowered periodically based
    /// on the amount of steps and the length of the minimum stake schedule in seconds.
    function minimumStake() public view returns (uint256) {
        if (block.timestamp < minimumStakeScheduleStart.add(minimumStakeSchedule)) {
            uint256 currentStep = minimumStakeSteps.mul(
                block.timestamp.sub(minimumStakeScheduleStart)
            ).div(minimumStakeSchedule);
            return minimumStakeBase.mul(minimumStakeSteps.sub(currentStep));
        }
        return minimumStakeBase;
    }

    /// @notice Receives approval of token transfer and stakes the approved amount.
    /// @dev Makes sure provided token contract is the same one linked to this contract.
    /// @param _from The owner of the tokens who approved them to transfer.
    /// @param _value Approved amount for the transfer and stake.
    /// @param _token Token contract address.
    /// @param _extraData Data for stake delegation. This byte array must have
    /// the following values concatenated:
    /// - Beneficiary address (20 bytes)
    /// - Operator address (20 bytes)
    /// - Authorizer address (20 bytes)
    function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) public {
        require(ERC20Burnable(_token) == token, "Token contract must be the same one linked to this contract.");
        require(_value >= minimumStake(), "Tokens amount must be greater than the minimum stake");
        require(_extraData.length == 60, "Stake delegation data must be provided.");

        address payable beneficiary = address(uint160(_extraData.toAddress(0)));
        address operator = _extraData.toAddress(20);
        require(operators[operator].owner == address(0), "Operator address is already in use.");
        address authorizer = _extraData.toAddress(40);

        // Transfer tokens to this contract.
        token.safeTransferFrom(_from, address(this), _value);

        operators[operator] = Operator(
            OperatorParams.pack(_value, block.timestamp, 0),
            _from,
            beneficiary,
            authorizer
        );
        ownerOperators[_from].push(operator);

        emit Staked(operator, _value);
    }

    /// @notice Cancels stake of tokens within the operator initialization period
    /// without being subjected to the token lockup for the undelegation period.
    /// This can be used to undo mistaken delegation to the wrong operator address.
    /// @param _operator Address of the stake operator.
    function cancelStake(address _operator) public {
        address owner = operators[_operator].owner;
        require(
            msg.sender == _operator ||
            msg.sender == owner, "Only operator or the owner of the stake can cancel the delegation."
        );
        uint256 operatorParams = operators[_operator].packedParams;

        require(
            !_isInitialized(operatorParams),
            "Initialization period is over"
        );

        uint256 amount = operatorParams.getAmount();
        operators[_operator].packedParams = operatorParams.setAmount(0);

        token.safeTransfer(owner, amount);
    }

    /// @notice Undelegates staked tokens. You will be able to recover your stake by calling
    /// `recoverStake()` with operator address once undelegation period is over.
    /// @param _operator Address of the stake operator.
    function undelegate(address _operator) public {
        undelegateAt(_operator, block.timestamp);
    }

    /// @notice Set an undelegation time for staked tokens.
    /// Undelegation will begin at the specified timestamp.
    /// You will be able to recover your stake by calling
    /// `recoverStake()` with operator address once undelegation period is over.
    /// @param _operator Address of the stake operator.
    /// @param _undelegationTimestamp The timestamp undelegation is to start at.    
    function undelegateAt(
        address _operator,
        uint256 _undelegationTimestamp
    ) public {
        address owner = operators[_operator].owner;
        bool sentByOwner = msg.sender == owner;
        require(
            msg.sender == _operator ||
            sentByOwner, "Only operator or the owner of the stake can undelegate."
        );
        require(
            _undelegationTimestamp >= block.timestamp,
            "May not set undelegation timestamp in the past"
        );
        uint256 oldParams = operators[_operator].packedParams;
        uint256 existingCreationTimestamp = oldParams.getCreationTimestamp();
        uint256 existingUndelegationTimestamp = oldParams.getUndelegationTimestamp();
        require(
            _undelegationTimestamp > existingCreationTimestamp.add(initializationPeriod),
            "Cannot undelegate in initialization period, use cancelStake instead"
        );
        require(
            // Undelegation not in progress OR
            existingUndelegationTimestamp == 0 ||
            // Undelegating sooner than previously set time OR
            existingUndelegationTimestamp > _undelegationTimestamp ||
            // Owner may override
            sentByOwner,
            "Only the owner may postpone previously set undelegation"
        );
        uint256 newParams = oldParams.setUndelegationTimestamp(_undelegationTimestamp);
        operators[_operator].packedParams = newParams;
        emit Undelegated(_operator, _undelegationTimestamp);
    }

    /// @notice Recovers staked tokens and transfers them back to the owner.
    /// Recovering tokens can only be performed when the operator finished
    /// undelegating.
    /// @param _operator Operator address.
    function recoverStake(address _operator) public {
        uint256 operatorParams = operators[_operator].packedParams;
        require(
            operatorParams.getUndelegationTimestamp() != 0,
            "Can not recover without first undelegating"
        );
        require(
            _isUndelegatingFinished(operatorParams),
            "Can not recover stake before undelegation period is over."
        );

        require(
            !isStakeLocked(_operator),
            "Can not recover locked stake"
        );

        address owner = operators[_operator].owner;
        uint256 amount = operatorParams.getAmount();

        operators[_operator].packedParams = operatorParams.setAmount(0);

        token.safeTransfer(owner, amount);
        emit RecoveredStake(_operator, block.timestamp);
    }

    /// @notice Gets stake delegation info for the given operator.
    /// @param _operator Operator address.
    /// @return amount The amount of tokens the given operator delegated.
    /// @return createdAt The time when the stake has been delegated.
    /// @return undelegatedAt The time when undelegation has been requested.
    /// If undelegation has not been requested, 0 is returned.
    function getDelegationInfo(address _operator)
    public view returns (uint256 amount, uint256 createdAt, uint256 undelegatedAt) {
        return operators[_operator].packedParams.unpack();
    }

    /// @notice Locks given operator stake for the specified duration.
    /// Locked stake may not be recovered until the lock expires or is released,
    /// even if the normal undelegation period has passed.
    /// Only previously authorized operator contract can lock the stake.
    /// @param operator Operator address.
    /// @param duration Lock duration in seconds.
    function lockStake(
        address operator,
        uint256 duration
    ) public onlyApprovedOperatorContract(msg.sender) {
        require(
            isAuthorizedForOperator(operator, msg.sender),
            "Not authorized"
        );
        require(duration <= maximumLockDuration, "Lock duration too long");

        uint256 operatorParams = operators[operator].packedParams;

        require(
            _isInitialized(operatorParams),
            "Operator stake must be active"
        );
        require(
            !_isUndelegating(operatorParams),
            "Operator undelegating"
        );

        operatorLocks[operator].setLock(
            msg.sender,
            uint96(block.timestamp.add(duration))
        );
        emit StakeLocked(operator, msg.sender, block.timestamp.add(duration));
    }

    /// @notice Removes a lock the caller had previously placed on the operator.
    /// @dev Only for operator contracts.
    /// To remove expired or disabled locks, use `releaseExpiredLocks`.
    /// The authorization check ensures that the caller must have been able
    /// to place a lock on the operator sometime in the past.
    /// We don't need to check for current approval status of the caller
    /// because unlocking stake cannot harm the operator
    /// nor interfere with other operator contracts.
    /// Therefore even disabled operator contracts may freely unlock stake.
    /// @param operator Operator address.
    function unlockStake(
        address operator
    ) public {
        require(
            isAuthorizedForOperator(operator, msg.sender),
            "Not authorized"
        );
        operatorLocks[operator].releaseLock(msg.sender);
        emit LockReleased(operator, msg.sender);
    }

    /// @notice Removes the lock of the specified operator contract
    /// if the lock has expired or the contract has been disabled.
    /// @dev Necessary for removing locks placed by contracts
    /// that have been disabled by the panic button.
    /// Also applicable to prevent inadvertent DoS of `recoverStake`
    /// if too many operator contracts have failed to clean up their locks.
    function releaseExpiredLock(
        address operator,
        address operatorContract
    ) public {
        LockUtils.LockSet storage locks = operatorLocks[operator];
        require(
            locks.contains(operatorContract),
            "No matching lock present"
        );
        bool expired = block.timestamp >= locks.getLockTime(operatorContract);
        bool disabled = !registry.isApprovedOperatorContract(operatorContract);
        require(
            expired || disabled,
            "Lock still active and valid"
        );
        locks.releaseLock(operatorContract);
        emit ExpiredLockReleased(operator, operatorContract);
    }

    /// @notice Check whether the operator has any active locks
    /// that haven't expired yet
    /// and whose creators aren't disabled by the panic button.
    function isStakeLocked(
        address operator
    ) public view returns (bool) {
        LockUtils.Lock[] storage _locks = operatorLocks[operator].locks;
        LockUtils.Lock memory lock;
        for (uint i = 0; i < _locks.length; i++) {
            lock = _locks[i];
            if (block.timestamp < lock.expiresAt) {
                if (registry.isApprovedOperatorContract(lock.creator)) {
                    return true;
                }
            }
        }
        return false;
    }

    /// @notice Get the locks placed on the operator.
    /// @return creators The addresses of operator contracts
    /// that have placed a lock on the operator.
    /// @return expirations The expiration times
    /// of the locks placed on the operator.
    function getLocks(address operator)
        public
        view
        returns (address[] memory creators, uint256[] memory expirations) {
        uint256 lockCount = operatorLocks[operator].locks.length;
        creators = new address[](lockCount);
        expirations = new uint256[](lockCount);
        LockUtils.Lock memory lock;
        for (uint i = 0; i < lockCount; i++) {
            lock = operatorLocks[operator].locks[i];
            creators[i] = lock.creator;
            expirations[i] = lock.expiresAt;
        }
    }

    /// @notice Slash provided token amount from every member in the misbehaved
    /// operators array and burn 100% of all the tokens.
    /// @param amountToSlash Token amount to slash from every misbehaved operator.
    /// @param misbehavedOperators Array of addresses to seize the tokens from.
    function slash(uint256 amountToSlash, address[] memory misbehavedOperators)
        public
        onlyApprovedOperatorContract(msg.sender) {

        uint256 totalAmountToBurn = 0;
        address authoritySource = getAuthoritySource(msg.sender);
        for (uint i = 0; i < misbehavedOperators.length; i++) {
            address operator = misbehavedOperators[i];
            require(authorizations[authoritySource][operator], "Not authorized");

            uint256 operatorParams = operators[operator].packedParams;
            require(
                _isInitialized(operatorParams),
                "Operator stake must be active"
            );

            require(
                !_isStakeReleased(operator, operatorParams, msg.sender),
                "Stake is released"
            );

            uint256 currentAmount = operatorParams.getAmount();

            if (currentAmount < amountToSlash) {
                totalAmountToBurn = totalAmountToBurn.add(currentAmount);

                uint256 newAmount = 0;
                operators[operator].packedParams = operatorParams.setAmount(newAmount);
                emit TokensSlashed(operator, currentAmount);
            } else {
                totalAmountToBurn = totalAmountToBurn.add(amountToSlash);

                uint256 newAmount = currentAmount.sub(amountToSlash);
                operators[operator].packedParams = operatorParams.setAmount(newAmount);
                emit TokensSlashed(operator, amountToSlash);
            }
        }

        token.burn(totalAmountToBurn);
    }

    /// @notice Seize provided token amount from every member in the misbehaved
    /// operators array. The tattletale is rewarded with 5% of the total seized
    /// amount scaled by the reward adjustment parameter and the rest 95% is burned.
    /// @param amountToSeize Token amount to seize from every misbehaved operator.
    /// @param rewardMultiplier Reward adjustment in percentage. Min 1% and 100% max.
    /// @param tattletale Address to receive the 5% reward.
    /// @param misbehavedOperators Array of addresses to seize the tokens from.
    function seize(
        uint256 amountToSeize,
        uint256 rewardMultiplier,
        address tattletale,
        address[] memory misbehavedOperators
    ) public onlyApprovedOperatorContract(msg.sender) {
        uint256 totalAmountToBurn = 0;
        address authoritySource = getAuthoritySource(msg.sender);
        for (uint i = 0; i < misbehavedOperators.length; i++) {
            address operator = misbehavedOperators[i];
            require(authorizations[authoritySource][operator], "Not authorized");

            uint256 operatorParams = operators[operator].packedParams;
            require(
                _isInitialized(operatorParams),
                "Operator stake must be active"
            );

            require(
                !_isStakeReleased(operator, operatorParams, msg.sender),
                "Stake is released"
            );

            uint256 currentAmount = operatorParams.getAmount();

            if (currentAmount < amountToSeize) {
                totalAmountToBurn = totalAmountToBurn.add(currentAmount);

                uint256 newAmount = 0;
                operators[operator].packedParams = operatorParams.setAmount(newAmount);
                emit TokensSeized(operator, currentAmount);
            } else {
                totalAmountToBurn = totalAmountToBurn.add(amountToSeize);

                uint256 newAmount = currentAmount.sub(amountToSeize);
                operators[operator].packedParams = operatorParams.setAmount(newAmount);
                emit TokensSeized(operator, amountToSeize);
            }
        }

        uint256 tattletaleReward = (totalAmountToBurn.percent(5)).percent(rewardMultiplier);

        token.safeTransfer(tattletale, tattletaleReward);
        token.burn(totalAmountToBurn.sub(tattletaleReward));
    }

    /// @notice Authorizes operator contract to access staked token balance of
    /// the provided operator. Can only be executed by stake operator authorizer.
    /// Contracts using delegated authority
    /// cannot be authorized with `authorizeOperatorContract`.
    /// Instead, authorize `getAuthoritySource(_operatorContract)`.
    /// @param _operator address of stake operator.
    /// @param _operatorContract address of operator contract.
    function authorizeOperatorContract(address _operator, address _operatorContract)
        public
        onlyOperatorAuthorizer(_operator)
        onlyApprovedOperatorContract(_operatorContract) {
        require(
            getAuthoritySource(_operatorContract) == _operatorContract,
            "Contract uses delegated authority"
        );
        authorizations[_operatorContract][_operator] = true;
    }

    /// @notice Checks if operator contract has access to the staked token balance of
    /// the provided operator.
    /// @param _operator address of stake operator.
    /// @param _operatorContract address of operator contract.
    function isAuthorizedForOperator(address _operator, address _operatorContract) public view returns (bool) {
        return authorizations[getAuthoritySource(_operatorContract)][_operator];
    }

    /// @notice Gets the eligible stake balance of the specified address.
    /// An eligible stake is a stake that passed the initialization period
    /// and is not currently undelegating. Also, the operator had to approve
    /// the specified operator contract.
    ///
    /// Operator with a minimum required amount of eligible stake can join the
    /// network and participate in new work selection.
    ///
    /// @param _operator address of stake operator.
    /// @param _operatorContract address of operator contract.
    /// @return an uint256 representing the eligible stake balance.
    function eligibleStake(
        address _operator,
        address _operatorContract
    ) public view returns (uint256 balance) {
        bool isAuthorized = isAuthorizedForOperator(_operator, _operatorContract);

        uint256 operatorParams = operators[_operator].packedParams;

        bool isActive = _isInitialized(operatorParams);
        // `undelegatedAt` may be set to a time in the future,
        // to schedule undelegation in advance.
        // In this case the operator is still eligible
        // until the timestamp `undelegatedAt`.
        bool isUndelegating = _isUndelegating(operatorParams);

        if (isAuthorized && isActive && !isUndelegating) {
            balance = operatorParams.getAmount();
        }
    }

    /// @notice Gets the active stake balance of the specified address.
    /// An active stake is a stake that passed the initialization period,
    /// and may be in the process of undelegation
    /// but has not been released yet,
    /// either because the undelegation period is not over,
    /// or because the operator contract has an active lock on the operator.
    /// Also, the operator had to approve the specified operator contract.
    ///
    /// The difference between eligible stake is that active stake does not make
    /// the operator eligible for work selection but it may be still finishing
    /// earlier work until the stake is released.
    /// Operator with a minimum required
    /// amount of active stake can join the network but cannot be selected to any
    /// new work.
    ///
    /// @param _operator address of stake operator.
    /// @param _operatorContract address of operator contract.
    /// @return an uint256 representing the eligible stake balance.
    function activeStake(
        address _operator,
        address _operatorContract
    ) public view returns (uint256 balance) {
        bool isAuthorized = isAuthorizedForOperator(_operator, _operatorContract);

        uint256 operatorParams = operators[_operator].packedParams;

        bool isActive = _isInitialized(operatorParams);

        bool stakeReleased = _isStakeReleased(
            _operator,
            operatorParams,
            _operatorContract
        );

        if (isAuthorized && isActive && !stakeReleased) {
            balance = operatorParams.getAmount();
        }
    }

    /// @notice Checks if the specified account has enough active stake to become
    /// network operator and that the specified operator contract has been
    /// authorized for potential slashing.
    ///
    /// Having the required minimum of active stake makes the operator eligible
    /// to join the network. If the active stake is not currently undelegating,
    /// operator is also eligible for work selection.
    ///
    /// @param staker Staker's address
    /// @param operatorContract Operator contract's address
    /// @return True if has enough active stake to participate in the network,
    /// false otherwise.
    function hasMinimumStake(
        address staker,
        address operatorContract
    ) public view returns(bool) {
        return activeStake(staker, operatorContract) >= minimumStake();
    }

    /// @notice Grant the sender the same authority as `delegatedAuthoritySource`
    /// @dev If `delegatedAuthoritySource` is an approved operator contract
    /// and recognizes the claimant,
    /// this relationship will be recorded in `delegatedAuthority`.
    /// Later, the claimant can slash, seize, place locks etc.
    /// on operators that have authorized the `delegatedAuthoritySource`.
    /// If the `delegatedAuthoritySource` is disabled with the panic button,
    /// any recipients of delegated authority from it will also be disabled.
    function claimDelegatedAuthority(
        address delegatedAuthoritySource
    ) public onlyApprovedOperatorContract(delegatedAuthoritySource) {
        require(
            AuthorityDelegator(delegatedAuthoritySource).__isRecognized(msg.sender),
            "Unrecognized claimant"
        );
        delegatedAuthority[msg.sender] = delegatedAuthoritySource;
    }

    /// @notice Get the source of the operator contract's authority.
    /// If the contract uses delegated authority,
    /// returns the original source of the delegated authority.
    /// If the contract doesn't use delegated authority,
    /// returns the contract itself.
    /// Authorize `getAuthoritySource(operatorContract)`
    /// to grant `operatorContract` the authority to penalize an operator.
    function getAuthoritySource(
        address operatorContract
    ) public view returns (address) {
        address delegatedAuthoritySource = delegatedAuthority[operatorContract];
        if (delegatedAuthoritySource == address(0)) {
            return operatorContract;
        }
        return getAuthoritySource(delegatedAuthoritySource);
    }

    /// @notice Is the operator with the given params initialized
    function _isInitialized(uint256 _operatorParams)
        internal view returns (bool) {
        uint256 createdAt = _operatorParams.getCreationTimestamp();
        return block.timestamp > createdAt.add(initializationPeriod);
    }

    /// @notice Is the operator with the given params undelegating
    function _isUndelegating(uint256 _operatorParams)
        internal view returns (bool) {
        uint256 undelegatedAt = _operatorParams.getUndelegationTimestamp();
        return (undelegatedAt != 0) && (block.timestamp > undelegatedAt);
    }

    /// @notice Has the operator with the given params finished undelegating
    function _isUndelegatingFinished(uint256 _operatorParams)
        internal view returns (bool) {
        uint256 undelegatedAt = _operatorParams.getUndelegationTimestamp();
        uint256 finishedAt = undelegatedAt.add(undelegationPeriod);
        return (undelegatedAt != 0) && (block.timestamp > finishedAt);
    }

    /// @notice Get whether the operator's stake is released
    /// as far as the operator contract is concerned.
    /// If the operator contract has a lock on the operator,
    /// the operator's stake is be released when the lock expires.
    /// Otherwise the stake is released when the operator finishes undelegating.
    function _isStakeReleased(
        address _operator,
        uint256 _operatorParams,
        address _operatorContract
    ) internal view returns (bool) {
        if (!_isUndelegatingFinished(_operatorParams)) {
            return false;
        }
        // Undelegating finished, so check locks
        LockUtils.LockSet storage locks = operatorLocks[_operator];
        // `getLockTime` returns 0 if the lock doesn't exist,
        // thus we don't need to check for its presence separately.
        return block.timestamp >= locks.getLockTime(_operatorContract);
    }
}

File 3 of 20 : TokenGrantStake.sol
pragma solidity 0.5.17;

import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./TokenStaking.sol";
import "./utils/BytesLib.sol";


/// @dev Interface of sender contract for approveAndCall pattern.
interface tokenSender {
    function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData) external;
}

contract TokenGrantStake {
    using SafeMath for uint256;
    using BytesLib for bytes;

    ERC20Burnable token;
    TokenStaking tokenStaking;

    address tokenGrant; // Address of the master grant contract.

    uint256 grantId; // ID of the grant for this stake.
    uint256 amount; // Amount of staked tokens.
    address operator; // Operator of the stake.

    constructor(
        address _tokenAddress,
        uint256 _grantId,
        address _tokenStaking
    ) public {
        require(
            _tokenAddress != address(0x0),
            "Token address can't be zero."
        );
        require(
            _tokenStaking != address(0x0),
            "Staking contract address can't be zero."
        );

        token = ERC20Burnable(_tokenAddress);
        tokenGrant = msg.sender;
        grantId = _grantId;
        tokenStaking = TokenStaking(_tokenStaking);
    }

    function stake(
        uint256 _amount,
        bytes memory _extraData
    ) public onlyGrant {
        amount = _amount;
        operator = _extraData.toAddress(20);
        tokenSender(address(token)).approveAndCall(
            address(tokenStaking),
            _amount,
            _extraData
        );
    }

    function getGrantId() public view onlyGrant returns (uint256) {
        return grantId;
    }

    function getAmount() public view onlyGrant returns (uint256) {
        return amount;
    }

    function getStakingContract() public view onlyGrant returns (address) {
        return address(tokenStaking);
    }

    function getDetails() public view onlyGrant returns (
        uint256 _grantId,
        uint256 _amount,
        address _tokenStaking
    ) {
        return (
            grantId,
            amount,
            address(tokenStaking)
        );
    }

    function cancelStake() public onlyGrant returns (uint256) {
        tokenStaking.cancelStake(operator);
        return returnTokens();
    }

    function undelegate() public onlyGrant {
        tokenStaking.undelegate(operator);
    }

    function recoverStake() public onlyGrant returns (uint256) {
        tokenStaking.recoverStake(operator);
        return returnTokens();
    }

    function returnTokens() internal returns (uint256) {
        uint256 returnedAmount = token.balanceOf(address(this));
        amount -= returnedAmount;
        token.transfer(tokenGrant, returnedAmount);
        return returnedAmount;
    }

    modifier onlyGrant {
        require(
            msg.sender == tokenGrant,
            "For token grant contract only"
        );
        _;
    }
}

File 4 of 20 : KeepRegistry.sol
pragma solidity 0.5.17;


/// @title KeepRegistry
/// @notice Governance owned registry of approved contracts and roles.
contract KeepRegistry {
    enum ContractStatus {New, Approved, Disabled}

    // Governance role is to enable recovery from key compromise by rekeying
    // other roles. Also, it can disable operator contract panic buttons
    // permanently.
    address public governance;

    // Registry Keeper maintains approved operator contracts. Each operator
    // contract must be approved before it can be authorized by a staker or
    // used by a service contract.
    address public registryKeeper;

    // Each operator contract has a Panic Button which can disable malicious
    // or malfunctioning contract that have been previously approved by the
    // Registry Keeper.
    //
    // New operator contract added to the registry has a default panic button
    // value assigned (defaultPanicButton). Panic button for each operator
    // contract can be later updated by Governance to individual value.
    //
    // It is possible to disable panic button for individual contract by
    // setting the panic button to zero address. In such case, operator contract
    // can not be disabled and is permanently approved in the registry.
    mapping(address => address) public panicButtons;

    // Default panic button for each new operator contract added to the
    // registry. Can be later updated for each contract.
    address public defaultPanicButton;

    // Each service contract has a Operator Contract Upgrader whose purpose
    // is to manage operator contracts for that specific service contract.
    // The Operator Contract Upgrader can add new operator contracts to the
    // service contract’s operator contract list, and deprecate old ones.
    mapping(address => address) public operatorContractUpgraders;

    // Operator contract may have a Service Contract Upgrader whose purpose is
    // to manage service contracts for that specific operator contract.
    // Service Contract Upgrader can add and remove service contracts
    // from the list of service contracts approved to work with the operator
    // contract. List of service contracts is maintained in the operator
    // contract and is optional - not every operator contract needs to have
    // a list of service contracts it wants to cooperate with.
    mapping(address => address) public serviceContractUpgraders;

    // The registry of operator contracts
    mapping(address => ContractStatus) public operatorContracts;

    event OperatorContractApproved(address operatorContract);
    event OperatorContractDisabled(address operatorContract);

    event GovernanceUpdated(address governance);
    event RegistryKeeperUpdated(address registryKeeper);
    event DefaultPanicButtonUpdated(address defaultPanicButton);
    event OperatorContractPanicButtonDisabled(address operatorContract);
    event OperatorContractPanicButtonUpdated(
        address operatorContract,
        address panicButton
    );
    event OperatorContractUpgraderUpdated(
        address serviceContract,
        address upgrader
    );
    event ServiceContractUpgraderUpdated(
        address operatorContract,
        address keeper
    );

    modifier onlyGovernance() {
        require(governance == msg.sender, "Not authorized");
        _;
    }

    modifier onlyRegistryKeeper() {
        require(registryKeeper == msg.sender, "Not authorized");
        _;
    }

    modifier onlyPanicButton(address _operatorContract) {
        address panicButton = panicButtons[_operatorContract];
        require(panicButton != address(0), "Panic button disabled");
        require(panicButton == msg.sender, "Not authorized");
        _;
    }

    modifier onlyForNewContract(address _operatorContract) {
        require(
            isNewOperatorContract(_operatorContract),
            "Not a new operator contract"
        );
        _;
    }

    modifier onlyForApprovedContract(address _operatorContract) {
        require(
            isApprovedOperatorContract(_operatorContract),
            "Not an approved operator contract"
        );
        _;
    }

    constructor() public {
        governance = msg.sender;
        registryKeeper = msg.sender;
        defaultPanicButton = msg.sender;
    }

    function setGovernance(address _governance) public onlyGovernance {
        governance = _governance;
        emit GovernanceUpdated(governance);
    }

    function setRegistryKeeper(address _registryKeeper) public onlyGovernance {
        registryKeeper = _registryKeeper;
        emit RegistryKeeperUpdated(registryKeeper);
    }

    function setDefaultPanicButton(address _panicButton) public onlyGovernance {
        defaultPanicButton = _panicButton;
        emit DefaultPanicButtonUpdated(defaultPanicButton);
    }

    function setOperatorContractPanicButton(
        address _operatorContract,
        address _panicButton
    ) public onlyForApprovedContract(_operatorContract) onlyGovernance {
        require(
            panicButtons[_operatorContract] != address(0),
            "Disabled panic button cannot be updated"
        );
        require(
            _panicButton != address(0),
            "Panic button must be non-zero address"
        );

        panicButtons[_operatorContract] = _panicButton;

        emit OperatorContractPanicButtonUpdated(
            _operatorContract,
            _panicButton
        );
    }

    function disableOperatorContractPanicButton(address _operatorContract)
        public
        onlyForApprovedContract(_operatorContract)
        onlyGovernance
    {
        require(
            panicButtons[_operatorContract] != address(0),
            "Panic button already disabled"
        );

        panicButtons[_operatorContract] = address(0);

        emit OperatorContractPanicButtonDisabled(_operatorContract);
    }

    function setOperatorContractUpgrader(
        address _serviceContract,
        address _operatorContractUpgrader
    ) public onlyGovernance {
        operatorContractUpgraders[_serviceContract] = _operatorContractUpgrader;
        emit OperatorContractUpgraderUpdated(
            _serviceContract,
            _operatorContractUpgrader
        );
    }

    function setServiceContractUpgrader(
        address _operatorContract,
        address _serviceContractUpgrader
    ) public onlyGovernance {
        serviceContractUpgraders[_operatorContract] = _serviceContractUpgrader;
        emit ServiceContractUpgraderUpdated(
            _operatorContract,
            _serviceContractUpgrader
        );
    }

    function approveOperatorContract(address operatorContract)
        public
        onlyForNewContract(operatorContract)
        onlyRegistryKeeper
    {
        operatorContracts[operatorContract] = ContractStatus.Approved;
        panicButtons[operatorContract] = defaultPanicButton;
        emit OperatorContractApproved(operatorContract);
    }

    function disableOperatorContract(address operatorContract)
        public
        onlyForApprovedContract(operatorContract)
        onlyPanicButton(operatorContract)
    {
        operatorContracts[operatorContract] = ContractStatus.Disabled;
        emit OperatorContractDisabled(operatorContract);
    }

    function isNewOperatorContract(address operatorContract)
        public
        view
        returns (bool)
    {
        return operatorContracts[operatorContract] == ContractStatus.New;
    }

    function isApprovedOperatorContract(address operatorContract)
        public
        view
        returns (bool)
    {
        return operatorContracts[operatorContract] == ContractStatus.Approved;
    }

    function operatorContractUpgraderFor(address _serviceContract)
        public
        view
        returns (address)
    {
        return operatorContractUpgraders[_serviceContract];
    }

    function serviceContractUpgraderFor(address _operatorContract)
        public
        view
        returns (address)
    {
        return serviceContractUpgraders[_operatorContract];
    }
}

File 5 of 20 : GrantStakingPolicy.sol
pragma solidity 0.5.17;

/// @title GrantStakingPolicy
/// @notice A staking policy defines the function `getStakeableAmount`
/// which calculates how many tokens may be staked from a token grant.
contract GrantStakingPolicy {
    function getStakeableAmount(
        uint256 _now,
        uint256 grantedAmount,
        uint256 duration,
        uint256 start,
        uint256 cliff,
        uint256 withdrawn) public view returns (uint256);
}

File 6 of 20 : StakeDelegatable.sol
pragma solidity 0.5.17;

import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./utils/BytesLib.sol";
import "./utils/AddressArrayUtils.sol";
import "./utils/OperatorParams.sol";


/// @title Stake Delegatable
/// @notice A base contract to allow stake delegation for staking contracts.
contract StakeDelegatable {
    using SafeMath for uint256;
    using SafeERC20 for ERC20Burnable;
    using BytesLib for bytes;
    using AddressArrayUtils for address[];
    using OperatorParams for uint256;

    ERC20Burnable public token;

    uint256 public initializationPeriod;
    uint256 public undelegationPeriod;

    mapping(address => address[]) public ownerOperators;

    mapping(address => Operator) public operators;

    struct Operator {
        uint256 packedParams;
        address owner;
        address payable beneficiary;
        address authorizer;
    }

    modifier onlyOperatorAuthorizer(address _operator) {
        require(
            operators[_operator].authorizer == msg.sender,
            "Not operator authorizer"
        );
        _;
    }

    /// @notice Gets the list of operators of the specified address.
    /// @return An array of addresses.
    function operatorsOf(address _address) public view returns (address[] memory) {
        return ownerOperators[_address];
    }

    /// @notice Gets the stake balance of the specified address.
    /// @param _address The address to query the balance of.
    /// @return An uint256 representing the amount staked by the passed address.
    function balanceOf(address _address) public view returns (uint256 balance) {
        return operators[_address].packedParams.getAmount();
    }

    /// @notice Gets the stake owner for the specified operator address.
    /// @return Stake owner address.
    function ownerOf(address _operator) public view returns (address) {
        return operators[_operator].owner;
    }

    /// @notice Gets the beneficiary for the specified operator address.
    /// @return Beneficiary address.
    function beneficiaryOf(address _operator) public view returns (address payable) {
        return operators[_operator].beneficiary;
    }

    /// @notice Gets the authorizer for the specified operator address.
    /// @return Authorizer address.
    function authorizerOf(address _operator) public view returns (address) {
        return operators[_operator].authorizer;
    }
}

File 7 of 20 : UnlockingSchedule.sol
pragma solidity 0.5.17;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";

library UnlockingSchedule {
    using SafeMath for uint256;

    function getUnlockedAmount(
        uint256 _now,
        uint256 grantedAmount,
        uint256 duration,
        uint256 start,
        uint256 cliff
    ) internal pure returns (uint256) {
        bool cliffNotReached = _now < cliff;
        if (cliffNotReached) { return 0; }

        uint256 timeElapsed = _now.sub(start);

        bool unlockingPeriodFinished = timeElapsed >= duration;
        if (unlockingPeriodFinished) { return grantedAmount; }

        return grantedAmount.mul(timeElapsed).div(duration);
    }
}

File 8 of 20 : AddressArrayUtils.sol
pragma solidity 0.5.17;


library AddressArrayUtils {

    function contains(address[] memory self, address _address)
        internal
        pure
        returns (bool)
    {
        for (uint i = 0; i < self.length; i++) {
            if (_address == self[i]) {
                return true;
            }
        }
        return false;
    }

    function removeAddress(address[] storage self, address _addressToRemove)
        internal
        returns (address[] storage)
    {
        for (uint i = 0; i < self.length; i++) {
            // If address is found in array.
            if (_addressToRemove == self[i]) {
                // Delete element at index and shift array.
                for (uint j = i; j < self.length-1; j++) {
                    self[j] = self[j+1];
                }
                self.length--;
                i--;
            }
        }
        return self;
    }
}

File 9 of 20 : BytesLib.sol
pragma solidity 0.5.17;

/*
Verison pulled from https://github.com/summa-tx/bitcoin-spv/blob/2535e4edaeaac4b2b095903fce684ae1c05761bc/solidity/contracts/BytesLib.sol
*/

/*
https://github.com/GNSPS/solidity-bytes-utils/
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
*/


/** @title BytesLib **/
/** @author https://github.com/GNSPS **/

library BytesLib {
    function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(0x40, and(
                add(add(end, iszero(add(length, mload(_preBytes)))), 31),
                not(31) // Round down to the nearest 32 bytes.
            ))
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes_slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes_slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                        ),
                        // and now shift left the number of bytes to
                        // leave space for the length in the slot
                        exp(0x100, sub(32, newlength))
                        ),
                        // increase length by the double of the memory
                        // bytes length
                        mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes_slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes_slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(
                            fslot,
                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                    ),
                    and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes_slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes_slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(bytes memory _bytes, uint _start, uint _length) internal  pure returns (bytes memory res) {
        uint _end = _start + _length;
        require(_end > _start && _bytes.length >= _end, "Slice out of bounds");

        assembly {
            // Alloc bytes array with additional 32 bytes afterspace and assign it's size
            res := mload(0x40)
            mstore(0x40, add(add(res, 64), _length))
            mstore(res, _length)

            // Compute distance between source and destination pointers
            let diff := sub(res, add(_bytes, _start))

            for {
                let src := add(add(_bytes, 32), _start)
                let end := add(src, _length)
            } lt(src, end) {
                src := add(src, 32)
            } {
                mstore(add(src, diff), mload(src))
            }
        }
    }

    function toAddress(bytes memory _bytes, uint _start) internal  pure returns (address) {
        uint _totalLen = _start + 20;
        require(_totalLen > _start && _bytes.length >= _totalLen, "Address conversion out of bounds.");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint _start) internal  pure returns (uint8) {
        require(_bytes.length >= (_start + 1), "Uint8 conversion out of bounds.");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint(bytes memory _bytes, uint _start) internal  pure returns (uint256) {
        uint _totalLen = _start + 32;
        require(_totalLen > _start && _bytes.length >= _totalLen, "Uint conversion out of bounds.");
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                    // the next line is the loop condition:
                    // while(uint(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes_slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes_slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function toBytes32(bytes memory _source) pure internal returns (bytes32 result) {
        if (_source.length == 0) {
            return 0x0;
        }

        assembly {
            result := mload(add(_source, 32))
        }
    }

    function keccak256Slice(bytes memory _bytes, uint _start, uint _length) pure internal returns (bytes32 result) {
        uint _end = _start + _length;
        require(_end > _start && _bytes.length >= _end, "Slice out of bounds");

        assembly {
            result := keccak256(add(add(_bytes, 32), _start), _length)
        }
    }
}

File 10 of 20 : UintArrayUtils.sol
pragma solidity 0.5.17;


library UintArrayUtils {

    function removeValue(uint256[] storage self, uint256 _value)
        internal
        returns(uint256[] storage)
    {
        for (uint i = 0; i < self.length; i++) {
            // If value is found in array.
            if (_value == self[i]) {
                // Delete element at index and shift array.
                for (uint j = i; j < self.length-1; j++) {
                    self[j] = self[j+1];
                }
                self.length--;
                i--;
            }
        }
        return self;
    }
}

File 11 of 20 : OperatorParams.sol
pragma solidity 0.5.17;

library OperatorParams {
    // OperatorParams packs values that are commonly used together
    // into a single uint256 to reduce the cost functions
    // like querying eligibility.
    //
    // An OperatorParams uint256 contains:
    // - the operator's staked token amount (uint128)
    // - the operator's creation timestamp (uint64)
    // - the operator's undelegation timestamp (uint64)
    //
    // These are packed as [amount | createdAt | undelegatedAt]
    //
    // Staked KEEP is stored in an uint128,
    // which is sufficient because KEEP tokens have 18 decimals (2^60)
    // and there will be at most 10^9 KEEP in existence (2^30).
    //
    // Creation and undelegation times are stored in an uint64 each.
    // Thus uint64s would be sufficient for around 3*10^11 years.
    uint256 constant TIMESTAMP_WIDTH = 64;
    uint256 constant AMOUNT_WIDTH = 128;

    uint256 constant TIMESTAMP_MAX = (2**TIMESTAMP_WIDTH) - 1;
    uint256 constant AMOUNT_MAX = (2**AMOUNT_WIDTH) - 1;

    uint256 constant CREATION_SHIFT = TIMESTAMP_WIDTH;
    uint256 constant AMOUNT_SHIFT = 2 * TIMESTAMP_WIDTH;

    function pack(
        uint256 amount,
        uint256 createdAt,
        uint256 undelegatedAt
    ) internal pure returns (uint256) {
        // Check for staked amount overflow.
        // We shouldn't actually ever need this.
        require(
            amount <= AMOUNT_MAX,
            "amount uint128 overflow"
        );
        // Bitwise OR the timestamps together.
        // The resulting number is equal or greater than either,
        // and tells if we have a bit set outside the 64 available bits.
        require(
            (createdAt | undelegatedAt) <= TIMESTAMP_MAX,
            "timestamp uint64 overflow"
        );
        uint256 a = amount << AMOUNT_SHIFT;
        uint256 c = createdAt << CREATION_SHIFT;
        uint256 u = undelegatedAt;
        return (a | c | u);
    }

    function unpack(uint256 packedParams) internal pure returns (
        uint256 amount,
        uint256 createdAt,
        uint256 undelegatedAt
    ) {
        amount = getAmount(packedParams);
        createdAt = getCreationTimestamp(packedParams);
        undelegatedAt = getUndelegationTimestamp(packedParams);
    }

    function getAmount(uint256 packedParams)
        internal pure returns (uint256) {
        return (packedParams >> AMOUNT_SHIFT) & AMOUNT_MAX;
    }

    function setAmount(
        uint256 packedParams,
        uint256 amount
    ) internal pure returns (uint256) {
        return pack(
            amount,
            getCreationTimestamp(packedParams),
            getUndelegationTimestamp(packedParams)
        );
    }

    function getCreationTimestamp(uint256 packedParams)
        internal pure returns (uint256) {
        return (packedParams >> CREATION_SHIFT) & TIMESTAMP_MAX;
    }

    function setCreationTimestamp(
        uint256 packedParams,
        uint256 creationTimestamp
    ) internal pure returns (uint256) {
        return pack(
            getAmount(packedParams),
            creationTimestamp,
            getUndelegationTimestamp(packedParams)
        );
    }

    function getUndelegationTimestamp(uint256 packedParams)
        internal pure returns (uint256) {
        return packedParams & TIMESTAMP_MAX;
    }

    function setUndelegationTimestamp(
        uint256 packedParams,
        uint256 undelegationTimestamp
    ) internal pure returns (uint256) {
        return pack(
            getAmount(packedParams),
            getCreationTimestamp(packedParams),
            undelegationTimestamp
        );
    }
}

File 12 of 20 : PercentUtils.sol
pragma solidity 0.5.17;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";

library PercentUtils {
    using SafeMath for uint256;

    // Return `b`% of `a`
    // 200.percent(40) == 80
    // Commutative, works both ways
    function percent(uint256 a, uint256 b) internal pure returns (uint256) {
        return a.mul(b).div(100);
    }

    // Return `a` as percentage of `b`:
    // 80.asPercentOf(200) == 40
    function asPercentOf(uint256 a, uint256 b) internal pure returns (uint256) {
        return a.mul(100).div(b);
    }
}

File 13 of 20 : LockUtils.sol
pragma solidity 0.5.17;

library LockUtils {
    struct Lock {
        address creator;
        uint96 expiresAt;
    }

    /// @notice The LockSet is like an array of unique `uint256`s,
    /// but additionally supports O(1) membership tests and removals.
    /// @dev Because the LockSet relies on a mapping,
    /// it can only be used in storage, not in memory.
    struct LockSet {
        // locks[positions[lock.creator] - 1] = lock
        Lock[] locks;
        mapping(address => uint256) positions;
    }

    /// @notice Check whether the LockSet `self` contains a lock by `creator`
    function contains(LockSet storage self, address creator)
        internal view returns (bool) {
        return (self.positions[creator] != 0);
    }

    function getLockTime(LockSet storage self, address creator)
        internal view returns (uint96) {
        uint256 positionPlusOne = self.positions[creator];
        if (positionPlusOne == 0) { return 0; }
        return self.locks[positionPlusOne - 1].expiresAt;
    }

    /// @notice Set the lock of `creator` to `expiresAt`,
    /// overriding the current value if any.
    function setLock(
        LockSet storage self,
        address _creator,
        uint96 _expiresAt
    ) internal {
        uint256 positionPlusOne = self.positions[_creator];
        Lock memory lock = Lock(_creator, _expiresAt);
        // No existing lock
        if (positionPlusOne == 0) {
            self.locks.push(lock);
            self.positions[_creator] = self.locks.length;
        // Existing lock present
        } else {
            self.locks[positionPlusOne - 1].expiresAt = _expiresAt;
        }
    }

    /// @notice Remove the lock of `creator`.
    /// If no lock present, do nothing.
    function releaseLock(
        LockSet storage self,
        address _creator
    ) internal {
        uint256 positionPlusOne = self.positions[_creator];
        if (positionPlusOne != 0) {
            uint256 lockCount = self.locks.length;
            if (positionPlusOne != lockCount) {
                // Not the last lock,
                // so we need to move the last lock into the emptied position.
                Lock memory lastLock = self.locks[lockCount - 1];
                self.locks[positionPlusOne - 1] = lastLock;
                self.positions[lastLock.creator] = positionPlusOne;
            }
            self.locks.length--;
            self.positions[_creator] = 0;
        }
    }

    /// @notice Return the locks of the LockSet `self`.
    function enumerate(LockSet storage self)
        internal view returns (Lock[] memory) {
        return self.locks;
    }
}

File 14 of 20 : ERC20Burnable.sol
pragma solidity ^0.5.0;

import "../../GSN/Context.sol";
import "./ERC20.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev See {ERC20-_burnFrom}.
     */
    function burnFrom(address account, uint256 amount) public {
        _burnFrom(account, amount);
    }
}

File 15 of 20 : ERC20.sol
pragma solidity ^0.5.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20Mintable}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`.`amount` is then deducted
     * from the caller's allowance.
     *
     * See {_burn} and {_approve}.
     */
    function _burnFrom(address account, uint256 amount) internal {
        _burn(account, amount);
        _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
    }
}

File 16 of 20 : SafeERC20.sol
pragma solidity ^0.5.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

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

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    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'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 17 of 20 : IERC20.sol
pragma solidity ^0.5.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 18 of 20 : Context.sol
pragma solidity ^0.5.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

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

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

File 19 of 20 : SafeMath.sol
pragma solidity ^0.5.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

File 20 of 20 : Address.sol
pragma solidity ^0.5.5;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * IMPORTANT: It is unsafe to assume that an address for which this
     * function returns false is an externally-owned account (EOA) and not a
     * contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != 0x0 && codehash != accountHash);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"grantManager","type":"address"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"}],"name":"StakingContractAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"TokenGrantCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"TokenGrantRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"grantId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"TokenGrantStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"grantId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenGrantWithdrawn","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"_stakingContract","type":"address"}],"name":"authorizeStakingContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_grantId","type":"uint256"}],"name":"availableToStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"cancelRevokedStake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"cancelStake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getGrant","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"withdrawn","type":"uint256"},{"internalType":"uint256","name":"staked","type":"uint256"},{"internalType":"uint256","name":"revokedAmount","type":"uint256"},{"internalType":"uint256","name":"revokedAt","type":"uint256"},{"internalType":"address","name":"grantee","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"getGrantStakeDetails","outputs":[{"internalType":"uint256","name":"grantId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"stakingContract","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getGrantUnlockingSchedule","outputs":[{"internalType":"address","name":"grantManager","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"address","name":"policy","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"grantee","type":"address"}],"name":"getGranteeOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_granteeOrGrantManager","type":"address"}],"name":"getGrants","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"grantIndices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"grantStakes","outputs":[{"internalType":"contract TokenGrantStake","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"granteesToOperators","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"grants","outputs":[{"internalType":"address","name":"grantManager","type":"address"},{"internalType":"address","name":"grantee","type":"address"},{"internalType":"uint256","name":"revokedAt","type":"uint256"},{"internalType":"uint256","name":"revokedAmount","type":"uint256"},{"internalType":"uint256","name":"revokedWithdrawn","type":"uint256"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"withdrawn","type":"uint256"},{"internalType":"uint256","name":"staked","type":"uint256"},{"internalType":"contract GrantStakingPolicy","name":"stakingPolicy","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numGrants","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"receiveApproval","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"recoverStake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"revoke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_stakingContract","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"stakeBalanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"internalType":"contract ERC20Burnable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"undelegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"undelegateRevoked","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"unlockedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"withdrawRevoked","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"withdrawable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162005f3c38038062005f3c833981810160405260208110156200003757600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620000ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546f6b656e20616464726573732063616e2774206265207a65726f2e0000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050615dfe806200013e6000396000f3fe60806040523480156200001157600080fd5b5060043610620001f05760003560e01c80639bf850781162000111578063dba6d92411620000a5578063f29e2737116200007b578063f29e27371462000c9b578063f3ad1c1a1462000d30578063f81a64631462000dce578063fc0c546a1462000dee57620001f0565b8063dba6d9241462000bc8578063e064172e1462000c0f578063f11988e01462000c5657620001f0565b8063c6076b7a11620000e7578063c6076b7a14620009e5578063c90376e41462000a9e578063ca9a33ce1462000ae3578063da8be8641462000b8157620001f0565b80639bf8507814620008af578063af46aa0814620008f6578063b8cc6c93146200095157620001f0565b80635860280c11620001895780638e34e561116200015f5780638e34e561146200069d5780638f4ffcb114620006ce578063910bcf6114620007d95780639ae6e9c4146200081e57620001f0565b80635860280c14620004e857806370a0823114620005dd57806373297585146200063857620001f0565b806327e235e311620001cb57806327e235e314620003ce5780632e1a7d4d14620004295780633934af5c146200045a578063525835f914620004a157620001f0565b80630c0debea14620001f557806320c5429b14620003165780632496bfb31462000347575b600080fd5b62000224600480360360208110156200020d57600080fd5b810190808035906020019092919050505062000e3a565b604051808e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018b81526020018a8152602001891515151581526020018881526020018781526020018681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019d505050505050505050505050505060405180910390f35b62000345600480360360208110156200032e57600080fd5b810190808035906020019092919050505062000f0d565b005b6200038c600480360360208110156200035f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062001284565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6200041360048036036020811015620003e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620012b7565b6040518082815260200191505060405180910390f35b62000458600480360360208110156200044157600080fd5b8101908080359060200190929190505050620012cf565b005b6200049f600480360360208110156200047257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062001542565b005b620004e660048036036020811015620004b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506200184d565b005b620005db600480360360808110156200050057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156200055257600080fd5b8201836020820111156200056557600080fd5b803590602001918460018302840111640100000000831117156200058857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505062001a70565b005b6200062260048036036020811015620005f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062002224565b6040518082815260200191505060405180910390f35b62000687600480360360408110156200065057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506200226d565b6040518082815260200191505060405180910390f35b620006cc60048036036020811015620006b557600080fd5b81019080803590602001909291905050506200229c565b005b620007d760048036036080811015620006e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156200074e57600080fd5b8201836020820111156200076157600080fd5b803590602001918460018302840111640100000000831117156200078457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505062002553565b005b6200080860048036036020811015620007f157600080fd5b810190808035906020019092919050505062002d9f565b6040518082815260200191505060405180910390f35b6200086d600480360360408110156200083657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505062002f18565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b620008f460048036036020811015620008c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062002f64565b005b6200093b600480360360208110156200090e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003201565b6040518082815260200191505060405180910390f35b62000980600480360360208110156200096957600080fd5b8101908080359060200190929190505050620032e1565b604051808781526020018681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001965050505050505060405180910390f35b62000a1460048036036020811015620009fd57600080fd5b8101908080359060200190929190505050620033a9565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390f35b62000acd6004803603602081101562000ab657600080fd5b810190808035906020019092919050505062003477565b6040518082815260200191505060405180910390f35b62000b286004803603602081101562000afb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620034f4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101562000b6d57808201518184015260208101905062000b50565b505050509050019250505060405180910390f35b62000bc66004803603602081101562000b9957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620035c3565b005b62000c0d6004803603602081101562000be057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003809565b005b62000c546004803603602081101562000c2757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620039a3565b005b62000c856004803603602081101562000c6e57600080fd5b810190808035906020019092919050505062003c57565b6040518082815260200191505060405180910390f35b62000ce06004803603602081101562000cb357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003cfa565b604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b62000d756004803603602081101562000d4857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003e03565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101562000dba57808201518184015260208101905062000d9d565b505050509050019250505060405180910390f35b62000dd862003e9c565b6040518082815260200191505060405180910390f35b62000df862003ea2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60036020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030154908060040154908060050160009054906101000a900460ff169080600601549080600701549080600801549080600901549080600a01549080600b01549080600c0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508d565b3373ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161462000fe5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4f6e6c79206772616e74206d616e616765722063616e207265766f6b652e000081525060200191505060405180910390fd5b6003600082815260200190815260200160002060050160009054906101000a900460ff1662001060576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b81526020018062005aa6602b913960400191505060405180910390fd5b6000600360008381526020019081526020016000206002015414620010d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018062005afd6022913960400191505060405180910390fd5b6000620010de8262003477565b905060006200110d82600360008681526020019081526020016000206006015462003ec890919063ffffffff16565b9050426003600085815260200190815260200160002060020181905550806003600085815260200190815260200160002060030181905550620011cf81600660006003600088815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205462003ec890919063ffffffff16565b600660006003600087815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f19791073e5f2b48fe653897875e9f5893ac441ce6df89f2053538191e5c47631836040518082815260200191505060405180910390a1505050565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60066020528060005260406000206000915090505481565b6000620012dc8262003c57565b90506000811162001339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f81526020018062005b6c603f913960400191505060405180910390fd5b620013648160036000858152602001908152602001600020600a015462003f1490919063ffffffff16565b60036000848152602001908152602001600020600a01819055506200140881600660006003600087815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205462003ec890919063ffffffff16565b600660006003600086815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550620015066003600084815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662003f9d9092919063ffffffff16565b817f16b38bde3a1f1ffcf6135152793028f56443302494c5c811e63cf5f460a1e093826040518082815260200191505060405180910390a25050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b158015620015ef57600080fd5b505afa15801562001604573d6000803e3d6000fd5b505050506040513d60208110156200161b57600080fd5b81019080805190602001909291905050509050600060036000838152602001908152602001600020600201541415620016bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4772616e74206d757374206265207265766f6b6564000000000000000000000081525060200191505060405180910390fd5b6003600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161462001778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604181526020018062005bd16041913960600191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1663ca9ce2916040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620017c357600080fd5b505af1158015620017d8573d6000803e3d6000fd5b505050506040513d6020811015620017ef57600080fd5b810190808051906020019092919050505090506200182d8160036000858152602001908152602001600020600b015462003ec890919063ffffffff16565b60036000848152602001908152602001600020600b018190555050505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16632a9a347a6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620018fc57600080fd5b505af115801562001911573d6000803e3d6000fd5b505050506040513d60208110156200192857600080fd5b8101908080519060200190929190505050905060008273ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200198457600080fd5b505afa15801562001999573d6000803e3d6000fd5b505050506040513d6020811015620019b057600080fd5b81019080805190602001909291905050509050620019ee8260036000848152602001908152602001600020600b015462003ec890919063ffffffff16565b60036000838152602001908152602001600020600b0181905550600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550505050565b3373ffffffffffffffffffffffffffffffffffffffff166003600086815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161462001b2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018062005c756027913960400191505060405180910390fd5b600060036000868152602001908152602001600020600201541462001bb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265766f6b6564206772616e742063616e206e6f74206265207374616b65640081525060200191505060405180910390fd5b600260006003600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1662001cd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018062005ad1602c913960400191505060405180910390fd5b603c81511462001d2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018062005c126027913960400191505060405180910390fd5b600062001d446014836200407090919063ffffffff16565b905062001d518562002d9f565b83111562001dab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018062005b40602c913960400191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16868660405162001de0906200479d565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050604051809103906000f08015801562001e6d573d6000803e3d6000fd5b50905080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760006003600089815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508360036000888152602001908152602001600020600b0160008282540192505081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156200209557600080fd5b505af1158015620020aa573d6000803e3d6000fd5b505050506040513d6020811015620020c157600080fd5b8101908080519060200190929190505050508073ffffffffffffffffffffffffffffffffffffffff16630e89439b85856040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015620021485780820151818401526020810190506200212b565b50505050905090810190601f168015620021765780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156200219757600080fd5b505af1158015620021ac573d6000803e3d6000fd5b50505050857ff05c07b89b3e4ff57b17aa6883ec35e90d7710c57a038c49c3ec3911a80c24458584604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a2505050505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560205281600052604060002081815481106200228757fe5b90600052602060002001600091509150505481565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146200235d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f81526020018062005a77602f913960400191505060405180910390fd5b600081600301549050600082600401549050818110620023e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416c6c207265766f6b656420746f6b656e732077697468647261776e2e00000081525060200191505060405180910390fd5b6000620023fc828462003ec890919063ffffffff16565b9050600084600601549050600085600b01549050600086600a015490506000620024588262002449886200243a878962003ec890919063ffffffff16565b62003ec890919063ffffffff16565b62003ec890919063ffffffff16565b905060008111620024d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4e6f207265766f6b656420746f6b656e7320776974686472617761626c652e0081525060200191505060405180910390fd5b6000858210620024e25785620024e4565b815b9050620025353382600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662003f9d9092919063ffffffff16565b80896004016000828254019250508190555050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614620025fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c81526020018062005c39603c913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156200269b57600080fd5b505afa158015620026b0573d6000803e3d6000fd5b505050506040513d6020811015620026c757600080fd5b81019080805190602001909291905050508311156200274e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f53656e646572206d757374206861766520656e6f75676820616d6f756e742e0081525060200191505060405180910390fd5b60008060008060008060008780602001905160e08110156200276f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050509650965096509650965096509650600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156200286e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4772616e74656520616464726573732063616e2774206265207a65726f2e000081525060200191505060405180910390fd5b84831115620028c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604881526020018062005d826048913960600191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156200296d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5374616b696e6720706f6c6963792063616e2774206265207a65726f2e00000081525060200191505060405180910390fd5b6000806000815480929190600101919050559050604051806101a001604052808973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200184151581526020018c815260200187815260200186815260200162002a09868862003f1490919063ffffffff16565b815260200160008152602001600081526020018373ffffffffffffffffffffffffffffffffffffffff168152506003600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b015561018082015181600c0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050600560008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819080600181540180825580915050906001820390600052602060002001600090919290919091505550600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505090600182039060005260206000200160009091929091909150555062002cc38c308d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662004106909392919063ffffffff16565b62002d178b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205462003f1490919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f74b1b578efe34f4348abe981c705578eb9c7f0e25fb6e5bb0eeeb33c67854f83816040518082815260200191505060405180910390a1505050505050505050505050565b600080600360008481526020019081526020016000209050600081600201541462002dcf57600091505062002f13565b600081600601549050600082600a01549050600062002df8828462003ec890919063ffffffff16565b9050600084600c0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dab409354286886007015489600801548a60090154896040518763ffffffff1660e01b815260040180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060206040518083038186803b15801562002ea657600080fd5b505afa15801562002ebb573d6000803e3d6000fd5b505050506040513d602081101562002ed257600080fd5b810190808051906020019092919050505090508181111562002ef2578190505b62002f0b85600b01548262003ec890919063ffffffff16565b955050505050505b919050565b6007602052816000526040600020818154811062002f3257fe5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200301157600080fd5b505afa15801562003026573d6000803e3d6000fd5b505050506040513d60208110156200303d57600080fd5b81019080805190602001909291905050509050600060036000838152602001908152602001600020600201541415620030de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4772616e74206d757374206265207265766f6b6564000000000000000000000081525060200191505060405180910390fd5b6003600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146200319a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604081526020018062005cbd6040913960400191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166392ab89bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620031e357600080fd5b505af1158015620031f8573d6000803e3d6000fd5b50505050505050565b600080600090505b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015620032d8576000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110620032a157fe5b9060005260206000200154905060036000828152602001908152602001600020600b01548301925050808060010191505062003209565b50809050919050565b600080600080600080600360008881526020019081526020016000206006015460036000898152602001908152602001600020600a0154600360008a8152602001908152602001600020600b0154600360008b815260200190815260200160002060030154600360008c815260200190815260200160002060020154600360008d815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695509550955095509550955091939550919395565b60008060008060006003600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660036000888152602001908152602001600020600701546003600089815260200190815260200160002060080154600360008a815260200190815260200160002060090154600360008b8152602001908152602001600020600c0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169450945094509450945091939590929450565b600080600360008481526020019081526020016000209050600081600201541415620034ce57620034c88160060154826007015483600801548460090154426200420e90949392919063ffffffff16565b620034ec565b620034eb8160030154826006015462003ec890919063ffffffff16565b5b915050919050565b6060600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015620035b757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116200356c575b50505050509050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200367057600080fd5b505afa15801562003685573d6000803e3d6000fd5b505050506040513d60208110156200369c57600080fd5b810190808051906020019092919050505090508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806200374b57506003600082815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b620037a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018062005cfd6028913960400191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166392ab89bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620037eb57600080fd5b505af115801562003800573d6000803e3d6000fd5b50505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562003891576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018062005bab6026913960400191505060405180910390fd5b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fbac7e51eb022cc795791d1f0eba6e9589981088e2f83d61326ea494b423684d282604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801562003a5057600080fd5b505afa15801562003a65573d6000803e3d6000fd5b505050506040513d602081101562003a7c57600080fd5b810190808051906020019092919050505090508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148062003b2b57506003600082815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b62003b82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603381526020018062005d256033913960400191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1663ca9ce2916040518163ffffffff1660e01b8152600401602060405180830381600087803b15801562003bcd57600080fd5b505af115801562003be2573d6000803e3d6000fd5b505050506040513d602081101562003bf957600080fd5b8101908080519060200190929190505050905062003c378160036000858152602001908152602001600020600b015462003ec890919063ffffffff16565b60036000848152602001908152602001600020600b018190555050505050565b60008062003c658362003477565b9050600060036000858152602001908152602001600020600a01549050600060036000868152602001908152602001600020600b015490508262003cb3828462003f1490919063ffffffff16565b1062003cc6576000935050505062003cf5565b62003cef8162003ce0848662003ec890919063ffffffff16565b62003ec890919063ffffffff16565b93505050505b919050565b6000806000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fbbf93a06040518163ffffffff1660e01b815260040160606040518083038186803b15801562003da557600080fd5b505afa15801562003dba573d6000803e3d6000fd5b505050506040513d606081101562003dd157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050509250925092509193909250565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801562003e9057602002820191906000526020600020905b81548152602001906001019080831162003e7b575b50505050509050919050565b60005481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600062003f0c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525062004294565b905092915050565b60008082840190508381101562003f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6200406b838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505062004358565b505050565b60008060148301905082811180156200408a575080845110155b620040e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018062005b1f6021913960400191505060405180910390fd5b60006c0100000000000000000000000084602087010151049050809250505092915050565b62004208848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505062004358565b50505050565b60008082871090508015620042285760009150506200428b565b60006200423f858962003ec890919063ffffffff16565b9050600086821015905080156200425c578793505050506200428b565b620042858762004276848b620045af90919063ffffffff16565b6200463a90919063ffffffff16565b93505050505b95945050505050565b600083831115829062004345576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101562004309578082015181840152602081019050620042ec565b50505050905090810190601f168015620043375780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b620043798273ffffffffffffffffffffffffffffffffffffffff1662004686565b620043ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106200443d578051825260208201915060208101905060208303925062004418565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114620044a1576040519150601f19603f3d011682016040523d82523d6000602084013e620044a6565b606091505b5091509150816200451f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115620045a9578080602001905160208110156200454057600080fd5b8101908080519060200190929190505050620045a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018062005d58602a913960400191505060405180910390fd5b5b50505050565b600080831415620045c4576000905062004634565b6000828402905082848281620045d657fe5b04146200462f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018062005c9c6021913960400191505060405180910390fd5b809150505b92915050565b60006200467e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250620046d2565b905092915050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015620046c95750808214155b92505050919050565b6000808311829062004782576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200474657808201518184015260208101905062004729565b50505050905090810190601f168015620047745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816200478f57fe5b049050809150509392505050565b6112cb80620047ac8339019056fe608060405234801561001057600080fd5b506040516112cb3803806112cb8339818101604052606081101561003357600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156100fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546f6b656e20616464726573732063616e2774206265207a65726f2e0000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610181576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806112a46027913960400191505060405180910390fd5b826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160038190555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050506110488061025c6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806392ab89bb1161005b57806392ab89bb146101d8578063ca9ce291146101e2578063d321fe2914610200578063fbbf93a01461021e57610088565b80630e89439b1461008d5780632a9a347a146101525780635c8fb3cf146101705780638e68dce41461018e575b600080fd5b610150600480360360408110156100a357600080fd5b8101908080359060200190929190803590602001906401000000008111156100ca57600080fd5b8201836020820111156100dc57600080fd5b803590602001918460018302840111640100000000831117156100fe57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610276565b005b61015a6104e7565b6040518082815260200191505060405180910390f35b610178610694565b6040518082815260200191505060405180910390f35b610196610761565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101e061084e565b005b6101ea6109ee565b6040518082815260200191505060405180910390f35b610208610b9b565b6040518082815260200191505060405180910390f35b610226610c68565b604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b81600481905550610354601482610d6490919063ffffffff16565b600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cae9ca51600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561047d578082015181840152602081019050610462565b50505050905090810190601f1680156104aa5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156104cb57600080fd5b505af11580156104df573d6000803e3d6000fd5b505050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663525835f9600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561066f57600080fd5b505af1158015610683573d6000803e3d6000fd5b5050505061068f610df7565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610759576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600354905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610826576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663da8be864600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156109d457600080fd5b505af11580156109e8573d6000803e3d6000fd5b50505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ab3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e064172e600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610b7657600080fd5b505af1158015610b8a573d6000803e3d6000fd5b50505050610b96610df7565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600454905090565b6000806000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600354600454600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925092509250909192565b6000806014830190508281118015610d7d575080845110155b610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610ff36021913960400191505060405180910390fd5b60006c0100000000000000000000000084602087010151049050809250505092915050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e9857600080fd5b505afa158015610eac573d6000803e3d6000fd5b505050506040513d6020811015610ec257600080fd5b81019080805190602001909291905050509050806004600082825403925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b505050506040513d6020811015610fd957600080fd5b810190808051906020019092919050505050809150509056fe4164647265737320636f6e76657273696f6e206f7574206f6620626f756e64732ea265627a7a72315820b8703f642bef76e66904a16314306c2d82f35e22cc41fc5d364e294163e575d364736f6c634300051100325374616b696e6720636f6e747261637420616464726573732063616e2774206265207a65726f2e4f6e6c79206772616e74206d616e616765722063616e207769746864726177207265766f6b656420746f6b656e732e4772616e74206d757374206265207265766f6361626c6520696e2074686520666972737420706c6163652e50726f7669646564207374616b696e6720636f6e7472616374206973206e6f7420617574686f72697a65642e4772616e74206d757374206e6f7420626520616c7265616479207265766f6b65642e4164647265737320636f6e76657273696f6e206f7574206f6620626f756e64732e4d757374206861766520617661696c61626c65206772616e74656420616d6f756e7420746f207374616b652e4772616e7420617661696c61626c6520746f20776974686472617720616d6f756e742073686f756c642062652067726561746572207468616e207a65726f2e5374616b696e6720636f6e747261637420616464726573732063616e2774206265207a65726f4f6e6c79206772616e74206d616e616765722063616e20666f7263652063616e63656c6c6174696f6e206f66207265766f6b6564206772616e74207374616b652e5374616b652064656c65676174696f6e2064617461206d7573742062652070726f76696465642e546f6b656e20636f6e7472616374206d757374206265207468652073616d65206f6e65206c696e6b656420746f207468697320636f6e74726163742e4f6e6c79206772616e746565206f6620746865206772616e742063616e207374616b652069742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c79206772616e74206d616e616765722063616e20666f72636520756e64656c65676174696f6e206f66207265766f6b6564206772616e74207374616b654f6e6c79206f70657261746f72206f72206772616e7465652063616e20756e64656c65676174652e4f6e6c79206f70657261746f72206f72206772616e7465652063616e2063616e63656c207468652064656c65676174696f6e2e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564556e6c6f636b696e6720636c696666206475726174696f6e206d757374206265206c657373206f7220657175616c20746f74616c20756e6c6f636b696e67206475726174696f6e2ea265627a7a72315820b67d857b091b8e55f3e238cfcd7da4c7c85f4306fba9ef3e9ff11f000e6b71fc64736f6c6343000511003200000000000000000000000085eee30c52b0b379b046fb0f85f4f3dc3009afec

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620001f05760003560e01c80639bf850781162000111578063dba6d92411620000a5578063f29e2737116200007b578063f29e27371462000c9b578063f3ad1c1a1462000d30578063f81a64631462000dce578063fc0c546a1462000dee57620001f0565b8063dba6d9241462000bc8578063e064172e1462000c0f578063f11988e01462000c5657620001f0565b8063c6076b7a11620000e7578063c6076b7a14620009e5578063c90376e41462000a9e578063ca9a33ce1462000ae3578063da8be8641462000b8157620001f0565b80639bf8507814620008af578063af46aa0814620008f6578063b8cc6c93146200095157620001f0565b80635860280c11620001895780638e34e561116200015f5780638e34e561146200069d5780638f4ffcb114620006ce578063910bcf6114620007d95780639ae6e9c4146200081e57620001f0565b80635860280c14620004e857806370a0823114620005dd57806373297585146200063857620001f0565b806327e235e311620001cb57806327e235e314620003ce5780632e1a7d4d14620004295780633934af5c146200045a578063525835f914620004a157620001f0565b80630c0debea14620001f557806320c5429b14620003165780632496bfb31462000347575b600080fd5b62000224600480360360208110156200020d57600080fd5b810190808035906020019092919050505062000e3a565b604051808e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018b81526020018a8152602001891515151581526020018881526020018781526020018681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019d505050505050505050505050505060405180910390f35b62000345600480360360208110156200032e57600080fd5b810190808035906020019092919050505062000f0d565b005b6200038c600480360360208110156200035f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062001284565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6200041360048036036020811015620003e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620012b7565b6040518082815260200191505060405180910390f35b62000458600480360360208110156200044157600080fd5b8101908080359060200190929190505050620012cf565b005b6200049f600480360360208110156200047257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062001542565b005b620004e660048036036020811015620004b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506200184d565b005b620005db600480360360808110156200050057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156200055257600080fd5b8201836020820111156200056557600080fd5b803590602001918460018302840111640100000000831117156200058857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505062001a70565b005b6200062260048036036020811015620005f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062002224565b6040518082815260200191505060405180910390f35b62000687600480360360408110156200065057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506200226d565b6040518082815260200191505060405180910390f35b620006cc60048036036020811015620006b557600080fd5b81019080803590602001909291905050506200229c565b005b620007d760048036036080811015620006e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156200074e57600080fd5b8201836020820111156200076157600080fd5b803590602001918460018302840111640100000000831117156200078457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505062002553565b005b6200080860048036036020811015620007f157600080fd5b810190808035906020019092919050505062002d9f565b6040518082815260200191505060405180910390f35b6200086d600480360360408110156200083657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505062002f18565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b620008f460048036036020811015620008c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062002f64565b005b6200093b600480360360208110156200090e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003201565b6040518082815260200191505060405180910390f35b62000980600480360360208110156200096957600080fd5b8101908080359060200190929190505050620032e1565b604051808781526020018681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001965050505050505060405180910390f35b62000a1460048036036020811015620009fd57600080fd5b8101908080359060200190929190505050620033a9565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390f35b62000acd6004803603602081101562000ab657600080fd5b810190808035906020019092919050505062003477565b6040518082815260200191505060405180910390f35b62000b286004803603602081101562000afb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620034f4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101562000b6d57808201518184015260208101905062000b50565b505050509050019250505060405180910390f35b62000bc66004803603602081101562000b9957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620035c3565b005b62000c0d6004803603602081101562000be057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003809565b005b62000c546004803603602081101562000c2757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050620039a3565b005b62000c856004803603602081101562000c6e57600080fd5b810190808035906020019092919050505062003c57565b6040518082815260200191505060405180910390f35b62000ce06004803603602081101562000cb357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003cfa565b604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b62000d756004803603602081101562000d4857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505062003e03565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101562000dba57808201518184015260208101905062000d9d565b505050509050019250505060405180910390f35b62000dd862003e9c565b6040518082815260200191505060405180910390f35b62000df862003ea2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60036020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030154908060040154908060050160009054906101000a900460ff169080600601549080600701549080600801549080600901549080600a01549080600b01549080600c0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508d565b3373ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161462000fe5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4f6e6c79206772616e74206d616e616765722063616e207265766f6b652e000081525060200191505060405180910390fd5b6003600082815260200190815260200160002060050160009054906101000a900460ff1662001060576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b81526020018062005aa6602b913960400191505060405180910390fd5b6000600360008381526020019081526020016000206002015414620010d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018062005afd6022913960400191505060405180910390fd5b6000620010de8262003477565b905060006200110d82600360008681526020019081526020016000206006015462003ec890919063ffffffff16565b9050426003600085815260200190815260200160002060020181905550806003600085815260200190815260200160002060030181905550620011cf81600660006003600088815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205462003ec890919063ffffffff16565b600660006003600087815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f19791073e5f2b48fe653897875e9f5893ac441ce6df89f2053538191e5c47631836040518082815260200191505060405180910390a1505050565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60066020528060005260406000206000915090505481565b6000620012dc8262003c57565b90506000811162001339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f81526020018062005b6c603f913960400191505060405180910390fd5b620013648160036000858152602001908152602001600020600a015462003f1490919063ffffffff16565b60036000848152602001908152602001600020600a01819055506200140881600660006003600087815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205462003ec890919063ffffffff16565b600660006003600086815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550620015066003600084815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662003f9d9092919063ffffffff16565b817f16b38bde3a1f1ffcf6135152793028f56443302494c5c811e63cf5f460a1e093826040518082815260200191505060405180910390a25050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b158015620015ef57600080fd5b505afa15801562001604573d6000803e3d6000fd5b505050506040513d60208110156200161b57600080fd5b81019080805190602001909291905050509050600060036000838152602001908152602001600020600201541415620016bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4772616e74206d757374206265207265766f6b6564000000000000000000000081525060200191505060405180910390fd5b6003600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161462001778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604181526020018062005bd16041913960600191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1663ca9ce2916040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620017c357600080fd5b505af1158015620017d8573d6000803e3d6000fd5b505050506040513d6020811015620017ef57600080fd5b810190808051906020019092919050505090506200182d8160036000858152602001908152602001600020600b015462003ec890919063ffffffff16565b60036000848152602001908152602001600020600b018190555050505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16632a9a347a6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015620018fc57600080fd5b505af115801562001911573d6000803e3d6000fd5b505050506040513d60208110156200192857600080fd5b8101908080519060200190929190505050905060008273ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200198457600080fd5b505afa15801562001999573d6000803e3d6000fd5b505050506040513d6020811015620019b057600080fd5b81019080805190602001909291905050509050620019ee8260036000848152602001908152602001600020600b015462003ec890919063ffffffff16565b60036000838152602001908152602001600020600b0181905550600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550505050565b3373ffffffffffffffffffffffffffffffffffffffff166003600086815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161462001b2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018062005c756027913960400191505060405180910390fd5b600060036000868152602001908152602001600020600201541462001bb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265766f6b6564206772616e742063616e206e6f74206265207374616b65640081525060200191505060405180910390fd5b600260006003600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1662001cd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018062005ad1602c913960400191505060405180910390fd5b603c81511462001d2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018062005c126027913960400191505060405180910390fd5b600062001d446014836200407090919063ffffffff16565b905062001d518562002d9f565b83111562001dab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018062005b40602c913960400191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16868660405162001de0906200479d565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050604051809103906000f08015801562001e6d573d6000803e3d6000fd5b50905080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760006003600089815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508360036000888152602001908152602001600020600b0160008282540192505081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156200209557600080fd5b505af1158015620020aa573d6000803e3d6000fd5b505050506040513d6020811015620020c157600080fd5b8101908080519060200190929190505050508073ffffffffffffffffffffffffffffffffffffffff16630e89439b85856040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015620021485780820151818401526020810190506200212b565b50505050905090810190601f168015620021765780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156200219757600080fd5b505af1158015620021ac573d6000803e3d6000fd5b50505050857ff05c07b89b3e4ff57b17aa6883ec35e90d7710c57a038c49c3ec3911a80c24458584604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a2505050505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560205281600052604060002081815481106200228757fe5b90600052602060002001600091509150505481565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146200235d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f81526020018062005a77602f913960400191505060405180910390fd5b600081600301549050600082600401549050818110620023e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416c6c207265766f6b656420746f6b656e732077697468647261776e2e00000081525060200191505060405180910390fd5b6000620023fc828462003ec890919063ffffffff16565b9050600084600601549050600085600b01549050600086600a015490506000620024588262002449886200243a878962003ec890919063ffffffff16565b62003ec890919063ffffffff16565b62003ec890919063ffffffff16565b905060008111620024d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4e6f207265766f6b656420746f6b656e7320776974686472617761626c652e0081525060200191505060405180910390fd5b6000858210620024e25785620024e4565b815b9050620025353382600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662003f9d9092919063ffffffff16565b80896004016000828254019250508190555050505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614620025fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c81526020018062005c39603c913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156200269b57600080fd5b505afa158015620026b0573d6000803e3d6000fd5b505050506040513d6020811015620026c757600080fd5b81019080805190602001909291905050508311156200274e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f53656e646572206d757374206861766520656e6f75676820616d6f756e742e0081525060200191505060405180910390fd5b60008060008060008060008780602001905160e08110156200276f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050509650965096509650965096509650600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156200286e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4772616e74656520616464726573732063616e2774206265207a65726f2e000081525060200191505060405180910390fd5b84831115620028c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604881526020018062005d826048913960600191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156200296d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5374616b696e6720706f6c6963792063616e2774206265207a65726f2e00000081525060200191505060405180910390fd5b6000806000815480929190600101919050559050604051806101a001604052808973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200184151581526020018c815260200187815260200186815260200162002a09868862003f1490919063ffffffff16565b815260200160008152602001600081526020018373ffffffffffffffffffffffffffffffffffffffff168152506003600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b015561018082015181600c0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050600560008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819080600181540180825580915050906001820390600052602060002001600090919290919091505550600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505090600182039060005260206000200160009091929091909150555062002cc38c308d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662004106909392919063ffffffff16565b62002d178b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205462003f1490919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f74b1b578efe34f4348abe981c705578eb9c7f0e25fb6e5bb0eeeb33c67854f83816040518082815260200191505060405180910390a1505050505050505050505050565b600080600360008481526020019081526020016000209050600081600201541462002dcf57600091505062002f13565b600081600601549050600082600a01549050600062002df8828462003ec890919063ffffffff16565b9050600084600c0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dab409354286886007015489600801548a60090154896040518763ffffffff1660e01b815260040180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060206040518083038186803b15801562002ea657600080fd5b505afa15801562002ebb573d6000803e3d6000fd5b505050506040513d602081101562002ed257600080fd5b810190808051906020019092919050505090508181111562002ef2578190505b62002f0b85600b01548262003ec890919063ffffffff16565b955050505050505b919050565b6007602052816000526040600020818154811062002f3257fe5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200301157600080fd5b505afa15801562003026573d6000803e3d6000fd5b505050506040513d60208110156200303d57600080fd5b81019080805190602001909291905050509050600060036000838152602001908152602001600020600201541415620030de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4772616e74206d757374206265207265766f6b6564000000000000000000000081525060200191505060405180910390fd5b6003600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146200319a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604081526020018062005cbd6040913960400191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166392ab89bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620031e357600080fd5b505af1158015620031f8573d6000803e3d6000fd5b50505050505050565b600080600090505b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015620032d8576000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110620032a157fe5b9060005260206000200154905060036000828152602001908152602001600020600b01548301925050808060010191505062003209565b50809050919050565b600080600080600080600360008881526020019081526020016000206006015460036000898152602001908152602001600020600a0154600360008a8152602001908152602001600020600b0154600360008b815260200190815260200160002060030154600360008c815260200190815260200160002060020154600360008d815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695509550955095509550955091939550919395565b60008060008060006003600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660036000888152602001908152602001600020600701546003600089815260200190815260200160002060080154600360008a815260200190815260200160002060090154600360008b8152602001908152602001600020600c0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169450945094509450945091939590929450565b600080600360008481526020019081526020016000209050600081600201541415620034ce57620034c88160060154826007015483600801548460090154426200420e90949392919063ffffffff16565b620034ec565b620034eb8160030154826006015462003ec890919063ffffffff16565b5b915050919050565b6060600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015620035b757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116200356c575b50505050509050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200367057600080fd5b505afa15801562003685573d6000803e3d6000fd5b505050506040513d60208110156200369c57600080fd5b810190808051906020019092919050505090508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806200374b57506003600082815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b620037a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018062005cfd6028913960400191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166392ab89bb6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620037eb57600080fd5b505af115801562003800573d6000803e3d6000fd5b50505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562003891576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018062005bab6026913960400191505060405180910390fd5b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fbac7e51eb022cc795791d1f0eba6e9589981088e2f83d61326ea494b423684d282604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16635c8fb3cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801562003a5057600080fd5b505afa15801562003a65573d6000803e3d6000fd5b505050506040513d602081101562003a7c57600080fd5b810190808051906020019092919050505090508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148062003b2b57506003600082815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b62003b82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603381526020018062005d256033913960400191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1663ca9ce2916040518163ffffffff1660e01b8152600401602060405180830381600087803b15801562003bcd57600080fd5b505af115801562003be2573d6000803e3d6000fd5b505050506040513d602081101562003bf957600080fd5b8101908080519060200190929190505050905062003c378160036000858152602001908152602001600020600b015462003ec890919063ffffffff16565b60036000848152602001908152602001600020600b018190555050505050565b60008062003c658362003477565b9050600060036000858152602001908152602001600020600a01549050600060036000868152602001908152602001600020600b015490508262003cb3828462003f1490919063ffffffff16565b1062003cc6576000935050505062003cf5565b62003cef8162003ce0848662003ec890919063ffffffff16565b62003ec890919063ffffffff16565b93505050505b919050565b6000806000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fbbf93a06040518163ffffffff1660e01b815260040160606040518083038186803b15801562003da557600080fd5b505afa15801562003dba573d6000803e3d6000fd5b505050506040513d606081101562003dd157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050509250925092509193909250565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801562003e9057602002820191906000526020600020905b81548152602001906001019080831162003e7b575b50505050509050919050565b60005481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600062003f0c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525062004294565b905092915050565b60008082840190508381101562003f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6200406b838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505062004358565b505050565b60008060148301905082811180156200408a575080845110155b620040e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018062005b1f6021913960400191505060405180910390fd5b60006c0100000000000000000000000084602087010151049050809250505092915050565b62004208848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505062004358565b50505050565b60008082871090508015620042285760009150506200428b565b60006200423f858962003ec890919063ffffffff16565b9050600086821015905080156200425c578793505050506200428b565b620042858762004276848b620045af90919063ffffffff16565b6200463a90919063ffffffff16565b93505050505b95945050505050565b600083831115829062004345576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101562004309578082015181840152602081019050620042ec565b50505050905090810190601f168015620043375780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b620043798273ffffffffffffffffffffffffffffffffffffffff1662004686565b620043ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106200443d578051825260208201915060208101905060208303925062004418565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114620044a1576040519150601f19603f3d011682016040523d82523d6000602084013e620044a6565b606091505b5091509150816200451f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115620045a9578080602001905160208110156200454057600080fd5b8101908080519060200190929190505050620045a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018062005d58602a913960400191505060405180910390fd5b5b50505050565b600080831415620045c4576000905062004634565b6000828402905082848281620045d657fe5b04146200462f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018062005c9c6021913960400191505060405180910390fd5b809150505b92915050565b60006200467e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250620046d2565b905092915050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015620046c95750808214155b92505050919050565b6000808311829062004782576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200474657808201518184015260208101905062004729565b50505050905090810190601f168015620047745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816200478f57fe5b049050809150509392505050565b6112cb80620047ac8339019056fe608060405234801561001057600080fd5b506040516112cb3803806112cb8339818101604052606081101561003357600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156100fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546f6b656e20616464726573732063616e2774206265207a65726f2e0000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610181576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806112a46027913960400191505060405180910390fd5b826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160038190555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050506110488061025c6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806392ab89bb1161005b57806392ab89bb146101d8578063ca9ce291146101e2578063d321fe2914610200578063fbbf93a01461021e57610088565b80630e89439b1461008d5780632a9a347a146101525780635c8fb3cf146101705780638e68dce41461018e575b600080fd5b610150600480360360408110156100a357600080fd5b8101908080359060200190929190803590602001906401000000008111156100ca57600080fd5b8201836020820111156100dc57600080fd5b803590602001918460018302840111640100000000831117156100fe57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610276565b005b61015a6104e7565b6040518082815260200191505060405180910390f35b610178610694565b6040518082815260200191505060405180910390f35b610196610761565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101e061084e565b005b6101ea6109ee565b6040518082815260200191505060405180910390f35b610208610b9b565b6040518082815260200191505060405180910390f35b610226610c68565b604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b81600481905550610354601482610d6490919063ffffffff16565b600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cae9ca51600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561047d578082015181840152602081019050610462565b50505050905090810190601f1680156104aa5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156104cb57600080fd5b505af11580156104df573d6000803e3d6000fd5b505050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663525835f9600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561066f57600080fd5b505af1158015610683573d6000803e3d6000fd5b5050505061068f610df7565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610759576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600354905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610826576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663da8be864600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156109d457600080fd5b505af11580156109e8573d6000803e3d6000fd5b50505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ab3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e064172e600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610b7657600080fd5b505af1158015610b8a573d6000803e3d6000fd5b50505050610b96610df7565b905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600454905090565b6000806000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f466f7220746f6b656e206772616e7420636f6e7472616374206f6e6c7900000081525060200191505060405180910390fd5b600354600454600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925092509250909192565b6000806014830190508281118015610d7d575080845110155b610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610ff36021913960400191505060405180910390fd5b60006c0100000000000000000000000084602087010151049050809250505092915050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e9857600080fd5b505afa158015610eac573d6000803e3d6000fd5b505050506040513d6020811015610ec257600080fd5b81019080805190602001909291905050509050806004600082825403925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b505050506040513d6020811015610fd957600080fd5b810190808051906020019092919050505050809150509056fe4164647265737320636f6e76657273696f6e206f7574206f6620626f756e64732ea265627a7a72315820b8703f642bef76e66904a16314306c2d82f35e22cc41fc5d364e294163e575d364736f6c634300051100325374616b696e6720636f6e747261637420616464726573732063616e2774206265207a65726f2e4f6e6c79206772616e74206d616e616765722063616e207769746864726177207265766f6b656420746f6b656e732e4772616e74206d757374206265207265766f6361626c6520696e2074686520666972737420706c6163652e50726f7669646564207374616b696e6720636f6e7472616374206973206e6f7420617574686f72697a65642e4772616e74206d757374206e6f7420626520616c7265616479207265766f6b65642e4164647265737320636f6e76657273696f6e206f7574206f6620626f756e64732e4d757374206861766520617661696c61626c65206772616e74656420616d6f756e7420746f207374616b652e4772616e7420617661696c61626c6520746f20776974686472617720616d6f756e742073686f756c642062652067726561746572207468616e207a65726f2e5374616b696e6720636f6e747261637420616464726573732063616e2774206265207a65726f4f6e6c79206772616e74206d616e616765722063616e20666f7263652063616e63656c6c6174696f6e206f66207265766f6b6564206772616e74207374616b652e5374616b652064656c65676174696f6e2064617461206d7573742062652070726f76696465642e546f6b656e20636f6e7472616374206d757374206265207468652073616d65206f6e65206c696e6b656420746f207468697320636f6e74726163742e4f6e6c79206772616e746565206f6620746865206772616e742063616e207374616b652069742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c79206772616e74206d616e616765722063616e20666f72636520756e64656c65676174696f6e206f66207265766f6b6564206772616e74207374616b654f6e6c79206f70657261746f72206f72206772616e7465652063616e20756e64656c65676174652e4f6e6c79206f70657261746f72206f72206772616e7465652063616e2063616e63656c207468652064656c65676174696f6e2e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564556e6c6f636b696e6720636c696666206475726174696f6e206d757374206265206c657373206f7220657175616c20746f74616c20756e6c6f636b696e67206475726174696f6e2ea265627a7a72315820b67d857b091b8e55f3e238cfcd7da4c7c85f4306fba9ef3e9ff11f000e6b71fc64736f6c63430005110032

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

00000000000000000000000085eee30c52b0b379b046fb0f85f4f3dc3009afec

-----Decoded View---------------
Arg [0] : _tokenAddress (address): 0x85Eee30c52B0b379b046Fb0F85F4f3Dc3009aFEC

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000085eee30c52b0b379b046fb0f85f4f3dc3009afec


Deployed Bytecode Sourcemap

843:22124:10:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;843:22124:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2677:39;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2677:39:10;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13945:691;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;13945:691:10;;;;;;;;;;;;;;;;;:::i;:::-;;2751:54;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2751:54:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;3172:43;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3172:43:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;11640:605;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11640:605:10;;;;;;;;;;;;;;;;;:::i;:::-;;21045:570;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21045:570:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;22633:332;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22633:332:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;16694:1492;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;16694:1492:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;16694:1492:10;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;16694:1492:10;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;16694:1492:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;16694:1492:10;;;;;;;;;;;;;;;:::i;:::-;;4383:113;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4383:113:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2932:49;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2932:49:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;15102:1082;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;15102:1082:10;;;;;;;;;;;;;;;;;:::i;:::-;;9736:1742;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;9736:1742:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;9736:1742:10;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;9736:1742:10;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;9736:1742:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;9736:1742:10;;;;;;;;;;;;;;;:::i;:::-;;18584:899;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;18584:899:10;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3291:56;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3291:56:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;21936:477;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21936:477:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;4709:282;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4709:282:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5842:456;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5842:456:10;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7069:431;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7069:431:10;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12583:504;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;12583:504:10;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;8007:137;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8007:137:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8007:137:10;;;;;;;;;;;;;;;;;20348:360;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;20348:360:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;3813:334;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3813:334:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;19787:463;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;19787:463:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;13270:371;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;13270:371:10;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;8446:185;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8446:185:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7670:150;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7670:150:10;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;7670:150:10;;;;;;;;;;;;;;;;;2394:24;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2425:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2677:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;13945:691::-;14027:10;13999:38;;:6;:11;14006:3;13999:11;;;;;;;;;;;:24;;;;;;;;;;;;:38;;;13991:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14090:6;:11;14097:3;14090:11;;;;;;;;;;;:21;;;;;;;;;;;;14082:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14202:1;14177:6;:11;14184:3;14177:11;;;;;;;;;;;:21;;;:26;14169:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14253:22;14278:19;14293:3;14278:14;:19::i;:::-;14253:44;;14307:21;14331:38;14354:14;14331:6;:11;14338:3;14331:11;;;;;;;;;;;:18;;;:22;;:38;;;;:::i;:::-;14307:62;;14403:3;14379:6;:11;14386:3;14379:11;;;;;;;;;;;:21;;:27;;;;14444:13;14416:6;:11;14423:3;14416:11;;;;;;;;;;;:25;;:41;;;;14544:48;14578:13;14544:8;:29;14553:6;:11;14560:3;14553:11;;;;;;;;;;;:19;;;;;;;;;;;;14544:29;;;;;;;;;;;;;;;;:33;;:48;;;;:::i;:::-;14512:8;:29;14521:6;:11;14528:3;14521:11;;;;;;;;;;;:19;;;;;;;;;;;;14512:29;;;;;;;;;;;;;;;:80;;;;14607:22;14625:3;14607:22;;;;;;;;;;;;;;;;;;13945:691;;;:::o;2751:54::-;;;;;;;;;;;;;;;;;;;;;;:::o;3172:43::-;;;;;;;;;;;;;;;;;:::o;11640:605::-;11688:14;11705:17;11718:3;11705:12;:17::i;:::-;11688:34;;11749:1;11740:6;:10;11732:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11889:33;11915:6;11889;:11;11896:3;11889:11;;;;;;;;;;;:21;;;:25;;:33;;;;:::i;:::-;11865:6;:11;11872:3;11865:11;;;;;;;;;;;:21;;:57;;;;12007:41;12041:6;12007:8;:29;12016:6;:11;12023:3;12016:11;;;;;;;;;;;:19;;;;;;;;;;;;12007:29;;;;;;;;;;;;;;;;:33;;:41;;;;:::i;:::-;11975:8;:29;11984:6;:11;11991:3;11984:11;;;;;;;;;;;:19;;;;;;;;;;;;11975:29;;;;;;;;;;;;;;;:73;;;;12143:47;12162:6;:11;12169:3;12162:11;;;;;;;;;;;:19;;;;;;;;;;;;12183:6;12143:5;;;;;;;;;;;:18;;;;:47;;;;;:::i;:::-;12226:3;12206:32;12231:6;12206:32;;;;;;;;;;;;;;;;;;11640:605;;:::o;21045:570::-;21109:26;21138:11;:22;21150:9;21138:22;;;;;;;;;;;;;;;;;;;;;;;;;21109:51;;21170:15;21188:10;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;21188:23:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;21188:23:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21188:23:10;;;;;;;;;;;;;;;;21170:41;;21271:1;21242:6;:15;21249:7;21242:15;;;;;;;;;;;:25;;;:30;;21221:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21364:6;:15;21371:7;21364:15;;;;;;;;;;;:28;;;;;;;;;;;;21350:42;;:10;:42;;;21329:154;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21494:16;21513:10;:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;21513:24:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;21513:24:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21513:24:10;;;;;;;;;;;;;;;;21494:43;;21572:36;21599:8;21572:6;:15;21579:7;21572:15;;;;;;;;;;;:22;;;:26;;:36;;;;:::i;:::-;21547:6;:15;21554:7;21547:15;;;;;;;;;;;:22;;:61;;;;21045:570;;;;:::o;22633:332::-;22691:26;22720:11;:22;22732:9;22720:22;;;;;;;;;;;;;;;;;;;;;;;;;22691:51;;22752:16;22771:10;:23;;;:25;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22771:25:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22771:25:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22771:25:10;;;;;;;;;;;;;;;;22752:44;;22806:15;22824:10;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22824:23:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22824:23:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22824:23:10;;;;;;;;;;;;;;;;22806:41;;22882:36;22909:8;22882:6;:15;22889:7;22882:15;;;;;;;;;;;:22;;;:26;;:36;;;;:::i;:::-;22857:6;:15;22864:7;22857:15;;;;;;;;;;;:22;;:61;;;;22936:11;:22;22948:9;22936:22;;;;;;;;;;;;;;;;22929:29;;;;;;;;;;;22633:332;;;;:::o;16694:1492::-;16838:10;16815:33;;:6;:11;16822:3;16815:11;;;;;;;;;;;:19;;;;;;;;;;;;:33;;;16807:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16935:1;16910:6;:11;16917:3;16910:11;;;;;;;;;;;:21;;;:26;16902:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17003:16;:42;17020:6;:11;17027:3;17020:11;;;;;;;;;;;:24;;;;;;;;;;;;17003:42;;;;;;;;;;;;;;;:60;17046:16;17003:60;;;;;;;;;;;;;;;;;;;;;;;;;16982:151;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17236:2;17215:10;:17;:23;17207:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17292:16;17311:24;17332:2;17311:10;:20;;:24;;;;:::i;:::-;17292:43;;17476:21;17493:3;17476:16;:21::i;:::-;17465:7;:32;;17457:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17589:26;17659:5;;;;;;;;;;;17679:3;17696:16;17618:104;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;17618:104:10;17589:133;;17756:10;17732:11;:21;17744:8;17732:21;;;;;;;;;;;;;;;;:34;;;;;;;;;;;;;;;;;;17776:19;:40;17796:6;:11;17803:3;17796:11;;;;;;;;;;;:19;;;;;;;;;;;;17776:40;;;;;;;;;;;;;;;17822:8;17776:55;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;17776:55:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17863:7;17841:6;:11;17848:3;17841:11;;;;;;;;;;;:18;;;:29;;;;;;;;;;;17881:5;;;;;;;;;;;:14;;;17904:10;17917:7;17881:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;17881:44:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;17881:44:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;17881:44:10;;;;;;;;;;;;;;;;;18087:10;:16;;;18104:7;18113:10;18087:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;18087:37:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18087:37:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;18087:37:10;;;;18156:3;18139:40;18161:7;18170:8;18139:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;16694:1492;;;;;;:::o;4383:113::-;4439:15;4473:8;:16;4482:6;4473:16;;;;;;;;;;;;;;;;4466:23;;4383:113;;;:::o;2932:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;15102:1082::-;15157:19;15179:6;:11;15186:3;15179:11;;;;;;;;;;;15157:33;;15243:10;15221:32;;:5;:18;;;;;;;;;;;;:32;;;15200:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15336:15;15354:5;:19;;;15336:37;;15383:24;15410:5;:22;;;15383:49;;15469:7;15450:16;:26;15442:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15521:24;15548:29;15560:16;15548:7;:11;;:29;;;;:::i;:::-;15521:56;;15588:19;15610:5;:12;;;15588:34;;15632:14;15649:5;:12;;;15632:29;;15671:24;15698:5;:15;;;15671:42;;15723:31;15769:67;15819:16;15769:45;15797:16;15769:23;15785:6;15769:11;:15;;:23;;;;:::i;:::-;:27;;:45;;;;:::i;:::-;:49;;:67;;;;:::i;:::-;15723:113;;15881:1;15855:23;:27;15847:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15929:24;15982:16;15956:23;:42;:111;;16051:16;15956:111;;;16013:23;15956:111;15929:138;;16077:48;16096:10;16108:16;16077:5;;;;;;;;;;;:18;;;;:48;;;;;:::i;:::-;16161:16;16135:5;:22;;;:42;;;;;;;;;;;15102:1082;;;;;;;;;;:::o;9736:1742::-;9884:5;;;;;;;;;;;9859:30;;9873:6;9859:30;;;9851:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9983:5;;;;;;;;;;;:15;;;9999:5;9983:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9983:22:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9983:22:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;9983:22:10;;;;;;;;;;;;;;;;9972:7;:33;;9964:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10052:21;10084:16;10111:17;10139:14;10164:22;10197:15;10223:22;10274:10;10249:120;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;10249:120:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10051:318;;;;;;;;;;;;;;10408:1;10388:22;;:8;:22;;;;10380:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10494:9;10476:14;:27;;10455:146;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10646:1;10620:28;;:14;:28;;;;10612:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10693:10;10706:9;;:11;;;;;;;;;;;;10693:24;;10740:279;;;;;;;;10759:13;10740:279;;;;;;10786:8;10740:279;;;;;;10808:1;10740:279;;;;10811:1;10740:279;;;;10814:1;10740:279;;;;10829:10;10740:279;;;;;;10853:7;10740:279;;;;10874:9;10740:279;;;;10897:6;10740:279;;;;10917:26;10928:14;10917:6;:10;;:26;;;;:::i;:::-;10740:279;;;;10957:1;10740:279;;;;10960:1;10740:279;;;;10994:14;10740:279;;;;;10727:6;:10;10734:2;10727:10;;;;;;;;;;;:292;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11111:12;:19;11124:5;11111:19;;;;;;;;;;;;;;;11136:2;11111:28;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;11111:28:10;;;;;;;;;;;;;;;;;;;;;;11225:12;:22;11238:8;11225:22;;;;;;;;;;;;;;;11253:2;11225:31;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;11225:31:10;;;;;;;;;;;;;;;;;;;;;;11267:53;11290:5;11305:4;11312:7;11267:5;;;;;;;;;;;:22;;;;:53;;;;;;:::i;:::-;11404:31;11427:7;11404:8;:18;11413:8;11404:18;;;;;;;;;;;;;;;;:22;;:31;;;;:::i;:::-;11383:8;:18;11392:8;11383:18;;;;;;;;;;;;;;;:52;;;;11450:21;11468:2;11450:21;;;;;;;;;;;;;;;;;;9736:1742;;;;;;;;;;;;:::o;18584:899::-;18649:7;18668:19;18690:6;:16;18697:8;18690:16;;;;;;;;;;;18668:38;;18857:1;18838:5;:15;;;:20;18834:39;;18869:1;18862:8;;;;;18834:39;18882:14;18899:5;:12;;;18882:29;;18921:17;18941:5;:15;;;18921:35;;18966:17;18986:21;18997:9;18986:6;:10;;:21;;;;:::i;:::-;18966:41;;19017:17;19037:5;:19;;;;;;;;;;;;:38;;;19089:3;19106:6;19126:5;:14;;;19154:5;:11;;;19179:5;:11;;;19204:9;19037:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19037:186:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;19037:186:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;19037:186:10;;;;;;;;;;;;;;;;19017:206;;19375:9;19363;:21;19359:73;;;19412:9;19400:21;;19359:73;19449:27;19463:5;:12;;;19449:9;:13;;:27;;;;:::i;:::-;19442:34;;;;;;;18584:899;;;;:::o;3291:56::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;21936:477::-;21999:26;22028:11;:22;22040:9;22028:22;;;;;;;;;;;;;;;;;;;;;;;;;21999:51;;22060:15;22078:10;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22078:23:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22078:23:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22078:23:10;;;;;;;;;;;;;;;;22060:41;;22161:1;22132:6;:15;22139:7;22132:15;;;;;;;;;;;:25;;;:30;;22111:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22254:6;:15;22261:7;22254:15;;;;;;;;;;;:28;;;;;;;;;;;;22240:42;;:10;:42;;;22219:153;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22383:10;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22383:23:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22383:23:10;;;;21936:477;;;:::o;4709:282::-;4772:15;4804:6;4813:1;4804:10;;4799:162;4820:12;:22;4833:8;4820:22;;;;;;;;;;;;;;;:29;;;;4816:1;:33;4799:162;;;4870:10;4883:12;:22;4896:8;4883:22;;;;;;;;;;;;;;;4906:1;4883:25;;;;;;;;;;;;;;;;4870:38;;4933:6;:10;4940:2;4933:10;;;;;;;;;;;:17;;;4922:28;;;;4799:162;4851:3;;;;;;;4799:162;;;;4977:7;4970:14;;4709:282;;;:::o;5842:456::-;5903:14;5927:17;5954:14;5978:21;6009:17;6036:15;6089:6;:11;6096:3;6089:11;;;;;;;;;;;:18;;;6121:6;:11;6128:3;6121:11;;;;;;;;;;;:21;;;6156:6;:11;6163:3;6156:11;;;;;;;;;;;:18;;;6188:6;:11;6195:3;6188:11;;;;;;;;;;;:25;;;6227:6;:11;6234:3;6227:11;;;;;;;;;;;:21;;;6262:6;:11;6269:3;6262:11;;;;;;;;;;;:19;;;;;;;;;;;;6068:223;;;;;;;;;;;;5842:456;;;;;;;:::o;7069:431::-;7161:20;7191:16;7217:13;7240;7263:14;7315:6;:11;7322:3;7315:11;;;;;;;;;;;:24;;;;;;;;;;;;7353:6;:11;7360:3;7353:11;;;;;;;;;;;:20;;;7387:6;:11;7394:3;7387:11;;;;;;;;;;;:17;;;7418:6;:11;7425:3;7418:11;;;;;;;;;;;:17;;;7457:6;:11;7464:3;7457:11;;;;;;;;;;;:25;;;;;;;;;;;;7294:199;;;;;;;;;;7069:431;;;;;;;:::o;12583:504::-;12641:7;12660:19;12682:6;:11;12689:3;12682:11;;;;;;;;;;;12660:33;;12730:1;12711:5;:15;;;:20;;12710:370;;12925:155;12964:5;:12;;;12994:5;:14;;;13026:5;:11;;;13055:5;:11;;;12925:3;:21;;:155;;;;;;;:::i;:::-;12710:370;;;12804:37;12821:5;:19;;;12804:5;:12;;;:16;;:37;;;;:::i;:::-;12710:370;12703:377;;;12583:504;;;:::o;8007:137::-;8074:16;8109:19;:28;8129:7;8109:28;;;;;;;;;;;;;;;8102:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8007:137;;;:::o;20348:360::-;20404:26;20433:11;:22;20445:9;20433:22;;;;;;;;;;;;;;;;;;;;;;;;;20404:51;;20465:15;20483:10;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;20483:23:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;20483:23:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;20483:23:10;;;;;;;;;;;;;;;;20465:41;;20551:9;20537:23;;:10;:23;;;:64;;;;20578:6;:15;20585:7;20578:15;;;;;;;;;;;:23;;;;;;;;;;;;20564:37;;:10;:37;;;20537:64;20516:151;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20678:10;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;20678:23:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;20678:23:10;;;;20348:360;;;:::o;3813:334::-;3939:3;3911:32;;:16;:32;;;;3890:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4066:4;4017:16;:28;4034:10;4017:28;;;;;;;;;;;;;;;:46;4046:16;4017:46;;;;;;;;;;;;;;;;:53;;;;;;;;;;;;;;;;;;4111:10;4085:55;;;4123:16;4085:55;;;;;;;;;;;;;;;;;;;;;;3813:334;:::o;19787:463::-;19844:26;19873:11;:22;19885:9;19873:22;;;;;;;;;;;;;;;;;;;;;;;;;19844:51;;19905:15;19923:10;:21;;;:23;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19923:23:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;19923:23:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;19923:23:10;;;;;;;;;;;;;;;;19905:41;;19991:9;19977:23;;:10;:23;;;:64;;;;20018:6;:15;20025:7;20018:15;;;;;;;;;;;:23;;;;;;;;;;;;20004:37;;:10;:37;;;19977:64;19956:162;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20129:16;20148:10;:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;20148:24:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;20148:24:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;20148:24:10;;;;;;;;;;;;;;;;20129:43;;20207:36;20234:8;20207:6;:15;20214:7;20207:15;;;;;;;;;;;:22;;;:26;;:36;;;;:::i;:::-;20182:6;:15;20189:7;20182:15;;;;;;;;;;;:22;;:61;;;;19787:463;;;;:::o;13270:371::-;13326:7;13345:16;13364:19;13379:3;13364:14;:19::i;:::-;13345:38;;13393:17;13413:6;:11;13420:3;13413:11;;;;;;;;;;;:21;;;13393:41;;13444:14;13461:6;:11;13468:3;13461:11;;;;;;;;;;;:18;;;13444:35;;13519:8;13494:21;13508:6;13494:9;:13;;:21;;;;:::i;:::-;:33;13490:145;;13550:1;13543:8;;;;;;;13490:145;13589:35;13617:6;13589:23;13602:9;13589:8;:12;;:23;;;;:::i;:::-;:27;;:35;;;;:::i;:::-;13582:42;;;;;13270:371;;;;:::o;8446:185::-;8515:15;8532:14;8548:23;8590:11;:21;8602:8;8590:21;;;;;;;;;;;;;;;;;;;;;;;;;:32;;;:34;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8590:34:10;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8590:34:10;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8590:34:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8583:41;;;;;;8446:185;;;;;:::o;7670:150::-;7742:16;7777:12;:36;7790:22;7777:36;;;;;;;;;;;;;;;7770:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7670:150;;;:::o;2394:24::-;;;;:::o;2425:26::-;;;;;;;;;;;;;:::o;1274:134:1:-;1332:7;1358:43;1362:1;1365;1358:43;;;;;;;;;;;;;;;;;:3;:43::i;:::-;1351:50;;1274:134;;;;:::o;834:176::-;892:7;911:9;927:1;923;:5;911:17;;951:1;946;:6;;938:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1002:1;995:8;;;834:176;;;;:::o;662:174:5:-;744:85;763:5;793;:14;;;:23;;;;818:2;822:5;770:58;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;770:58:5;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;770:58:5;744:18;:85::i;:::-;662:174;;;:::o;11349:422:15:-;11426:7;11445:14;11471:2;11462:6;:11;11445:28;;11503:6;11491:9;:18;:48;;;;;11530:9;11513:6;:13;:26;;11491:48;11483:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11587:19;11698:27;11688:6;11681:4;11673:6;11669:17;11665:30;11659:37;11655:71;11640:86;;11753:11;11746:18;;;;11349:422;;;;:::o;842:202:5:-;942:95;961:5;991;:18;;;:27;;;;1020:4;1026:2;1030:5;968:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;968:68:5;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;968:68:5;942:18;:95::i;:::-;842:202;;;;:::o;151:523:13:-;332:7;351:20;381:5;374:4;:12;351:35;;400:15;396:34;;;426:1;419:8;;;;;396:34;440:19;462:15;471:5;462:4;:8;;:15;;;;:::i;:::-;440:37;;488:28;534:8;519:11;:23;;488:54;;556:23;552:54;;;590:13;583:20;;;;;;;552:54;623:44;658:8;623:30;641:11;623:13;:17;;:30;;;;:::i;:::-;:34;;:44;;;;:::i;:::-;616:51;;;;;151:523;;;;;;;;:::o;1732:187:1:-;1818:7;1850:1;1845;:6;;1853:12;1837:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1837:29:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1876:9;1892:1;1888;:5;1876:17;;1911:1;1904:8;;;1732:187;;;;;:::o;2666:1095:5:-;3261:27;3269:5;3261:25;;;:27::i;:::-;3253:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3395:12;3409:23;3444:5;3436:19;;3456:4;3436:25;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3436:25:5;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;3394:67:5;;;;3479:7;3471:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3558:1;3538:10;:17;:21;3534:221;;;3678:10;3667:30;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3667:30:5;;;;;;;;;;;;;;;;3659:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3534:221;2666:1095;;;;:::o;2159:459:1:-;2217:7;2463:1;2458;:6;2454:45;;;2487:1;2480:8;;;;2454:45;2509:9;2525:1;2521;:5;2509:17;;2553:1;2548;2544;:5;;;;;;:10;2536:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2610:1;2603:8;;;2159:459;;;;;:::o;3073:130::-;3131:7;3157:39;3161:1;3164;3157:39;;;;;;;;;;;;;;;;;:3;:39::i;:::-;3150:46;;3073:130;;;;:::o;557:797:6:-;617:4;1062:16;1088:19;1110:66;1088:88;;;;1277:7;1265:20;1253:32;;1316:3;1304:15;;:8;:15;;:42;;;;;1335:11;1323:8;:23;;1304:42;1296:51;;;;557:797;;;:::o;3718:338:1:-;3804:7;3901:1;3897;:5;3904:12;3889:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;3889:28:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3927:9;3943:1;3939;:5;;;;;;3927:17;;4048:1;4041:8;;;3718:338;;;;;:::o;843:22124:10:-;;;;;;;;:::o

Swarm Source

bzzr://b67d857b091b8e55f3e238cfcd7da4c7c85f4306fba9ef3e9ff11f000e6b71fc

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

The Keep TokenGrant contract holds all locked employee, advisor, and purchaser tokens.

Validator Index Block Amount
View All Withdrawals

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

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