ETH Price: $3,160.31 (-8.94%)
Gas: 3 Gwei

Contract

0xB5303c22396333D9D27Dc45bDcC8E7Fc502b4B32
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0xd96d34e018da8c37e27aa6788be2acc572ae4e9a5f8fd2105dedde060f81eedb Claim Staking Re...(pending)2024-07-25 8:17:402 hrs ago1721895460IN
0xB5303c22...c502b4B32
0 ETH(Pending)(Pending)
0x9ebd526e37cb871f7ad34baa6643cb1f8174e4fdb0e18cc69cd73766ceafdb72 Claim Staking Re...(pending)2024-07-25 8:07:282 hrs ago1721894848IN
0xB5303c22...c502b4B32
0 ETH(Pending)(Pending)
Claim Staking Re...203819692024-07-25 7:07:473 hrs ago1721891267IN
0xB5303c22...c502b4B32
0 ETH0.000656282.66622056
Claim Staking Re...203818632024-07-25 6:46:234 hrs ago1721889983IN
0xB5303c22...c502b4B32
0 ETH0.000800242.99409278
Claim Staking Re...203731922024-07-24 1:43:4733 hrs ago1721785427IN
0xB5303c22...c502b4B32
0 ETH0.001250815
Claim Staking Re...203674462024-07-23 6:29:592 days ago1721716199IN
0xB5303c22...c502b4B32
0 ETH0.000500352
Claim Staking Re...203547302024-07-21 11:51:353 days ago1721562695IN
0xB5303c22...c502b4B32
0 ETH0.000500352
Claim Staking Re...203538482024-07-21 8:54:354 days ago1721552075IN
0xB5303c22...c502b4B32
0 ETH0.000582322.36576191
Claim Staking Re...203520652024-07-21 2:56:234 days ago1721530583IN
0xB5303c22...c502b4B32
0 ETH0.000492422
Claim Staking Re...203520192024-07-21 2:47:114 days ago1721530031IN
0xB5303c22...c502b4B32
0 ETH0.000500352
Claim Staking Re...203469252024-07-20 9:44:235 days ago1721468663IN
0xB5303c22...c502b4B32
0 ETH0.001250875
Claim Staking Re...203454782024-07-20 4:53:235 days ago1721451203IN
0xB5303c22...c502b4B32
0 ETH0.000534552
Claim Staking Re...203452912024-07-20 4:15:595 days ago1721448959IN
0xB5303c22...c502b4B32
0 ETH0.000586132.34289494
Claim Staking Re...203452822024-07-20 4:14:115 days ago1721448851IN
0xB5303c22...c502b4B32
0 ETH0.000708792.49245858
Claim Staking Re...203448572024-07-20 2:48:235 days ago1721443703IN
0xB5303c22...c502b4B32
0 ETH0.000592272.3674393
Claim Staking Re...203448502024-07-20 2:46:595 days ago1721443619IN
0xB5303c22...c502b4B32
0 ETH0.000592942.3701135
Claim Staking Re...203444412024-07-20 1:24:235 days ago1721438663IN
0xB5303c22...c502b4B32
0 ETH0.001230745
Claim Staking Re...203443472024-07-20 1:05:235 days ago1721437523IN
0xB5303c22...c502b4B32
0 ETH0.000750523
Claim Staking Re...203430052024-07-19 20:35:475 days ago1721421347IN
0xB5303c22...c502b4B32
0 ETH0.001501056
Claim Staking Re...203391742024-07-19 7:46:596 days ago1721375219IN
0xB5303c22...c502b4B32
0 ETH0.001501056
Claim Staking Re...203369332024-07-19 0:16:476 days ago1721348207IN
0xB5303c22...c502b4B32
0 ETH0.001751227
Claim Staking Re...203273022024-07-17 16:00:357 days ago1721232035IN
0xB5303c22...c502b4B32
0 ETH0.0087906435.138
Claim Staking Re...203236962024-07-17 3:55:598 days ago1721188559IN
0xB5303c22...c502b4B32
0 ETH0.00100074
Claim Staking Re...203226332024-07-17 0:22:358 days ago1721175755IN
0xB5303c22...c502b4B32
0 ETH0.001159774.63666761
Claim Staking Re...203220822024-07-16 22:32:238 days ago1721169143IN
0xB5303c22...c502b4B32
0 ETH0.001751227
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
203819972024-07-25 7:13:233 hrs ago1721891603
0xB5303c22...c502b4B32
0 ETH
203819972024-07-25 7:13:233 hrs ago1721891603
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203819692024-07-25 7:07:473 hrs ago1721891267
0xB5303c22...c502b4B32
0 ETH
203818712024-07-25 6:47:594 hrs ago1721890079
0xB5303c22...c502b4B32
0 ETH
203818712024-07-25 6:47:594 hrs ago1721890079
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203818632024-07-25 6:46:234 hrs ago1721889983
0xB5303c22...c502b4B32
0 ETH
203809252024-07-25 3:38:237 hrs ago1721878703
0xB5303c22...c502b4B32
0 ETH
203809252024-07-25 3:38:237 hrs ago1721878703
0xB5303c22...c502b4B32
0 ETH
203737632024-07-24 3:38:2331 hrs ago1721792303
0xB5303c22...c502b4B32
0 ETH
203737632024-07-24 3:38:2331 hrs ago1721792303
0xB5303c22...c502b4B32
0 ETH
203731952024-07-24 1:44:2333 hrs ago1721785463
0xB5303c22...c502b4B32
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingRewards

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-11-04
*/

// File: @openzeppelin/contracts/math/SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

// File: contracts/SafeMath96.sol

pragma solidity 0.6.12;

/**
 * @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 SafeMath96 {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint96 a, uint256 b) internal pure returns (uint96) {
        require(uint256(uint96(b)) == b, "SafeMath: addition overflow");
        uint96 c = a + uint96(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(uint96 a, uint256 b) internal pure returns (uint96) {
        require(uint256(uint96(b)) == b, "SafeMath: subtraction overflow");
        return sub(a, uint96(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(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
        require(b <= a, errorMessage);
        uint96 c = a - b;

        return c;
    }

}

// File: @openzeppelin/contracts/math/Math.sol

pragma solidity ^0.6.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

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

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

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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: contracts/spec_interfaces/ICommittee.sol

pragma solidity 0.6.12;

/// @title Committee contract interface
interface ICommittee {
	event CommitteeChange(address indexed addr, uint256 weight, bool certification, bool inCommittee);
	event CommitteeSnapshot(address[] addrs, uint256[] weights, bool[] certification);

	// No external functions

	/*
     * External functions
     */

    /// Notifies a weight change of a member
    /// @dev Called only by: Elections contract
    /// @param addr is the committee member address
    /// @param weight is the updated weight of the committee member
	function memberWeightChange(address addr, uint256 weight) external /* onlyElectionsContract onlyWhenActive */;

    /// Notifies a change in the certification of a member
    /// @dev Called only by: Elections contract
    /// @param addr is the committee member address
    /// @param isCertified is the updated certification state of the member
	function memberCertificationChange(address addr, bool isCertified) external /* onlyElectionsContract onlyWhenActive */;

    /// Notifies a member removal for example due to voteOut or voteUnready
    /// @dev Called only by: Elections contract
    /// @param memberRemoved is the removed committee member address
    /// @return memberRemoved indicates whether the member was removed from the committee
    /// @return removedMemberWeight indicates the removed member weight
    /// @return removedMemberCertified indicates whether the member was in the certified committee
	function removeMember(address addr) external returns (bool memberRemoved, uint removedMemberWeight, bool removedMemberCertified)/* onlyElectionContract */;

    /// Notifies a new member applicable for committee (due to registration, unbanning, certification change)
    /// The new member will be added only if it is qualified to join the committee 
    /// @dev Called only by: Elections contract
    /// @param addr is the added committee member address
    /// @param weight is the added member weight
    /// @param isCertified is the added member certification state
    /// @return memberAdded bool indicates whether the member was added
	function addMember(address addr, uint256 weight, bool isCertified) external returns (bool memberAdded)  /* onlyElectionsContract */;

    /// Checks if addMember() would add a the member to the committee (qualified to join)
    /// @param addr is the candidate committee member address
    /// @param weight is the candidate committee member weight
    /// @return wouldAddMember bool indicates whether the member will be added
	function checkAddMember(address addr, uint256 weight) external view returns (bool wouldAddMember);

    /// Returns the committee members and their weights
    /// @return addrs is the committee members list
    /// @return weights is an array of uint, indicating committee members list weight
    /// @return certification is an array of bool, indicating the committee members certification status
	function getCommittee() external view returns (address[] memory addrs, uint256[] memory weights, bool[] memory certification);

    /// Returns the currently appointed committee data
    /// @return generalCommitteeSize is the number of members in the committee
    /// @return certifiedCommitteeSize is the number of certified members in the committee
    /// @return totalWeight is the total effective stake (weight) of the committee
	function getCommitteeStats() external view returns (uint generalCommitteeSize, uint certifiedCommitteeSize, uint totalWeight);

    /// Returns a committee member data
    /// @param addr is the committee member address
    /// @return inCommittee indicates whether the queried address is a member in the committee
    /// @return weight is the committee member weight
    /// @return isCertified indicates whether the committee member is certified
    /// @return totalCommitteeWeight is the total weight of the committee.
	function getMemberInfo(address addr) external view returns (bool inCommittee, uint weight, bool isCertified, uint totalCommitteeWeight);

    /// Emits a CommitteeSnapshot events with current committee info
    /// @dev a CommitteeSnapshot is useful on contract migration or to remove the need to track past events.
	function emitCommitteeSnapshot() external;

	/*
	 * Governance functions
	 */

	event MaxCommitteeSizeChanged(uint8 newValue, uint8 oldValue);

    /// Sets the maximum number of committee members
    /// @dev governance function called only by the functional manager
    /// @dev when reducing the number of members, the bottom ones are removed from the committee
    /// @param _maxCommitteeSize is the maximum number of committee members 
	function setMaxCommitteeSize(uint8 _maxCommitteeSize) external /* onlyFunctionalManager */;

    /// Returns the maximum number of committee members
    /// @return maxCommitteeSize is the maximum number of committee members 
	function getMaxCommitteeSize() external view returns (uint8);
	
    /// Imports the committee members from a previous committee contract during migration
    /// @dev initialization function called only by the initializationManager
    /// @dev does not update the reward contract to avoid incorrect notifications 
    /// @param previousCommitteeContract is the address of the previous committee contract
	function importMembers(ICommittee previousCommitteeContract) external /* onlyInitializationAdmin */;
}

// File: contracts/spec_interfaces/IProtocolWallet.sol

pragma solidity 0.6.12;


/// @title Protocol Wallet interface
interface IProtocolWallet {
    event FundsAddedToPool(uint256 added, uint256 total);

    /*
    * External functions
    */

    /// Returns the address of the underlying staked token
    /// @return balance is the wallet balance
    function getBalance() external view returns (uint256 balance);

    /// Transfers the given amount of orbs tokens form the sender to this contract and updates the pool
    /// @dev assumes the caller approved the amount prior to calling
    /// @param amount is the amount to add to the wallet
    function topUp(uint256 amount) external;

    /// Withdraws from pool to the client address, limited by the pool's MaxRate.
    /// @dev may only be called by the wallet client
    /// @dev no more than MaxRate x time period since the last withdraw may be withdrawn
    /// @dev allocation that wasn't withdrawn can not be withdrawn in the next call
    /// @param amount is the amount to withdraw
    function withdraw(uint256 amount) external; /* onlyClient */


    /*
    * Governance functions
    */

    event ClientSet(address client);
    event MaxAnnualRateSet(uint256 maxAnnualRate);
    event EmergencyWithdrawal(address addr, address token);
    event OutstandingTokensReset(uint256 startTime);

    /// Sets a new annual withdraw rate for the pool
    /// @dev governance function called only by the migration owner
    /// @dev the rate for a duration is duration x annualRate / 1 year 
    /// @param _annualRate is the maximum annual rate that can be withdrawn
    function setMaxAnnualRate(uint256 _annualRate) external; /* onlyMigrationOwner */

    /// Returns the annual withdraw rate of the pool
    /// @return annualRate is the maximum annual rate that can be withdrawn
    function getMaxAnnualRate() external view returns (uint256);

    /// Resets the outstanding tokens to new start time
    /// @dev governance function called only by the migration owner
    /// @dev the next duration will be calculated starting from the given time
    /// @param startTime is the time to set as the last withdrawal time
    function resetOutstandingTokens(uint256 startTime) external; /* onlyMigrationOwner */

    /// Emergency withdraw the wallet funds
    /// @dev governance function called only by the migration owner
    /// @dev used in emergencies, when a migration to a new wallet is needed
    /// @param erc20 is the erc20 address of the token to withdraw
    function emergencyWithdraw(address erc20) external; /* onlyMigrationOwner */

    /// Sets the address of the client that can withdraw funds
    /// @dev governance function called only by the functional owner
    /// @param _client is the address of the new client
    function setClient(address _client) external; /* onlyFunctionalOwner */

}

// File: contracts/spec_interfaces/IStakingRewards.sol

pragma solidity 0.6.12;

/// @title Staking rewards contract interface
interface IStakingRewards {

    event DelegatorStakingRewardsAssigned(address indexed delegator, uint256 amount, uint256 totalAwarded, address guardian, uint256 delegatorRewardsPerToken, uint256 delegatorRewardsPerTokenDelta);
    event GuardianStakingRewardsAssigned(address indexed guardian, uint256 amount, uint256 totalAwarded, uint256 delegatorRewardsPerToken, uint256 delegatorRewardsPerTokenDelta, uint256 stakingRewardsPerWeight, uint256 stakingRewardsPerWeightDelta);
    event StakingRewardsClaimed(address indexed addr, uint256 claimedDelegatorRewards, uint256 claimedGuardianRewards, uint256 totalClaimedDelegatorRewards, uint256 totalClaimedGuardianRewards);
    event StakingRewardsAllocated(uint256 allocatedRewards, uint256 stakingRewardsPerWeight);
    event GuardianDelegatorsStakingRewardsPercentMilleUpdated(address indexed guardian, uint256 delegatorsStakingRewardsPercentMille);

    /*
     * External functions
     */

    /// Returns the current reward balance of the given address.
    /// @dev calculates the up to date balances (differ from the state)
    /// @param addr is the address to query
    /// @return delegatorStakingRewardsBalance the rewards awarded to the guardian role
    /// @return guardianStakingRewardsBalance the rewards awarded to the guardian role
    function getStakingRewardsBalance(address addr) external view returns (uint256 delegatorStakingRewardsBalance, uint256 guardianStakingRewardsBalance);

    /// Claims the staking rewards balance of an addr, staking the rewards
    /// @dev Claimed rewards are staked in the staking contract using the distributeRewards interface
    /// @dev includes the rewards for both the delegator and guardian roles
    /// @dev calculates the up to date rewards prior to distribute them to the staking contract
    /// @param addr is the address to claim rewards for
    function claimStakingRewards(address addr) external;

    /// Returns the current global staking rewards state
    /// @dev calculated to the latest block, may differ from the state read
    /// @return stakingRewardsPerWeight is the potential reward per 1E18 (TOKEN_BASE) committee weight assigned to a guardian was in the committee from day zero
    /// @return unclaimedStakingRewards is the of tokens that were assigned to participants and not claimed yet
    function getStakingRewardsState() external view returns (
        uint96 stakingRewardsPerWeight,
        uint96 unclaimedStakingRewards
    );

    /// Returns the current guardian staking rewards state
    /// @dev calculated to the latest block, may differ from the state read
    /// @dev notice that the guardian rewards are the rewards for the guardian role as guardian and do not include delegation rewards
    /// @dev use getDelegatorStakingRewardsData to get the guardian's rewards as delegator
    /// @param guardian is the guardian to query
    /// @return balance is the staking rewards balance for the guardian role
    /// @return claimed is the staking rewards for the guardian role that were claimed
    /// @return delegatorRewardsPerToken is the potential reward per token (1E18 units) assigned to a guardian's delegator that delegated from day zero
    /// @return delegatorRewardsPerTokenDelta is the increment in delegatorRewardsPerToken since the last guardian update
    /// @return lastStakingRewardsPerWeight is the up to date stakingRewardsPerWeight used for the guardian state calculation
    /// @return stakingRewardsPerWeightDelta is the increment in stakingRewardsPerWeight since the last guardian update
    function getGuardianStakingRewardsData(address guardian) external view returns (
        uint256 balance,
        uint256 claimed,
        uint256 delegatorRewardsPerToken,
        uint256 delegatorRewardsPerTokenDelta,
        uint256 lastStakingRewardsPerWeight,
        uint256 stakingRewardsPerWeightDelta
    );

    /// Returns the current delegator staking rewards state
    /// @dev calculated to the latest block, may differ from the state read
    /// @param delegator is the delegator to query
    /// @return balance is the staking rewards balance for the delegator role
    /// @return claimed is the staking rewards for the delegator role that were claimed
    /// @return guardian is the guardian the delegator delegated to receiving a portion of the guardian staking rewards
    /// @return lastDelegatorRewardsPerToken is the up to date delegatorRewardsPerToken used for the delegator state calculation
    /// @return delegatorRewardsPerTokenDelta is the increment in delegatorRewardsPerToken since the last delegator update
    function getDelegatorStakingRewardsData(address delegator) external view returns (
        uint256 balance,
        uint256 claimed,
        address guardian,
        uint256 lastDelegatorRewardsPerToken,
        uint256 delegatorRewardsPerTokenDelta
    );

    /// Returns an estimation for the delegator and guardian staking rewards for a given duration
    /// @dev the returned value is an estimation, assuming no change in the PoS state
    /// @dev the period calculated for start from the current block time until the current time + duration.
    /// @param addr is the address to estimate rewards for
    /// @param duration is the duration to calculate for in seconds
    /// @return estimatedDelegatorStakingRewards is the estimated reward for the delegator role
    /// @return estimatedGuardianStakingRewards is the estimated reward for the guardian role
    function estimateFutureRewards(address addr, uint256 duration) external view returns (
        uint256 estimatedDelegatorStakingRewards,
        uint256 estimatedGuardianStakingRewards
    );

    /// Sets the guardian's delegators staking reward portion
    /// @dev by default uses the defaultDelegatorsStakingRewardsPercentMille
    /// @param delegatorRewardsPercentMille is the delegators portion in percent-mille (0 - maxDelegatorsStakingRewardsPercentMille)
    function setGuardianDelegatorsStakingRewardsPercentMille(uint32 delegatorRewardsPercentMille) external;

    /// Returns a guardian's delegators staking reward portion
    /// @dev If not explicitly set, returns the defaultDelegatorsStakingRewardsPercentMille
    /// @return delegatorRewardsRatioPercentMille is the delegators portion in percent-mille
    function getGuardianDelegatorsStakingRewardsPercentMille(address guardian) external view returns (uint256 delegatorRewardsRatioPercentMille);

    /// Returns the amount of ORBS tokens in the staking rewards wallet allocated to staking rewards
    /// @dev The staking wallet balance must always larger than the allocated value
    /// @return allocated is the amount of tokens allocated in the staking rewards wallet
    function getStakingRewardsWalletAllocatedTokens() external view returns (uint256 allocated);

    /// Returns the current annual staking reward rate
    /// @dev calculated based on the current total committee weight
    /// @return annualRate is the current staking reward rate in percent-mille
    function getCurrentStakingRewardsRatePercentMille() external view returns (uint256 annualRate);

    /// Notifies an expected change in the committee membership of the guardian
    /// @dev Called only by: the Committee contract
    /// @dev called upon expected change in the committee membership of the guardian
    /// @dev triggers update of the global rewards state and the guardian rewards state
    /// @dev updates the rewards state based on the committee state prior to the change
    /// @param guardian is the guardian who's committee membership is updated
    /// @param weight is the weight of the guardian prior to the change
    /// @param totalCommitteeWeight is the total committee weight prior to the change
    /// @param inCommittee indicates whether the guardian was in the committee prior to the change
    /// @param inCommitteeAfter indicates whether the guardian is in the committee after the change
    function committeeMembershipWillChange(address guardian, uint256 weight, uint256 totalCommitteeWeight, bool inCommittee, bool inCommitteeAfter) external /* onlyCommitteeContract */;

    /// Notifies an expected change in a delegator and his guardian delegation state
    /// @dev Called only by: the Delegation contract
    /// @dev called upon expected change in a delegator's delegation state
    /// @dev triggers update of the global rewards state, the guardian rewards state and the delegator rewards state
    /// @dev on delegation change, updates also the new guardian and the delegator's lastDelegatorRewardsPerToken accordingly
    /// @param guardian is the delegator's guardian prior to the change
    /// @param guardianDelegatedStake is the delegated stake of the delegator's guardian prior to the change
    /// @param delegator is the delegator about to change delegation state
    /// @param delegatorStake is the stake of the delegator
    /// @param nextGuardian is the delegator's guardian after to the change
    /// @param nextGuardianDelegatedStake is the delegated stake of the delegator's guardian after to the change
    function delegationWillChange(address guardian, uint256 guardianDelegatedStake, address delegator, uint256 delegatorStake, address nextGuardian, uint256 nextGuardianDelegatedStake) external /* onlyDelegationsContract */;

    /*
     * Governance functions
     */

    event AnnualStakingRewardsRateChanged(uint256 annualRateInPercentMille, uint256 annualCap);
    event DefaultDelegatorsStakingRewardsChanged(uint32 defaultDelegatorsStakingRewardsPercentMille);
    event MaxDelegatorsStakingRewardsChanged(uint32 maxDelegatorsStakingRewardsPercentMille);
    event RewardDistributionActivated(uint256 startTime);
    event RewardDistributionDeactivated();
    event StakingRewardsBalanceMigrated(address indexed addr, uint256 guardianStakingRewards, uint256 delegatorStakingRewards, address toRewardsContract);
    event StakingRewardsBalanceMigrationAccepted(address from, address indexed addr, uint256 guardianStakingRewards, uint256 delegatorStakingRewards);
    event EmergencyWithdrawal(address addr, address token);

    /// Activates staking rewards allocation
    /// @dev governance function called only by the initialization admin
    /// @dev On migrations, startTime should be set to the previous contract deactivation time
    /// @param startTime sets the last assignment time
    function activateRewardDistribution(uint startTime) external /* onlyInitializationAdmin */;

    /// Deactivates fees and bootstrap allocation
    /// @dev governance function called only by the migration manager
    /// @dev guardians updates remain active based on the current perMember value
    function deactivateRewardDistribution() external /* onlyMigrationManager */;
    
    /// Sets the default delegators staking reward portion
    /// @dev governance function called only by the functional manager
    /// @param defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille(0 - maxDelegatorsStakingRewardsPercentMille)
    function setDefaultDelegatorsStakingRewardsPercentMille(uint32 defaultDelegatorsStakingRewardsPercentMille) external /* onlyFunctionalManager */;

    /// Returns the default delegators staking reward portion
    /// @return defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille
    function getDefaultDelegatorsStakingRewardsPercentMille() external view returns (uint32);

    /// Sets the maximum delegators staking reward portion
    /// @dev governance function called only by the functional manager
    /// @param maxDelegatorsStakingRewardsPercentMille is the maximum delegators portion in percent-mille(0 - 100,000)
    function setMaxDelegatorsStakingRewardsPercentMille(uint32 maxDelegatorsStakingRewardsPercentMille) external /* onlyFunctionalManager */;

    /// Returns the default delegators staking reward portion
    /// @return maxDelegatorsStakingRewardsPercentMille is the maximum delegators portion in percent-mille
    function getMaxDelegatorsStakingRewardsPercentMille() external view returns (uint32);

    /// Sets the annual rate and cap for the staking reward
    /// @dev governance function called only by the functional manager
    /// @param annualRateInPercentMille is the annual rate in percent-mille
    /// @param annualCap is the annual staking rewards cap
    function setAnnualStakingRewardsRate(uint32 annualRateInPercentMille, uint96 annualCap) external /* onlyFunctionalManager */;

    /// Returns the annual staking reward rate
    /// @return annualStakingRewardsRatePercentMille is the annual rate in percent-mille
    function getAnnualStakingRewardsRatePercentMille() external view returns (uint32);

    /// Returns the annual staking rewards cap
    /// @return annualStakingRewardsCap is the annual rate in percent-mille
    function getAnnualStakingRewardsCap() external view returns (uint256);

    /// Checks if rewards allocation is active
    /// @return rewardAllocationActive is a bool that indicates that rewards allocation is active
    function isRewardAllocationActive() external view returns (bool);

    /// Returns the contract's settings
    /// @return annualStakingRewardsCap is the annual rate in percent-mille
    /// @return annualStakingRewardsRatePercentMille is the annual rate in percent-mille
    /// @return defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille
    /// @return maxDelegatorsStakingRewardsPercentMille is the maximum delegators portion in percent-mille
    /// @return rewardAllocationActive is a bool that indicates that rewards allocation is active
    function getSettings() external view returns (
        uint annualStakingRewardsCap,
        uint32 annualStakingRewardsRatePercentMille,
        uint32 defaultDelegatorsStakingRewardsPercentMille,
        uint32 maxDelegatorsStakingRewardsPercentMille,
        bool rewardAllocationActive
    );

    /// Migrates the staking rewards balance of the given addresses to a new staking rewards contract
    /// @dev The new rewards contract is determined according to the contracts registry
    /// @dev No impact of the calling contract if the currently configured contract in the registry
    /// @dev may be called also while the contract is locked
    /// @param addrs is the list of addresses to migrate
    function migrateRewardsBalance(address[] calldata addrs) external;

    /// Accepts addresses balance migration from a previous rewards contract
    /// @dev the function may be called by any caller that approves the amounts provided for transfer
    /// @param addrs is the list migrated addresses
    /// @param migratedGuardianStakingRewards is the list of received guardian rewards balance for each address
    /// @param migratedDelegatorStakingRewards is the list of received delegator rewards balance for each address
    /// @param totalAmount is the total amount of staking rewards migrated for all addresses in the list. Must match the sum of migratedGuardianStakingRewards and migratedDelegatorStakingRewards lists.
    function acceptRewardsBalanceMigration(address[] calldata addrs, uint256[] calldata migratedGuardianStakingRewards, uint256[] calldata migratedDelegatorStakingRewards, uint256 totalAmount) external;

    /// Performs emergency withdrawal of the contract balance
    /// @dev called with a token to withdraw, should be called twice with the fees and bootstrap tokens
    /// @dev governance function called only by the migration manager
    /// @param erc20 is the ERC20 token to withdraw
    function emergencyWithdraw(address erc20) external /* onlyMigrationManager */;
}

// File: contracts/spec_interfaces/IDelegations.sol

pragma solidity 0.6.12;

/// @title Delegations contract interface
interface IDelegations /* is IStakeChangeNotifier */ {

    // Delegation state change events
	event DelegatedStakeChanged(address indexed addr, uint256 selfDelegatedStake, uint256 delegatedStake, address indexed delegator, uint256 delegatorContributedStake);

    // Function calls
	event Delegated(address indexed from, address indexed to);

	/*
     * External functions
     */

    /// Delegate your stake
    /// @dev updates the election contract on the changes in the delegated stake
    /// @dev updates the rewards contract on the upcoming change in the delegator's delegation state
    /// @param to is the address to delegate to
	function delegate(address to) external /* onlyWhenActive */;

    /// Refresh the address stake for delegation power based on the staking contract
    /// @dev Disabled stake change update notifications from the staking contract may create mismatches
    /// @dev refreshStake re-syncs the stake data with the staking contract
    /// @param addr is the address to refresh its stake
	function refreshStake(address addr) external /* onlyWhenActive */;

    /// Refresh the addresses stake for delegation power based on the staking contract
    /// @dev Batched version of refreshStake
    /// @dev Disabled stake change update notifications from the staking contract may create mismatches
    /// @dev refreshStakeBatch re-syncs the stake data with the staking contract
    /// @param addrs is the list of addresses to refresh their stake
	function refreshStakeBatch(address[] calldata addrs) external /* onlyWhenActive */;

    /// Returns the delegate address of the given address
    /// @param addr is the address to query
    /// @return delegation is the address the addr delegated to
	function getDelegation(address addr) external view returns (address);

    /// Returns a delegator info
    /// @param addr is the address to query
    /// @return delegation is the address the addr delegated to
    /// @return delegatorStake is the stake of the delegator as reflected in the delegation contract
	function getDelegationInfo(address addr) external view returns (address delegation, uint256 delegatorStake);
	
    /// Returns the delegated stake of an addr 
    /// @dev an address that is not self delegating has a 0 delegated stake
    /// @param addr is the address to query
    /// @return delegatedStake is the address delegated stake
	function getDelegatedStake(address addr) external view returns (uint256);

    /// Returns the total delegated stake
    /// @dev delegatedStake - the total stake delegated to an address that is self delegating
    /// @dev the delegated stake of a non self-delegated address is 0
    /// @return totalDelegatedStake is the total delegatedStake of all the addresses
	function getTotalDelegatedStake() external view returns (uint256) ;

	/*
	 * Governance functions
	 */

	event DelegationsImported(address[] from, address indexed to);

	event DelegationInitialized(address indexed from, address indexed to);

    /// Imports delegations during initial migration
    /// @dev initialization function called only by the initializationManager
    /// @dev Does not update the Rewards or Election contracts
    /// @dev assumes deactivated Rewards
    /// @param from is a list of delegator addresses
    /// @param to is the address the delegators delegate to
	function importDelegations(address[] calldata from, address to) external /* onlyMigrationManager onlyDuringDelegationImport */;

    /// Initializes the delegation of an address during initial migration 
    /// @dev initialization function called only by the initializationManager
    /// @dev behaves identically to a delegate transaction sent by the delegator
    /// @param from is the delegator addresses
    /// @param to is the delegator delegates to
	function initDelegation(address from, address to) external /* onlyInitializationAdmin */;
}

// File: contracts/IMigratableStakingContract.sol

pragma solidity 0.6.12;


/// @title An interface for staking contracts which support stake migration.
interface IMigratableStakingContract {
    /// @dev Returns the address of the underlying staked token.
    /// @return IERC20 The address of the token.
    function getToken() external view returns (IERC20);

    /// @dev Stakes ORBS tokens on behalf of msg.sender. This method assumes that the user has already approved at least
    /// the required amount using ERC20 approve.
    /// @param _stakeOwner address The specified stake owner.
    /// @param _amount uint256 The number of tokens to stake.
    function acceptMigration(address _stakeOwner, uint256 _amount) external;

    event AcceptedMigration(address indexed stakeOwner, uint256 amount, uint256 totalStakedAmount);
}

// File: contracts/IStakingContract.sol

pragma solidity 0.6.12;


/// @title An interface for staking contracts.
interface IStakingContract {
    /// @dev Stakes ORBS tokens on behalf of msg.sender. This method assumes that the user has already approved at least
    /// the required amount using ERC20 approve.
    /// @param _amount uint256 The amount of tokens to stake.
    function stake(uint256 _amount) external;

    /// @dev Unstakes ORBS tokens from msg.sender. If successful, this will start the cooldown period, after which
    /// msg.sender would be able to withdraw all of his tokens.
    /// @param _amount uint256 The amount of tokens to unstake.
    function unstake(uint256 _amount) external;

    /// @dev Requests to withdraw all of staked ORBS tokens back to msg.sender. Stake owners can withdraw their ORBS
    /// tokens only after previously unstaking them and after the cooldown period has passed (unless the contract was
    /// requested to release all stakes).
    function withdraw() external;

    /// @dev Restakes unstaked ORBS tokens (in or after cooldown) for msg.sender.
    function restake() external;

    /// @dev Distributes staking rewards to a list of addresses by directly adding rewards to their stakes. This method
    /// assumes that the user has already approved at least the required amount using ERC20 approve. Since this is a
    /// convenience method, we aren't concerned about reaching block gas limit by using large lists. We assume that
    /// callers will be able to properly batch/paginate their requests.
    /// @param _totalAmount uint256 The total amount of rewards to distribute.
    /// @param _stakeOwners address[] The addresses of the stake owners.
    /// @param _amounts uint256[] The amounts of the rewards.
    function distributeRewards(uint256 _totalAmount, address[] calldata _stakeOwners, uint256[] calldata _amounts) external;

    /// @dev Returns the stake of the specified stake owner (excluding unstaked tokens).
    /// @param _stakeOwner address The address to check.
    /// @return uint256 The total stake.
    function getStakeBalanceOf(address _stakeOwner) external view returns (uint256);

    /// @dev Returns the total amount staked tokens (excluding unstaked tokens).
    /// @return uint256 The total staked tokens of all stake owners.
    function getTotalStakedTokens() external view returns (uint256);

    /// @dev Returns the time that the cooldown period ends (or ended) and the amount of tokens to be released.
    /// @param _stakeOwner address The address to check.
    /// @return cooldownAmount uint256 The total tokens in cooldown.
    /// @return cooldownEndTime uint256 The time when the cooldown period ends (in seconds).
    function getUnstakeStatus(address _stakeOwner) external view returns (uint256 cooldownAmount,
        uint256 cooldownEndTime);

    /// @dev Migrates the stake of msg.sender from this staking contract to a new approved staking contract.
    /// @param _newStakingContract IMigratableStakingContract The new staking contract which supports stake migration.
    /// @param _amount uint256 The amount of tokens to migrate.
    function migrateStakedTokens(IMigratableStakingContract _newStakingContract, uint256 _amount) external;

    event Staked(address indexed stakeOwner, uint256 amount, uint256 totalStakedAmount);
    event Unstaked(address indexed stakeOwner, uint256 amount, uint256 totalStakedAmount);
    event Withdrew(address indexed stakeOwner, uint256 amount, uint256 totalStakedAmount);
    event Restaked(address indexed stakeOwner, uint256 amount, uint256 totalStakedAmount);
    event MigratedStake(address indexed stakeOwner, uint256 amount, uint256 totalStakedAmount);
}

// File: contracts/spec_interfaces/IManagedContract.sol

pragma solidity 0.6.12;

/// @title managed contract interface, used by the contracts registry to notify the contract on updates
interface IManagedContract /* is ILockable, IContractRegistryAccessor, Initializable */ {

    /// Refreshes the address of the other contracts the contract interacts with
    /// @dev called by the registry contract upon an update of a contract in the registry
    function refreshContracts() external;

}

// File: contracts/spec_interfaces/IContractRegistry.sol

pragma solidity 0.6.12;

/// @title Contract registry contract interface
/// @dev The contract registry holds Orbs PoS contracts and managers lists
/// @dev The contract registry updates the managed contracts on changes in the contract list
/// @dev Governance functions restricted to managers access the registry to retrieve the manager address 
/// @dev The contract registry represents the source of truth for Orbs Ethereum contracts 
/// @dev By tracking the registry events or query before interaction, one can access the up to date contracts 
interface IContractRegistry {

	event ContractAddressUpdated(string contractName, address addr, bool managedContract);
	event ManagerChanged(string role, address newManager);
	event ContractRegistryUpdated(address newContractRegistry);

	/*
	* External functions
	*/

    /// Updates the contracts address and emits a corresponding event
    /// @dev governance function called only by the migrationManager or registryAdmin
    /// @param contractName is the contract name, used to identify it
    /// @param addr is the contract updated address
    /// @param managedContract indicates whether the contract is managed by the registry and notified on changes
	function setContract(string calldata contractName, address addr, bool managedContract) external /* onlyAdminOrMigrationManager */;

    /// Returns the current address of the given contracts
    /// @param contractName is the contract name, used to identify it
    /// @return addr is the contract updated address
	function getContract(string calldata contractName) external view returns (address);

    /// Returns the list of contract addresses managed by the registry
    /// @dev Managed contracts are updated on changes in the registry contracts addresses 
    /// @return addrs is the list of managed contracts
	function getManagedContracts() external view returns (address[] memory);

    /// Locks all the managed contracts 
    /// @dev governance function called only by the migrationManager or registryAdmin
    /// @dev When set all onlyWhenActive functions will revert
	function lockContracts() external /* onlyAdminOrMigrationManager */;

    /// Unlocks all the managed contracts 
    /// @dev governance function called only by the migrationManager or registryAdmin
	function unlockContracts() external /* onlyAdminOrMigrationManager */;
	
    /// Updates a manager address and emits a corresponding event
    /// @dev governance function called only by the registryAdmin
    /// @dev the managers list is a flexible list of role to the manager's address
    /// @param role is the managers' role name, for example "functionalManager"
    /// @param manager is the manager updated address
	function setManager(string calldata role, address manager) external /* onlyAdmin */;

    /// Returns the current address of the given manager
    /// @param role is the manager name, used to identify it
    /// @return addr is the manager updated address
	function getManager(string calldata role) external view returns (address);

    /// Sets a new contract registry to migrate to
    /// @dev governance function called only by the registryAdmin
    /// @dev updates the registry address record in all the managed contracts
    /// @dev by tracking the emitted ContractRegistryUpdated, tools can track the up to date contracts
    /// @param newRegistry is the new registry contract 
	function setNewContractRegistry(IContractRegistry newRegistry) external /* onlyAdmin */;

    /// Returns the previous contract registry address 
    /// @dev used when the setting the contract as a new registry to assure a valid registry
    /// @return previousContractRegistry is the previous contract registry
	function getPreviousContractRegistry() external view returns (address);
}

// File: contracts/spec_interfaces/IContractRegistryAccessor.sol

pragma solidity 0.6.12;


interface IContractRegistryAccessor {

    /// Sets the contract registry address
    /// @dev governance function called only by an admin
    /// @param newRegistry is the new registry contract 
    function setContractRegistry(IContractRegistry newRegistry) external /* onlyAdmin */;

    /// Returns the contract registry address
    /// @return contractRegistry is the contract registry address
    function getContractRegistry() external view returns (IContractRegistry contractRegistry);

    function setRegistryAdmin(address _registryAdmin) external /* onlyInitializationAdmin */;

}

// File: @openzeppelin/contracts/GSN/Context.sol

pragma solidity ^0.6.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.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

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

// File: contracts/WithClaimableRegistryManagement.sol

pragma solidity 0.6.12;


/**
 * @title Claimable
 * @dev Extension for the Ownable contract, where the ownership needs to be claimed.
 * This allows the new owner to accept the transfer.
 */
contract WithClaimableRegistryManagement is Context {
    address private _registryAdmin;
    address private _pendingRegistryAdmin;

    event RegistryManagementTransferred(address indexed previousRegistryAdmin, address indexed newRegistryAdmin);

    /**
     * @dev Initializes the contract setting the deployer as the initial registryRegistryAdmin.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _registryAdmin = msgSender;
        emit RegistryManagementTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the registryAdmin.
     */
    modifier onlyRegistryAdmin() {
        require(isRegistryAdmin(), "WithClaimableRegistryManagement: caller is not the registryAdmin");
        _;
    }

    /**
     * @dev Returns true if the caller is the current registryAdmin.
     */
    function isRegistryAdmin() public view returns (bool) {
        return _msgSender() == _registryAdmin;
    }

    /**
     * @dev Leaves the contract without registryAdmin. It will not be possible to call
     * `onlyManager` functions anymore. Can only be called by the current registryAdmin.
     *
     * NOTE: Renouncing registryManagement will leave the contract without an registryAdmin,
     * thereby removing any functionality that is only available to the registryAdmin.
     */
    function renounceRegistryManagement() public onlyRegistryAdmin {
        emit RegistryManagementTransferred(_registryAdmin, address(0));
        _registryAdmin = address(0);
    }

    /**
     * @dev Transfers registryManagement of the contract to a new account (`newManager`).
     */
    function _transferRegistryManagement(address newRegistryAdmin) internal {
        require(newRegistryAdmin != address(0), "RegistryAdmin: new registryAdmin is the zero address");
        emit RegistryManagementTransferred(_registryAdmin, newRegistryAdmin);
        _registryAdmin = newRegistryAdmin;
    }

    /**
     * @dev Modifier throws if called by any account other than the pendingManager.
     */
    modifier onlyPendingRegistryAdmin() {
        require(msg.sender == _pendingRegistryAdmin, "Caller is not the pending registryAdmin");
        _;
    }
    /**
     * @dev Allows the current registryAdmin to set the pendingManager address.
     * @param newRegistryAdmin The address to transfer registryManagement to.
     */
    function transferRegistryManagement(address newRegistryAdmin) public onlyRegistryAdmin {
        _pendingRegistryAdmin = newRegistryAdmin;
    }

    /**
     * @dev Allows the _pendingRegistryAdmin address to finalize the transfer.
     */
    function claimRegistryManagement() external onlyPendingRegistryAdmin {
        _transferRegistryManagement(_pendingRegistryAdmin);
        _pendingRegistryAdmin = address(0);
    }

    /**
     * @dev Returns the current pendingRegistryAdmin
    */
    function pendingRegistryAdmin() public view returns (address) {
       return _pendingRegistryAdmin;  
    }
}

// File: contracts/Initializable.sol

pragma solidity 0.6.12;

contract Initializable {

    address private _initializationAdmin;

    event InitializationComplete();

    /// Constructor
    /// Sets the initializationAdmin to the contract deployer
    /// The initialization admin may call any manager only function until initializationComplete
    constructor() public{
        _initializationAdmin = msg.sender;
    }

    modifier onlyInitializationAdmin() {
        require(msg.sender == initializationAdmin(), "sender is not the initialization admin");

        _;
    }

    /*
    * External functions
    */

    /// Returns the initializationAdmin address
    function initializationAdmin() public view returns (address) {
        return _initializationAdmin;
    }

    /// Finalizes the initialization and revokes the initializationAdmin role 
    function initializationComplete() external onlyInitializationAdmin {
        _initializationAdmin = address(0);
        emit InitializationComplete();
    }

    /// Checks if the initialization was completed
    function isInitializationComplete() public view returns (bool) {
        return _initializationAdmin == address(0);
    }

}

// File: contracts/ContractRegistryAccessor.sol

pragma solidity 0.6.12;





contract ContractRegistryAccessor is IContractRegistryAccessor, WithClaimableRegistryManagement, Initializable {

    IContractRegistry private contractRegistry;

    /// Constructor
    /// @param _contractRegistry is the contract registry address
    /// @param _registryAdmin is the registry admin address
    constructor(IContractRegistry _contractRegistry, address _registryAdmin) public {
        require(address(_contractRegistry) != address(0), "_contractRegistry cannot be 0");
        setContractRegistry(_contractRegistry);
        _transferRegistryManagement(_registryAdmin);
    }

    modifier onlyAdmin {
        require(isAdmin(), "sender is not an admin (registryManger or initializationAdmin)");

        _;
    }

    modifier onlyMigrationManager {
        require(isMigrationManager(), "sender is not the migration manager");

        _;
    }

    modifier onlyFunctionalManager {
        require(isFunctionalManager(), "sender is not the functional manager");

        _;
    }

    /// Checks whether the caller is Admin: either the contract registry, the registry admin, or the initialization admin
    function isAdmin() internal view returns (bool) {
        return msg.sender == address(contractRegistry) || msg.sender == registryAdmin() || msg.sender == initializationAdmin();
    }

    /// Checks whether the caller is a specific manager role or and Admin
    /// @dev queries the registry contract for the up to date manager assignment
    function isManager(string memory role) internal view returns (bool) {
        IContractRegistry _contractRegistry = contractRegistry;
        return isAdmin() || _contractRegistry != IContractRegistry(0) && contractRegistry.getManager(role) == msg.sender;
    }

    /// Checks whether the caller is the migration manager
    function isMigrationManager() internal view returns (bool) {
        return isManager('migrationManager');
    }

    /// Checks whether the caller is the functional manager
    function isFunctionalManager() internal view returns (bool) {
        return isManager('functionalManager');
    }

    /* 
     * Contract getters, return the address of a contract by calling the contract registry 
     */ 

    function getProtocolContract() internal view returns (address) {
        return contractRegistry.getContract("protocol");
    }

    function getStakingRewardsContract() internal view returns (address) {
        return contractRegistry.getContract("stakingRewards");
    }

    function getFeesAndBootstrapRewardsContract() internal view returns (address) {
        return contractRegistry.getContract("feesAndBootstrapRewards");
    }

    function getCommitteeContract() internal view returns (address) {
        return contractRegistry.getContract("committee");
    }

    function getElectionsContract() internal view returns (address) {
        return contractRegistry.getContract("elections");
    }

    function getDelegationsContract() internal view returns (address) {
        return contractRegistry.getContract("delegations");
    }

    function getGuardiansRegistrationContract() internal view returns (address) {
        return contractRegistry.getContract("guardiansRegistration");
    }

    function getCertificationContract() internal view returns (address) {
        return contractRegistry.getContract("certification");
    }

    function getStakingContract() internal view returns (address) {
        return contractRegistry.getContract("staking");
    }

    function getSubscriptionsContract() internal view returns (address) {
        return contractRegistry.getContract("subscriptions");
    }

    function getStakingRewardsWallet() internal view returns (address) {
        return contractRegistry.getContract("stakingRewardsWallet");
    }

    function getBootstrapRewardsWallet() internal view returns (address) {
        return contractRegistry.getContract("bootstrapRewardsWallet");
    }

    function getGeneralFeesWallet() internal view returns (address) {
        return contractRegistry.getContract("generalFeesWallet");
    }

    function getCertifiedFeesWallet() internal view returns (address) {
        return contractRegistry.getContract("certifiedFeesWallet");
    }

    function getStakingContractHandler() internal view returns (address) {
        return contractRegistry.getContract("stakingContractHandler");
    }

    /*
    * Governance functions
    */

    event ContractRegistryAddressUpdated(address addr);

    /// Sets the contract registry address
    /// @dev governance function called only by an admin
    /// @param newContractRegistry is the new registry contract 
    function setContractRegistry(IContractRegistry newContractRegistry) public override onlyAdmin {
        require(newContractRegistry.getPreviousContractRegistry() == address(contractRegistry), "new contract registry must provide the previous contract registry");
        contractRegistry = newContractRegistry;
        emit ContractRegistryAddressUpdated(address(newContractRegistry));
    }

    /// Returns the contract registry that the contract is set to use
    /// @return contractRegistry is the registry contract address
    function getContractRegistry() public override view returns (IContractRegistry) {
        return contractRegistry;
    }

    function setRegistryAdmin(address _registryAdmin) external override onlyInitializationAdmin {
        _transferRegistryManagement(_registryAdmin);
    }

}

// File: contracts/spec_interfaces/ILockable.sol

pragma solidity 0.6.12;

/// @title lockable contract interface, allows to lock a contract
interface ILockable {

    event Locked();
    event Unlocked();

    /// Locks the contract to external non-governance function calls
    /// @dev governance function called only by the migration manager or an admin
    /// @dev typically called by the registry contract upon locking all managed contracts
    /// @dev getters and migration functions remain active also for locked contracts
    /// @dev checked by the onlyWhenActive modifier
    function lock() external /* onlyMigrationManager */;

    /// Unlocks the contract 
    /// @dev governance function called only by the migration manager or an admin
    /// @dev typically called by the registry contract upon unlocking all managed contracts
    function unlock() external /* onlyMigrationManager */;

    /// Returns the contract locking status
    /// @return isLocked is a bool indicating the contract is locked 
    function isLocked() view external returns (bool);

}

// File: contracts/Lockable.sol

pragma solidity 0.6.12;



/// @title lockable contract
contract Lockable is ILockable, ContractRegistryAccessor {

    bool public locked;

    /// Constructor
    /// @param _contractRegistry is the contract registry address
    /// @param _registryAdmin is the registry admin address
    constructor(IContractRegistry _contractRegistry, address _registryAdmin) ContractRegistryAccessor(_contractRegistry, _registryAdmin) public {}

    /// Locks the contract to external non-governance function calls
    /// @dev governance function called only by the migration manager or an admin
    /// @dev typically called by the registry contract upon locking all managed contracts
    /// @dev getters and migration functions remain active also for locked contracts
    /// @dev checked by the onlyWhenActive modifier
    function lock() external override onlyMigrationManager {
        locked = true;
        emit Locked();
    }

    /// Unlocks the contract 
    /// @dev governance function called only by the migration manager or an admin
    /// @dev typically called by the registry contract upon unlocking all managed contracts
    function unlock() external override onlyMigrationManager {
        locked = false;
        emit Unlocked();
    }

    /// Returns the contract locking status
    /// @return isLocked is a bool indicating the contract is locked 
    function isLocked() external override view returns (bool) {
        return locked;
    }

    modifier onlyWhenActive() {
        require(!locked, "contract is locked for this operation");

        _;
    }
}

// File: contracts/ManagedContract.sol

pragma solidity 0.6.12;



/// @title managed contract
contract ManagedContract is IManagedContract, Lockable {

    /// @param _contractRegistry is the contract registry address
    /// @param _registryAdmin is the registry admin address
    constructor(IContractRegistry _contractRegistry, address _registryAdmin) Lockable(_contractRegistry, _registryAdmin) public {}

    /// Refreshes the address of the other contracts the contract interacts with
    /// @dev called by the registry contract upon an update of a contract in the registry
    function refreshContracts() virtual override external {}

}

// File: contracts/StakingRewards.sol

pragma solidity 0.6.12;











contract StakingRewards is IStakingRewards, ManagedContract {
    using SafeMath for uint256;
    using SafeMath96 for uint96;

    uint256 constant PERCENT_MILLIE_BASE = 100000;
    uint256 constant TOKEN_BASE = 1e18;

    struct Settings {
        uint96 annualCap;
        uint32 annualRateInPercentMille;
        uint32 defaultDelegatorsStakingRewardsPercentMille;
        uint32 maxDelegatorsStakingRewardsPercentMille;
        bool rewardAllocationActive;
    }
    Settings settings;

    IERC20 public token;

    struct StakingRewardsState {
        uint96 stakingRewardsPerWeight;
        uint96 unclaimedStakingRewards;
        uint32 lastAssigned;
    }
    StakingRewardsState public stakingRewardsState;

    uint256 public stakingRewardsContractBalance;

    struct GuardianStakingRewards {
        uint96 delegatorRewardsPerToken;
        uint96 lastStakingRewardsPerWeight;
        uint96 balance;
        uint96 claimed;
    }
    mapping(address => GuardianStakingRewards) public guardiansStakingRewards;

    struct GuardianRewardSettings {
        uint32 delegatorsStakingRewardsPercentMille;
        bool overrideDefault;
    }
    mapping(address => GuardianRewardSettings) public guardiansRewardSettings;

    struct DelegatorStakingRewards {
        uint96 balance;
        uint96 lastDelegatorRewardsPerToken;
        uint96 claimed;
    }
    mapping(address => DelegatorStakingRewards) public delegatorsStakingRewards;

    /// Constructor
    /// @dev the constructor does not migrate reward balances from the previous rewards contract
    /// @param _contractRegistry is the contract registry address
    /// @param _registryAdmin is the registry admin address
    /// @param _token is the token used for staking rewards
    /// @param annualRateInPercentMille is the annual rate in percent-mille
    /// @param annualCap is the annual staking rewards cap
    /// @param defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille(0 - maxDelegatorsStakingRewardsPercentMille)
    /// @param maxDelegatorsStakingRewardsPercentMille is the maximum delegators portion in percent-mille(0 - 100,000)
    /// @param previousRewardsContract is the previous rewards contract address used for migration of guardians settings. address(0) indicates no guardian settings to migrate
    /// @param guardiansToMigrate is a list of guardian addresses to migrate their rewards settings
    constructor(
        IContractRegistry _contractRegistry,
        address _registryAdmin,
        IERC20 _token,
        uint32 annualRateInPercentMille,
        uint96 annualCap,
        uint32 defaultDelegatorsStakingRewardsPercentMille,
        uint32 maxDelegatorsStakingRewardsPercentMille,
        IStakingRewards previousRewardsContract,
        address[] memory guardiansToMigrate
    ) ManagedContract(_contractRegistry, _registryAdmin) public {
        require(address(_token) != address(0), "token must not be 0");

        _setAnnualStakingRewardsRate(annualRateInPercentMille, annualCap);
        setMaxDelegatorsStakingRewardsPercentMille(maxDelegatorsStakingRewardsPercentMille);
        setDefaultDelegatorsStakingRewardsPercentMille(defaultDelegatorsStakingRewardsPercentMille);

        token = _token;

        if (address(previousRewardsContract) != address(0)) {
            migrateGuardiansSettings(previousRewardsContract, guardiansToMigrate);
        }
    }

    modifier onlyCommitteeContract() {
        require(msg.sender == address(committeeContract), "caller is not the elections contract");

        _;
    }

    modifier onlyDelegationsContract() {
        require(msg.sender == address(delegationsContract), "caller is not the delegations contract");

        _;
    }

    /*
    * External functions
    */

    /// Returns the current reward balance of the given address.
    /// @dev calculates the up to date balances (differ from the state)
    /// @param addr is the address to query
    /// @return delegatorStakingRewardsBalance the rewards awarded to the guardian role
    /// @return guardianStakingRewardsBalance the rewards awarded to the guardian role
    function getStakingRewardsBalance(address addr) external override view returns (uint256 delegatorStakingRewardsBalance, uint256 guardianStakingRewardsBalance) {
        (DelegatorStakingRewards memory delegatorStakingRewards,,) = getDelegatorStakingRewards(addr, block.timestamp);
        (GuardianStakingRewards memory guardianStakingRewards,,) = getGuardianStakingRewards(addr, block.timestamp);
        return (delegatorStakingRewards.balance, guardianStakingRewards.balance);
    }

    /// Claims the staking rewards balance of an addr, staking the rewards
    /// @dev Claimed rewards are staked in the staking contract using the distributeRewards interface
    /// @dev includes the rewards for both the delegator and guardian roles
    /// @dev calculates the up to date rewards prior to distribute them to the staking contract
    /// @param addr is the address to claim rewards for
    function claimStakingRewards(address addr) external override onlyWhenActive {
        (uint256 guardianRewards, uint256 delegatorRewards) = claimStakingRewardsLocally(addr);
        uint256 total = delegatorRewards.add(guardianRewards);
        if (total == 0) {
            return;
        }

        uint96 claimedGuardianRewards = guardiansStakingRewards[addr].claimed.add(guardianRewards);
        guardiansStakingRewards[addr].claimed = claimedGuardianRewards;
        uint96 claimedDelegatorRewards = delegatorsStakingRewards[addr].claimed.add(delegatorRewards);
        delegatorsStakingRewards[addr].claimed = claimedDelegatorRewards;

        require(token.approve(address(stakingContract), total), "claimStakingRewards: approve failed");

        address[] memory addrs = new address[](1);
        addrs[0] = addr;
        uint256[] memory amounts = new uint256[](1);
        amounts[0] = total;
        stakingContract.distributeRewards(total, addrs, amounts);

        emit StakingRewardsClaimed(addr, delegatorRewards, guardianRewards, claimedDelegatorRewards, claimedGuardianRewards);
    }

    /// Returns the current global staking rewards state
    /// @dev calculated to the latest block, may differ from the state read
    /// @return stakingRewardsPerWeight is the potential reward per 1E18 (TOKEN_BASE) committee weight assigned to a guardian was in the committee from day zero
    /// @return unclaimedStakingRewards is the of tokens that were assigned to participants and not claimed yet
    function getStakingRewardsState() public override view returns (
        uint96 stakingRewardsPerWeight,
        uint96 unclaimedStakingRewards
    ) {
        (, , uint totalCommitteeWeight) = committeeContract.getCommitteeStats();
        (StakingRewardsState memory _stakingRewardsState,) = _getStakingRewardsState(totalCommitteeWeight, block.timestamp, settings);
        stakingRewardsPerWeight = _stakingRewardsState.stakingRewardsPerWeight;
        unclaimedStakingRewards = _stakingRewardsState.unclaimedStakingRewards;
    }

    /// Returns the current guardian staking rewards state
    /// @dev calculated to the latest block, may differ from the state read
    /// @dev notice that the guardian rewards are the rewards for the guardian role as guardian and do not include delegation rewards
    /// @dev use getDelegatorStakingRewardsData to get the guardian's rewards as delegator
    /// @param guardian is the guardian to query
    /// @return balance is the staking rewards balance for the guardian role
    /// @return claimed is the staking rewards for the guardian role that were claimed
    /// @return delegatorRewardsPerToken is the potential reward per token (1E18 units) assigned to a guardian's delegator that delegated from day zero
    /// @return delegatorRewardsPerTokenDelta is the increment in delegatorRewardsPerToken since the last guardian update
    /// @return lastStakingRewardsPerWeight is the up to date stakingRewardsPerWeight used for the guardian state calculation
    /// @return stakingRewardsPerWeightDelta is the increment in stakingRewardsPerWeight since the last guardian update
    function getGuardianStakingRewardsData(address guardian) external override view returns (
        uint256 balance,
        uint256 claimed,
        uint256 delegatorRewardsPerToken,
        uint256 delegatorRewardsPerTokenDelta,
        uint256 lastStakingRewardsPerWeight,
        uint256 stakingRewardsPerWeightDelta
    ) {
        (GuardianStakingRewards memory rewards, uint256 _stakingRewardsPerWeightDelta, uint256 _delegatorRewardsPerTokenDelta) = getGuardianStakingRewards(guardian, block.timestamp);
        return (rewards.balance, rewards.claimed, rewards.delegatorRewardsPerToken, _delegatorRewardsPerTokenDelta, rewards.lastStakingRewardsPerWeight, _stakingRewardsPerWeightDelta);
    }

    /// Returns the current delegator staking rewards state
    /// @dev calculated to the latest block, may differ from the state read
    /// @param delegator is the delegator to query
    /// @return balance is the staking rewards balance for the delegator role
    /// @return claimed is the staking rewards for the delegator role that were claimed
    /// @return guardian is the guardian the delegator delegated to receiving a portion of the guardian staking rewards
    /// @return lastDelegatorRewardsPerToken is the up to date delegatorRewardsPerToken used for the delegator state calculation
    /// @return delegatorRewardsPerTokenDelta is the increment in delegatorRewardsPerToken since the last delegator update
    function getDelegatorStakingRewardsData(address delegator) external override view returns (
        uint256 balance,
        uint256 claimed,
        address guardian,
        uint256 lastDelegatorRewardsPerToken,
        uint256 delegatorRewardsPerTokenDelta
    ) {
        (DelegatorStakingRewards memory rewards, address _guardian, uint256 _delegatorRewardsPerTokenDelta) = getDelegatorStakingRewards(delegator, block.timestamp);
        return (rewards.balance, rewards.claimed, _guardian, rewards.lastDelegatorRewardsPerToken, _delegatorRewardsPerTokenDelta);
    }

    /// Returns an estimation for the delegator and guardian staking rewards for a given duration
    /// @dev the returned value is an estimation, assuming no change in the PoS state
    /// @dev the period calculated for start from the current block time until the current time + duration.
    /// @param addr is the address to estimate rewards for
    /// @param duration is the duration to calculate for in seconds
    /// @return estimatedDelegatorStakingRewards is the estimated reward for the delegator role
    /// @return estimatedGuardianStakingRewards is the estimated reward for the guardian role
    function estimateFutureRewards(address addr, uint256 duration) external override view returns (uint256 estimatedDelegatorStakingRewards, uint256 estimatedGuardianStakingRewards) {
        (GuardianStakingRewards memory guardianRewardsNow,,) = getGuardianStakingRewards(addr, block.timestamp);
        (DelegatorStakingRewards memory delegatorRewardsNow,,) = getDelegatorStakingRewards(addr, block.timestamp);
        (GuardianStakingRewards memory guardianRewardsFuture,,) = getGuardianStakingRewards(addr, block.timestamp.add(duration));
        (DelegatorStakingRewards memory delegatorRewardsFuture,,) = getDelegatorStakingRewards(addr, block.timestamp.add(duration));

        estimatedDelegatorStakingRewards = delegatorRewardsFuture.balance.sub(delegatorRewardsNow.balance);
        estimatedGuardianStakingRewards = guardianRewardsFuture.balance.sub(guardianRewardsNow.balance);
    }

    /// Sets the guardian's delegators staking reward portion
    /// @dev by default uses the defaultDelegatorsStakingRewardsPercentMille
    /// @param delegatorRewardsPercentMille is the delegators portion in percent-mille (0 - maxDelegatorsStakingRewardsPercentMille)
    function setGuardianDelegatorsStakingRewardsPercentMille(uint32 delegatorRewardsPercentMille) external override onlyWhenActive {
        require(delegatorRewardsPercentMille <= PERCENT_MILLIE_BASE, "delegatorRewardsPercentMille must be 100000 at most");
        require(delegatorRewardsPercentMille <= settings.maxDelegatorsStakingRewardsPercentMille, "delegatorRewardsPercentMille must not be larger than maxDelegatorsStakingRewardsPercentMille");
        updateDelegatorStakingRewards(msg.sender);
        _setGuardianDelegatorsStakingRewardsPercentMille(msg.sender, delegatorRewardsPercentMille);
    }

    /// Returns a guardian's delegators staking reward portion
    /// @dev If not explicitly set, returns the defaultDelegatorsStakingRewardsPercentMille
    /// @return delegatorRewardsRatioPercentMille is the delegators portion in percent-mille
    function getGuardianDelegatorsStakingRewardsPercentMille(address guardian) external override view returns (uint256 delegatorRewardsRatioPercentMille) {
        return _getGuardianDelegatorsStakingRewardsPercentMille(guardian, settings);
    }

    /// Returns the amount of ORBS tokens in the staking rewards wallet allocated to staking rewards
    /// @dev The staking wallet balance must always larger than the allocated value
    /// @return allocated is the amount of tokens allocated in the staking rewards wallet
    function getStakingRewardsWalletAllocatedTokens() external override view returns (uint256 allocated) {
        (, uint96 unclaimedStakingRewards) = getStakingRewardsState();
        return uint256(unclaimedStakingRewards).sub(stakingRewardsContractBalance);
    }

    /// Returns the current annual staking reward rate
    /// @dev calculated based on the current total committee weight
    /// @return annualRate is the current staking reward rate in percent-mille
    function getCurrentStakingRewardsRatePercentMille() external override view returns (uint256 annualRate) {
        (, , uint totalCommitteeWeight) = committeeContract.getCommitteeStats();
        annualRate = _getAnnualRewardPerWeight(totalCommitteeWeight, settings).mul(PERCENT_MILLIE_BASE).div(TOKEN_BASE);
    }

    /// Notifies an expected change in the committee membership of the guardian
    /// @dev Called only by: the Committee contract
    /// @dev called upon expected change in the committee membership of the guardian
    /// @dev triggers update of the global rewards state and the guardian rewards state
    /// @dev updates the rewards state based on the committee state prior to the change
    /// @param guardian is the guardian who's committee membership is updated
    /// @param weight is the weight of the guardian prior to the change
    /// @param totalCommitteeWeight is the total committee weight prior to the change
    /// @param inCommittee indicates whether the guardian was in the committee prior to the change
    /// @param inCommitteeAfter indicates whether the guardian is in the committee after the change
    function committeeMembershipWillChange(address guardian, uint256 weight, uint256 totalCommitteeWeight, bool inCommittee, bool inCommitteeAfter) external override onlyWhenActive onlyCommitteeContract {
        uint256 delegatedStake = delegationsContract.getDelegatedStake(guardian);

        Settings memory _settings = settings;
        StakingRewardsState memory _stakingRewardsState = _updateStakingRewardsState(totalCommitteeWeight, _settings);
        _updateGuardianStakingRewards(guardian, inCommittee, inCommitteeAfter, weight, delegatedStake, _stakingRewardsState, _settings);
    }

    /// Notifies an expected change in a delegator and his guardian delegation state
    /// @dev Called only by: the Delegation contract
    /// @dev called upon expected change in a delegator's delegation state
    /// @dev triggers update of the global rewards state, the guardian rewards state and the delegator rewards state
    /// @dev on delegation change, updates also the new guardian and the delegator's lastDelegatorRewardsPerToken accordingly
    /// @param guardian is the delegator's guardian prior to the change
    /// @param guardianDelegatedStake is the delegated stake of the delegator's guardian prior to the change
    /// @param delegator is the delegator about to change delegation state
    /// @param delegatorStake is the stake of the delegator
    /// @param nextGuardian is the delegator's guardian after to the change
    /// @param nextGuardianDelegatedStake is the delegated stake of the delegator's guardian after to the change
    function delegationWillChange(address guardian, uint256 guardianDelegatedStake, address delegator, uint256 delegatorStake, address nextGuardian, uint256 nextGuardianDelegatedStake) external override onlyWhenActive onlyDelegationsContract {
        Settings memory _settings = settings;
        (bool inCommittee, uint256 weight, , uint256 totalCommitteeWeight) = committeeContract.getMemberInfo(guardian);

        StakingRewardsState memory _stakingRewardsState = _updateStakingRewardsState(totalCommitteeWeight, _settings);
        GuardianStakingRewards memory guardianStakingRewards = _updateGuardianStakingRewards(guardian, inCommittee, inCommittee, weight, guardianDelegatedStake, _stakingRewardsState, _settings);
        _updateDelegatorStakingRewards(delegator, delegatorStake, guardian, guardianStakingRewards);

        if (nextGuardian != guardian) {
            (inCommittee, weight, , totalCommitteeWeight) = committeeContract.getMemberInfo(nextGuardian);
            GuardianStakingRewards memory nextGuardianStakingRewards = _updateGuardianStakingRewards(nextGuardian, inCommittee, inCommittee, weight, nextGuardianDelegatedStake, _stakingRewardsState, _settings);
            delegatorsStakingRewards[delegator].lastDelegatorRewardsPerToken = nextGuardianStakingRewards.delegatorRewardsPerToken;
        }
    }

    /*
    * Governance functions
    */

    /// Activates staking rewards allocation
    /// @dev governance function called only by the initialization admin
    /// @dev On migrations, startTime should be set to the previous contract deactivation time
    /// @param startTime sets the last assignment time
    function activateRewardDistribution(uint startTime) external override onlyMigrationManager {
        require(!settings.rewardAllocationActive, "reward distribution is already activated");

        stakingRewardsState.lastAssigned = uint32(startTime);
        settings.rewardAllocationActive = true;

        emit RewardDistributionActivated(startTime);
    }

    /// Deactivates fees and bootstrap allocation
    /// @dev governance function called only by the migration manager
    /// @dev guardians updates remain active based on the current perMember value
    function deactivateRewardDistribution() external override onlyMigrationManager {
        require(settings.rewardAllocationActive, "reward distribution is already deactivated");

        StakingRewardsState memory _stakingRewardsState = updateStakingRewardsState();

        settings.rewardAllocationActive = false;

        withdrawRewardsWalletAllocatedTokens(_stakingRewardsState);

        emit RewardDistributionDeactivated();
    }

    /// Sets the default delegators staking reward portion
    /// @dev governance function called only by the functional manager
    /// @param defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille(0 - maxDelegatorsStakingRewardsPercentMille)
    function setDefaultDelegatorsStakingRewardsPercentMille(uint32 defaultDelegatorsStakingRewardsPercentMille) public override onlyFunctionalManager {
        require(defaultDelegatorsStakingRewardsPercentMille <= PERCENT_MILLIE_BASE, "defaultDelegatorsStakingRewardsPercentMille must not be larger than 100000");
        require(defaultDelegatorsStakingRewardsPercentMille <= settings.maxDelegatorsStakingRewardsPercentMille, "defaultDelegatorsStakingRewardsPercentMille must not be larger than maxDelegatorsStakingRewardsPercentMille");
        settings.defaultDelegatorsStakingRewardsPercentMille = defaultDelegatorsStakingRewardsPercentMille;
        emit DefaultDelegatorsStakingRewardsChanged(defaultDelegatorsStakingRewardsPercentMille);
    }

    /// Returns the default delegators staking reward portion
    /// @return defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille
    function getDefaultDelegatorsStakingRewardsPercentMille() public override view returns (uint32) {
        return settings.defaultDelegatorsStakingRewardsPercentMille;
    }

    /// Sets the maximum delegators staking reward portion
    /// @dev governance function called only by the functional manager
    /// @param maxDelegatorsStakingRewardsPercentMille is the maximum delegators portion in percent-mille(0 - 100,000)
    function setMaxDelegatorsStakingRewardsPercentMille(uint32 maxDelegatorsStakingRewardsPercentMille) public override onlyFunctionalManager {
        require(maxDelegatorsStakingRewardsPercentMille <= PERCENT_MILLIE_BASE, "maxDelegatorsStakingRewardsPercentMille must not be larger than 100000");
        settings.maxDelegatorsStakingRewardsPercentMille = maxDelegatorsStakingRewardsPercentMille;
        emit MaxDelegatorsStakingRewardsChanged(maxDelegatorsStakingRewardsPercentMille);
    }

    /// Returns the default delegators staking reward portion
    /// @return maxDelegatorsStakingRewardsPercentMille is the maximum delegators portion in percent-mille
    function getMaxDelegatorsStakingRewardsPercentMille() public override view returns (uint32) {
        return settings.maxDelegatorsStakingRewardsPercentMille;
    }

    /// Sets the annual rate and cap for the staking reward
    /// @dev governance function called only by the functional manager
    /// @param annualRateInPercentMille is the annual rate in percent-mille
    /// @param annualCap is the annual staking rewards cap
    function setAnnualStakingRewardsRate(uint32 annualRateInPercentMille, uint96 annualCap) external override onlyFunctionalManager {
        updateStakingRewardsState();
        return _setAnnualStakingRewardsRate(annualRateInPercentMille, annualCap);
    }

    /// Returns the annual staking reward rate
    /// @return annualStakingRewardsRatePercentMille is the annual rate in percent-mille
    function getAnnualStakingRewardsRatePercentMille() external override view returns (uint32) {
        return settings.annualRateInPercentMille;
    }

    /// Returns the annual staking rewards cap
    /// @return annualStakingRewardsCap is the annual rate in percent-mille
    function getAnnualStakingRewardsCap() external override view returns (uint256) {
        return settings.annualCap;
    }

    /// Checks if rewards allocation is active
    /// @return rewardAllocationActive is a bool that indicates that rewards allocation is active
    function isRewardAllocationActive() external override view returns (bool) {
        return settings.rewardAllocationActive;
    }

    /// Returns the contract's settings
    /// @return annualStakingRewardsCap is the annual rate in percent-mille
    /// @return annualStakingRewardsRatePercentMille is the annual rate in percent-mille
    /// @return defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille
    /// @return maxDelegatorsStakingRewardsPercentMille is the maximum delegators portion in percent-mille
    /// @return rewardAllocationActive is a bool that indicates that rewards allocation is active
    function getSettings() external override view returns (
        uint annualStakingRewardsCap,
        uint32 annualStakingRewardsRatePercentMille,
        uint32 defaultDelegatorsStakingRewardsPercentMille,
        uint32 maxDelegatorsStakingRewardsPercentMille,
        bool rewardAllocationActive
    ) {
        Settings memory _settings = settings;
        annualStakingRewardsCap = _settings.annualCap;
        annualStakingRewardsRatePercentMille = _settings.annualRateInPercentMille;
        defaultDelegatorsStakingRewardsPercentMille = _settings.defaultDelegatorsStakingRewardsPercentMille;
        maxDelegatorsStakingRewardsPercentMille = _settings.maxDelegatorsStakingRewardsPercentMille;
        rewardAllocationActive = _settings.rewardAllocationActive;
    }

    /// Migrates the staking rewards balance of the given addresses to a new staking rewards contract
    /// @dev The new rewards contract is determined according to the contracts registry
    /// @dev No impact of the calling contract if the currently configured contract in the registry
    /// @dev may be called also while the contract is locked
    /// @param addrs is the list of addresses to migrate
    function migrateRewardsBalance(address[] calldata addrs) external override {
        require(!settings.rewardAllocationActive, "Reward distribution must be deactivated for migration");

        IStakingRewards currentRewardsContract = IStakingRewards(getStakingRewardsContract());
        require(address(currentRewardsContract) != address(this), "New rewards contract is not set");

        uint256 totalAmount = 0;
        uint256[] memory guardianRewards = new uint256[](addrs.length);
        uint256[] memory delegatorRewards = new uint256[](addrs.length);
        for (uint i = 0; i < addrs.length; i++) {
            (guardianRewards[i], delegatorRewards[i]) = claimStakingRewardsLocally(addrs[i]);
            totalAmount = totalAmount.add(guardianRewards[i]).add(delegatorRewards[i]);
        }

        require(token.approve(address(currentRewardsContract), totalAmount), "migrateRewardsBalance: approve failed");
        currentRewardsContract.acceptRewardsBalanceMigration(addrs, guardianRewards, delegatorRewards, totalAmount);

        for (uint i = 0; i < addrs.length; i++) {
            emit StakingRewardsBalanceMigrated(addrs[i], guardianRewards[i], delegatorRewards[i], address(currentRewardsContract));
        }
    }

    /// Accepts addresses balance migration from a previous rewards contract
    /// @dev the function may be called by any caller that approves the amounts provided for transfer
    /// @param addrs is the list migrated addresses
    /// @param migratedGuardianStakingRewards is the list of received guardian rewards balance for each address
    /// @param migratedDelegatorStakingRewards is the list of received delegator rewards balance for each address
    /// @param totalAmount is the total amount of staking rewards migrated for all addresses in the list. Must match the sum of migratedGuardianStakingRewards and migratedDelegatorStakingRewards lists.
    function acceptRewardsBalanceMigration(address[] calldata addrs, uint256[] calldata migratedGuardianStakingRewards, uint256[] calldata migratedDelegatorStakingRewards, uint256 totalAmount) external override {
        uint256 _totalAmount = 0;

        for (uint i = 0; i < addrs.length; i++) {
            _totalAmount = _totalAmount.add(migratedGuardianStakingRewards[i]).add(migratedDelegatorStakingRewards[i]);
        }

        require(totalAmount == _totalAmount, "totalAmount does not match sum of rewards");

        if (totalAmount > 0) {
            require(token.transferFrom(msg.sender, address(this), totalAmount), "acceptRewardBalanceMigration: transfer failed");
        }

        for (uint i = 0; i < addrs.length; i++) {
            guardiansStakingRewards[addrs[i]].balance = guardiansStakingRewards[addrs[i]].balance.add(migratedGuardianStakingRewards[i]);
            delegatorsStakingRewards[addrs[i]].balance = delegatorsStakingRewards[addrs[i]].balance.add(migratedDelegatorStakingRewards[i]);
            emit StakingRewardsBalanceMigrationAccepted(msg.sender, addrs[i], migratedGuardianStakingRewards[i], migratedDelegatorStakingRewards[i]);
        }

        stakingRewardsContractBalance = stakingRewardsContractBalance.add(totalAmount);
        stakingRewardsState.unclaimedStakingRewards = stakingRewardsState.unclaimedStakingRewards.add(totalAmount);
    }

    /// Performs emergency withdrawal of the contract balance
    /// @dev called with a token to withdraw, should be called twice with the fees and bootstrap tokens
    /// @dev governance function called only by the migration manager
    /// @param erc20 is the ERC20 token to withdraw
    function emergencyWithdraw(address erc20) external override onlyMigrationManager {
        IERC20 _token = IERC20(erc20);
        emit EmergencyWithdrawal(msg.sender, address(_token));
        require(_token.transfer(msg.sender, _token.balanceOf(address(this))), "StakingRewards::emergencyWithdraw - transfer failed");
    }

    /*
    * Private functions
    */

    // Global state

    /// Returns the annual reward per weight
    /// @dev calculates the current annual rewards per weight based on the annual rate and annual cap
    function _getAnnualRewardPerWeight(uint256 totalCommitteeWeight, Settings memory _settings) private pure returns (uint256) {
        return totalCommitteeWeight == 0 ? 0 : Math.min(uint256(_settings.annualRateInPercentMille).mul(TOKEN_BASE).div(PERCENT_MILLIE_BASE), uint256(_settings.annualCap).mul(TOKEN_BASE).div(totalCommitteeWeight));
    }

    /// Calculates the added rewards per weight for the given duration based on the committee data
    /// @param totalCommitteeWeight is the current committee total weight
    /// @param duration is the duration to calculate for in seconds
    /// @param _settings is the contract settings
    function calcStakingRewardPerWeightDelta(uint256 totalCommitteeWeight, uint duration, Settings memory _settings) private pure returns (uint256 stakingRewardsPerWeightDelta) {
        stakingRewardsPerWeightDelta = 0;

        if (totalCommitteeWeight > 0) {
            uint annualRewardPerWeight = _getAnnualRewardPerWeight(totalCommitteeWeight, _settings);
            stakingRewardsPerWeightDelta = annualRewardPerWeight.mul(duration).div(365 days);
        }
    }

    /// Returns the up global staking rewards state for a specific time
    /// @dev receives the relevant committee data
    /// @dev for future time calculations assumes no change in the committee data
    /// @param totalCommitteeWeight is the current committee total weight
    /// @param currentTime is the time to calculate the rewards for
    /// @param _settings is the contract settings
    function _getStakingRewardsState(uint256 totalCommitteeWeight, uint256 currentTime, Settings memory _settings) private view returns (StakingRewardsState memory _stakingRewardsState, uint256 allocatedRewards) {
        _stakingRewardsState = stakingRewardsState;
        if (_settings.rewardAllocationActive) {
            uint delta = calcStakingRewardPerWeightDelta(totalCommitteeWeight, currentTime.sub(stakingRewardsState.lastAssigned), _settings);
            _stakingRewardsState.stakingRewardsPerWeight = stakingRewardsState.stakingRewardsPerWeight.add(delta);
            _stakingRewardsState.lastAssigned = uint32(currentTime);
            allocatedRewards = delta.mul(totalCommitteeWeight).div(TOKEN_BASE);
            _stakingRewardsState.unclaimedStakingRewards = _stakingRewardsState.unclaimedStakingRewards.add(allocatedRewards);
        }
    }

    /// Updates the global staking rewards
    /// @dev calculated to the latest block, may differ from the state read
    /// @dev uses the _getStakingRewardsState function
    /// @param totalCommitteeWeight is the current committee total weight
    /// @param _settings is the contract settings
    /// @return _stakingRewardsState is the updated global staking rewards struct
    function _updateStakingRewardsState(uint256 totalCommitteeWeight, Settings memory _settings) private returns (StakingRewardsState memory _stakingRewardsState) {
        if (!_settings.rewardAllocationActive) {
            return stakingRewardsState;
        }

        uint allocatedRewards;
        (_stakingRewardsState, allocatedRewards) = _getStakingRewardsState(totalCommitteeWeight, block.timestamp, _settings);
        stakingRewardsState = _stakingRewardsState;
        emit StakingRewardsAllocated(allocatedRewards, _stakingRewardsState.stakingRewardsPerWeight);
    }

    /// Updates the global staking rewards
    /// @dev calculated to the latest block, may differ from the state read
    /// @dev queries the committee state from the committee contract
    /// @dev uses the _updateStakingRewardsState function
    /// @return _stakingRewardsState is the updated global staking rewards struct
    function updateStakingRewardsState() private returns (StakingRewardsState memory _stakingRewardsState) {
        (, , uint totalCommitteeWeight) = committeeContract.getCommitteeStats();
        return _updateStakingRewardsState(totalCommitteeWeight, settings);
    }

    // Guardian state

    /// Returns the current guardian staking rewards state
    /// @dev receives the relevant committee and guardian data along with the global updated global state
    /// @dev calculated to the latest block, may differ from the state read
    /// @param guardian is the guardian to query
    /// @param inCommittee indicates whether the guardian is currently in the committee
    /// @param inCommitteeAfter indicates whether after a potential change the guardian is in the committee
    /// @param guardianWeight is the guardian committee weight
    /// @param guardianDelegatedStake is the guardian delegated stake
    /// @param _stakingRewardsState is the updated global staking rewards state
    /// @param _settings is the contract settings
    /// @return guardianStakingRewards is the updated guardian staking rewards state
    /// @return rewardsAdded is the amount awarded to the guardian since the last update
    /// @return stakingRewardsPerWeightDelta is the delta added to the stakingRewardsPerWeight since the last update
    /// @return delegatorRewardsPerTokenDelta is the delta added to the guardian's delegatorRewardsPerToken since the last update
    function _getGuardianStakingRewards(address guardian, bool inCommittee, bool inCommitteeAfter, uint256 guardianWeight, uint256 guardianDelegatedStake, StakingRewardsState memory _stakingRewardsState, Settings memory _settings) private view returns (GuardianStakingRewards memory guardianStakingRewards, uint256 rewardsAdded, uint256 stakingRewardsPerWeightDelta, uint256 delegatorRewardsPerTokenDelta) {
        guardianStakingRewards = guardiansStakingRewards[guardian];

        if (inCommittee) {
            stakingRewardsPerWeightDelta = uint256(_stakingRewardsState.stakingRewardsPerWeight).sub(guardianStakingRewards.lastStakingRewardsPerWeight);
            uint256 totalRewards = stakingRewardsPerWeightDelta.mul(guardianWeight);

            uint256 delegatorRewardsRatioPercentMille = _getGuardianDelegatorsStakingRewardsPercentMille(guardian, _settings);

            delegatorRewardsPerTokenDelta = guardianDelegatedStake == 0 ? 0 : totalRewards
            .div(guardianDelegatedStake)
            .mul(delegatorRewardsRatioPercentMille)
            .div(PERCENT_MILLIE_BASE);

            uint256 guardianCutPercentMille = PERCENT_MILLIE_BASE.sub(delegatorRewardsRatioPercentMille);

            rewardsAdded = totalRewards
            .mul(guardianCutPercentMille)
            .div(PERCENT_MILLIE_BASE)
            .div(TOKEN_BASE);

            guardianStakingRewards.delegatorRewardsPerToken = guardianStakingRewards.delegatorRewardsPerToken.add(delegatorRewardsPerTokenDelta);
            guardianStakingRewards.balance = guardianStakingRewards.balance.add(rewardsAdded);
        }

        guardianStakingRewards.lastStakingRewardsPerWeight = inCommitteeAfter ? _stakingRewardsState.stakingRewardsPerWeight : 0;
    }

    /// Returns the guardian staking rewards state for a given time
    /// @dev if the time to estimate is in the future, estimates the rewards for the given time
    /// @dev for future time estimation assumes no change in the committee and the guardian state
    /// @param guardian is the guardian to query
    /// @param currentTime is the time to calculate the rewards for
    /// @return guardianStakingRewards is the guardian staking rewards state updated to the give time
    /// @return stakingRewardsPerWeightDelta is the delta added to the stakingRewardsPerWeight since the last update
    /// @return delegatorRewardsPerTokenDelta is the delta added to the guardian's delegatorRewardsPerToken since the last update
    function getGuardianStakingRewards(address guardian, uint256 currentTime) private view returns (GuardianStakingRewards memory guardianStakingRewards, uint256 stakingRewardsPerWeightDelta, uint256 delegatorRewardsPerTokenDelta) {
        Settings memory _settings = settings;

        (bool inCommittee, uint256 guardianWeight, ,uint256 totalCommitteeWeight) = committeeContract.getMemberInfo(guardian);
        uint256 guardianDelegatedStake = delegationsContract.getDelegatedStake(guardian);

        (StakingRewardsState memory _stakingRewardsState,) = _getStakingRewardsState(totalCommitteeWeight, currentTime, _settings);
        (guardianStakingRewards,,stakingRewardsPerWeightDelta,delegatorRewardsPerTokenDelta) = _getGuardianStakingRewards(guardian, inCommittee, inCommittee, guardianWeight, guardianDelegatedStake, _stakingRewardsState, _settings);
    }

    /// Updates a guardian staking rewards state
    /// @dev receives the relevant committee and guardian data along with the global updated global state
    /// @dev updates the global staking rewards state prior to calculating the guardian's
    /// @dev uses _getGuardianStakingRewards
    /// @param guardian is the guardian to update
    /// @param inCommittee indicates whether the guardian was in the committee prior to the change
    /// @param inCommitteeAfter indicates whether the guardian is in the committee after the change
    /// @param guardianWeight is the committee weight of the guardian prior to the change
    /// @param guardianDelegatedStake is the delegated stake of the guardian prior to the change
    /// @param _stakingRewardsState is the updated global staking rewards state
    /// @param _settings is the contract settings
    /// @return guardianStakingRewards is the updated guardian staking rewards state
    function _updateGuardianStakingRewards(address guardian, bool inCommittee, bool inCommitteeAfter, uint256 guardianWeight, uint256 guardianDelegatedStake, StakingRewardsState memory _stakingRewardsState, Settings memory _settings) private returns (GuardianStakingRewards memory guardianStakingRewards) {
        uint256 guardianStakingRewardsAdded;
        uint256 stakingRewardsPerWeightDelta;
        uint256 delegatorRewardsPerTokenDelta;
        (guardianStakingRewards, guardianStakingRewardsAdded, stakingRewardsPerWeightDelta, delegatorRewardsPerTokenDelta) = _getGuardianStakingRewards(guardian, inCommittee, inCommitteeAfter, guardianWeight, guardianDelegatedStake, _stakingRewardsState, _settings);
        guardiansStakingRewards[guardian] = guardianStakingRewards;
        emit GuardianStakingRewardsAssigned(guardian, guardianStakingRewardsAdded, guardianStakingRewards.claimed.add(guardianStakingRewards.balance), guardianStakingRewards.delegatorRewardsPerToken, delegatorRewardsPerTokenDelta, _stakingRewardsState.stakingRewardsPerWeight, stakingRewardsPerWeightDelta);
    }

    /// Updates a guardian staking rewards state
    /// @dev queries the relevant guardian and committee data from the committee contract
    /// @dev uses _updateGuardianStakingRewards
    /// @param guardian is the guardian to update
    /// @param _stakingRewardsState is the updated global staking rewards state
    /// @param _settings is the contract settings
    /// @return guardianStakingRewards is the updated guardian staking rewards state
    function updateGuardianStakingRewards(address guardian, StakingRewardsState memory _stakingRewardsState, Settings memory _settings) private returns (GuardianStakingRewards memory guardianStakingRewards) {
        (bool inCommittee, uint256 guardianWeight,,) = committeeContract.getMemberInfo(guardian);
        return _updateGuardianStakingRewards(guardian, inCommittee, inCommittee, guardianWeight, delegationsContract.getDelegatedStake(guardian), _stakingRewardsState, _settings);
    }

    // Delegator state

    /// Returns the current delegator staking rewards state
    /// @dev receives the relevant delegator data along with the delegator's current guardian updated global state
    /// @dev calculated to the latest block, may differ from the state read
    /// @param delegator is the delegator to query
    /// @param delegatorStake is the stake of the delegator
    /// @param guardianStakingRewards is the updated guardian staking rewards state
    /// @return delegatorStakingRewards is the updated delegator staking rewards state
    /// @return delegatorRewardsAdded is the amount awarded to the delegator since the last update
    /// @return delegatorRewardsPerTokenDelta is the delta added to the delegator's delegatorRewardsPerToken since the last update
    function _getDelegatorStakingRewards(address delegator, uint256 delegatorStake, GuardianStakingRewards memory guardianStakingRewards) private view returns (DelegatorStakingRewards memory delegatorStakingRewards, uint256 delegatorRewardsAdded, uint256 delegatorRewardsPerTokenDelta) {
        delegatorStakingRewards = delegatorsStakingRewards[delegator];

        delegatorRewardsPerTokenDelta = uint256(guardianStakingRewards.delegatorRewardsPerToken)
        .sub(delegatorStakingRewards.lastDelegatorRewardsPerToken);
        delegatorRewardsAdded = delegatorRewardsPerTokenDelta
        .mul(delegatorStake)
        .div(TOKEN_BASE);

        delegatorStakingRewards.balance = delegatorStakingRewards.balance.add(delegatorRewardsAdded);
        delegatorStakingRewards.lastDelegatorRewardsPerToken = guardianStakingRewards.delegatorRewardsPerToken;
    }

    /// Returns the delegator staking rewards state for a given time
    /// @dev if the time to estimate is in the future, estimates the rewards for the given time
    /// @dev for future time estimation assumes no change in the committee, delegation and the delegator state
    /// @param delegator is the delegator to query
    /// @param currentTime is the time to calculate the rewards for
    /// @return delegatorStakingRewards is the updated delegator staking rewards state
    /// @return guardian is the guardian the delegator delegated to
    /// @return delegatorStakingRewardsPerTokenDelta is the delta added to the delegator's delegatorRewardsPerToken since the last update
    function getDelegatorStakingRewards(address delegator, uint256 currentTime) private view returns (DelegatorStakingRewards memory delegatorStakingRewards, address guardian, uint256 delegatorStakingRewardsPerTokenDelta) {
        uint256 delegatorStake;
        (guardian, delegatorStake) = delegationsContract.getDelegationInfo(delegator);
        (GuardianStakingRewards memory guardianStakingRewards,,) = getGuardianStakingRewards(guardian, currentTime);

        (delegatorStakingRewards,,delegatorStakingRewardsPerTokenDelta) = _getDelegatorStakingRewards(delegator, delegatorStake, guardianStakingRewards);
    }

    /// Updates a delegator staking rewards state
    /// @dev receives the relevant delegator data along with the delegator's current guardian updated global state
    /// @dev updates the guardian staking rewards state prior to calculating the delegator's
    /// @dev uses _getDelegatorStakingRewards
    /// @param delegator is the delegator to update
    /// @param delegatorStake is the stake of the delegator
    /// @param guardianStakingRewards is the updated guardian staking rewards state
    function _updateDelegatorStakingRewards(address delegator, uint256 delegatorStake, address guardian, GuardianStakingRewards memory guardianStakingRewards) private {
        uint256 delegatorStakingRewardsAdded;
        uint256 delegatorRewardsPerTokenDelta;
        DelegatorStakingRewards memory delegatorStakingRewards;
        (delegatorStakingRewards, delegatorStakingRewardsAdded, delegatorRewardsPerTokenDelta) = _getDelegatorStakingRewards(delegator, delegatorStake, guardianStakingRewards);
        delegatorsStakingRewards[delegator] = delegatorStakingRewards;

        emit DelegatorStakingRewardsAssigned(delegator, delegatorStakingRewardsAdded, delegatorStakingRewards.claimed.add(delegatorStakingRewards.balance), guardian, guardianStakingRewards.delegatorRewardsPerToken, delegatorRewardsPerTokenDelta);
    }

    /// Updates a delegator staking rewards state
    /// @dev queries the relevant delegator and committee data from the committee contract and delegation contract
    /// @dev uses _updateDelegatorStakingRewards
    /// @param delegator is the delegator to update
    function updateDelegatorStakingRewards(address delegator) private {
        Settings memory _settings = settings;

        (, , uint totalCommitteeWeight) = committeeContract.getCommitteeStats();
        StakingRewardsState memory _stakingRewardsState = _updateStakingRewardsState(totalCommitteeWeight, _settings);

        (address guardian, uint delegatorStake) = delegationsContract.getDelegationInfo(delegator);
        GuardianStakingRewards memory guardianRewards = updateGuardianStakingRewards(guardian, _stakingRewardsState, _settings);

        _updateDelegatorStakingRewards(delegator, delegatorStake, guardian, guardianRewards);
    }

    // Guardian settings

    /// Returns the guardian's delegator portion in percent-mille
    /// @dev if no explicit value was set by the guardian returns the default value
    /// @dev enforces the maximum delegators staking rewards cut
    function _getGuardianDelegatorsStakingRewardsPercentMille(address guardian, Settings memory _settings) private view returns (uint256 delegatorRewardsRatioPercentMille) {
        GuardianRewardSettings memory guardianSettings = guardiansRewardSettings[guardian];
        delegatorRewardsRatioPercentMille =  guardianSettings.overrideDefault ? guardianSettings.delegatorsStakingRewardsPercentMille : _settings.defaultDelegatorsStakingRewardsPercentMille;
        return Math.min(delegatorRewardsRatioPercentMille, _settings.maxDelegatorsStakingRewardsPercentMille);
    }

    /// Migrates a list of guardians' delegators portion setting from a previous staking rewards contract
    /// @dev called by the constructor
    function migrateGuardiansSettings(IStakingRewards previousRewardsContract, address[] memory guardiansToMigrate) private {
        for (uint i = 0; i < guardiansToMigrate.length; i++) {
            _setGuardianDelegatorsStakingRewardsPercentMille(guardiansToMigrate[i], uint32(previousRewardsContract.getGuardianDelegatorsStakingRewardsPercentMille(guardiansToMigrate[i])));
        }
    }

    // Governance and misc.

    /// Sets the annual rate and cap for the staking reward
    /// @param annualRateInPercentMille is the annual rate in percent-mille
    /// @param annualCap is the annual staking rewards cap
    function _setAnnualStakingRewardsRate(uint32 annualRateInPercentMille, uint96 annualCap) private {
        Settings memory _settings = settings;
        _settings.annualRateInPercentMille = annualRateInPercentMille;
        _settings.annualCap = annualCap;
        settings = _settings;

        emit AnnualStakingRewardsRateChanged(annualRateInPercentMille, annualCap);
    }

    /// Sets the guardian's delegators staking reward portion
    /// @param guardian is the guardian to set
    /// @param delegatorRewardsPercentMille is the delegators portion in percent-mille (0 - maxDelegatorsStakingRewardsPercentMille)
    function _setGuardianDelegatorsStakingRewardsPercentMille(address guardian, uint32 delegatorRewardsPercentMille) private {
        guardiansRewardSettings[guardian] = GuardianRewardSettings({
            overrideDefault: true,
            delegatorsStakingRewardsPercentMille: delegatorRewardsPercentMille
            });

        emit GuardianDelegatorsStakingRewardsPercentMilleUpdated(guardian, delegatorRewardsPercentMille);
    }

    /// Claims an addr staking rewards and update its rewards state without transferring the rewards
    /// @dev used by claimStakingRewards and migrateRewardsBalance
    /// @param addr is the address to claim rewards for
    /// @return guardianRewards is the claimed guardian rewards balance
    /// @return delegatorRewards is the claimed delegator rewards balance
    function claimStakingRewardsLocally(address addr) private returns (uint256 guardianRewards, uint256 delegatorRewards) {
        updateDelegatorStakingRewards(addr);

        guardianRewards = guardiansStakingRewards[addr].balance;
        guardiansStakingRewards[addr].balance = 0;

        delegatorRewards = delegatorsStakingRewards[addr].balance;
        delegatorsStakingRewards[addr].balance = 0;

        uint256 total = delegatorRewards.add(guardianRewards);

        StakingRewardsState memory _stakingRewardsState = stakingRewardsState;

        uint256 _stakingRewardsContractBalance = stakingRewardsContractBalance;
        if (total > _stakingRewardsContractBalance) {
            _stakingRewardsContractBalance = withdrawRewardsWalletAllocatedTokens(_stakingRewardsState);
        }

        stakingRewardsContractBalance = _stakingRewardsContractBalance.sub(total);
        stakingRewardsState.unclaimedStakingRewards = _stakingRewardsState.unclaimedStakingRewards.sub(total);
    }

    /// Withdraws the tokens that were allocated to the contract from the staking rewards wallet
    /// @dev used as part of the migration flow to withdraw all the funds allocated for participants before updating the wallet client to a new contract
    /// @param _stakingRewardsState is the updated global staking rewards state
    function withdrawRewardsWalletAllocatedTokens(StakingRewardsState memory _stakingRewardsState) private returns (uint256 _stakingRewardsContractBalance){
        _stakingRewardsContractBalance = stakingRewardsContractBalance;
        uint256 allocated = _stakingRewardsState.unclaimedStakingRewards.sub(_stakingRewardsContractBalance);
        stakingRewardsWallet.withdraw(allocated);
        _stakingRewardsContractBalance = _stakingRewardsContractBalance.add(allocated);
        stakingRewardsContractBalance = _stakingRewardsContractBalance;
    }

    /*
     * Contracts topology / registry interface
     */

    ICommittee committeeContract;
    IDelegations delegationsContract;
    IProtocolWallet stakingRewardsWallet;
    IStakingContract stakingContract;

    /// Refreshes the address of the other contracts the contract interacts with
    /// @dev called by the registry contract upon an update of a contract in the registry
    function refreshContracts() external override {
        committeeContract = ICommittee(getCommitteeContract());
        delegationsContract = IDelegations(getDelegationsContract());
        stakingRewardsWallet = IProtocolWallet(getStakingRewardsWallet());
        stakingContract = IStakingContract(getStakingContract());
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IContractRegistry","name":"_contractRegistry","type":"address"},{"internalType":"address","name":"_registryAdmin","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint32","name":"annualRateInPercentMille","type":"uint32"},{"internalType":"uint96","name":"annualCap","type":"uint96"},{"internalType":"uint32","name":"defaultDelegatorsStakingRewardsPercentMille","type":"uint32"},{"internalType":"uint32","name":"maxDelegatorsStakingRewardsPercentMille","type":"uint32"},{"internalType":"contract IStakingRewards","name":"previousRewardsContract","type":"address"},{"internalType":"address[]","name":"guardiansToMigrate","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"annualRateInPercentMille","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"annualCap","type":"uint256"}],"name":"AnnualStakingRewardsRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"}],"name":"ContractRegistryAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"defaultDelegatorsStakingRewardsPercentMille","type":"uint32"}],"name":"DefaultDelegatorsStakingRewardsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAwarded","type":"uint256"},{"indexed":false,"internalType":"address","name":"guardian","type":"address"},{"indexed":false,"internalType":"uint256","name":"delegatorRewardsPerToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delegatorRewardsPerTokenDelta","type":"uint256"}],"name":"DelegatorStakingRewardsAssigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"EmergencyWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"guardian","type":"address"},{"indexed":false,"internalType":"uint256","name":"delegatorsStakingRewardsPercentMille","type":"uint256"}],"name":"GuardianDelegatorsStakingRewardsPercentMilleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"guardian","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAwarded","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delegatorRewardsPerToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delegatorRewardsPerTokenDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakingRewardsPerWeight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakingRewardsPerWeightDelta","type":"uint256"}],"name":"GuardianStakingRewardsAssigned","type":"event"},{"anonymous":false,"inputs":[],"name":"InitializationComplete","type":"event"},{"anonymous":false,"inputs":[],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"maxDelegatorsStakingRewardsPercentMille","type":"uint32"}],"name":"MaxDelegatorsStakingRewardsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousRegistryAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newRegistryAdmin","type":"address"}],"name":"RegistryManagementTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"RewardDistributionActivated","type":"event"},{"anonymous":false,"inputs":[],"name":"RewardDistributionDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"allocatedRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakingRewardsPerWeight","type":"uint256"}],"name":"StakingRewardsAllocated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"guardianStakingRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delegatorStakingRewards","type":"uint256"},{"indexed":false,"internalType":"address","name":"toRewardsContract","type":"address"}],"name":"StakingRewardsBalanceMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"guardianStakingRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delegatorStakingRewards","type":"uint256"}],"name":"StakingRewardsBalanceMigrationAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimedDelegatorRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimedGuardianRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalClaimedDelegatorRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalClaimedGuardianRewards","type":"uint256"}],"name":"StakingRewardsClaimed","type":"event"},{"anonymous":false,"inputs":[],"name":"Unlocked","type":"event"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"},{"internalType":"uint256[]","name":"migratedGuardianStakingRewards","type":"uint256[]"},{"internalType":"uint256[]","name":"migratedDelegatorStakingRewards","type":"uint256[]"},{"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"acceptRewardsBalanceMigration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"activateRewardDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRegistryManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"claimStakingRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"},{"internalType":"uint256","name":"totalCommitteeWeight","type":"uint256"},{"internalType":"bool","name":"inCommittee","type":"bool"},{"internalType":"bool","name":"inCommitteeAfter","type":"bool"}],"name":"committeeMembershipWillChange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deactivateRewardDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"},{"internalType":"uint256","name":"guardianDelegatedStake","type":"uint256"},{"internalType":"address","name":"delegator","type":"address"},{"internalType":"uint256","name":"delegatorStake","type":"uint256"},{"internalType":"address","name":"nextGuardian","type":"address"},{"internalType":"uint256","name":"nextGuardianDelegatedStake","type":"uint256"}],"name":"delegationWillChange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegatorsStakingRewards","outputs":[{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"uint96","name":"lastDelegatorRewardsPerToken","type":"uint96"},{"internalType":"uint96","name":"claimed","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"estimateFutureRewards","outputs":[{"internalType":"uint256","name":"estimatedDelegatorStakingRewards","type":"uint256"},{"internalType":"uint256","name":"estimatedGuardianStakingRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAnnualStakingRewardsCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAnnualStakingRewardsRatePercentMille","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractRegistry","outputs":[{"internalType":"contract IContractRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentStakingRewardsRatePercentMille","outputs":[{"internalType":"uint256","name":"annualRate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultDelegatorsStakingRewardsPercentMille","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"getDelegatorStakingRewardsData","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"address","name":"guardian","type":"address"},{"internalType":"uint256","name":"lastDelegatorRewardsPerToken","type":"uint256"},{"internalType":"uint256","name":"delegatorRewardsPerTokenDelta","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"}],"name":"getGuardianDelegatorsStakingRewardsPercentMille","outputs":[{"internalType":"uint256","name":"delegatorRewardsRatioPercentMille","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"}],"name":"getGuardianStakingRewardsData","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"delegatorRewardsPerToken","type":"uint256"},{"internalType":"uint256","name":"delegatorRewardsPerTokenDelta","type":"uint256"},{"internalType":"uint256","name":"lastStakingRewardsPerWeight","type":"uint256"},{"internalType":"uint256","name":"stakingRewardsPerWeightDelta","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxDelegatorsStakingRewardsPercentMille","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSettings","outputs":[{"internalType":"uint256","name":"annualStakingRewardsCap","type":"uint256"},{"internalType":"uint32","name":"annualStakingRewardsRatePercentMille","type":"uint32"},{"internalType":"uint32","name":"defaultDelegatorsStakingRewardsPercentMille","type":"uint32"},{"internalType":"uint32","name":"maxDelegatorsStakingRewardsPercentMille","type":"uint32"},{"internalType":"bool","name":"rewardAllocationActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getStakingRewardsBalance","outputs":[{"internalType":"uint256","name":"delegatorStakingRewardsBalance","type":"uint256"},{"internalType":"uint256","name":"guardianStakingRewardsBalance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakingRewardsState","outputs":[{"internalType":"uint96","name":"stakingRewardsPerWeight","type":"uint96"},{"internalType":"uint96","name":"unclaimedStakingRewards","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakingRewardsWalletAllocatedTokens","outputs":[{"internalType":"uint256","name":"allocated","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"guardiansRewardSettings","outputs":[{"internalType":"uint32","name":"delegatorsStakingRewardsPercentMille","type":"uint32"},{"internalType":"bool","name":"overrideDefault","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"guardiansStakingRewards","outputs":[{"internalType":"uint96","name":"delegatorRewardsPerToken","type":"uint96"},{"internalType":"uint96","name":"lastStakingRewardsPerWeight","type":"uint96"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"uint96","name":"claimed","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initializationAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initializationComplete","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitializationComplete","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRegistryAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRewardAllocationActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"migrateRewardsBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingRegistryAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refreshContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registryAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceRegistryManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"annualRateInPercentMille","type":"uint32"},{"internalType":"uint96","name":"annualCap","type":"uint96"}],"name":"setAnnualStakingRewardsRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IContractRegistry","name":"newContractRegistry","type":"address"}],"name":"setContractRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"defaultDelegatorsStakingRewardsPercentMille","type":"uint32"}],"name":"setDefaultDelegatorsStakingRewardsPercentMille","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"delegatorRewardsPercentMille","type":"uint32"}],"name":"setGuardianDelegatorsStakingRewardsPercentMille","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"maxDelegatorsStakingRewardsPercentMille","type":"uint32"}],"name":"setMaxDelegatorsStakingRewardsPercentMille","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registryAdmin","type":"address"}],"name":"setRegistryAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingRewardsContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingRewardsState","outputs":[{"internalType":"uint96","name":"stakingRewardsPerWeight","type":"uint96"},{"internalType":"uint96","name":"unclaimedStakingRewards","type":"uint96"},{"internalType":"uint32","name":"lastAssigned","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newRegistryAdmin","type":"address"}],"name":"transferRegistryManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200646f3803806200646f83398181016040526101208110156200003857600080fd5b815160208301516040808501516060860151608087015160a088015160c089015160e08a01516101008b0180519751999b989a969995989497939692959194919392820192846401000000008211156200009157600080fd5b908301906020820185811115620000a757600080fd5b8251866020820283011164010000000082111715620000c557600080fd5b82525081516020918201928201910280838360005b83811015620000f4578181015183820152602001620000da565b50505050905001604052505050888881818181600062000119620002a060201b60201c565b600080546001600160a01b0319166001600160a01b03831690811782556040519293509160008051602062006405833981519152908290a350600280546001600160a01b031916331790556001600160a01b038216620001c0576040805162461bcd60e51b815260206004820152601d60248201527f5f636f6e747261637452656769737472792063616e6e6f742062652030000000604482015290519081900360640190fd5b620001cb82620002a4565b620001d681620003fc565b50505050506001600160a01b038816151590506200023b576040805162461bcd60e51b815260206004820152601360248201527f746f6b656e206d757374206e6f74206265203000000000000000000000000000604482015290519081900360640190fd5b6200024786866200048d565b62000252836200058d565b6200025d8462000678565b600580546001600160a01b0319166001600160a01b03898116919091179091558216156200029157620002918282620007b7565b50505050505050505062000b25565b3390565b620002ae62000881565b620002eb5760405162461bcd60e51b815260040180806020018281038252603e815260200180620062c3603e913960400191505060405180910390fd5b600354604080516301e32edf60e21b815290516001600160a01b039283169284169163078cbb7c916004808301926020929190829003018186803b1580156200033357600080fd5b505afa15801562000348573d6000803e3d6000fd5b505050506040513d60208110156200035f57600080fd5b50516001600160a01b031614620003a85760405162461bcd60e51b8152600401808060200182810382526041815260200180620063016041913960600191505060405180910390fd5b600380546001600160a01b0383166001600160a01b0319909116811790915560408051918252517ffea2d033438b968078a6264409d0104b5f3d2ce7b795afc74918e70f3534f22b9181900360200190a150565b6001600160a01b038116620004435760405162461bcd60e51b8152600401808060200182810382526034815260200180620063d16034913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216916000805160206200640583398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6200049762000af7565b506040805160a0810182526004805463ffffffff600160801b8083048216858701819052600160a01b808504841660608801819052600160c01b80870460ff16151560808a01819052958c166020808b018290526001600160601b038d16808c526001600160601b0319909916891763ffffffff60601b19166c0100000000000000000000000083021763ffffffff60801b1916959096029490941763ffffffff60a01b1916919092021760ff60c01b1916930292909217909355845190815291820152825191927fca8985ddc364f44d5b848534640681ad74dee87e83386b2b801989769592f00a92918290030190a1505050565b62000597620008e3565b620005d45760405162461bcd60e51b8152600401808060200182810382526024815260200180620063ad6024913960400191505060405180910390fd5b620186a08163ffffffff1611156200061e5760405162461bcd60e51b81526004018080602001828103825260468152602001806200627d6046913960600191505060405180910390fd5b6004805463ffffffff8316600160a01b810263ffffffff60a01b199092169190911790915560408051918252517f41b601885e44600c749e03dfecdd2ff57bd9468338f4248162dcaf7172bad67b9181900360200190a150565b62000682620008e3565b620006bf5760405162461bcd60e51b8152600401808060200182810382526024815260200180620063ad6024913960400191505060405180910390fd5b620186a08163ffffffff161115620007095760405162461bcd60e51b815260040180806020018281038252604a81526020018062006425604a913960600191505060405180910390fd5b60045463ffffffff600160a01b909104811690821611156200075d5760405162461bcd60e51b815260040180806020018281038252606b81526020018062006342606b913960800191505060405180910390fd5b6004805463ffffffff8316600160801b810263ffffffff60801b199092169190911790915560408051918252517f4d041e13c20fbec9dc54635af5ae0619f090f19f1f49046da068970e606741509181900360200190a150565b60005b81518110156200087c5762000873828281518110620007d557fe5b6020026020010151846001600160a01b031663959a4ba2858581518110620007f957fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156200083f57600080fd5b505afa15801562000854573d6000803e3d6000fd5b505050506040513d60208110156200086b57600080fd5b50516200091f565b600101620007ba565b505050565b6003546000906001600160a01b0316331480620008b85750620008a3620009b9565b6001600160a01b0316336001600160a01b0316145b80620008de5750620008c9620009c8565b6001600160a01b0316336001600160a01b0316145b905090565b6000620008de60405180604001604052806011815260200170333ab731ba34b7b730b626b0b730b3b2b960791b815250620009d760201b60201c565b60408051808201825263ffffffff838116808352600160208085019182526001600160a01b03881660008181526009835287902095518654935163ffffffff1990941695169490941760ff60201b191664010000000092151592909202919091179093558351908152925190927f6dfe6b1412aa34cec2188ca3d7de113a662f2cc283fec85f338571c7d52cece092908290030190a25050565b6000546001600160a01b031690565b6002546001600160a01b031690565b6003546000906001600160a01b0316620009f062000881565b8062000af057506001600160a01b0381161580159062000af05750600354604051631ee441e960e01b815260206004820181815286516024840152865133946001600160a01b031693631ee441e99389939283926044019185019080838360005b8381101562000a6b57818101518382015260200162000a51565b50505050905090810190601f16801562000a995780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801562000ab757600080fd5b505afa15801562000acc573d6000803e3d6000fd5b505050506040513d602081101562000ae357600080fd5b50516001600160a01b0316145b9392505050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6157488062000b356000396000f3fe608060405234801561001057600080fd5b506004361061032b5760003560e01c806385b4bb53116101b2578063cf309012116100f9578063e4e99222116100a2578063f83d08ba1161007c578063f83d08ba14610a3a578063fc0c546a14610a42578063fccf894014610a4a578063fcd13d6514610aa95761032b565b8063e4e9922214610a0d578063e7ca4ef314610a15578063eec0701f14610a325761032b565b8063d78cd307116100d3578063d78cd3071461093f578063dd57194914610995578063e3270e3b1461099d5761032b565b8063cf309012146108ee578063cfbe49f2146108f6578063d2523526146109375761032b565b8063a948bd311161015b578063b84a207511610135578063b84a2075146107ca578063c7b60862146108de578063cdee9fbb146108e65761032b565b8063a948bd3114610797578063acdb8e04146107ba578063adbe95b1146107c25761032b565b806396bb1fef1161018c57806396bb1fef14610761578063a4e2d63414610787578063a69df4b51461078f5761032b565b806385b4bb53146106b65780638a1f3c02146106f3578063959a4ba21461073b5761032b565b80635797f7c11161027657806362d7c7c51161021f5780637ffdd081116101f95780637ffdd0811461068557806382d716c5146106a657806383c3774e146106ae5761032b565b806362d7c7c5146105fe5780636ff1c9bc1461065757806374c16b231461067d5761032b565b80635f94cd9c116102505780635f94cd9c1461059c57806360416b7a146105a4578063616281ff146105c75761032b565b80635797f7c1146105105780635d6e9e5e146105335780635dd189ff146105705761032b565b806332f98629116102d857806339069d8c116102b257806339069d8c146104a357806346edd016146104c957806348106fe3146105085761032b565b806332f98629146103f7578063333df1541461043957806337cedbeb1461045d5761032b565b80631c7bbde5116103095780631c7bbde51461036e5780632987cea0146103c75780632a1fac72146103ef5761032b565b806313e9728f146103305780631479d34d1461034a5780631a0b2c4f14610366575b600080fd5b610338610acf565b60408051918252519081900360200190f35b610352610ad5565b604080519115158252519081900360200190f35b610352610ae5565b6103946004803603602081101561038457600080fd5b50356001600160a01b0316610b09565b6040805195865260208601949094526001600160a01b039092168484015260608401526080830152519081900360a00190f35b6103ed600480360360208110156103dd57600080fd5b50356001600160a01b0316610b5b565b005b6103ed610bd8565b6103ed600480360360a081101561040d57600080fd5b506001600160a01b03813516906020810135906040810135906060810135151590608001351515610c82565b610441610e5c565b604080516001600160a01b039092168252519081900360200190f35b6104836004803603602081101561047357600080fd5b50356001600160a01b0316610e6b565b6040805163ffffffff909316835290151560208301528051918290030190f35b6103ed600480360360208110156104b957600080fd5b50356001600160a01b0316610e90565b6104ef600480360360208110156104df57600080fd5b50356001600160a01b0316610ef3565b6040805192835260208301919091528051918290030190f35b610352610f44565b6103ed6004803603602081101561052657600080fd5b503563ffffffff16610f54565b61053b611051565b604080516bffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b6104ef6004803603604081101561058657600080fd5b506001600160a01b038135169060200135611089565b610441611178565b6103ed600480360360208110156105ba57600080fd5b503563ffffffff16611187565b6103ed600480360360408110156105dd57600080fd5b50803563ffffffff1690602001356bffffffffffffffffffffffff166112e3565b6106246004803603602081101561061457600080fd5b50356001600160a01b031661133d565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6103ed6004803603602081101561066d57600080fd5b50356001600160a01b031661139f565b61044161157b565b61068d61158a565b6040805163ffffffff9092168252519081900360200190f35b6103386115a6565b6103386115ba565b6106be6115f1565b6040805195865263ffffffff948516602087015292841685840152921660608401529015156080830152519081900360a00190f35b6103ed600480360360c081101561070957600080fd5b506001600160a01b03813581169160208101359160408201358116916060810135916080820135169060a00135611691565b6103386004803603602081101561075157600080fd5b50356001600160a01b03166119d0565b6103ed6004803603602081101561077757600080fd5b50356001600160a01b0316611a5d565b610352611ebc565b6103ed611ecc565b6103ed600480360360208110156107ad57600080fd5b503563ffffffff16611f62565b6103ed612058565b6103ed6120fd565b6103ed600480360360808110156107e057600080fd5b8101906020810181356401000000008111156107fb57600080fd5b82018360208201111561080d57600080fd5b8035906020019184602083028401116401000000008311171561082f57600080fd5b91939092909160208101903564010000000081111561084d57600080fd5b82018360208201111561085f57600080fd5b8035906020019184602083028401116401000000008311171561088157600080fd5b91939092909160208101903564010000000081111561089f57600080fd5b8201836020820111156108b157600080fd5b803590602001918460208302840111640100000000831117156108d357600080fd5b9193509150356121f8565b61033861264d565b61068d612776565b610352612789565b6108fe612799565b60405180836bffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff1681526020019250505060405180910390f35b6103ed6128bf565b6109656004803603602081101561095557600080fd5b50356001600160a01b0316612947565b604080516bffffffffffffffffffffffff9485168152928416602084015292168183015290519081900360600190f35b61068d612985565b6103ed600480360360208110156109b357600080fd5b8101906020810181356401000000008111156109ce57600080fd5b8201836020820111156109e057600080fd5b80359060200191846020830284011164010000000083111715610a0257600080fd5b5090925090506129a5565b610441612e50565b6103ed60048036036020811015610a2b57600080fd5b5035612e5f565b6103ed612f88565b6103ed61308a565b610441613126565b610a7060048036036020811015610a6057600080fd5b50356001600160a01b0316613135565b604080516bffffffffffffffffffffffff9586168152938516602085015291841683830152909216606082015290519081900360800190f35b6103ed60048036036020811015610abf57600080fd5b50356001600160a01b031661317c565b60075481565b600454600160c01b900460ff1690565b600080546001600160a01b0316610afa6132fc565b6001600160a01b031614905090565b6000806000806000610b1961518d565b600080610b268942613300565b825160408401516020909401516bffffffffffffffffffffffff9182169e9482169d50929b5090911698509650945050505050565b610b63610ae5565b610b9e5760405162461bcd60e51b81526004018080602001828103825260408152602001806156566040913960400191505060405180910390fd5b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610be0610e5c565b6001600160a01b0316336001600160a01b031614610c2f5760405162461bcd60e51b81526004018080602001828103825260268152602001806154ca6026913960400191505060405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040517f2a2b3ea974fb057582c3b210ef8b5f81492d15673f49d4384bfa3b896a964c3c90600090a1565b600354600160a01b900460ff1615610ccb5760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b600b546001600160a01b03163314610d145760405162461bcd60e51b81526004018080602001828103825260248152602001806152446024913960400191505060405180910390fd5b600c54604080517f7c47c16d0000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015291516000939290921691637c47c16d91602480820192602092909190829003018186803b158015610d7e57600080fd5b505afa158015610d92573d6000803e3d6000fd5b505050506040513d6020811015610da857600080fd5b50519050610db46151ad565b506040805160a0810182526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811693830193909352600160a01b81049092166060820152600160c01b90910460ff1615156080820152610e3661518d565b610e4086836133db565b9050610e518886868a878688613545565b505050505050505050565b6002546001600160a01b031690565b60096020526000908152604090205463ffffffff811690640100000000900460ff1682565b610e98610e5c565b6001600160a01b0316336001600160a01b031614610ee75760405162461bcd60e51b81526004018080602001828103825260268152602001806154ca6026913960400191505060405180910390fd5b610ef0816136ac565b50565b600080610efe61518d565b610f088442613300565b50509050610f146151db565b610f1e8542613764565b505091516040909201516bffffffffffffffffffffffff92831696921694509092505050565b6002546001600160a01b03161590565b610f5c613986565b610f975760405162461bcd60e51b81526004018080602001828103825260248152602001806155236024913960400191505060405180910390fd5b620186a08163ffffffff161115610fdf5760405162461bcd60e51b815260040180806020018281038252604681526020018061529d6046913960600191505060405180910390fd5b6004805463ffffffff8316600160a01b81027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff9092169190911790915560408051918252517f41b601885e44600c749e03dfecdd2ff57bd9468338f4248162dcaf7172bad67b9181900360200190a150565b6006546bffffffffffffffffffffffff808216916c01000000000000000000000000810490911690600160c01b900463ffffffff1683565b6000806110946151db565b61109e8542613764565b505090506110aa61518d565b6110b48642613300565b505090506110c06151db565b6110d3876110ce42896139cb565b613764565b505090506110df61518d565b6110f2886110ed428a6139cb565b613300565b505083518151919250611116916bffffffffffffffffffffffff9081169116613a2c565b6bffffffffffffffffffffffff16955061115d84604001516bffffffffffffffffffffffff1683604001516bffffffffffffffffffffffff16613a2c90919063ffffffff16565b6bffffffffffffffffffffffff169450505050509250929050565b6001546001600160a01b031690565b61118f613986565b6111ca5760405162461bcd60e51b81526004018080602001828103825260248152602001806155236024913960400191505060405180910390fd5b620186a08163ffffffff1611156112125760405162461bcd60e51b815260040180806020018281038252604a815260200180615696604a913960600191505060405180910390fd5b60045463ffffffff600160a01b909104811690821611156112645760405162461bcd60e51b815260040180806020018281038252606b81526020018061545f606b913960800191505060405180910390fd5b6004805463ffffffff831670010000000000000000000000000000000081027fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff9092169190911790915560408051918252517f4d041e13c20fbec9dc54635af5ae0619f090f19f1f49046da068970e606741509181900360200190a150565b6112eb613986565b6113265760405162461bcd60e51b81526004018080602001828103825260248152602001806155236024913960400191505060405180910390fd5b61132e613ad0565b506113398282613beb565b5050565b60008060008060008061134e6151db565b60008061135b8a42613764565b6040830151606084015184516020909501516bffffffffffffffffffffffff9283169e509082169c509381169a509098509091169550935050505091939550919395565b6113a7613d76565b6113e25760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b604080513381526001600160a01b0383166020820152815183927ff5b6d8b404f034718f55a370884db03c4e27e9652e2636d4adcd0540d7c4203f928290030190a1806001600160a01b031663a9059cbb33836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561148157600080fd5b505afa158015611495573d6000803e3d6000fd5b505050506040513d60208110156114ab57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561151457600080fd5b505af1158015611528573d6000803e3d6000fd5b505050506040513d602081101561153e57600080fd5b50516113395760405162461bcd60e51b81526004018080602001828103825260338152602001806156e06033913960400191505060405180910390fd5b6000546001600160a01b031690565b6004546c01000000000000000000000000900463ffffffff1690565b6004546bffffffffffffffffffffffff1690565b6000806115c5612799565b9150506115eb600754826bffffffffffffffffffffffff16613db690919063ffffffff16565b91505090565b60008060008060006116016151ad565b50506040805160a0810182526004546bffffffffffffffffffffffff81168083526c01000000000000000000000000820463ffffffff9081166020850181905270010000000000000000000000000000000084048216958501869052600160a01b840490911660608501819052600160c01b90930460ff1615156080909401849052909890975092955093509150565b600354600160a01b900460ff16156116da5760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b600c546001600160a01b031633146117235760405162461bcd60e51b81526004018080602001828103825260268152602001806155ae6026913960400191505060405180910390fd5b61172b6151ad565b506040805160a081018252600480546bffffffffffffffffffffffff8116835263ffffffff6c010000000000000000000000008204811660208501527001000000000000000000000000000000008204811684860152600160a01b820416606084015260ff600160c01b909104161515608080840191909152600b5484517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038c8116948201949094529451939460009485948594931692635f1231ea9260248082019391829003018186803b15801561180d57600080fd5b505afa158015611821573d6000803e3d6000fd5b505050506040513d608081101561183757600080fd5b5080516020820151606090920151909450909250905061185561518d565b61185f82866133db565b90506118696151db565b6118788c8687878f878c613545565b90506118868a8a8e84613df8565b8b6001600160a01b0316886001600160a01b0316146119c257600b54604080517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116600483015291519190921691635f1231ea916024808301926080929190829003018186803b15801561190557600080fd5b505afa158015611919573d6000803e3d6000fd5b505050506040513d608081101561192f57600080fd5b5080516020820151606090920151909650909450925061194d6151db565b61195c898788888c888d613545565b516001600160a01b038c166000908152600a6020526040902080546bffffffffffffffffffffffff9092166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff909216919091179055505b505050505050505050505050565b6040805160a0810182526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811693830193909352600160a01b81049092166060820152600160c01b90910460ff1615156080820152600090611a57908390613f3d565b92915050565b600354600160a01b900460ff1615611aa65760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b600080611ab283613fbe565b90925090506000611ac382846139cb565b905080611ad257505050610ef0565b6001600160a01b038416600090815260086020526040812060010154611b16906c0100000000000000000000000090046bffffffffffffffffffffffff1685614110565b6001600160a01b0386166000908152600860209081526040808320600190810180546bffffffffffffffffffffffff8088166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff90921691909117909155600a90935290832001549293509091611b9c911685614110565b6001600160a01b038781166000908152600a6020908152604080832060010180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff8716179055600554600e5482517f095ea7b30000000000000000000000000000000000000000000000000000000081529086166004820152602481018a905291519596509093169363095ea7b393604480820194918390030190829087803b158015611c5757600080fd5b505af1158015611c6b573d6000803e3d6000fd5b505050506040513d6020811015611c8157600080fd5b5051611cbe5760405162461bcd60e51b81526004018080602001828103825260238152602001806155476023913960400191505060405180910390fd5b604080516001808252818301909252606091602080830190803683370190505090508681600081518110611cee57fe5b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526060918160200160208202803683370190505090508481600081518110611d3957fe5b602090810291909101810191909152600e546040517f19d6a88d000000000000000000000000000000000000000000000000000000008152600481018881526060602483019081528651606484015286516001600160a01b03909416946319d6a88d948b948994899490939092604483019260840191878101910280838360005b83811015611dd2578181015183820152602001611dba565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015611e11578181015183820152602001611df9565b5050505090500195505050505050600060405180830381600087803b158015611e3957600080fd5b505af1158015611e4d573d6000803e3d6000fd5b505060408051898152602081018b90526bffffffffffffffffffffffff808816828401528816606082015290516001600160a01b038c1693507f5f51e0cd4567b63928e199868f571929625ded3459b724759a0eb8edbf94158b92509081900360800190a25050505050505050565b600354600160a01b900460ff1690565b611ed4613d76565b611f0f5760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556040517f19aad37188a1d3921e29eb3c66acf43d81975e107cb650d58cca878627955fd690600090a1565b600354600160a01b900460ff1615611fab5760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b620186a08163ffffffff161115611ff35760405162461bcd60e51b81526004018080602001828103825260338152602001806154f06033913960400191505060405180910390fd5b60045463ffffffff600160a01b909104811690821611156120455760405162461bcd60e51b815260040180806020018281038252605c8152602001806152e3605c913960600191505060405180910390fd5b61204e336141dd565b610ef033826143c3565b612060610ae5565b61209b5760405162461bcd60e51b81526004018080602001828103825260408152602001806156566040913960400191505060405180910390fd5b600080546040516001600160a01b03909116907f1f5f028be638d6a0e3b8d56fd05b812ce325cc8dc73cdb0e16df94d6b2725c2e908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b612105613d76565b6121405760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600454600160c01b900460ff166121885760405162461bcd60e51b815260040180806020018281038252602a81526020018061521a602a913960400191505060405180910390fd5b61219061518d565b612198613ad0565b600480547fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff16905590506121cb81614493565b506040517f9a68ce2011fec09202b5443f4484b1983ef6ad49111f730f49a65924f539d0e290600090a150565b6000805b8781101561224f5761224585858381811061221357fe5b9050602002013561223f89898581811061222957fe5b90506020020135856139cb90919063ffffffff16565b906139cb565b91506001016121fc565b5080821461228e5760405162461bcd60e51b81526004018080602001828103825260298152602001806155d46029913960400191505060405180910390fd5b811561236e57600554604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561230757600080fd5b505af115801561231b573d6000803e3d6000fd5b505050506040513d602081101561233157600080fd5b505161236e5760405162461bcd60e51b815260040180806020018281038252602d8152602001806153e3602d913960400191505060405180910390fd5b60005b878110156125b9576123d987878381811061238857fe5b90506020020135600860008c8c8681811061239f57fe5b602090810292909201356001600160a01b0316835250810191909152604001600020600101546bffffffffffffffffffffffff1690614110565b600860008b8b858181106123e957fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060010160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506124a785858381811061245957fe5b90506020020135600a60008c8c8681811061247057fe5b602090810292909201356001600160a01b0316835250810191909152604001600020546bffffffffffffffffffffffff1690614110565b600a60008b8b858181106124b757fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555088888281811061252457fe5b905060200201356001600160a01b03166001600160a01b03167f3dc5ad7d2bcb290b59b40c376a1ba37e1dff2af15e74a8628e54890dcb02b5c13389898581811061256b57fe5b9050602002013588888681811061257e57fe5b9050602002013560405180846001600160a01b03168152602001838152602001828152602001935050505060405180910390a2600101612371565b506007546125c790836139cb565b6007556006546125f5906c0100000000000000000000000090046bffffffffffffffffffffffff1683614110565b600680546bffffffffffffffffffffffff929092166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff9092169190911790555050505050505050565b600080600b60009054906101000a90046001600160a01b03166001600160a01b03166346cc116a6040518163ffffffff1660e01b815260040160606040518083038186803b15801561269e57600080fd5b505afa1580156126b2573d6000803e3d6000fd5b505050506040513d60608110156126c857600080fd5b50604090810151815160a0810183526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811694830194909452600160a01b81049093166060820152600160c01b90920460ff161515608083015291506115eb90670de0b6b3a76400009061277090620186a09061276a908690614566565b906145d8565b90614631565b600454600160a01b900463ffffffff1690565b600354600160a01b900460ff1681565b6000806000600b60009054906101000a90046001600160a01b03166001600160a01b03166346cc116a6040518163ffffffff1660e01b815260040160606040518083038186803b1580156127ec57600080fd5b505afa158015612800573d6000803e3d6000fd5b505050506040513d606081101561281657600080fd5b5060400151905061282561518d565b6040805160a0810182526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811693830193909352600160a01b81049092166060820152600160c01b90910460ff16151560808201526128ab9083904290614673565b508051602090910151909590945092505050565b6001546001600160a01b031633146129085760405162461bcd60e51b81526004018080602001828103825260278152602001806154386027913960400191505060405180910390fd5b60015461291d906001600160a01b03166136ac565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600a60205260009081526040902080546001909101546bffffffffffffffffffffffff808316926c0100000000000000000000000090048116911683565b600454700100000000000000000000000000000000900463ffffffff1690565b600454600160c01b900460ff16156129ee5760405162461bcd60e51b81526004018080602001828103825260358152602001806152686035913960400191505060405180910390fd5b60006129f8614794565b90506001600160a01b038116301415612a58576040805162461bcd60e51b815260206004820152601f60248201527f4e6577207265776172647320636f6e7472616374206973206e6f742073657400604482015290519081900360640190fd5b600060608367ffffffffffffffff81118015612a7357600080fd5b50604051908082528060200260200182016040528015612a9d578160200160208202803683370190505b50905060608467ffffffffffffffff81118015612ab957600080fd5b50604051908082528060200260200182016040528015612ae3578160200160208202803683370190505b50905060005b85811015612b8c57612b15878783818110612b0057fe5b905060200201356001600160a01b0316613fbe565b848381518110612b2157fe5b60200260200101848481518110612b3457fe5b6020026020010182815250828152505050612b82828281518110612b5457fe5b602002602001015161223f858481518110612b6b57fe5b6020026020010151876139cb90919063ffffffff16565b9350600101612ae9565b50600554604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152602482018790529151919092169163095ea7b39160448083019260209291908290030181600087803b158015612bfc57600080fd5b505af1158015612c10573d6000803e3d6000fd5b505050506040513d6020811015612c2657600080fd5b5051612c635760405162461bcd60e51b81526004018080602001828103825260258152602001806156316025913960400191505060405180910390fd5b836001600160a01b031663b84a207587878585886040518663ffffffff1660e01b81526004018080602001806020018060200185815260200184810384528989828181526020019250602002808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018681038552895181528951602091820193828c0193509102908190849084905b83811015612d1d578181015183820152602001612d05565b50505050905001848103825286818151815260200191508051906020019060200280838360005b83811015612d5c578181015183820152602001612d44565b5050505090500198505050505050505050600060405180830381600087803b158015612d8757600080fd5b505af1158015612d9b573d6000803e3d6000fd5b5050505060005b85811015612e4757868682818110612db657fe5b905060200201356001600160a01b03166001600160a01b03167f854216b077fbbbb1ec8c23db47ba2b21ceae54d75f2998d6b1ac80ee9881c83f848381518110612dfc57fe5b6020026020010151848481518110612e1057fe5b60209081029190910181015160408051938452918301526001600160a01b03891682820152519081900360600190a2600101612da2565b50505050505050565b6003546001600160a01b031690565b612e67613d76565b612ea25760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600454600160c01b900460ff1615612eeb5760405162461bcd60e51b81526004018080602001828103825260288152602001806154106028913960400191505060405180910390fd5b600680547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b63ffffffff8416810291909117909155600480547fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff1690911790556040805182815290517f5a5cf98385bad94fae95d7079332030d7467c9a9ae3a8178d183290a5018398e916020908290030190a150565b612f90614855565b600b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055612fd06148e5565b600c80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055613010614975565b600d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055613050614a05565b600e80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b613092613d76565b6130cd5760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b1790556040517f0f2e5b6c72c6a4491efd919a9f9a409f324ef0708c11ee57d410c2cb06c0992b90600090a1565b6005546001600160a01b031681565b600860205260009081526040902080546001909101546bffffffffffffffffffffffff808316926c0100000000000000000000000090819004821692808316929190041684565b613184614a95565b6131bf5760405162461bcd60e51b815260040180806020018281038252603e815260200180615364603e913960400191505060405180910390fd5b600354604080517f078cbb7c00000000000000000000000000000000000000000000000000000000815290516001600160a01b039283169284169163078cbb7c916004808301926020929190829003018186803b15801561321f57600080fd5b505afa158015613233573d6000803e3d6000fd5b505050506040513d602081101561324957600080fd5b50516001600160a01b0316146132905760405162461bcd60e51b81526004018080602001828103825260418152602001806153a26041913960600191505060405180910390fd5b600380546001600160a01b0383167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517ffea2d033438b968078a6264409d0104b5f3d2ce7b795afc74918e70f3534f22b9181900360200190a150565b3390565b61330861518d565b600c54604080517ffab46d660000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152825160009485948594939091169263fab46d669260248083019392829003018186803b15801561337157600080fd5b505afa158015613385573d6000803e3d6000fd5b505050506040513d604081101561339b57600080fd5b50805160209091015190935090506133b16151db565b6133bb8487613764565b505090506133ca878383614af0565b919995985090965093945050505050565b6133e361518d565b816080015161343b5750604080516060810182526006546bffffffffffffffffffffffff80821683526c010000000000000000000000008204166020830152600160c01b900463ffffffff1691810191909152611a57565b6000613448844285614673565b81516006805460208086015160408088015163ffffffff16600160c01b027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff9384166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff949098167fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090961686179390931696909617919091169490941790925582518481529182015281519395509193507f5830b366dc4564bf14d32116f14c979ac2c150a96b7c6b99bea717e6990d56ba92918290030190a15092915050565b61354d6151db565b60008060006135618b8b8b8b8b8b8b614bc5565b6001600160a01b038f1660008181526008602090815260409182902087518154928901517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009384166bffffffffffffffffffffffff928316177fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff9081166c010000000000000000000000009284168302178455948a01516001909301805460608c0151951693831693841790951693909116908102929092179092559599509397509195509350917f3880098574881d40bf7b9775086fdc9e6d6edac939d881add769581473c84b4591869161365691614110565b87518a51604080519485526bffffffffffffffffffffffff9384166020860152918316848301526060840187905291909116608083015260a08201869052519081900360c00190a2505050979650505050505050565b6001600160a01b0381166136f15760405162461bcd60e51b81526004018080602001828103825260348152602001806155fd6034913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f1f5f028be638d6a0e3b8d56fd05b812ce325cc8dc73cdb0e16df94d6b2725c2e91a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61376c6151db565b6000806137776151ad565b506040805160a081018252600480546bffffffffffffffffffffffff8116835263ffffffff6c010000000000000000000000008204811660208501527001000000000000000000000000000000008204811684860152600160a01b820416606084015260ff600160c01b909104161515608080840191909152600b5484517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116948201949094529451939460009485948594931692635f1231ea9260248082019391829003018186803b15801561385957600080fd5b505afa15801561386d573d6000803e3d6000fd5b505050506040513d608081101561388357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190505050935050925092506000600c60009054906101000a90046001600160a01b03166001600160a01b0316637c47c16d8b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561391d57600080fd5b505afa158015613931573d6000803e3d6000fd5b505050506040513d602081101561394757600080fd5b5051905061395361518d565b61395e838b88614673565b5090506139708b86878786868c614bc5565b929e909d50919b50909950505050505050505050565b60006139c66040518060400160405280601181526020017f66756e6374696f6e616c4d616e61676572000000000000000000000000000000815250614d5d565b905090565b600082820183811015613a25576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600081826bffffffffffffffffffffffff1614613a90576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b613a2583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250614e8b565b613ad861518d565b600b54604080517f46cc116a00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916346cc116a916004808301926060929190829003018186803b158015613b3657600080fd5b505afa158015613b4a573d6000803e3d6000fd5b505050506040513d6060811015613b6057600080fd5b50604090810151815160a0810183526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811694830194909452600160a01b81049093166060820152600160c01b90920460ff161515608083015291506115eb9082906133db565b613bf36151ad565b506040805160a0810182526004805463ffffffff7001000000000000000000000000000000008083048216858701819052600160a01b808504841660608801819052600160c01b80870460ff16151560808a01819052958c166020808b018290526bffffffffffffffffffffffff8d16808c527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090991689177fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c010000000000000000000000008302177fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff1695909602949094177fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff1691909202177fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff16930292909217909355845190815291820152825191927fca8985ddc364f44d5b848534640681ad74dee87e83386b2b801989769592f00a92918290030190a1505050565b60006139c66040518060400160405280601081526020017f6d6967726174696f6e4d616e6167657200000000000000000000000000000000815250614d5d565b6000613a2583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250614f3f565b600080613e0361518d565b613e0e878786614af0565b6001600160a01b038a166000818152600a602090815260409182902086518154928801516bffffffffffffffffffffffff9081166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff9282167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009586168117939093161783559388015160019092018054929094169190921681179092559397509195509293507f411edbca4a882d6fbf12b557451a9358a63f73e3011a8c712885cb1e207120dd918691613ef091614110565b8751604080519384526bffffffffffffffffffffffff92831660208501526001600160a01b038b16848201529116606083015260808201869052519081900360a00190a250505050505050565b6000613f47615202565b506001600160a01b03831660009081526009602090815260409182902082518084019093525463ffffffff81168352640100000000900460ff161515908201819052613f97578260400151613f9a565b80515b63ffffffff169150613fb682846060015163ffffffff16614f91565b949350505050565b600080613fca836141dd565b50506001600160a01b038116600090815260086020908152604080832060010180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808216909255600a909352908320805491821690556bffffffffffffffffffffffff9182169291169061404082846139cb565b905061404a61518d565b50604080516060810182526006546bffffffffffffffffffffffff80821683526c010000000000000000000000008204166020830152600160c01b900463ffffffff1691810191909152600754808311156140ab576140a882614493565b90505b6140b58184613db6565b60075560208201516140d5906bffffffffffffffffffffffff1684613a2c565b6006600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505050915091565b600081826bffffffffffffffffffffffff1614614174576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b8282016bffffffffffffffffffffffff8085169082161015613a25576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6141e56151ad565b506040805160a081018252600480546bffffffffffffffffffffffff811683526c01000000000000000000000000810463ffffffff90811660208501527001000000000000000000000000000000008204811684860152600160a01b820416606080850191909152600160c01b90910460ff1615156080840152600b5484517f46cc116a000000000000000000000000000000000000000000000000000000008152945193946000946001600160a01b03909216936346cc116a93828201939092909190829003018186803b1580156142bd57600080fd5b505afa1580156142d1573d6000803e3d6000fd5b505050506040513d60608110156142e757600080fd5b506040015190506142f661518d565b61430082846133db565b600c54604080517ffab46d660000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015282519495506000948594919091169263fab46d669260248082019391829003018186803b15801561436a57600080fd5b505afa15801561437e573d6000803e3d6000fd5b505050506040513d604081101561439457600080fd5b50805160209091015190925090506143aa6151db565b6143b5838588614fa7565b9050612e4787838584613df8565b60408051808201825263ffffffff838116808352600160208085019182526001600160a01b0388166000818152600983528790209551865493517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000009094169516949094177fffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffff1664010000000092151592909202919091179093558351908152925190927f6dfe6b1412aa34cec2188ca3d7de113a662f2cc283fec85f338571c7d52cece092908290030190a25050565b60075460208201516000906144b6906bffffffffffffffffffffffff1683613a2c565b600d54604080517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff939093166004840181905290519093506001600160a01b0390911691632e1a7d4d91602480830192600092919082900301818387803b15801561452f57600080fd5b505af1158015614543573d6000803e3d6000fd5b5050505061455a81836139cb90919063ffffffff16565b60078190559392505050565b600082156145cf576145ca61459d620186a0612770670de0b6b3a7640000866020015163ffffffff166145d890919063ffffffff16565b83516145c5908690612770906bffffffffffffffffffffffff16670de0b6b3a76400006145d8565b614f91565b613a25565b50600092915050565b6000826145e757506000611a57565b828202828482816145f457fe5b0414613a255760405162461bcd60e51b815260040180806020018281038252602181526020018061558d6021913960400191505060405180910390fd5b6000613a2583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506150f7565b61467b61518d565b50604080516060810182526006546bffffffffffffffffffffffff80821683526c010000000000000000000000008204166020830152600160c01b900463ffffffff169181019190915260808201516000901561478c576006546000906147009087906146fa90889063ffffffff600160c01b909104811690613db616565b8661515c565b60065490915061471e906bffffffffffffffffffffffff1682614110565b6bffffffffffffffffffffffff16835263ffffffff808616604085015261475790670de0b6b3a7640000906127709084908a906145d816565b6020840151909250614777906bffffffffffffffffffffffff1683614110565b6bffffffffffffffffffffffff166020840152505b935093915050565b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600e60248301527f7374616b696e6752657761726473000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b505afa158015614838573d6000803e3d6000fd5b505050506040513d602081101561484e57600080fd5b5051905090565b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600960248301527f636f6d6d69747465650000000000000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600b60248301527f64656c65676174696f6e73000000000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052601460248301527f7374616b696e675265776172647357616c6c6574000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600760248301527f7374616b696e6700000000000000000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b6003546000906001600160a01b0316331480614ac95750614ab461157b565b6001600160a01b0316336001600160a01b0316145b806139c65750614ad7610e5c565b6001600160a01b0316336001600160a01b031614905090565b614af861518d565b506001600160a01b0383166000908152600a60209081526040808320815160608101835281546bffffffffffffffffffffffff80821683526c01000000000000000000000000909104811694820185905260019092015482169281019290925284519193928392614b6a921690613db6565b9050614b82670de0b6b3a764000061277083886145d8565b8351909250614b9f906bffffffffffffffffffffffff1683614110565b6bffffffffffffffffffffffff9081168452935190931660208301529094909350909150565b614bcd6151db565b506001600160a01b0387166000908152600860209081526040808320815160808101835281546bffffffffffffffffffffffff80821683526c010000000000000000000000009182900481169583019590955260019092015480851693820193909352910490911660608201529080808915614d2a5760208401518651614c65916bffffffffffffffffffffffff9182169116613db6565b91506000614c73838a6145d8565b90506000614c818d88613f3d565b90508815614ca357614c9e620186a06127708361276a868e614631565b614ca6565b60005b92506000614cb7620186a083613db6565b9050614cd4670de0b6b3a7640000612770620186a08187866145d8565b8751909650614cf1906bffffffffffffffffffffffff1685614110565b6bffffffffffffffffffffffff90811688526040880151614d13911687614110565b6bffffffffffffffffffffffff1660408801525050505b88614d36576000614d39565b85515b6bffffffffffffffffffffffff166020850152929a91995097509095509350505050565b6003546000906001600160a01b0316614d74614a95565b80613a2557506001600160a01b03811615801590613a2557506003546040517f1ee441e900000000000000000000000000000000000000000000000000000000815260206004820181815286516024840152865133946001600160a01b031693631ee441e99389939283926044019185019080838360005b83811015614e04578181015183820152602001614dec565b50505050905090810190601f168015614e315780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b158015614e4e57600080fd5b505afa158015614e62573d6000803e3d6000fd5b505050506040513d6020811015614e7857600080fd5b50516001600160a01b0316149392505050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290614f375760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614efc578181015183820152602001614ee4565b50505050905090810190601f168015614f295780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008184841115614f375760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315614efc578181015183820152602001614ee4565b6000818310614fa05781613a25565b5090919050565b614faf6151db565b600b54604080517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152915160009384931691635f1231ea916024808301926080929190829003018186803b15801561501757600080fd5b505afa15801561502b573d6000803e3d6000fd5b505050506040513d608081101561504157600080fd5b508051602091820151600c54604080517f7c47c16d0000000000000000000000000000000000000000000000000000000081526001600160a01b03808d16600483015291519497509295506150ed948b948894859489941692637c47c16d92602480840193829003018186803b1580156150ba57600080fd5b505afa1580156150ce573d6000803e3d6000fd5b505050506040513d60208110156150e457600080fd5b50518a8a613545565b9695505050505050565b600081836151465760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315614efc578181015183820152602001614ee4565b50600083858161515257fe5b0495945050505050565b60008315613a255760006151708584614566565b90506151846301e1338061277083876145d8565b95945050505050565b604080516060810182526000808252602082018190529181019190915290565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b60408051808201909152600080825260208201529056fe72657761726420646973747269627574696f6e20697320616c726561647920646561637469766174656463616c6c6572206973206e6f742074686520656c656374696f6e7320636f6e747261637452657761726420646973747269627574696f6e206d75737420626520646561637469766174656420666f72206d6967726174696f6e6d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e2031303030303064656c656761746f725265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e206d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65636f6e7472616374206973206c6f636b656420666f722074686973206f7065726174696f6e73656e646572206973206e6f7420616e2061646d696e202872656769737472794d616e676572206f7220696e697469616c697a6174696f6e41646d696e296e657720636f6e7472616374207265676973747279206d7573742070726f76696465207468652070726576696f757320636f6e747261637420726567697374727961636365707452657761726442616c616e63654d6967726174696f6e3a207472616e73666572206661696c656472657761726420646973747269627574696f6e20697320616c72656164792061637469766174656443616c6c6572206973206e6f74207468652070656e64696e6720726567697374727941646d696e64656661756c7444656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e206d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c6573656e646572206973206e6f742074686520696e697469616c697a6174696f6e2061646d696e64656c656761746f725265776172647350657263656e744d696c6c65206d75737420626520313030303030206174206d6f737473656e646572206973206e6f74207468652066756e6374696f6e616c206d616e61676572636c61696d5374616b696e67526577617264733a20617070726f7665206661696c656473656e646572206973206e6f7420746865206d6967726174696f6e206d616e61676572536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7763616c6c6572206973206e6f74207468652064656c65676174696f6e7320636f6e7472616374746f74616c416d6f756e7420646f6573206e6f74206d617463682073756d206f662072657761726473526567697374727941646d696e3a206e657720726567697374727941646d696e20697320746865207a65726f20616464726573736d6967726174655265776172647342616c616e63653a20617070726f7665206661696c656457697468436c61696d61626c6552656769737472794d616e6167656d656e743a2063616c6c6572206973206e6f742074686520726567697374727941646d696e64656661756c7444656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e203130303030305374616b696e67526577617264733a3a656d657267656e63795769746864726177202d207472616e73666572206661696c6564a26469706673582212205f96e076940b90b2d507fdaad317547c2e2bba329ec9ee9e7b228d7792d0e5f664736f6c634300060c00336d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e2031303030303073656e646572206973206e6f7420616e2061646d696e202872656769737472794d616e676572206f7220696e697469616c697a6174696f6e41646d696e296e657720636f6e7472616374207265676973747279206d7573742070726f76696465207468652070726576696f757320636f6e747261637420726567697374727964656661756c7444656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e206d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c6573656e646572206973206e6f74207468652066756e6374696f6e616c206d616e61676572526567697374727941646d696e3a206e657720726567697374727941646d696e20697320746865207a65726f20616464726573731f5f028be638d6a0e3b8d56fd05b812ce325cc8dc73cdb0e16df94d6b2725c2e64656661756c7444656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e20313030303030000000000000000000000000d859701c81119ab12a1e62af6270ad2ae05c7ab3000000000000000000000000f1fd5233e60e7ef797025fe9dd066d60d59bcb92000000000000000000000000ff56cc6b1e6ded347aa0b7676c85ab0b3d08b0fa0000000000000000000000000000000000000000000000000000000000002ee0000000000000000000000000000000000000000000422ca8b0a00a4250000000000000000000000000000000000000000000000000000000000000000001046b000000000000000000000000000000000000000000000000000000000001046b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061032b5760003560e01c806385b4bb53116101b2578063cf309012116100f9578063e4e99222116100a2578063f83d08ba1161007c578063f83d08ba14610a3a578063fc0c546a14610a42578063fccf894014610a4a578063fcd13d6514610aa95761032b565b8063e4e9922214610a0d578063e7ca4ef314610a15578063eec0701f14610a325761032b565b8063d78cd307116100d3578063d78cd3071461093f578063dd57194914610995578063e3270e3b1461099d5761032b565b8063cf309012146108ee578063cfbe49f2146108f6578063d2523526146109375761032b565b8063a948bd311161015b578063b84a207511610135578063b84a2075146107ca578063c7b60862146108de578063cdee9fbb146108e65761032b565b8063a948bd3114610797578063acdb8e04146107ba578063adbe95b1146107c25761032b565b806396bb1fef1161018c57806396bb1fef14610761578063a4e2d63414610787578063a69df4b51461078f5761032b565b806385b4bb53146106b65780638a1f3c02146106f3578063959a4ba21461073b5761032b565b80635797f7c11161027657806362d7c7c51161021f5780637ffdd081116101f95780637ffdd0811461068557806382d716c5146106a657806383c3774e146106ae5761032b565b806362d7c7c5146105fe5780636ff1c9bc1461065757806374c16b231461067d5761032b565b80635f94cd9c116102505780635f94cd9c1461059c57806360416b7a146105a4578063616281ff146105c75761032b565b80635797f7c1146105105780635d6e9e5e146105335780635dd189ff146105705761032b565b806332f98629116102d857806339069d8c116102b257806339069d8c146104a357806346edd016146104c957806348106fe3146105085761032b565b806332f98629146103f7578063333df1541461043957806337cedbeb1461045d5761032b565b80631c7bbde5116103095780631c7bbde51461036e5780632987cea0146103c75780632a1fac72146103ef5761032b565b806313e9728f146103305780631479d34d1461034a5780631a0b2c4f14610366575b600080fd5b610338610acf565b60408051918252519081900360200190f35b610352610ad5565b604080519115158252519081900360200190f35b610352610ae5565b6103946004803603602081101561038457600080fd5b50356001600160a01b0316610b09565b6040805195865260208601949094526001600160a01b039092168484015260608401526080830152519081900360a00190f35b6103ed600480360360208110156103dd57600080fd5b50356001600160a01b0316610b5b565b005b6103ed610bd8565b6103ed600480360360a081101561040d57600080fd5b506001600160a01b03813516906020810135906040810135906060810135151590608001351515610c82565b610441610e5c565b604080516001600160a01b039092168252519081900360200190f35b6104836004803603602081101561047357600080fd5b50356001600160a01b0316610e6b565b6040805163ffffffff909316835290151560208301528051918290030190f35b6103ed600480360360208110156104b957600080fd5b50356001600160a01b0316610e90565b6104ef600480360360208110156104df57600080fd5b50356001600160a01b0316610ef3565b6040805192835260208301919091528051918290030190f35b610352610f44565b6103ed6004803603602081101561052657600080fd5b503563ffffffff16610f54565b61053b611051565b604080516bffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b6104ef6004803603604081101561058657600080fd5b506001600160a01b038135169060200135611089565b610441611178565b6103ed600480360360208110156105ba57600080fd5b503563ffffffff16611187565b6103ed600480360360408110156105dd57600080fd5b50803563ffffffff1690602001356bffffffffffffffffffffffff166112e3565b6106246004803603602081101561061457600080fd5b50356001600160a01b031661133d565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6103ed6004803603602081101561066d57600080fd5b50356001600160a01b031661139f565b61044161157b565b61068d61158a565b6040805163ffffffff9092168252519081900360200190f35b6103386115a6565b6103386115ba565b6106be6115f1565b6040805195865263ffffffff948516602087015292841685840152921660608401529015156080830152519081900360a00190f35b6103ed600480360360c081101561070957600080fd5b506001600160a01b03813581169160208101359160408201358116916060810135916080820135169060a00135611691565b6103386004803603602081101561075157600080fd5b50356001600160a01b03166119d0565b6103ed6004803603602081101561077757600080fd5b50356001600160a01b0316611a5d565b610352611ebc565b6103ed611ecc565b6103ed600480360360208110156107ad57600080fd5b503563ffffffff16611f62565b6103ed612058565b6103ed6120fd565b6103ed600480360360808110156107e057600080fd5b8101906020810181356401000000008111156107fb57600080fd5b82018360208201111561080d57600080fd5b8035906020019184602083028401116401000000008311171561082f57600080fd5b91939092909160208101903564010000000081111561084d57600080fd5b82018360208201111561085f57600080fd5b8035906020019184602083028401116401000000008311171561088157600080fd5b91939092909160208101903564010000000081111561089f57600080fd5b8201836020820111156108b157600080fd5b803590602001918460208302840111640100000000831117156108d357600080fd5b9193509150356121f8565b61033861264d565b61068d612776565b610352612789565b6108fe612799565b60405180836bffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff1681526020019250505060405180910390f35b6103ed6128bf565b6109656004803603602081101561095557600080fd5b50356001600160a01b0316612947565b604080516bffffffffffffffffffffffff9485168152928416602084015292168183015290519081900360600190f35b61068d612985565b6103ed600480360360208110156109b357600080fd5b8101906020810181356401000000008111156109ce57600080fd5b8201836020820111156109e057600080fd5b80359060200191846020830284011164010000000083111715610a0257600080fd5b5090925090506129a5565b610441612e50565b6103ed60048036036020811015610a2b57600080fd5b5035612e5f565b6103ed612f88565b6103ed61308a565b610441613126565b610a7060048036036020811015610a6057600080fd5b50356001600160a01b0316613135565b604080516bffffffffffffffffffffffff9586168152938516602085015291841683830152909216606082015290519081900360800190f35b6103ed60048036036020811015610abf57600080fd5b50356001600160a01b031661317c565b60075481565b600454600160c01b900460ff1690565b600080546001600160a01b0316610afa6132fc565b6001600160a01b031614905090565b6000806000806000610b1961518d565b600080610b268942613300565b825160408401516020909401516bffffffffffffffffffffffff9182169e9482169d50929b5090911698509650945050505050565b610b63610ae5565b610b9e5760405162461bcd60e51b81526004018080602001828103825260408152602001806156566040913960400191505060405180910390fd5b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610be0610e5c565b6001600160a01b0316336001600160a01b031614610c2f5760405162461bcd60e51b81526004018080602001828103825260268152602001806154ca6026913960400191505060405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040517f2a2b3ea974fb057582c3b210ef8b5f81492d15673f49d4384bfa3b896a964c3c90600090a1565b600354600160a01b900460ff1615610ccb5760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b600b546001600160a01b03163314610d145760405162461bcd60e51b81526004018080602001828103825260248152602001806152446024913960400191505060405180910390fd5b600c54604080517f7c47c16d0000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015291516000939290921691637c47c16d91602480820192602092909190829003018186803b158015610d7e57600080fd5b505afa158015610d92573d6000803e3d6000fd5b505050506040513d6020811015610da857600080fd5b50519050610db46151ad565b506040805160a0810182526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811693830193909352600160a01b81049092166060820152600160c01b90910460ff1615156080820152610e3661518d565b610e4086836133db565b9050610e518886868a878688613545565b505050505050505050565b6002546001600160a01b031690565b60096020526000908152604090205463ffffffff811690640100000000900460ff1682565b610e98610e5c565b6001600160a01b0316336001600160a01b031614610ee75760405162461bcd60e51b81526004018080602001828103825260268152602001806154ca6026913960400191505060405180910390fd5b610ef0816136ac565b50565b600080610efe61518d565b610f088442613300565b50509050610f146151db565b610f1e8542613764565b505091516040909201516bffffffffffffffffffffffff92831696921694509092505050565b6002546001600160a01b03161590565b610f5c613986565b610f975760405162461bcd60e51b81526004018080602001828103825260248152602001806155236024913960400191505060405180910390fd5b620186a08163ffffffff161115610fdf5760405162461bcd60e51b815260040180806020018281038252604681526020018061529d6046913960600191505060405180910390fd5b6004805463ffffffff8316600160a01b81027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff9092169190911790915560408051918252517f41b601885e44600c749e03dfecdd2ff57bd9468338f4248162dcaf7172bad67b9181900360200190a150565b6006546bffffffffffffffffffffffff808216916c01000000000000000000000000810490911690600160c01b900463ffffffff1683565b6000806110946151db565b61109e8542613764565b505090506110aa61518d565b6110b48642613300565b505090506110c06151db565b6110d3876110ce42896139cb565b613764565b505090506110df61518d565b6110f2886110ed428a6139cb565b613300565b505083518151919250611116916bffffffffffffffffffffffff9081169116613a2c565b6bffffffffffffffffffffffff16955061115d84604001516bffffffffffffffffffffffff1683604001516bffffffffffffffffffffffff16613a2c90919063ffffffff16565b6bffffffffffffffffffffffff169450505050509250929050565b6001546001600160a01b031690565b61118f613986565b6111ca5760405162461bcd60e51b81526004018080602001828103825260248152602001806155236024913960400191505060405180910390fd5b620186a08163ffffffff1611156112125760405162461bcd60e51b815260040180806020018281038252604a815260200180615696604a913960600191505060405180910390fd5b60045463ffffffff600160a01b909104811690821611156112645760405162461bcd60e51b815260040180806020018281038252606b81526020018061545f606b913960800191505060405180910390fd5b6004805463ffffffff831670010000000000000000000000000000000081027fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff9092169190911790915560408051918252517f4d041e13c20fbec9dc54635af5ae0619f090f19f1f49046da068970e606741509181900360200190a150565b6112eb613986565b6113265760405162461bcd60e51b81526004018080602001828103825260248152602001806155236024913960400191505060405180910390fd5b61132e613ad0565b506113398282613beb565b5050565b60008060008060008061134e6151db565b60008061135b8a42613764565b6040830151606084015184516020909501516bffffffffffffffffffffffff9283169e509082169c509381169a509098509091169550935050505091939550919395565b6113a7613d76565b6113e25760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b604080513381526001600160a01b0383166020820152815183927ff5b6d8b404f034718f55a370884db03c4e27e9652e2636d4adcd0540d7c4203f928290030190a1806001600160a01b031663a9059cbb33836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561148157600080fd5b505afa158015611495573d6000803e3d6000fd5b505050506040513d60208110156114ab57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561151457600080fd5b505af1158015611528573d6000803e3d6000fd5b505050506040513d602081101561153e57600080fd5b50516113395760405162461bcd60e51b81526004018080602001828103825260338152602001806156e06033913960400191505060405180910390fd5b6000546001600160a01b031690565b6004546c01000000000000000000000000900463ffffffff1690565b6004546bffffffffffffffffffffffff1690565b6000806115c5612799565b9150506115eb600754826bffffffffffffffffffffffff16613db690919063ffffffff16565b91505090565b60008060008060006116016151ad565b50506040805160a0810182526004546bffffffffffffffffffffffff81168083526c01000000000000000000000000820463ffffffff9081166020850181905270010000000000000000000000000000000084048216958501869052600160a01b840490911660608501819052600160c01b90930460ff1615156080909401849052909890975092955093509150565b600354600160a01b900460ff16156116da5760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b600c546001600160a01b031633146117235760405162461bcd60e51b81526004018080602001828103825260268152602001806155ae6026913960400191505060405180910390fd5b61172b6151ad565b506040805160a081018252600480546bffffffffffffffffffffffff8116835263ffffffff6c010000000000000000000000008204811660208501527001000000000000000000000000000000008204811684860152600160a01b820416606084015260ff600160c01b909104161515608080840191909152600b5484517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038c8116948201949094529451939460009485948594931692635f1231ea9260248082019391829003018186803b15801561180d57600080fd5b505afa158015611821573d6000803e3d6000fd5b505050506040513d608081101561183757600080fd5b5080516020820151606090920151909450909250905061185561518d565b61185f82866133db565b90506118696151db565b6118788c8687878f878c613545565b90506118868a8a8e84613df8565b8b6001600160a01b0316886001600160a01b0316146119c257600b54604080517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116600483015291519190921691635f1231ea916024808301926080929190829003018186803b15801561190557600080fd5b505afa158015611919573d6000803e3d6000fd5b505050506040513d608081101561192f57600080fd5b5080516020820151606090920151909650909450925061194d6151db565b61195c898788888c888d613545565b516001600160a01b038c166000908152600a6020526040902080546bffffffffffffffffffffffff9092166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff909216919091179055505b505050505050505050505050565b6040805160a0810182526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811693830193909352600160a01b81049092166060820152600160c01b90910460ff1615156080820152600090611a57908390613f3d565b92915050565b600354600160a01b900460ff1615611aa65760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b600080611ab283613fbe565b90925090506000611ac382846139cb565b905080611ad257505050610ef0565b6001600160a01b038416600090815260086020526040812060010154611b16906c0100000000000000000000000090046bffffffffffffffffffffffff1685614110565b6001600160a01b0386166000908152600860209081526040808320600190810180546bffffffffffffffffffffffff8088166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff90921691909117909155600a90935290832001549293509091611b9c911685614110565b6001600160a01b038781166000908152600a6020908152604080832060010180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff8716179055600554600e5482517f095ea7b30000000000000000000000000000000000000000000000000000000081529086166004820152602481018a905291519596509093169363095ea7b393604480820194918390030190829087803b158015611c5757600080fd5b505af1158015611c6b573d6000803e3d6000fd5b505050506040513d6020811015611c8157600080fd5b5051611cbe5760405162461bcd60e51b81526004018080602001828103825260238152602001806155476023913960400191505060405180910390fd5b604080516001808252818301909252606091602080830190803683370190505090508681600081518110611cee57fe5b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526060918160200160208202803683370190505090508481600081518110611d3957fe5b602090810291909101810191909152600e546040517f19d6a88d000000000000000000000000000000000000000000000000000000008152600481018881526060602483019081528651606484015286516001600160a01b03909416946319d6a88d948b948994899490939092604483019260840191878101910280838360005b83811015611dd2578181015183820152602001611dba565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015611e11578181015183820152602001611df9565b5050505090500195505050505050600060405180830381600087803b158015611e3957600080fd5b505af1158015611e4d573d6000803e3d6000fd5b505060408051898152602081018b90526bffffffffffffffffffffffff808816828401528816606082015290516001600160a01b038c1693507f5f51e0cd4567b63928e199868f571929625ded3459b724759a0eb8edbf94158b92509081900360800190a25050505050505050565b600354600160a01b900460ff1690565b611ed4613d76565b611f0f5760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556040517f19aad37188a1d3921e29eb3c66acf43d81975e107cb650d58cca878627955fd690600090a1565b600354600160a01b900460ff1615611fab5760405162461bcd60e51b815260040180806020018281038252602581526020018061533f6025913960400191505060405180910390fd5b620186a08163ffffffff161115611ff35760405162461bcd60e51b81526004018080602001828103825260338152602001806154f06033913960400191505060405180910390fd5b60045463ffffffff600160a01b909104811690821611156120455760405162461bcd60e51b815260040180806020018281038252605c8152602001806152e3605c913960600191505060405180910390fd5b61204e336141dd565b610ef033826143c3565b612060610ae5565b61209b5760405162461bcd60e51b81526004018080602001828103825260408152602001806156566040913960400191505060405180910390fd5b600080546040516001600160a01b03909116907f1f5f028be638d6a0e3b8d56fd05b812ce325cc8dc73cdb0e16df94d6b2725c2e908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b612105613d76565b6121405760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600454600160c01b900460ff166121885760405162461bcd60e51b815260040180806020018281038252602a81526020018061521a602a913960400191505060405180910390fd5b61219061518d565b612198613ad0565b600480547fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff16905590506121cb81614493565b506040517f9a68ce2011fec09202b5443f4484b1983ef6ad49111f730f49a65924f539d0e290600090a150565b6000805b8781101561224f5761224585858381811061221357fe5b9050602002013561223f89898581811061222957fe5b90506020020135856139cb90919063ffffffff16565b906139cb565b91506001016121fc565b5080821461228e5760405162461bcd60e51b81526004018080602001828103825260298152602001806155d46029913960400191505060405180910390fd5b811561236e57600554604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561230757600080fd5b505af115801561231b573d6000803e3d6000fd5b505050506040513d602081101561233157600080fd5b505161236e5760405162461bcd60e51b815260040180806020018281038252602d8152602001806153e3602d913960400191505060405180910390fd5b60005b878110156125b9576123d987878381811061238857fe5b90506020020135600860008c8c8681811061239f57fe5b602090810292909201356001600160a01b0316835250810191909152604001600020600101546bffffffffffffffffffffffff1690614110565b600860008b8b858181106123e957fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060010160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506124a785858381811061245957fe5b90506020020135600a60008c8c8681811061247057fe5b602090810292909201356001600160a01b0316835250810191909152604001600020546bffffffffffffffffffffffff1690614110565b600a60008b8b858181106124b757fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060000160006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555088888281811061252457fe5b905060200201356001600160a01b03166001600160a01b03167f3dc5ad7d2bcb290b59b40c376a1ba37e1dff2af15e74a8628e54890dcb02b5c13389898581811061256b57fe5b9050602002013588888681811061257e57fe5b9050602002013560405180846001600160a01b03168152602001838152602001828152602001935050505060405180910390a2600101612371565b506007546125c790836139cb565b6007556006546125f5906c0100000000000000000000000090046bffffffffffffffffffffffff1683614110565b600680546bffffffffffffffffffffffff929092166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff9092169190911790555050505050505050565b600080600b60009054906101000a90046001600160a01b03166001600160a01b03166346cc116a6040518163ffffffff1660e01b815260040160606040518083038186803b15801561269e57600080fd5b505afa1580156126b2573d6000803e3d6000fd5b505050506040513d60608110156126c857600080fd5b50604090810151815160a0810183526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811694830194909452600160a01b81049093166060820152600160c01b90920460ff161515608083015291506115eb90670de0b6b3a76400009061277090620186a09061276a908690614566565b906145d8565b90614631565b600454600160a01b900463ffffffff1690565b600354600160a01b900460ff1681565b6000806000600b60009054906101000a90046001600160a01b03166001600160a01b03166346cc116a6040518163ffffffff1660e01b815260040160606040518083038186803b1580156127ec57600080fd5b505afa158015612800573d6000803e3d6000fd5b505050506040513d606081101561281657600080fd5b5060400151905061282561518d565b6040805160a0810182526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811693830193909352600160a01b81049092166060820152600160c01b90910460ff16151560808201526128ab9083904290614673565b508051602090910151909590945092505050565b6001546001600160a01b031633146129085760405162461bcd60e51b81526004018080602001828103825260278152602001806154386027913960400191505060405180910390fd5b60015461291d906001600160a01b03166136ac565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600a60205260009081526040902080546001909101546bffffffffffffffffffffffff808316926c0100000000000000000000000090048116911683565b600454700100000000000000000000000000000000900463ffffffff1690565b600454600160c01b900460ff16156129ee5760405162461bcd60e51b81526004018080602001828103825260358152602001806152686035913960400191505060405180910390fd5b60006129f8614794565b90506001600160a01b038116301415612a58576040805162461bcd60e51b815260206004820152601f60248201527f4e6577207265776172647320636f6e7472616374206973206e6f742073657400604482015290519081900360640190fd5b600060608367ffffffffffffffff81118015612a7357600080fd5b50604051908082528060200260200182016040528015612a9d578160200160208202803683370190505b50905060608467ffffffffffffffff81118015612ab957600080fd5b50604051908082528060200260200182016040528015612ae3578160200160208202803683370190505b50905060005b85811015612b8c57612b15878783818110612b0057fe5b905060200201356001600160a01b0316613fbe565b848381518110612b2157fe5b60200260200101848481518110612b3457fe5b6020026020010182815250828152505050612b82828281518110612b5457fe5b602002602001015161223f858481518110612b6b57fe5b6020026020010151876139cb90919063ffffffff16565b9350600101612ae9565b50600554604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152602482018790529151919092169163095ea7b39160448083019260209291908290030181600087803b158015612bfc57600080fd5b505af1158015612c10573d6000803e3d6000fd5b505050506040513d6020811015612c2657600080fd5b5051612c635760405162461bcd60e51b81526004018080602001828103825260258152602001806156316025913960400191505060405180910390fd5b836001600160a01b031663b84a207587878585886040518663ffffffff1660e01b81526004018080602001806020018060200185815260200184810384528989828181526020019250602002808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018681038552895181528951602091820193828c0193509102908190849084905b83811015612d1d578181015183820152602001612d05565b50505050905001848103825286818151815260200191508051906020019060200280838360005b83811015612d5c578181015183820152602001612d44565b5050505090500198505050505050505050600060405180830381600087803b158015612d8757600080fd5b505af1158015612d9b573d6000803e3d6000fd5b5050505060005b85811015612e4757868682818110612db657fe5b905060200201356001600160a01b03166001600160a01b03167f854216b077fbbbb1ec8c23db47ba2b21ceae54d75f2998d6b1ac80ee9881c83f848381518110612dfc57fe5b6020026020010151848481518110612e1057fe5b60209081029190910181015160408051938452918301526001600160a01b03891682820152519081900360600190a2600101612da2565b50505050505050565b6003546001600160a01b031690565b612e67613d76565b612ea25760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600454600160c01b900460ff1615612eeb5760405162461bcd60e51b81526004018080602001828103825260288152602001806154106028913960400191505060405180910390fd5b600680547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b63ffffffff8416810291909117909155600480547fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff1690911790556040805182815290517f5a5cf98385bad94fae95d7079332030d7467c9a9ae3a8178d183290a5018398e916020908290030190a150565b612f90614855565b600b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055612fd06148e5565b600c80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055613010614975565b600d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055613050614a05565b600e80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b613092613d76565b6130cd5760405162461bcd60e51b815260040180806020018281038252602381526020018061556a6023913960400191505060405180910390fd5b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b1790556040517f0f2e5b6c72c6a4491efd919a9f9a409f324ef0708c11ee57d410c2cb06c0992b90600090a1565b6005546001600160a01b031681565b600860205260009081526040902080546001909101546bffffffffffffffffffffffff808316926c0100000000000000000000000090819004821692808316929190041684565b613184614a95565b6131bf5760405162461bcd60e51b815260040180806020018281038252603e815260200180615364603e913960400191505060405180910390fd5b600354604080517f078cbb7c00000000000000000000000000000000000000000000000000000000815290516001600160a01b039283169284169163078cbb7c916004808301926020929190829003018186803b15801561321f57600080fd5b505afa158015613233573d6000803e3d6000fd5b505050506040513d602081101561324957600080fd5b50516001600160a01b0316146132905760405162461bcd60e51b81526004018080602001828103825260418152602001806153a26041913960600191505060405180910390fd5b600380546001600160a01b0383167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517ffea2d033438b968078a6264409d0104b5f3d2ce7b795afc74918e70f3534f22b9181900360200190a150565b3390565b61330861518d565b600c54604080517ffab46d660000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152825160009485948594939091169263fab46d669260248083019392829003018186803b15801561337157600080fd5b505afa158015613385573d6000803e3d6000fd5b505050506040513d604081101561339b57600080fd5b50805160209091015190935090506133b16151db565b6133bb8487613764565b505090506133ca878383614af0565b919995985090965093945050505050565b6133e361518d565b816080015161343b5750604080516060810182526006546bffffffffffffffffffffffff80821683526c010000000000000000000000008204166020830152600160c01b900463ffffffff1691810191909152611a57565b6000613448844285614673565b81516006805460208086015160408088015163ffffffff16600160c01b027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff9384166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff949098167fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090961686179390931696909617919091169490941790925582518481529182015281519395509193507f5830b366dc4564bf14d32116f14c979ac2c150a96b7c6b99bea717e6990d56ba92918290030190a15092915050565b61354d6151db565b60008060006135618b8b8b8b8b8b8b614bc5565b6001600160a01b038f1660008181526008602090815260409182902087518154928901517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009384166bffffffffffffffffffffffff928316177fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff9081166c010000000000000000000000009284168302178455948a01516001909301805460608c0151951693831693841790951693909116908102929092179092559599509397509195509350917f3880098574881d40bf7b9775086fdc9e6d6edac939d881add769581473c84b4591869161365691614110565b87518a51604080519485526bffffffffffffffffffffffff9384166020860152918316848301526060840187905291909116608083015260a08201869052519081900360c00190a2505050979650505050505050565b6001600160a01b0381166136f15760405162461bcd60e51b81526004018080602001828103825260348152602001806155fd6034913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f1f5f028be638d6a0e3b8d56fd05b812ce325cc8dc73cdb0e16df94d6b2725c2e91a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61376c6151db565b6000806137776151ad565b506040805160a081018252600480546bffffffffffffffffffffffff8116835263ffffffff6c010000000000000000000000008204811660208501527001000000000000000000000000000000008204811684860152600160a01b820416606084015260ff600160c01b909104161515608080840191909152600b5484517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116948201949094529451939460009485948594931692635f1231ea9260248082019391829003018186803b15801561385957600080fd5b505afa15801561386d573d6000803e3d6000fd5b505050506040513d608081101561388357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190505050935050925092506000600c60009054906101000a90046001600160a01b03166001600160a01b0316637c47c16d8b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561391d57600080fd5b505afa158015613931573d6000803e3d6000fd5b505050506040513d602081101561394757600080fd5b5051905061395361518d565b61395e838b88614673565b5090506139708b86878786868c614bc5565b929e909d50919b50909950505050505050505050565b60006139c66040518060400160405280601181526020017f66756e6374696f6e616c4d616e61676572000000000000000000000000000000815250614d5d565b905090565b600082820183811015613a25576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600081826bffffffffffffffffffffffff1614613a90576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b613a2583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250614e8b565b613ad861518d565b600b54604080517f46cc116a00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916346cc116a916004808301926060929190829003018186803b158015613b3657600080fd5b505afa158015613b4a573d6000803e3d6000fd5b505050506040513d6060811015613b6057600080fd5b50604090810151815160a0810183526004546bffffffffffffffffffffffff811682526c01000000000000000000000000810463ffffffff90811660208401527001000000000000000000000000000000008204811694830194909452600160a01b81049093166060820152600160c01b90920460ff161515608083015291506115eb9082906133db565b613bf36151ad565b506040805160a0810182526004805463ffffffff7001000000000000000000000000000000008083048216858701819052600160a01b808504841660608801819052600160c01b80870460ff16151560808a01819052958c166020808b018290526bffffffffffffffffffffffff8d16808c527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090991689177fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c010000000000000000000000008302177fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff1695909602949094177fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff1691909202177fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff16930292909217909355845190815291820152825191927fca8985ddc364f44d5b848534640681ad74dee87e83386b2b801989769592f00a92918290030190a1505050565b60006139c66040518060400160405280601081526020017f6d6967726174696f6e4d616e6167657200000000000000000000000000000000815250614d5d565b6000613a2583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250614f3f565b600080613e0361518d565b613e0e878786614af0565b6001600160a01b038a166000818152600a602090815260409182902086518154928801516bffffffffffffffffffffffff9081166c01000000000000000000000000027fffffffffffffffff000000000000000000000000ffffffffffffffffffffffff9282167fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009586168117939093161783559388015160019092018054929094169190921681179092559397509195509293507f411edbca4a882d6fbf12b557451a9358a63f73e3011a8c712885cb1e207120dd918691613ef091614110565b8751604080519384526bffffffffffffffffffffffff92831660208501526001600160a01b038b16848201529116606083015260808201869052519081900360a00190a250505050505050565b6000613f47615202565b506001600160a01b03831660009081526009602090815260409182902082518084019093525463ffffffff81168352640100000000900460ff161515908201819052613f97578260400151613f9a565b80515b63ffffffff169150613fb682846060015163ffffffff16614f91565b949350505050565b600080613fca836141dd565b50506001600160a01b038116600090815260086020908152604080832060010180547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808216909255600a909352908320805491821690556bffffffffffffffffffffffff9182169291169061404082846139cb565b905061404a61518d565b50604080516060810182526006546bffffffffffffffffffffffff80821683526c010000000000000000000000008204166020830152600160c01b900463ffffffff1691810191909152600754808311156140ab576140a882614493565b90505b6140b58184613db6565b60075560208201516140d5906bffffffffffffffffffffffff1684613a2c565b6006600001600c6101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550505050915091565b600081826bffffffffffffffffffffffff1614614174576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b8282016bffffffffffffffffffffffff8085169082161015613a25576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6141e56151ad565b506040805160a081018252600480546bffffffffffffffffffffffff811683526c01000000000000000000000000810463ffffffff90811660208501527001000000000000000000000000000000008204811684860152600160a01b820416606080850191909152600160c01b90910460ff1615156080840152600b5484517f46cc116a000000000000000000000000000000000000000000000000000000008152945193946000946001600160a01b03909216936346cc116a93828201939092909190829003018186803b1580156142bd57600080fd5b505afa1580156142d1573d6000803e3d6000fd5b505050506040513d60608110156142e757600080fd5b506040015190506142f661518d565b61430082846133db565b600c54604080517ffab46d660000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015282519495506000948594919091169263fab46d669260248082019391829003018186803b15801561436a57600080fd5b505afa15801561437e573d6000803e3d6000fd5b505050506040513d604081101561439457600080fd5b50805160209091015190925090506143aa6151db565b6143b5838588614fa7565b9050612e4787838584613df8565b60408051808201825263ffffffff838116808352600160208085019182526001600160a01b0388166000818152600983528790209551865493517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000009094169516949094177fffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffff1664010000000092151592909202919091179093558351908152925190927f6dfe6b1412aa34cec2188ca3d7de113a662f2cc283fec85f338571c7d52cece092908290030190a25050565b60075460208201516000906144b6906bffffffffffffffffffffffff1683613a2c565b600d54604080517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff939093166004840181905290519093506001600160a01b0390911691632e1a7d4d91602480830192600092919082900301818387803b15801561452f57600080fd5b505af1158015614543573d6000803e3d6000fd5b5050505061455a81836139cb90919063ffffffff16565b60078190559392505050565b600082156145cf576145ca61459d620186a0612770670de0b6b3a7640000866020015163ffffffff166145d890919063ffffffff16565b83516145c5908690612770906bffffffffffffffffffffffff16670de0b6b3a76400006145d8565b614f91565b613a25565b50600092915050565b6000826145e757506000611a57565b828202828482816145f457fe5b0414613a255760405162461bcd60e51b815260040180806020018281038252602181526020018061558d6021913960400191505060405180910390fd5b6000613a2583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506150f7565b61467b61518d565b50604080516060810182526006546bffffffffffffffffffffffff80821683526c010000000000000000000000008204166020830152600160c01b900463ffffffff169181019190915260808201516000901561478c576006546000906147009087906146fa90889063ffffffff600160c01b909104811690613db616565b8661515c565b60065490915061471e906bffffffffffffffffffffffff1682614110565b6bffffffffffffffffffffffff16835263ffffffff808616604085015261475790670de0b6b3a7640000906127709084908a906145d816565b6020840151909250614777906bffffffffffffffffffffffff1683614110565b6bffffffffffffffffffffffff166020840152505b935093915050565b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600e60248301527f7374616b696e6752657761726473000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b505afa158015614838573d6000803e3d6000fd5b505050506040513d602081101561484e57600080fd5b5051905090565b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600960248301527f636f6d6d69747465650000000000000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600b60248301527f64656c65676174696f6e73000000000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052601460248301527f7374616b696e675265776172647357616c6c6574000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b600354604080517f35817773000000000000000000000000000000000000000000000000000000008152602060048201819052600760248301527f7374616b696e6700000000000000000000000000000000000000000000000000604483015291516000936001600160a01b03169263358177739260648082019391829003018186803b15801561482457600080fd5b6003546000906001600160a01b0316331480614ac95750614ab461157b565b6001600160a01b0316336001600160a01b0316145b806139c65750614ad7610e5c565b6001600160a01b0316336001600160a01b031614905090565b614af861518d565b506001600160a01b0383166000908152600a60209081526040808320815160608101835281546bffffffffffffffffffffffff80821683526c01000000000000000000000000909104811694820185905260019092015482169281019290925284519193928392614b6a921690613db6565b9050614b82670de0b6b3a764000061277083886145d8565b8351909250614b9f906bffffffffffffffffffffffff1683614110565b6bffffffffffffffffffffffff9081168452935190931660208301529094909350909150565b614bcd6151db565b506001600160a01b0387166000908152600860209081526040808320815160808101835281546bffffffffffffffffffffffff80821683526c010000000000000000000000009182900481169583019590955260019092015480851693820193909352910490911660608201529080808915614d2a5760208401518651614c65916bffffffffffffffffffffffff9182169116613db6565b91506000614c73838a6145d8565b90506000614c818d88613f3d565b90508815614ca357614c9e620186a06127708361276a868e614631565b614ca6565b60005b92506000614cb7620186a083613db6565b9050614cd4670de0b6b3a7640000612770620186a08187866145d8565b8751909650614cf1906bffffffffffffffffffffffff1685614110565b6bffffffffffffffffffffffff90811688526040880151614d13911687614110565b6bffffffffffffffffffffffff1660408801525050505b88614d36576000614d39565b85515b6bffffffffffffffffffffffff166020850152929a91995097509095509350505050565b6003546000906001600160a01b0316614d74614a95565b80613a2557506001600160a01b03811615801590613a2557506003546040517f1ee441e900000000000000000000000000000000000000000000000000000000815260206004820181815286516024840152865133946001600160a01b031693631ee441e99389939283926044019185019080838360005b83811015614e04578181015183820152602001614dec565b50505050905090810190601f168015614e315780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b158015614e4e57600080fd5b505afa158015614e62573d6000803e3d6000fd5b505050506040513d6020811015614e7857600080fd5b50516001600160a01b0316149392505050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290614f375760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614efc578181015183820152602001614ee4565b50505050905090810190601f168015614f295780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008184841115614f375760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315614efc578181015183820152602001614ee4565b6000818310614fa05781613a25565b5090919050565b614faf6151db565b600b54604080517f5f1231ea0000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152915160009384931691635f1231ea916024808301926080929190829003018186803b15801561501757600080fd5b505afa15801561502b573d6000803e3d6000fd5b505050506040513d608081101561504157600080fd5b508051602091820151600c54604080517f7c47c16d0000000000000000000000000000000000000000000000000000000081526001600160a01b03808d16600483015291519497509295506150ed948b948894859489941692637c47c16d92602480840193829003018186803b1580156150ba57600080fd5b505afa1580156150ce573d6000803e3d6000fd5b505050506040513d60208110156150e457600080fd5b50518a8a613545565b9695505050505050565b600081836151465760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315614efc578181015183820152602001614ee4565b50600083858161515257fe5b0495945050505050565b60008315613a255760006151708584614566565b90506151846301e1338061277083876145d8565b95945050505050565b604080516060810182526000808252602082018190529181019190915290565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b60408051808201909152600080825260208201529056fe72657761726420646973747269627574696f6e20697320616c726561647920646561637469766174656463616c6c6572206973206e6f742074686520656c656374696f6e7320636f6e747261637452657761726420646973747269627574696f6e206d75737420626520646561637469766174656420666f72206d6967726174696f6e6d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e2031303030303064656c656761746f725265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e206d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65636f6e7472616374206973206c6f636b656420666f722074686973206f7065726174696f6e73656e646572206973206e6f7420616e2061646d696e202872656769737472794d616e676572206f7220696e697469616c697a6174696f6e41646d696e296e657720636f6e7472616374207265676973747279206d7573742070726f76696465207468652070726576696f757320636f6e747261637420726567697374727961636365707452657761726442616c616e63654d6967726174696f6e3a207472616e73666572206661696c656472657761726420646973747269627574696f6e20697320616c72656164792061637469766174656443616c6c6572206973206e6f74207468652070656e64696e6720726567697374727941646d696e64656661756c7444656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e206d617844656c656761746f72735374616b696e675265776172647350657263656e744d696c6c6573656e646572206973206e6f742074686520696e697469616c697a6174696f6e2061646d696e64656c656761746f725265776172647350657263656e744d696c6c65206d75737420626520313030303030206174206d6f737473656e646572206973206e6f74207468652066756e6374696f6e616c206d616e61676572636c61696d5374616b696e67526577617264733a20617070726f7665206661696c656473656e646572206973206e6f7420746865206d6967726174696f6e206d616e61676572536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7763616c6c6572206973206e6f74207468652064656c65676174696f6e7320636f6e7472616374746f74616c416d6f756e7420646f6573206e6f74206d617463682073756d206f662072657761726473526567697374727941646d696e3a206e657720726567697374727941646d696e20697320746865207a65726f20616464726573736d6967726174655265776172647342616c616e63653a20617070726f7665206661696c656457697468436c61696d61626c6552656769737472794d616e6167656d656e743a2063616c6c6572206973206e6f742074686520726567697374727941646d696e64656661756c7444656c656761746f72735374616b696e675265776172647350657263656e744d696c6c65206d757374206e6f74206265206c6172676572207468616e203130303030305374616b696e67526577617264733a3a656d657267656e63795769746864726177202d207472616e73666572206661696c6564a26469706673582212205f96e076940b90b2d507fdaad317547c2e2bba329ec9ee9e7b228d7792d0e5f664736f6c634300060c0033

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

000000000000000000000000d859701c81119ab12a1e62af6270ad2ae05c7ab3000000000000000000000000f1fd5233e60e7ef797025fe9dd066d60d59bcb92000000000000000000000000ff56cc6b1e6ded347aa0b7676c85ab0b3d08b0fa0000000000000000000000000000000000000000000000000000000000002ee0000000000000000000000000000000000000000000422ca8b0a00a4250000000000000000000000000000000000000000000000000000000000000000001046b000000000000000000000000000000000000000000000000000000000001046b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _contractRegistry (address): 0xD859701C81119aB12A1e62AF6270aD2AE05c7AB3
Arg [1] : _registryAdmin (address): 0xf1fD5233E60E7Ef797025FE9DD066d60d59BcB92
Arg [2] : _token (address): 0xff56Cc6b1E6dEd347aA0B7676C85AB0B3D08B0FA
Arg [3] : annualRateInPercentMille (uint32): 12000
Arg [4] : annualCap (uint96): 80000000000000000000000000
Arg [5] : defaultDelegatorsStakingRewardsPercentMille (uint32): 66667
Arg [6] : maxDelegatorsStakingRewardsPercentMille (uint32): 66667
Arg [7] : previousRewardsContract (address): 0x0000000000000000000000000000000000000000

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000d859701c81119ab12a1e62af6270ad2ae05c7ab3
Arg [1] : 000000000000000000000000f1fd5233e60e7ef797025fe9dd066d60d59bcb92
Arg [2] : 000000000000000000000000ff56cc6b1e6ded347aa0b7676c85ab0b3d08b0fa
Arg [3] : 0000000000000000000000000000000000000000000000000000000000002ee0
Arg [4] : 000000000000000000000000000000000000000000422ca8b0a00a4250000000
Arg [5] : 000000000000000000000000000000000000000000000000000000000001046b
Arg [6] : 000000000000000000000000000000000000000000000000000000000001046b
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000000


Deployed Bytecode Sourcemap

64696:51915:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;65444:44;;;:::i;:::-;;;;;;;;;;;;;;;;87937:131;;;:::i;:::-;;;;;;;;;;;;;;;;;;52053:110;;;:::i;74497:580::-;;;;;;;;;;;;;;;;-1:-1:-1;74497:580:0;-1:-1:-1;;;;;74497:580:0;;:::i;:::-;;;;;;;;;;;;;;-1:-1:-1;;;;;74497:580:0;;;;;;;;;;;;;;;;;;;;;;;;53614:146;;;;;;;;;;;;;;;;-1:-1:-1;53614:146:0;-1:-1:-1;;;;;53614:146:0;;:::i;:::-;;55140:159;;;:::i;79923:597::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;79923:597:0;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;54945:107::-;;;:::i;:::-;;;;-1:-1:-1;;;;;54945:107:0;;;;;;;;;;;;;;65889:73;;;;;;;;;;;;;;;;-1:-1:-1;65889:73:0;-1:-1:-1;;;;;65889:73:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;61014:154;;;;;;;;;;;;;;;;-1:-1:-1;61014:154:0;-1:-1:-1;;;;;61014:154:0;;:::i;68943:489::-;;;;;;;;;;;;;;;;-1:-1:-1;68943:489:0;-1:-1:-1;;;;;68943:489:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;55359:123;;;:::i;85856:494::-;;;;;;;;;;;;;;;;-1:-1:-1;85856:494:0;;;;:::i;65389:46::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;75701:899;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;75701:899:0;;;;;;;;:::i;54128:110::-;;;:::i;84487:752::-;;;;;;;;;;;;;;;;-1:-1:-1;84487:752:0;;;;:::i;86973:257::-;;;;;;;;;;;;;;;;-1:-1:-1;86973:257:0;;;;;;;;;;;:::i;73046:710::-;;;;;;;;;;;;;;;;-1:-1:-1;73046:710:0;-1:-1:-1;;;;;73046:710:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;93451:328;;;;;;;;;;;;;;;;-1:-1:-1;93451:328:0;-1:-1:-1;;;;;93451:328:0;;:::i;51607:95::-;;;:::i;87376:150::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;87659:123;;;:::i;78282:266::-;;;:::i;88603:786::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81500:1341;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;81500:1341:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;77752:244::-;;;;;;;;;;;;;;;;-1:-1:-1;77752:244:0;-1:-1:-1;;;;;77752:244:0;;:::i;69850:1125::-;;;;;;;;;;;;;;;;-1:-1:-1;69850:1125:0;-1:-1:-1;;;;;69850:1125:0;;:::i;63721:90::-;;;:::i;63481:116::-;;;:::i;76883:610::-;;;;;;;;;;;;;;;;-1:-1:-1;76883:610:0;;;;:::i;52557:182::-;;;:::i;83745:446::-;;;:::i;91742:1409::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;91742:1409:0;-1:-1:-1;91742:1409:0;;:::i;78761:316::-;;;:::i;86529:166::-;;;:::i;62446:18::-;;;:::i;71393:541::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53866:183;;;:::i;66112:75::-;;;;;;;;;;;;;;;;-1:-1:-1;66112:75:0;-1:-1:-1;;;;;66112:75:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;85422:174;;;:::i;89810:1259::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;89810:1259:0;;-1:-1:-1;89810:1259:0;-1:-1:-1;89810:1259:0;:::i;60884:122::-;;;:::i;83167:365::-;;;;;;;;;;;;;;;;-1:-1:-1;83167:365:0;;:::i;116275:333::-;;;:::i;63155:111::-;;;:::i;65208:19::-;;;:::i;65678:73::-;;;;;;;;;;;;;;;;-1:-1:-1;65678:73:0;-1:-1:-1;;;;;65678:73:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60344:394;;;;;;;;;;;;;;;;-1:-1:-1;60344:394:0;-1:-1:-1;;;;;60344:394:0;;:::i;65444:44::-;;;;:::o;87937:131::-;88029:8;:31;-1:-1:-1;;;88029:31:0;;;;;87937:131::o;52053:110::-;52101:4;52141:14;;-1:-1:-1;;;;;52141:14:0;52125:12;:10;:12::i;:::-;-1:-1:-1;;;;;52125:30:0;;52118:37;;52053:110;:::o;74497:580::-;74598:15;74624;74650:16;74677:36;74724:37;74781:38;;:::i;:::-;74821:17;74840:38;74882:54;74909:9;74920:15;74882:26;:54::i;:::-;74955:15;;74972;;;;75000:36;;;;;74947:122;;;;;;;;;-1:-1:-1;74780:156:0;;-1:-1:-1;74947:122:0;;;;-1:-1:-1;74947:122:0;-1:-1:-1;74497:580:0;-1:-1:-1;;;;;74497:580:0:o;53614:146::-;51851:17;:15;:17::i;:::-;51843:94;;;;-1:-1:-1;;;51843:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53712:21:::1;:40:::0;;;::::1;-1:-1:-1::0;;;;;53712:40:0;;;::::1;::::0;;;::::1;::::0;;53614:146::o;55140:159::-;54758:21;:19;:21::i;:::-;-1:-1:-1;;;;;54744:35:0;:10;-1:-1:-1;;;;;54744:35:0;;54736:86;;;;-1:-1:-1;;;54736:86:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55218:20:::1;:33:::0;;;::::1;::::0;;55267:24:::1;::::0;::::1;::::0;55249:1:::1;::::0;55267:24:::1;55140:159::o:0;79923:597::-;63865:6;;-1:-1:-1;;;63865:6:0;;;;63864:7;63856:57;;;;-1:-1:-1;;;63856:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;68280:17:::1;::::0;-1:-1:-1;;;;;68280:17:0::1;68258:10;:40;68250:89;;;;-1:-1:-1::0;;;68250:89:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;80158:19:::2;::::0;:47:::2;::::0;;;;;-1:-1:-1;;;;;80158:47:0;;::::2;;::::0;::::2;::::0;;;80133:22:::2;::::0;80158:19;;;::::2;::::0;:37:::2;::::0;:47;;;;;::::2;::::0;;;;;;;;;:19;:47;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;80158:47:0;;-1:-1:-1;80218:25:0::2;;:::i;:::-;-1:-1:-1::0;80218:36:0::2;::::0;;::::2;::::0;::::2;::::0;;80246:8:::2;80218:36:::0;::::2;::::0;::::2;::::0;;;;::::2;;::::0;;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;::::0;;;;;;;-1:-1:-1;;;80218:36:0;::::2;::::0;;::::2;::::0;;;;-1:-1:-1;;;80218:36:0;;::::2;;;;;::::0;;;;80265:47:::2;;:::i;:::-;80315:59;80342:20;80364:9;80315:26;:59::i;:::-;80265:109;;80385:127;80415:8;80425:11;80438:16;80456:6;80464:14;80480:20;80502:9;80385:29;:127::i;:::-;;68352:1;;;79923:597:::0;;;;;:::o;54945:107::-;55024:20;;-1:-1:-1;;;;;55024:20:0;54945:107;:::o;65889:73::-;;;;;;;;;;;;;;;;;;;;;;:::o;61014:154::-;54758:21;:19;:21::i;:::-;-1:-1:-1;;;;;54744:35:0;:10;-1:-1:-1;;;;;54744:35:0;;54736:86;;;;-1:-1:-1;;;54736:86:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61117:43:::1;61145:14;61117:27;:43::i;:::-;61014:154:::0;:::o;68943:489::-;69023:38;69063:37;69114:54;;:::i;:::-;69174:49;69201:4;69207:15;69174:26;:49::i;:::-;69113:110;;;;69235:52;;:::i;:::-;69293:48;69319:4;69325:15;69293:25;:48::i;:::-;-1:-1:-1;;69360:31:0;;69393:30;;;;;69352:72;;;;;;;;-1:-1:-1;68943:489:0;;-1:-1:-1;;;68943:489:0:o;55359:123::-;55440:20;;-1:-1:-1;;;;;55440:20:0;:34;55359:123;:::o;85856:494::-;56522:21;:19;:21::i;:::-;56514:70;;;;-1:-1:-1;;;56514:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;64871:6:::1;86013:39;:62;;;;86005:145;;;;-1:-1:-1::0;;;86005:145:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86161:8;:90:::0;;::::1;::::0;::::1;-1:-1:-1::0;;;86161:90:0;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;;86267:75:::1;::::0;;;;;;::::1;::::0;;;;::::1;::::0;;::::1;85856:494:::0;:::o;65389:46::-;;;;;;;;;;;;;;;-1:-1:-1;;;65389:46:0;;;;;:::o;75701:899::-;75796:40;75838:39;75891:48;;:::i;:::-;75945;75971:4;75977:15;75945:25;:48::i;:::-;75890:103;;;;76005:50;;:::i;:::-;76061:49;76088:4;76094:15;76061:26;:49::i;:::-;76004:106;;;;76122:51;;:::i;:::-;76179:62;76205:4;76211:29;:15;76231:8;76211:19;:29::i;:::-;76179:25;:62::i;:::-;76121:120;;;;76253:53;;:::i;:::-;76312:63;76339:4;76345:29;:15;76365:8;76345:19;:29::i;:::-;76312:26;:63::i;:::-;-1:-1:-1;;76458:27:0;;76423:30;;76252:123;;-1:-1:-1;76423:63:0;;;:34;;;;:63;:34;:63::i;:::-;76388:98;;;;76531:61;76565:18;:26;;;76531:61;;:21;:29;;;:33;;;;:61;;;;:::i;:::-;76497:95;;;;75701:899;;;;;;;;;:::o;54128:110::-;54207:21;;-1:-1:-1;;;;;54207:21:0;54128:110;:::o;84487:752::-;56522:21;:19;:21::i;:::-;56514:70;;;;-1:-1:-1;;;56514:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;64871:6:::1;84652:43;:66;;;;84644:153;;;;-1:-1:-1::0;;;84644:153:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84863:8;:48:::0;::::1;-1:-1:-1::0;;;84863:48:0;;::::1;::::0;::::1;84816:95:::0;;::::1;;;84808:215;;;;-1:-1:-1::0;;;84808:215:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;85034:8;:98:::0;;::::1;::::0;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;;85148:83:::1;::::0;;;;;;::::1;::::0;;;;::::1;::::0;;::::1;84487:752:::0;:::o;86973:257::-;56522:21;:19;:21::i;:::-;56514:70;;;;-1:-1:-1;;;56514:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;87112:27:::1;:25;:27::i;:::-;;87157:65;87186:24;87212:9;87157:28;:65::i;:::-;86973:257:::0;;:::o;73046:710::-;73145:15;73171;73197:32;73240:37;73288:35;73334:36;73390:37;;:::i;:::-;73429;73468:38;73510:52;73536:8;73546:15;73510:25;:52::i;:::-;73581:15;;;;73598;;;;73615:32;;73681:35;;;;;73573:175;;;;;-1:-1:-1;73573:175:0;;;;-1:-1:-1;73573:175:0;;;;-1:-1:-1;73389:173:0;;-1:-1:-1;73573:175:0;;;;-1:-1:-1;73389:173:0;-1:-1:-1;;;;73046:710:0;;;;;;;:::o;93451:328::-;56382:20;:18;:20::i;:::-;56374:68;;;;-1:-1:-1;;;56374:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;93588:48:::1;::::0;;93608:10:::1;93588:48:::0;;-1:-1:-1;;;;;93588:48:0;::::1;;::::0;::::1;::::0;;;93566:5;;93588:48:::1;::::0;;;;;;::::1;93655:6;-1:-1:-1::0;;;;;93655:15:0::1;;93671:10;93683:6;-1:-1:-1::0;;;;;93683:16:0::1;;93708:4;93683:31;;;;;;;;;;;;;-1:-1:-1::0;;;;;93683:31:0::1;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;93683:31:0;93655:60:::1;::::0;;;::::1;::::0;;;;;;-1:-1:-1;;;;;93655:60:0;;::::1;;::::0;::::1;::::0;;;;;;;;;;;;;;93683:31:::1;::::0;93655:60;;;;;;;-1:-1:-1;93655:60:0;;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;93655:60:0;93647:124:::1;;;;-1:-1:-1::0;;;93647:124:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;51607:95:::0;51653:7;51680:14;-1:-1:-1;;;;;51680:14:0;51607:95;:::o;87376:150::-;87485:8;:33;;;;;;;87376:150::o;87659:123::-;87756:8;:18;;;87659:123;:::o;78282:266::-;78364:17;78397:30;78431:24;:22;:24::i;:::-;78394:61;;;78473:67;78510:29;;78481:23;78473:32;;:36;;:67;;;;:::i;:::-;78466:74;;;78282:266;:::o;88603:786::-;88668:28;88707:43;88761:50;88822:46;88879:27;88925:25;;:::i;:::-;-1:-1:-1;;88925:36:0;;;;;;;;88953:8;88925:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;88925:36:0;;;;;;;;;;;-1:-1:-1;;;88925:36:0;;;;;;;;;;;;;;;;;;-1:-1:-1;88925:36:0;;-1:-1:-1;88925:36:0;-1:-1:-1;88925:36:0;-1:-1:-1;88603:786:0:o;81500:1341::-;63865:6;;-1:-1:-1;;;63865:6:0;;;;63864:7;63856:57;;;;-1:-1:-1;;;63856:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;68445:19:::1;::::0;-1:-1:-1;;;;;68445:19:0::1;68423:10;:42;68415:93;;;;-1:-1:-1::0;;;68415:93:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81749:25:::2;;:::i;:::-;-1:-1:-1::0;81749:36:0::2;::::0;;::::2;::::0;::::2;::::0;;81777:8:::2;81749:36:::0;;::::2;::::0;::::2;::::0;;::::2;::::0;;::::2;::::0;::::2;;::::0;::::2;::::0;;;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;81749:36:0;::::2;;::::0;;;;::::2;-1:-1:-1::0;;;81749:36:0;;::::2;;;;::::0;;;;;;;;81865:17:::2;::::0;:41;;;;;-1:-1:-1;;;;;81865:41:0;;::::2;::::0;;::::2;::::0;;;;;;81749:36;;-1:-1:-1;;;;;;81865:17:0;::::2;::::0;:31:::2;::::0;:41;;;;;;;;;;;:17;:41;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;81865:41:0;;::::2;::::0;::::2;::::0;;;;;;;;-1:-1:-1;81865:41:0;;-1:-1:-1;81865:41:0;-1:-1:-1;81919:47:0::2;;:::i;:::-;81969:59;81996:20;82018:9;81969:26;:59::i;:::-;81919:109;;82039:52;;:::i;:::-;82094:130;82124:8;82134:11;82147;82160:6;82168:22;82192:20;82214:9;82094:29;:130::i;:::-;82039:185;;82235:91;82266:9;82277:14;82293:8;82303:22;82235:30;:91::i;:::-;82359:8;-1:-1:-1::0;;;;;82343:24:0::2;:12;-1:-1:-1::0;;;;;82343:24:0::2;;82339:495;;82432:17;::::0;:45:::2;::::0;;;;;-1:-1:-1;;;;;82432:45:0;;::::2;;::::0;::::2;::::0;;;:17;;;::::2;::::0;:31:::2;::::0;:45;;;;;::::2;::::0;;;;;;;;:17;:45;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;82432:45:0;;::::2;::::0;::::2;::::0;;;;;;;;-1:-1:-1;82432:45:0;;-1:-1:-1;82432:45:0;-1:-1:-1;82492:56:0::2;;:::i;:::-;82551:138;82581:12;82595:11;82608;82621:6;82629:26;82657:20;82679:9;82551:29;:138::i;:::-;82771:51:::0;-1:-1:-1;;;;;82704:35:0;::::2;82771:51;82704:35:::0;;;:24:::2;:35;::::0;;;;:118;;::::2;::::0;;::::2;::::0;::::2;::::0;;;::::2;::::0;;;::::2;::::0;;-1:-1:-1;82339:495:0::2;68521:1;;;;;;81500:1341:::0;;;;;;:::o;77752:244::-;77920:68;;;;;;;;77979:8;77920:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;77920:68:0;;;;;;;;;-1:-1:-1;;;77920:68:0;;;;;;;;;;;-1:-1:-1;;77920:68:0;;77969:8;;77920:48;:68::i;:::-;77913:75;77752:244;-1:-1:-1;;77752:244:0:o;69850:1125::-;63865:6;;-1:-1:-1;;;63865:6:0;;;;63864:7;63856:57;;;;-1:-1:-1;;;63856:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69938:23:::1;69963:24:::0;69991:32:::1;70018:4;69991:26;:32::i;:::-;69937:86:::0;;-1:-1:-1;69937:86:0;-1:-1:-1;70034:13:0::1;70050:37;69937:86:::0;;70050:20:::1;:37::i;:::-;70034:53:::0;-1:-1:-1;70102:10:0;70098:49:::1;;70129:7;;;;;70098:49;-1:-1:-1::0;;;;;70191:29:0;::::1;70159;70191::::0;;;:23:::1;:29;::::0;;;;:37:::1;;::::0;:58:::1;::::0;:37;;::::1;;;70233:15:::0;70191:41:::1;:58::i;:::-;-1:-1:-1::0;;;;;70260:29:0;::::1;;::::0;;;:23:::1;:29;::::0;;;;;;;:37:::1;::::0;;::::1;:62:::0;;::::1;::::0;;::::1;::::0;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;;70366:24:::1;:30:::0;;;;;;:38:::1;::::0;70159:90;;-1:-1:-1;70260:29:0;;70366:60:::1;::::0;:38:::1;70409:16:::0;70366:42:::1;:60::i;:::-;-1:-1:-1::0;;;;;70437:30:0;;::::1;;::::0;;;:24:::1;:30;::::0;;;;;;;:38:::1;;:64:::0;;;::::1;;::::0;::::1;;::::0;;70522:5:::1;::::0;70544:15:::1;::::0;70522:46;;;;;70544:15;;::::1;70522:46;::::0;::::1;::::0;;;;;;;;;70437:64;;-1:-1:-1;70522:5:0;;::::1;::::0;:13:::1;::::0;:46;;;;;;;;;;;;;:5;:46;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;70522:46:0;70514:94:::1;;;;-1:-1:-1::0;;;70514:94:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;70646:16;::::0;;70660:1:::1;70646:16:::0;;;;;::::1;::::0;;;70621:22:::1;::::0;70646:16:::1;::::0;;::::1;::::0;;::::1;::::0;::::1;;::::0;-1:-1:-1;70646:16:0::1;70621:41;;70684:4;70673:5;70679:1;70673:8;;;;;;;;-1:-1:-1::0;;;;;70673:15:0;;;::::1;:8;::::0;;::::1;::::0;;;;;;;:15;70726:16:::1;::::0;;70740:1:::1;70726:16:::0;;;;;::::1;::::0;;;70699:24:::1;::::0;70726:16:::1;;;;;;;;;;;::::0;-1:-1:-1;70726:16:0::1;70699:43;;70766:5;70753:7;70761:1;70753:10;;;;;;;;;::::0;;::::1;::::0;;;;;;:18;;;;70782:15:::1;::::0;:56:::1;::::0;;;;::::1;::::0;::::1;::::0;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;70782:15:0;;::::1;::::0;:33:::1;::::0;70816:5;;70823;;70830:7;;70782:56;;;;;;;;;;;;;::::1;::::0;::::1;::::0;;;:15:::1;:56;;;;;;;::::0;;::::1;::::0;;;::::1;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;;::::1;::::0;;;::::1;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;70856:111:0::1;::::0;;;;;::::1;::::0;::::1;::::0;;;::::1;::::0;;::::1;::::0;;;;;::::1;::::0;;;;;;-1:-1:-1;;;;;70856:111:0;::::1;::::0;-1:-1:-1;70856:111:0::1;::::0;-1:-1:-1;70856:111:0;;;;;;;::::1;63926:1;;;;;;;69850:1125:::0;:::o;63721:90::-;63797:6;;-1:-1:-1;;;63797:6:0;;;;;63721:90::o;63481:116::-;56382:20;:18;:20::i;:::-;56374:68;;;;-1:-1:-1;;;56374:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;63549:6:::1;:14:::0;;;::::1;::::0;;63579:10:::1;::::0;::::1;::::0;63558:5:::1;::::0;63579:10:::1;63481:116::o:0;76883:610::-;63865:6;;-1:-1:-1;;;63865:6:0;;;;63864:7;63856:57;;;;-1:-1:-1;;;63856:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;64871:6:::1;77029:28;:51;;;;77021:115;;;;-1:-1:-1::0;;;77021:115:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;77187:8;:48:::0;::::1;-1:-1:-1::0;;;77187:48:0;;::::1;::::0;::::1;77155:80:::0;;::::1;;;77147:185;;;;-1:-1:-1::0;;;77147:185:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;77343:41;77373:10;77343:29;:41::i;:::-;77395:90;77444:10;77456:28;77395:48;:90::i;52557:182::-:0;51851:17;:15;:17::i;:::-;51843:94;;;;-1:-1:-1;;;51843:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;52690:1:::1;52666:14:::0;;52636:57:::1;::::0;-1:-1:-1;;;;;52666:14:0;;::::1;::::0;52636:57:::1;::::0;52690:1;;52636:57:::1;52729:1;52704:27:::0;;;::::1;::::0;;52557:182::o;83745:446::-;56382:20;:18;:20::i;:::-;56374:68;;;;-1:-1:-1;;;56374:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83843:8:::1;:31:::0;-1:-1:-1;;;83843:31:0;::::1;;;83835:86;;;;-1:-1:-1::0;;;83835:86:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83934:47;;:::i;:::-;83984:27;:25;:27::i;:::-;84024:8;:39:::0;;;::::1;::::0;;83934:77;-1:-1:-1;84076:58:0::1;83934:77:::0;84076:36:::1;:58::i;:::-;-1:-1:-1::0;84152:31:0::1;::::0;::::1;::::0;;;::::1;56455:1;83745:446::o:0;91742:1409::-;91960:20;92002:6;91997:173;92014:16;;;91997:173;;;92067:91;92123:31;;92155:1;92123:34;;;;;;;;;;;;;92067:51;92084:30;;92115:1;92084:33;;;;;;;;;;;;;92067:12;:16;;:51;;;;:::i;:::-;:55;;:91::i;:::-;92052:106;-1:-1:-1;92032:3:0;;91997:173;;;;92205:12;92190:11;:27;92182:81;;;;-1:-1:-1;;;92182:81:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;92280:15;;92276:164;;92320:5;;:58;;;;;;92339:10;92320:58;;;;92359:4;92320:58;;;;;;;;;;;;-1:-1:-1;;;;;92320:5:0;;;;:18;;:58;;;;;;;;;;;;;;;:5;;:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;92320:58:0;92312:116;;;;-1:-1:-1;;;92312:116:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;92457:6;92452:484;92469:16;;;92452:484;;;92551:80;92597:30;;92628:1;92597:33;;;;;;;;;;;;;92551:23;:33;92575:5;;92581:1;92575:8;;;;;;;;;;;;;;;;-1:-1:-1;;;;;92575:8:0;92551:33;;-1:-1:-1;92551:33:0;;;;;;;;-1:-1:-1;92551:33:0;:41;;;;;;:45;:80::i;:::-;92507:23;:33;92531:5;;92537:1;92531:8;;;;;;;;;;;;;-1:-1:-1;;;;;92531:8:0;-1:-1:-1;;;;;92507:33:0;-1:-1:-1;;;;;92507:33:0;;;;;;;;;;;;:41;;;:124;;;;;;;;;;;;;;;;;;92691:82;92738:31;;92770:1;92738:34;;;;;;;;;;;;;92691:24;:34;92716:5;;92722:1;92716:8;;;;;;;;;;;;;;;;-1:-1:-1;;;;;92716:8:0;92691:34;;-1:-1:-1;92691:34:0;;;;;;;;-1:-1:-1;92691:34:0;:42;;;;:46;:82::i;:::-;92646:24;:34;92671:5;;92677:1;92671:8;;;;;;;;;;;;;-1:-1:-1;;;;;92671:8:0;-1:-1:-1;;;;;92646:34:0;-1:-1:-1;;;;;92646:34:0;;;;;;;;;;;;:42;;;:127;;;;;;;;;;;;;;;;;;92844:5;;92850:1;92844:8;;;;;;;;;;;;;-1:-1:-1;;;;;92844:8:0;-1:-1:-1;;;;;92793:131:0;;92832:10;92854:30;;92885:1;92854:33;;;;;;;;;;;;;92889:31;;92921:1;92889:34;;;;;;;;;;;;;92793:131;;;;-1:-1:-1;;;;;92793:131:0;;;;;;;;;;;;;;;;;;;;;;;;;;;92487:3;;92452:484;;;-1:-1:-1;92980:29:0;;:46;;93014:11;92980:33;:46::i;:::-;92948:29;:78;93083:19;:43;:60;;:43;;;;;93131:11;93083:47;:60::i;:::-;93037:19;:106;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;91742:1409:0:o;78761:316::-;78845:18;78881:25;78910:17;;;;;;;;;-1:-1:-1;;;;;78910:17:0;-1:-1:-1;;;;;78910:35:0;;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;78910:37:0;;;;;78971:57;;;;;;;79019:8;78971:57;;;;;;;;;;;;;78910:37;78971:57;;;;;;;;;;;;;;;-1:-1:-1;;;78971:57:0;;;;;78910:37;78971:57;;;-1:-1:-1;;;78971:57:0;;;;;;;;;;;78910:37;-1:-1:-1;78971:98:0;;64914:4;;78971:82;;64871:6;;78971:57;;78910:37;;78971:25;:57::i;:::-;:61;;:82::i;:::-;:86;;:98::i;86529:166::-;86639:8;:48;-1:-1:-1;;;86639:48:0;;;;;86529:166::o;62446:18::-;;;-1:-1:-1;;;62446:18:0;;;;;:::o;71393:541::-;71467:30;71508;71562:25;71591:17;;;;;;;;;-1:-1:-1;;;;;71591:17:0;-1:-1:-1;;;;;71591:35:0;;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;71591:37:0;;;;-1:-1:-1;71640:47:0;;:::i;:::-;71692:72;;;;;;;;71755:8;71692:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;71692:72:0;;;;;;;;;-1:-1:-1;;;71692:72:0;;;;;;;;;;;;;71716:20;;71738:15;;71692:23;:72::i;:::-;-1:-1:-1;71801:44:0;;71882;;;;;71801;;71882;;-1:-1:-1;71393:541:0;-1:-1:-1;;;71393:541:0:o;53866:183::-;53345:21;;-1:-1:-1;;;;;53345:21:0;53331:10;:35;53323:87;;;;-1:-1:-1;;;53323:87:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53974:21:::1;::::0;53946:50:::1;::::0;-1:-1:-1;;;;;53974:21:0::1;53946:27;:50::i;:::-;54007:21;:34:::0;;;::::1;::::0;;53866:183::o;66112:75::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;85422:174::-;85536:8;:52;;;;;;;85422:174::o;89810:1259::-;89905:8;:31;-1:-1:-1;;;89905:31:0;;;;89904:32;89896:98;;;;-1:-1:-1;;;89896:98:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;90007:38;90064:27;:25;:27::i;:::-;90007:85;-1:-1:-1;;;;;;90111:48:0;;90154:4;90111:48;;90103:92;;;;;-1:-1:-1;;;90103:92:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;90208:19;90242:32;90291:5;90277:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;90277:27:0;-1:-1:-1;90242:62:0;-1:-1:-1;90315:33:0;90365:5;90351:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;90351:27:0;;90315:63;;90394:6;90389:236;90406:16;;;90389:236;;;90488:36;90515:5;;90521:1;90515:8;;;;;;;;;;;;;-1:-1:-1;;;;;90515:8:0;90488:26;:36::i;:::-;90445:15;90461:1;90445:18;;;;;;;;;;;;;90465:16;90482:1;90465:19;;;;;;;;;;;;;90444:80;;;;;;;;;;90553:60;90593:16;90610:1;90593:19;;;;;;;;;;;;;;90553:35;90569:15;90585:1;90569:18;;;;;;;;;;;;;;90553:11;:15;;:35;;;;:::i;:60::-;90539:74;-1:-1:-1;90424:3:0;;90389:236;;;-1:-1:-1;90645:5:0;;:59;;;;;;-1:-1:-1;;;;;90645:59:0;;;;;;;;;;;;;;;:5;;;;;:13;;:59;;;;;;;;;;;;;;:5;;:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;90645:59:0;90637:109;;;;-1:-1:-1;;;90637:109:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;90757:22;-1:-1:-1;;;;;90757:52:0;;90810:5;;90817:15;90834:16;90852:11;90757:107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;90757:107:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;90882:6;90877:185;90894:16;;;90877:185;;;90967:5;;90973:1;90967:8;;;;;;;;;;;;;-1:-1:-1;;;;;90967:8:0;-1:-1:-1;;;;;90937:113:0;;90977:15;90993:1;90977:18;;;;;;;;;;;;;;90997:16;91014:1;90997:19;;;;;;;;;;;;;;;;;;;90937:113;;;;;;;;;;-1:-1:-1;;;;;90937:113:0;;;;;;;;;;;;;;;90912:3;;90877:185;;;;89810:1259;;;;;;:::o;60884:122::-;60982:16;;-1:-1:-1;;;;;60982:16:0;60884:122;:::o;83167:365::-;56382:20;:18;:20::i;:::-;56374:68;;;;-1:-1:-1;;;56374:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83278:8:::1;:31:::0;-1:-1:-1;;;83278:31:0;::::1;;;83277:32;83269:85;;;;-1:-1:-1::0;;;83269:85:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83367:19;:52:::0;;;::::1;-1:-1:-1::0;;;83367:52:0::1;::::0;::::1;::::0;::::1;::::0;;;::::1;::::0;;;83430:8:::1;:38:::0;;;::::1;::::0;;::::1;::::0;;83486::::1;::::0;;;;;;;::::1;::::0;::::1;::::0;;;;;;::::1;83167:365:::0;:::o;116275:333::-;116363:22;:20;:22::i;:::-;116332:17;:54;;;;-1:-1:-1;;;;;116332:54:0;;;;;;;;;;116432:24;:22;:24::i;:::-;116397:19;:60;;;;-1:-1:-1;;;;;116397:60:0;;;;;;;;;;116507:25;:23;:25::i;:::-;116468:20;:65;;;;-1:-1:-1;;;;;116468:65:0;;;;;;;;;;116579:20;:18;:20::i;:::-;116544:15;:56;;;;-1:-1:-1;;;;;116544:56:0;;;;;;;;;;116275:333::o;63155:111::-;56382:20;:18;:20::i;:::-;56374:68;;;;-1:-1:-1;;;56374:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;63221:6:::1;:13:::0;;;::::1;-1:-1:-1::0;;;63221:13:0::1;::::0;;63250:8:::1;::::0;::::1;::::0;63221:13;;63250:8:::1;63155:111::o:0;65208:19::-;;;-1:-1:-1;;;;;65208:19:0;;:::o;65678:73::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;60344:394::-;56227:9;:7;:9::i;:::-;56219:84;;;;-1:-1:-1;;;56219:84:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60518:16:::1;::::0;60457:49:::1;::::0;;;;;;;-1:-1:-1;;;;;60518:16:0;;::::1;::::0;60457:47;::::1;::::0;::::1;::::0;:49:::1;::::0;;::::1;::::0;::::1;::::0;;;;;;;;:47;:49;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;60457:49:0;-1:-1:-1;;;;;60457:78:0::1;;60449:156;;;;-1:-1:-1::0;;;60449:156:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60616:16;:38:::0;;-1:-1:-1;;;;;60616:38:0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;60670:60:::1;::::0;;;;;;::::1;::::0;;;;::::1;::::0;;::::1;60344:394:::0;:::o;50352:106::-;50440:10;50352:106;:::o;107983:622::-;108081:54;;:::i;:::-;108274:19;;:48;;;;;;-1:-1:-1;;;;;108274:48:0;;;;;;;;;108137:16;;;;;;108274:19;;;;;:37;;:48;;;;;;;;;;;:19;:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;108274:48:0;;;;;;;;;-1:-1:-1;108274:48:0;-1:-1:-1;108334:52:0;;:::i;:::-;108392:48;108418:8;108428:11;108392:25;:48::i;:::-;108333:107;;;;108519:78;108547:9;108558:14;108574:22;108519:27;:78::i;:::-;108453:144;;107983:622;;-1:-1:-1;108453:144:0;;-1:-1:-1;107983:622:0;;-1:-1:-1;;;;;107983:622:0:o;96798:586::-;96908:47;;:::i;:::-;96973:9;:32;;;96968:92;;-1:-1:-1;97022:26:0;;;;;;;;97029:19;97022:26;;;;;;;;;;;;;;;-1:-1:-1;;;97022:26:0;;;;;;;;;;;;;96968:92;97072:21;97147:73;97171:20;97193:15;97210:9;97147:23;:73::i;:::-;97231:42;;:19;:42;;;;;;;;;;;;;;-1:-1:-1;;;97231:42:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;97289:87;;;;;;;;;;;97104:116;;-1:-1:-1;97104:116:0;;-1:-1:-1;97289:87:0;;;;;;;;;96798:586;;;;;:::o;103550:1096::-;103797:52;;:::i;:::-;103862:35;103908:36;103955:37;104120:140;104147:8;104157:11;104170:16;104188:14;104204:22;104228:20;104250:9;104120:26;:140::i;:::-;-1:-1:-1;;;;;104271:33:0;;;;;;:23;:33;;;;;;;;;:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;104271:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;104003:257:0;;-1:-1:-1;104003:257:0;;-1:-1:-1;104003:257:0;-1:-1:-1;104271:33:0;104345:293;;104003:257;;104415:66;;:34;:66::i;:::-;104483:47;;104563:44;;104345:293;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;103550:1096;;;;;;;;;;;;:::o;52856:309::-;-1:-1:-1;;;;;52947:30:0;;52939:95;;;;-1:-1:-1;;;52939:95:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53080:14;;;53050:63;;-1:-1:-1;;;;;53050:63:0;;;;53080:14;;;53050:63;;;53124:14;:33;;;;-1:-1:-1;;;;;53124:33:0;;;;;;;;;;52856:309::o;101718:871::-;101814:52;;:::i;:::-;101868:36;101906:37;101956:25;;:::i;:::-;-1:-1:-1;101956:36:0;;;;;;;;101984:8;101956:36;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;101956:36:0;;;;;;;;-1:-1:-1;;;101956:36:0;;;;;;;;;;;;;;102081:17;;:41;;;;;-1:-1:-1;;;;;102081:41:0;;;;;;;;;;;;101956:36;;-1:-1:-1;;;;;;102081:17:0;;;:31;;:41;;;;;;;;;;;:17;:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;102005:117;;;;;;;102133:30;102166:19;;;;;;;;;-1:-1:-1;;;;;102166:19:0;-1:-1:-1;;;;;102166:37:0;;102204:8;102166:47;;;;;;;;;;;;;-1:-1:-1;;;;;102166:47:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;102166:47:0;;-1:-1:-1;102227:47:0;;:::i;:::-;102279:69;102303:20;102325:11;102338:9;102279:23;:69::i;:::-;102226:122;;;102446:135;102473:8;102483:11;102496;102509:14;102525:22;102549:20;102571:9;102446:26;:135::i;:::-;102359:222;;;;-1:-1:-1;102359:222:0;;-1:-1:-1;101718:871:0;;-1:-1:-1;;;;;;;;;;101718:871:0:o;57602:116::-;57656:4;57680:30;;;;;;;;;;;;;;;;;;:9;:30::i;:::-;57673:37;;57602:116;:::o;956:181::-;1014:7;1046:5;;;1070:6;;;;1062:46;;;;;-1:-1:-1;;;1062:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;1128:1;956:181;-1:-1:-1;;;956:181:0:o;6849:219::-;6906:6;6955:1;6948;6933:18;;:23;6925:66;;;;;-1:-1:-1;;;6925:66:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;7009:51;7013:1;7023;7009:51;;;;;;;;;;;;;;;;;:3;:51::i;97725:269::-;97779:47;;:::i;:::-;97873:17;;:37;;;;;;;;97844:25;;-1:-1:-1;;;;;97873:17:0;;:35;;:37;;;;;;;;;;;;;;:17;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;97873:37:0;;;;;97928:58;;;;;;;97977:8;97928:58;;;;;;;;;;;;;97873:37;97928:58;;;;;;;;;;;;;;;-1:-1:-1;;;97928:58:0;;;;;97873:37;97928:58;;;-1:-1:-1;;;97928:58:0;;;;;;;;;;;97873:37;-1:-1:-1;97928:58:0;;97873:37;;97928:26;:58::i;112496:383::-;112604:25;;:::i;:::-;-1:-1:-1;112604:36:0;;;;;;;;112632:8;112604:36;;;;;;;;;;;;;;;-1:-1:-1;;;112604:36:0;;;;;;;;;;;-1:-1:-1;;;112604:36:0;;;;;;;;;;;;;112651:61;;;112604:36;;;;112651:61;;;112604:36;112723:31;;;;;112765:20;;;;;;;;112604:36;112765:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;112803:68;;;;;;;;;;;112604:36;;112803:68;;;;;;;;;112496:383;;;:::o;57419:114::-;57472:4;57496:29;;;;;;;;;;;;;;;;;;:9;:29::i;1420:136::-;1478:7;1505:43;1509:1;1512;1505:43;;;;;;;;;;;;;;;;;:3;:43::i;109120:831::-;109294:36;109341:37;109389:54;;:::i;:::-;109543:78;109571:9;109582:14;109598:22;109543:27;:78::i;:::-;-1:-1:-1;;;;;109632:35:0;;;;;;:24;:35;;;;;;;;;:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;109454:167;;-1:-1:-1;109454:167:0;;-1:-1:-1;109454:167:0;;-1:-1:-1;109711:232:0;;109454:167;;109784:68;;:35;:68::i;:::-;109864:47;;109711:232;;;;;;;;;;;;;;-1:-1:-1;;;;;109711:232:0;;;;;;;;;;;;;;;;;;;;;;;;;;;109120:831;;;;;;;:::o;111138:573::-;111263:41;111317:46;;:::i;:::-;-1:-1:-1;;;;;;111366:33:0;;;;;;:23;:33;;;;;;;;;111317:82;;;;;;;;;;;;;;;;;;;;;;;;;;;111447:144;;111538:9;:53;;;111447:144;;;111482:53;;111447:144;111410:181;;;;111609:94;111618:33;111653:9;:49;;;111609:94;;:8;:94::i;:::-;111602:101;111138:573;-1:-1:-1;;;;111138:573:0:o;113956:1016::-;114023:23;114048:24;114085:35;114115:4;114085:29;:35::i;:::-;-1:-1:-1;;;;;;;114151:29:0;;;;;;:23;:29;;;;;;;;:37;;;;114199:41;;;;;;;114272:24;:30;;;;;;:38;;114321:42;;;;;114151:37;;;;;114272:38;;;114392:37;114272:38;114151:37;114392:20;:37::i;:::-;114376:53;;114442:47;;:::i;:::-;-1:-1:-1;114442:69:0;;;;;;;;114492:19;114442:69;;;;;;;;;;;;;;;-1:-1:-1;;;114442:69:0;;;;;;;;;;;114565:29;;114609:38;;;114605:162;;;114697:58;114734:20;114697:36;:58::i;:::-;114664:91;;114605:162;114811:41;:30;114846:5;114811:34;:41::i;:::-;114779:29;:73;114909:44;;;;:55;;:48;;114958:5;114909:48;:55::i;:::-;114863:19;:43;;;:101;;;;;;;;;;;;;;;;;;113956:1016;;;;;;:::o;6314:260::-;6371:6;6420:1;6413;6398:18;;:23;6390:63;;;;;-1:-1:-1;;;6390:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;6475:13;;;6507:6;;;;;;;;;6499:46;;;;;-1:-1:-1;;;6499:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;110229:655;110306:25;;:::i;:::-;-1:-1:-1;110306:36:0;;;;;;;;110334:8;110306:36;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;110306:36:0;;;;;;;;;;;-1:-1:-1;;;110306:36:0;;;;;;;;;;;110389:17;;:37;;;;;;;110306:36;;-1:-1:-1;;;;;;;110389:17:0;;;;:35;;:37;;;;110306:36;;110389:37;;;;;;;;:17;:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;110389:37:0;;;;-1:-1:-1;110437:47:0;;:::i;:::-;110487:59;110514:20;110536:9;110487:26;:59::i;:::-;110601:19;;:48;;;;;;-1:-1:-1;;;;;110601:48:0;;;;;;;;;110437:109;;-1:-1:-1;110560:16:0;;;;110601:19;;;;;:37;;:48;;;;;;;;;;;:19;:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;110601:48:0;;;;;;;;;-1:-1:-1;110601:48:0;-1:-1:-1;110660:45:0;;:::i;:::-;110708:71;110737:8;110747:20;110769:9;110708:28;:71::i;:::-;110660:119;;110792:84;110823:9;110834:14;110850:8;110860:15;110792:30;:84::i;113132:441::-;113300:156;;;;;;;;;;;;;;;113355:4;113300:156;;;;;;;-1:-1:-1;;;;;113264:33:0;;-1:-1:-1;113264:33:0;;;:23;:33;;;;;:192;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;113474:91;;;;;;;113264:33;;113474:91;;;;;;;;;113132:441;;:::o;115313:556::-;115508:29;;115568:44;;;;115425:38;;115568:80;;:48;;115508:29;115568:48;:80::i;:::-;115659:20;;:40;;;;;;115548:100;;;;;115659:40;;;;;;;;115548:100;;-1:-1:-1;;;;;;115659:20:0;;;;:29;;:40;;;;;:20;;:40;;;;;;;:20;;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;115743:45;115778:9;115743:30;:34;;:45;;;;:::i;:::-;115799:29;:62;;;115710:78;115313:556;-1:-1:-1;;;115313:556:0:o;94002:347::-;94116:7;94143:25;;:198;;94175:166;94184:84;64871:6;94184:59;64914:4;94192:9;:34;;;94184:43;;:47;;:59;;;;:::i;:84::-;94278:19;;94270:70;;94319:20;;94270:44;;:28;;64914:4;94270:32;:44::i;:70::-;94175:8;:166::i;:::-;94143:198;;;-1:-1:-1;94171:1:0;;94002:347;-1:-1:-1;;94002:347:0:o;2310:471::-;2368:7;2613:6;2609:47;;-1:-1:-1;2643:1:0;2636:8;;2609:47;2680:5;;;2684:1;2680;:5;:1;2704:5;;;;;:10;2696:56;;;;-1:-1:-1;;;2696:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3257:132;3315:7;3342:39;3346:1;3349;3342:39;;;;;;;;;;;;;;;;;:3;:39::i;95537:867::-;95670:47;;:::i;:::-;-1:-1:-1;95756:42:0;;;;;;;;95779:19;95756:42;;;;;;;;;;;;;;;-1:-1:-1;;;95756:42:0;;;;;;;;;;;95813:32;;;;-1:-1:-1;;95809:588:0;;;95945:19;:32;95862:10;;95875:115;;95907:20;;95929:49;;:11;;95945:32;-1:-1:-1;;;95945:32:0;;;;;;95929:15;:49;:::i;:::-;95980:9;95875:31;:115::i;:::-;96052:19;:43;95862:128;;-1:-1:-1;96052:54:0;;:43;;95862:128;96052:47;:54::i;:::-;96005:101;;;;96121:55;;;;:33;;;:55;96210:47;;64914:4;;96210:31;;:5;;96220:20;;96210:9;:31;:::i;:47::-;96319:44;;;;96191:66;;-1:-1:-1;96319:66:0;;:48;;96191:66;96319:48;:66::i;:::-;96272:113;;:44;;;:113;-1:-1:-1;95809:588:0;95537:867;;;;;;:::o;57977:141::-;58064:16;;:46;;;;;;;;;;;;;;;;;;;;;;;;;58037:7;;-1:-1:-1;;;;;58064:16:0;;:28;;:46;;;;;;;;;;;:16;:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;58064:46:0;;-1:-1:-1;57977:141:0;:::o;58293:131::-;58375:16;;:41;;;;;;;;;;;;;;;;;;;;;;;;;58348:7;;-1:-1:-1;;;;;58375:16:0;;:28;;:41;;;;;;;;;;;:16;:41;;;;;;;;;;58571:135;58655:16;;:43;;;;;;;;;;;;;;;;;;;;;;;;;58628:7;;-1:-1:-1;;;;;58655:16:0;;:28;;:43;;;;;;;;;;;:16;:43;;;;;;;;;;59306:145;59391:16;;:52;;;;;;;;;;;;;;;;;;;;;;;;;59364:7;;-1:-1:-1;;;;;59391:16:0;;:28;;:52;;;;;;;;;;;:16;:52;;;;;;;;;;59024:127;59104:16;;:39;;;;;;;;;;;;;;;;;;;;;;;;;59077:7;;-1:-1:-1;;;;;59104:16:0;;:28;;:39;;;;;;;;;;;:16;:39;;;;;;;;;;56737:185;56825:16;;56779:4;;-1:-1:-1;;;;;56825:16:0;56803:10;:39;;:72;;;56860:15;:13;:15::i;:::-;-1:-1:-1;;;;;56846:29:0;:10;-1:-1:-1;;;;;56846:29:0;;56803:72;:111;;;;56893:21;:19;:21::i;:::-;-1:-1:-1;;;;;56879:35:0;:10;-1:-1:-1;;;;;56879:35:0;;56796:118;;56737:185;:::o;106410:869::-;106566:54;;:::i;:::-;-1:-1:-1;;;;;;106729:35:0;;106622:29;106729:35;;;:24;:35;;;;;;;;106703:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;106817:47;;106703:61;;106622:29;;;106809:124;;:56;;:70;:124::i;:::-;106777:156;-1:-1:-1;106968:85:0;64914:4;106968:59;106777:156;107012:14;106968:43;:59::i;:85::-;107100:31;;106944:109;;-1:-1:-1;107100:58:0;;:35;;106944:109;107100:35;:58::i;:::-;107066:92;;;;;;107224:47;;107169:102;;;:52;;;:102;107066:23;;106410:869;;-1:-1:-1;106410:869:0;;-1:-1:-1;106410:869:0:o;99211:1763::-;99460:52;;:::i;:::-;-1:-1:-1;;;;;;99649:33:0;;99514:20;99649:33;;;:23;:33;;;;;;;;99624:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;99514:20;;99695:1139;;;;99816:50;;;;99766:44;;99758:109;;;:53;;;;:109;:57;:109::i;:::-;99727:140;-1:-1:-1;99882:20:0;99905:48;99727:140;99938:14;99905:32;:48::i;:::-;99882:71;;99970:41;100014:69;100063:8;100073:9;100014:48;:69::i;:::-;99970:113;-1:-1:-1;100132:27:0;;:180;;100166:146;64871:6;100166:107;100239:33;100166:54;:12;100197:22;100166:30;:54::i;:146::-;100132:180;;;100162:1;100132:180;100100:212;-1:-1:-1;100329:31:0;100363:58;64871:6;100387:33;100363:23;:58::i;:::-;100329:92;-1:-1:-1;100453:124:0;64914:4;100453:94;64871:6;100453:94;:12;100329:92;100453:30;:55::i;:124::-;100644:47;;100438:139;;-1:-1:-1;100644:82:0;;:51;;100696:29;100644:51;:82::i;:::-;100594:132;;;;;;100774:30;;;;:48;;:34;100809:12;100774:34;:48::i;:::-;100741:81;;:30;;;:81;-1:-1:-1;;;99695:1139:0;100899:16;:67;;100965:1;100899:67;;;100918:44;;100899:67;100846:120;;:50;;;:120;:22;;99211:1763;;-1:-1:-1;99211:1763:0;-1:-1:-1;99211:1763:0;;-1:-1:-1;99211:1763:0;-1:-1:-1;;;;99211:1763:0:o;57087:264::-;57204:16;;57149:4;;-1:-1:-1;;;;;57204:16:0;57238:9;:7;:9::i;:::-;:105;;;-1:-1:-1;;;;;;57251:41:0;;;;;;:92;;-1:-1:-1;57296:16:0;;:33;;;;;;;;;;;;;;;;;;;;57333:10;;-1:-1:-1;;;;;57296:16:0;;:27;;57324:4;;57296:33;;;;;;;;;;;;:16;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;57296:33:0;-1:-1:-1;;;;;57296:47:0;;57231:112;57087:264;-1:-1:-1;;;57087:264:0:o;7405:188::-;7489:6;7521:1;7516:6;;:1;:6;;;;7524:12;7508:29;;;;;-1:-1:-1;;;7508:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;7559:5:0;;;7405:188::o;1859:192::-;1945:7;1981:12;1973:6;;;;1965:29;;;;-1:-1:-1;;;1965:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8026:106;8084:7;8115:1;8111;:5;:13;;8123:1;8111:13;;;-1:-1:-1;8119:1:0;;8026:106;-1:-1:-1;8026:106:0:o;105113:491::-;105262:52;;:::i;:::-;105374:17;;:41;;;;;;-1:-1:-1;;;;;105374:41:0;;;;;;;;;105328:16;;;;105374:17;;:31;;:41;;;;;;;;;;;;;;:17;:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;105374:41:0;;;;;;;105515:19;;105374:41;105515:47;;;;;-1:-1:-1;;;;;105515:47:0;;;;;;;;;105374:41;;-1:-1:-1;105374:41:0;;-1:-1:-1;105433:163:0;;105463:8;;105374:41;;;;;;105515:19;;:37;;:47;;;;;;;;;;:19;:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;105515:47:0;105564:20;105586:9;105433:29;:163::i;:::-;105426:170;105113:491;-1:-1:-1;;;;;;105113:491:0:o;3885:278::-;3971:7;4006:12;3999:5;3991:28;;;;-1:-1:-1;;;3991:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4030:9;4046:1;4042;:5;;;;;;;3885:278;-1:-1:-1;;;;;3885:278:0:o;94652:475::-;94787:36;94885:24;;94881:239;;94926:26;94955:58;94981:20;95003:9;94955:25;:58::i;:::-;94926:87;-1:-1:-1;95059:49:0;95099:8;95059:35;94926:87;95085:8;95059:25;:35::i;:49::-;95028:80;94652:475;-1:-1:-1;;;;;94652:475:0:o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o

Swarm Source

ipfs://5f96e076940b90b2d507fdaad317547c2e2bba329ec9ee9e7b228d7792d0e5f6

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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.