Address Details
contract
0x0a0b728D00f0E3A3D8C6849e76dC98B1d39F3aDe
- Contract Name
- Account
- Creator
- 0x5bc1c4–68a788 at 0xd7cb3d–9a42ff
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 0 Transactions
- Transfers
- 0 Transfers
- Gas Used
- Fetching gas used...
- Last Balance Update
- 25501861
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- Account
- Optimization enabled
- false
- Compiler version
- v0.8.11+commit.d7f03943
- EVM Version
- istanbul
- Verified at
- 2023-07-18T23:46:32.565606Z
contracts/Account.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts/utils/math/Math.sol"; import "./Managed.sol"; import "./common/UUPSOwnableUpgradeable.sol"; import "./common/UsingRegistryUpgradeable.sol"; import "./interfaces/IAccount.sol"; /** * @title A contract that facilitates voting on behalf of StakedCelo.sol. * @notice This contract depends on the Manager to decide how to distribute votes and how to * keep track of ownership of CELO voted via this contract. */ contract Account is UUPSOwnableUpgradeable, UsingRegistryUpgradeable, Managed, IAccount { /** * @notice Used to keep track of a pending withdrawal. A similar data structure * exists within LockedGold.sol, but it only keeps track of pending withdrawals * by the msg.sender to the LockedGold contract. * Because this contract facilitates withdrawals for different beneficiaries, * this contract must keep track of which beneficiaries correspond to which * pending withdrawals to prevent someone from finalizing/taking a pending * withdrawal they did not create. * @param value The withdrawal amount. * @param timestamp The timestamp at which the withdrawal amount becomes available. */ struct PendingWithdrawal { uint256 value; uint256 timestamp; } /** * @notice Used to keep track of CELO that is scheduled to be used for * voting or revoking for a validator group. * @param toVote Amount of CELO held by this contract intended to vote for a group. * @param toWithdraw Amount of CELO that's scheduled for withdrawal. * @param toWithdrawFor Amount of CELO that's scheduled for withdrawal grouped by beneficiary. * @param toRevoke Amount of CELO that's scheduled to be revoked. */ struct ScheduledVotes { uint256 toVote; uint256 toWithdraw; mapping(address => uint256) toWithdrawFor; uint256 toRevoke; } /** * @notice Keyed by beneficiary address, the related array of pending withdrawals. * See `PendingWithdrawal` for more info. */ mapping(address => PendingWithdrawal[]) public pendingWithdrawals; /** * @notice Keyed by validator group address, the ScheduledVotes struct * which holds the amount of CELO that's scheduled to vote, the amount * of CELO scheduled to be withdrawn, and the amount of CELO to be * withdrawn for each beneficiary. */ mapping(address => ScheduledVotes) private scheduledVotes; /** * @notice Total amount of CELO scheduled to be withdrawn from all groups * by all beneficiaries. */ uint256 public totalScheduledWithdrawals; /** * @notice Emitted when CELO is scheduled for voting for a given group. * @param group The validator group the CELO is intended to vote for. * @param amount The amount of CELO scheduled. */ event VotesScheduled(address indexed group, uint256 amount); /** * @notice Emitted when CELO is scheduled to be revoked from a given group. * @param group The validator group the CELO is being revoked from. * @param amount The amount of CELO scheduled. */ event RevocationScheduled(address indexed group, uint256 amount); /** * @notice Emitted when CELO withdrawal is scheduled for a group. * @param group The validator group the CELO is withdrawn from. * @param withdrawalAmount The amount of CELO requested for withdrawal. * @param beneficiary The user for whom the withdrawal amount is intended for. */ event CeloWithdrawalScheduled( address indexed beneficiary, address indexed group, uint256 withdrawalAmount ); /** * @notice Emitted when CELO withdrawal kicked off for group. Immediate withdrawals * are not included in this event, but can be identified by a GoldToken.sol transfer * from this contract. * @param group The validator group the CELO is withdrawn from. * @param withdrawalAmount The amount of CELO requested for withdrawal. * @param beneficiary The user for whom the withdrawal amount is intended for. */ event CeloWithdrawalStarted( address indexed beneficiary, address indexed group, uint256 withdrawalAmount ); /** * @notice Emitted when a CELO withdrawal completes for `beneficiary`. * @param beneficiary The user for whom the withdrawal amount is intended. * @param amount The amount of CELO requested for withdrawal. * @param timestamp The timestamp of the pending withdrawal. */ event CeloWithdrawalFinished(address indexed beneficiary, uint256 amount, uint256 timestamp); /// @notice Used when the creation of an account with Accounts.sol fails. error AccountCreationFailed(); /// @notice Used when arrays passed for scheduling votes don't have matching lengths. error GroupsAndVotesArrayLengthsMismatch(); /** * @notice Used when the sum of votes per groups during vote scheduling * doesn't match the `msg.value` sent with the call. * @param sentValue The `msg.value` of the call. * @param expectedValue The expected sum of votes for groups. */ error TotalVotesMismatch(uint256 sentValue, uint256 expectedValue); /// @notice Used when activating of pending votes via Election has failed. error ActivatePendingVotesFailed(address group); /// @notice Used when voting via Election has failed. error VoteFailed(address group, uint256 amount); /// @notice Used when call to Election.sol's `revokePendingVotes` fails. error RevokePendingFailed(address group, uint256 amount); /// @notice Used when call to Election.sol's `revokeActiveVotes` fails. error RevokeActiveFailed(address group, uint256 amount); /** * @notice Used when active + pending votes amount is unable to fulfil a * withdrawal request amount. */ error InsufficientRevokableVotes(address group, uint256 amount); /// @notice Used when unable to transfer CELO. error CeloTransferFailed(address to, uint256 amount); /** * @notice Used when `pendingWithdrawalIndex` is too high for the * beneficiary's pending withdrawals array. */ error PendingWithdrawalIndexTooHigh( uint256 pendingWithdrawalIndex, uint256 pendingWithdrawalsLength ); /** * @notice Used when attempting to schedule more withdrawals * than CELO available to the contract. * @param group The offending group. * @param celoAvailable CELO available to the group across scheduled, pending and active votes. * @param celoToWindraw total amount of CELO that would be scheduled to be withdrawn. */ error WithdrawalAmountTooHigh(address group, uint256 celoAvailable, uint256 celoToWindraw); /** * @notice Used when any of the resolved stakedCeloGroupVoter.pendingWithdrawal * values do not match the equivalent record in lockedGold.pendingWithdrawals. */ error InconsistentPendingWithdrawalValues( uint256 localPendingWithdrawalValue, uint256 lockedGoldPendingWithdrawalValue ); /** * @notice Used when any of the resolved stakedCeloGroupVoter.pendingWithdrawal * timestamps do not match the equivalent record in lockedGold.pendingWithdrawals. */ error InconsistentPendingWithdrawalTimestamps( uint256 localPendingWithdrawalTimestamp, uint256 lockedGoldPendingWithdrawalTimestamp ); /// @notice There's no amount of scheduled withdrawal for the given beneficiary and group. error NoScheduledWithdrawal(address beneficiary, address group); /// @notice Voting for proposal was not successfull. error VotingNotSuccessful(uint256 proposalId); /** * @notice Scheduling transfer was not successfull since * total amount of "from" and "to" are not the same. */ error TransferAmountMisalignment(); /** * @notice Empty constructor for proxy implementation, `initializer` modifer ensures the * implementation gets initialized. */ // solhint-disable-next-line no-empty-blocks constructor() initializer {} // solhint-disable-next-line no-empty-blocks receive() external payable {} /** * @param _registry The address of the Celo Registry. * @param _manager The address of the Manager contract. * @param _owner The address of the contract owner. */ function initialize( address _registry, address _manager, address _owner ) external initializer { __UsingRegistry_init(_registry); __Managed_init(_manager); _transferOwnership(_owner); // Create an account so this contract can vote. if (!getAccounts().createAccount()) { revert AccountCreationFailed(); } } /** * @notice Deposits CELO sent via msg.value as unlocked CELO intended as * votes for groups. * @dev Only callable by the Manager contract, which must restrict which groups * gets CELO distribution. * @param groups The groups the deposited CELO is intended to vote for. * @param votes The amount of CELO to schedule for each respective group * from `groups`. */ function scheduleVotes(address[] calldata groups, uint256[] calldata votes) external payable onlyManager { if (groups.length != votes.length) { revert GroupsAndVotesArrayLengthsMismatch(); } uint256 totalVotes; for (uint256 i = 0; i < groups.length; i++) { getAndUpdateToVoteAndToRevoke(groups[i], votes[i], 0); totalVotes += votes[i]; } if (totalVotes != uint256(msg.value)) { revert TotalVotesMismatch(msg.value, totalVotes); } } /** * @notice Schedules votes which will be revoked from some groups and voted to others. * @dev Only callable by the Manager contract, which must restrict which groups are valid. * @param fromGroups The groups the deposited CELO is intended to be revoked from. * @param fromVotes The amount of CELO scheduled to be revoked from each respective group. * @param toGroups The groups the transferred CELO is intended to vote for. * @param toVotes The amount of CELO to schedule for each respective group * from `toGroups`. */ function scheduleTransfer( address[] calldata fromGroups, uint256[] calldata fromVotes, address[] calldata toGroups, uint256[] calldata toVotes ) external onlyManager { if (fromGroups.length != fromVotes.length || toGroups.length != toVotes.length) { revert GroupsAndVotesArrayLengthsMismatch(); } uint256 totalFromVotes; uint256 totalToVotes; for (uint256 i = 0; i < fromGroups.length; i++) { getAndUpdateToVoteAndToRevoke(fromGroups[i], 0, fromVotes[i]); totalFromVotes += fromVotes[i]; } for (uint256 i = 0; i < toGroups.length; i++) { getAndUpdateToVoteAndToRevoke(toGroups[i], toVotes[i], 0); totalToVotes += toVotes[i]; } if (totalFromVotes != totalToVotes) { revert TransferAmountMisalignment(); } } /** * @notice Schedule a list of withdrawals to be refunded to a beneficiary. * @param groups The groups the deposited CELO is intended to be withdrawn from. * @param withdrawals The amount of CELO to withdraw for each respective group. * @param beneficiary The account that will receive the CELO once it's withdrawn. * from `groups`. */ function scheduleWithdrawals( address beneficiary, address[] calldata groups, uint256[] calldata withdrawals ) external onlyManager { if (groups.length != withdrawals.length) { revert GroupsAndVotesArrayLengthsMismatch(); } uint256 totalWithdrawalsDelta; for (uint256 i = 0; i < withdrawals.length; i++) { uint256 celoAvailableForGroup = this.getCeloForGroup(groups[i]); if (celoAvailableForGroup < withdrawals[i]) { revert WithdrawalAmountTooHigh(groups[i], celoAvailableForGroup, withdrawals[i]); } scheduledVotes[groups[i]].toWithdraw += withdrawals[i]; scheduledVotes[groups[i]].toWithdrawFor[beneficiary] += withdrawals[i]; totalWithdrawalsDelta += withdrawals[i]; emit CeloWithdrawalScheduled(beneficiary, groups[i], withdrawals[i]); } totalScheduledWithdrawals += totalWithdrawalsDelta; } /** * @notice Starts withdrawal of CELO from `group`. If there is any unlocked CELO for the group, * that CELO is used for immediate withdrawal. Otherwise, CELO is taken from pending and active * votes, which are subject to the unlock period of LockedGold.sol. * @param group The group to withdraw CELO from. * @param beneficiary The recipient of the withdrawn CELO. * @param lesserAfterPendingRevoke Used by Election's `revokePending`. This is the group that * is before `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of pending votes has occurred. * @param greaterAfterPendingRevoke Used by Election's `revokePending`. This is the group that * is after `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of pending votes has occurred. * @param lesserAfterActiveRevoke Used by Election's `revokeActive`. This is the group that * is before `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of active votes has occurred. * @param greaterAfterActiveRevoke Used by Election's `revokeActive`. This is the group that * is after `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of active votes has occurred. * @param index Used by Election's `revokePending` and `revokeActive`. This is the index of * `group` in this contract's array of groups it is voting for. * @return The amount of immediately withdrawn CELO that is obtained from scheduledVotes * for `group`. */ function withdraw( address beneficiary, address group, address lesserAfterPendingRevoke, address greaterAfterPendingRevoke, address lesserAfterActiveRevoke, address greaterAfterActiveRevoke, uint256 index ) external returns (uint256) { uint256 withdrawalAmount = scheduledVotes[group].toWithdrawFor[beneficiary]; if (withdrawalAmount == 0) { revert NoScheduledWithdrawal(beneficiary, group); } // Emit early to return without needing to emit in multiple places. emit CeloWithdrawalStarted(beneficiary, group, withdrawalAmount); // Subtract withdrawal amount from all bookkeeping scheduledVotes[group].toWithdrawFor[beneficiary] = 0; scheduledVotes[group].toWithdraw -= withdrawalAmount; totalScheduledWithdrawals -= withdrawalAmount; // It might happen that toVotes are from transfers // and the contract doesn't have enough CELO. (uint256 celoToVoteForGroup, ) = getAndUpdateToVoteAndToRevoke(group, 0, 0); uint256 immediateWithdrawalAmount = Math.min(address(this).balance, celoToVoteForGroup); if (immediateWithdrawalAmount > 0) { if (immediateWithdrawalAmount > withdrawalAmount) { immediateWithdrawalAmount = withdrawalAmount; } scheduledVotes[group].toVote -= immediateWithdrawalAmount; // The benefit of using getGoldToken().transfer() rather than transferring // using a message value is that the recepient's callback is not called, thus // removing concern that a malicious beneficiary would control code at this point. bool success = getGoldToken().transfer(beneficiary, immediateWithdrawalAmount); if (!success) { revert CeloTransferFailed(beneficiary, immediateWithdrawalAmount); } // If we've withdrawn the entire amount, return. if (immediateWithdrawalAmount == withdrawalAmount) { return immediateWithdrawalAmount; } } // We know that withdrawalAmount is >= immediateWithdrawalAmount. uint256 revokeAmount = withdrawalAmount - immediateWithdrawalAmount; ILockedGold lockedGold = getLockedGold(); // Save the pending withdrawal for `beneficiary`. pendingWithdrawals[beneficiary].push( PendingWithdrawal(revokeAmount, block.timestamp + lockedGold.unlockingPeriod()) ); _revokeVotes( group, revokeAmount, lesserAfterPendingRevoke, greaterAfterPendingRevoke, lesserAfterActiveRevoke, greaterAfterActiveRevoke, index ); lockedGold.unlock(revokeAmount); return immediateWithdrawalAmount; } /** * @notice Activates any activatable pending votes for group, and locks & votes any * unlocked CELO for group. * @dev Callable by anyone. In practice, this is expected to be called near the end of each * epoch by an off-chain agent. * @param group The group to activate pending votes for and lock & vote any unlocked CELO for. * @param voteLesser Used by Election's `vote`. This is the group that will recieve fewer * votes than group after the votes are cast, or address(0) if no such group exists. * @param voteGreater Used by Election's `vote`. This is the group that will recieve greater * votes than group after the votes are cast, or address(0) if no such group exists. */ function activateAndVote( address group, address voteLesser, address voteGreater ) external { IElection election = getElection(); // The amount of unlocked CELO for group that we want to lock and vote with. (uint256 celoToVoteForGroup, ) = getAndUpdateToVoteAndToRevoke(group, 0, 0); // Reset the unlocked CELO amount for group. scheduledVotes[group].toVote = 0; // If there are activatable pending votes from this contract for group, activate them. if (election.hasActivatablePendingVotes(address(this), group)) { // Revert if the activation fails. if (!election.activate(group)) { revert ActivatePendingVotesFailed(group); } } // If there is no CELO to lock up and vote with, return. if (celoToVoteForGroup == 0) { return; } uint256 accountLockedNonvotingCelo = getLockedGold().getAccountNonvotingLockedGold( address(this) ); // There might be some locked unvoting (revoked) CELO from previous transfers uint256 toLock = accountLockedNonvotingCelo >= celoToVoteForGroup ? 0 : celoToVoteForGroup - accountLockedNonvotingCelo; // Lock up the unlockedCeloForGroup in LockedGold, which increments the // non-voting LockedGold balance for this contract. if (toLock > 0) { getLockedGold().lock{value: toLock}(); } // Vote for group using the newly locked CELO, reverting if it fails. if (!election.vote(group, celoToVoteForGroup, voteLesser, voteGreater)) { revert VoteFailed(group, celoToVoteForGroup); } } /** * @notice Finishes a pending withdrawal created as a result of a `withdrawCelo` call, * claiming CELO after the `unlockingPeriod` defined in LockedGold.sol. * @dev Callable by anyone, but ultimatly the withdrawal goes to `beneficiary`. * The pending withdrawal info found in both StakedCeloGroupVoter and LockedGold must match * to ensure that the beneficiary is claiming the appropriate pending withdrawal. * @param beneficiary The account that owns the pending withdrawal being processed. * @param localPendingWithdrawalIndex The index of the pending withdrawal to finish * in pendingWithdrawals[beneficiary] array. * @param lockedGoldPendingWithdrawalIndex The index of the pending withdrawal to finish * in LockedGold. * @return amount The amount of CELO sent to `beneficiary`. */ function finishPendingWithdrawal( address beneficiary, uint256 localPendingWithdrawalIndex, uint256 lockedGoldPendingWithdrawalIndex ) external returns (uint256 amount) { (uint256 value, uint256 timestamp) = validatePendingWithdrawalRequest( beneficiary, localPendingWithdrawalIndex, lockedGoldPendingWithdrawalIndex ); // Remove the pending withdrawal. PendingWithdrawal[] storage localPendingWithdrawals = pendingWithdrawals[beneficiary]; localPendingWithdrawals[localPendingWithdrawalIndex] = localPendingWithdrawals[ localPendingWithdrawals.length - 1 ]; localPendingWithdrawals.pop(); // Process withdrawal. getLockedGold().withdraw(lockedGoldPendingWithdrawalIndex); /** * The benefit of using getGoldToken().transfer() is that the recepients callback * is not called thus removing concern that a malicious * caller would control code at this point. */ bool success = getGoldToken().transfer(beneficiary, value); if (!success) { revert CeloTransferFailed(beneficiary, value); } emit CeloWithdrawalFinished(beneficiary, value, timestamp); return value; } /** * @notice Turns on/off voting for more then max number of groups. * @param flag The on/off flag. */ function setAllowedToVoteOverMaxNumberOfGroups(bool flag) external onlyOwner { getElection().setAllowedToVoteOverMaxNumberOfGroups(flag); } /** * @notice Votes on a proposal in the referendum stage. * @param proposalId The ID of the proposal to vote on. * @param index The index of the proposal ID in `dequeued`. * @param yesVotes The yes votes weight. * @param noVotes The no votes weight. * @param abstainVotes The abstain votes weight. */ function votePartially( uint256 proposalId, uint256 index, uint256 yesVotes, uint256 noVotes, uint256 abstainVotes ) external onlyManager { bool voteResult = getGovernance().votePartially( proposalId, index, yesVotes, noVotes, abstainVotes ); if (!voteResult) { revert VotingNotSuccessful(proposalId); } } /** * @notice Gets the total amount of CELO this contract controls. This is the * unlocked CELO balance of the contract plus the amount of LockedGold for this contract, * which included unvoting and voting LockedGold. * @return The total amount of CELO this contract controls, including LockedGold. */ function getTotalCelo() external view returns (uint256) { // LockedGold's getAccountTotalLockedGold returns any non-voting locked gold + // voting locked gold for each group the account is voting for, which is an // O(# of groups voted for) operation. return address(this).balance + getLockedGold().getAccountTotalLockedGold(address(this)) - totalScheduledWithdrawals; } /** * @notice Returns the pending withdrawals for a beneficiary. * @param beneficiary The address of the beneficiary who initiated the pending withdrawal. * @return values The values of pending withdrawals. * @return timestamps The timestamps of pending withdrawals. */ function getPendingWithdrawals(address beneficiary) external view returns (uint256[] memory values, uint256[] memory timestamps) { uint256 length = pendingWithdrawals[beneficiary].length; values = new uint256[](length); timestamps = new uint256[](length); for (uint256 i = 0; i < length; i++) { PendingWithdrawal memory p = pendingWithdrawals[beneficiary][i]; values[i] = p.value; timestamps[i] = p.timestamp; } return (values, timestamps); } /** * @notice Returns the number of pending withdrawals for a beneficiary. * @param beneficiary The address of the beneficiary who initiated the pending withdrawal. * @return The numbers of pending withdrawals for `beneficiary` */ function getNumberPendingWithdrawals(address beneficiary) external view returns (uint256) { return pendingWithdrawals[beneficiary].length; } /** * @notice Returns a pending withdrawals for a beneficiary. * @param beneficiary The address of the beneficiary who initiated the pending withdrawal. * @param index The index in `beneficiary`'s pendingWithdrawals array. * @return value The values of the pending withdrawal. * @return timestamp The timestamp of the pending withdrawal. */ function getPendingWithdrawal(address beneficiary, uint256 index) external view returns (uint256 value, uint256 timestamp) { PendingWithdrawal memory withdrawal = pendingWithdrawals[beneficiary][index]; return (withdrawal.value, withdrawal.timestamp); } /** * @notice Returns the total amount of CELO directed towards `group`. This is * the Unlocked CELO balance for `group` plus the combined amount in pending * and active votes made by this contract. * @param group The address of the validator group. * @return The total amount of CELO directed towards `group`. */ function getCeloForGroup(address group) external view returns (uint256) { return getElection().getTotalVotesForGroupByAccount(group, address(this)) + scheduledVotes[group].toVote - scheduledVotes[group].toRevoke - scheduledVotes[group].toWithdraw; } /** * @notice Returns the total amount of CELO that's scheduled to vote for a group. * @param group The address of the validator group. * @return The total amount of CELO directed towards `group`. */ function scheduledVotesForGroup(address group) external view returns (uint256) { return scheduledVotes[group].toVote; } /** * @notice Returns the total amount of CELO that's scheduled to be revoked for a group. * @param group The address of the validator group. * @return The total amount of CELO scheduled to be revoked from `group`. */ function scheduledRevokeForGroup(address group) external view returns (uint256) { return scheduledVotes[group].toRevoke; } /** * @notice Returns the total amount of CELO that's scheduled to be withdrawn for a group. * @param group The address of the validator group. * @return The total amount of CELO to be withdrawn for `group`. */ function scheduledWithdrawalsForGroup(address group) external view returns (uint256) { return scheduledVotes[group].toWithdraw; } /** * @notice Returns the total amount of CELO that's scheduled to be withdrawn for a group * scoped by a beneficiary. * @param group The address of the validator group. * @param beneficiary The beneficiary of the withdrawal. * @return The total amount of CELO to be withdrawn for `group` by `beneficiary`. */ function scheduledWithdrawalsForGroupAndBeneficiary(address group, address beneficiary) external view returns (uint256) { return scheduledVotes[group].toWithdrawFor[beneficiary]; } /** * @notice Returns the storage, major, minor, and patch version of the contract. * @return Storage version of the contract. * @return Major version of the contract. * @return Minor version of the contract. * @return Patch version of the contract. */ function getVersionNumber() external pure returns ( uint256, uint256, uint256, uint256 ) { return (1, 2, 0, 0); } /** * @notice Revokes votes from a validator group. It first attempts to revoke pending votes, * and then active votes if necessary. * @dev Reverts if `revokeAmount` exceeds the total number of pending and active votes for * the group from this contract. * @param group The group to revoke CELO from. * @param lesserAfterPendingRevoke Used by Election's `revokePending`. This is the group that * is before `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of pending votes has occurred. * @param greaterAfterPendingRevoke Used by Election's `revokePending`. This is the group that * is after `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of pending votes has occurred. * @param lesserAfterActiveRevoke Used by Election's `revokeActive`. This is the group that * is before `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of active votes has occurred. * @param greaterAfterActiveRevoke Used by Election's `revokeActive`. This is the group that * is after `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of active votes has occurred. * @param index Used by Election's `revokePending` and `revokeActive`. This is the index of * `group` in the this contract's array of groups it is voting for. */ function revokeVotes( address group, address lesserAfterPendingRevoke, address greaterAfterPendingRevoke, address lesserAfterActiveRevoke, address greaterAfterActiveRevoke, uint256 index ) public { (, uint256 revokeAmount) = getAndUpdateToVoteAndToRevoke(group, 0, 0); if (revokeAmount == 0) { return; } _revokeVotes( group, revokeAmount, lesserAfterPendingRevoke, greaterAfterPendingRevoke, lesserAfterActiveRevoke, greaterAfterActiveRevoke, index ); scheduledVotes[group].toRevoke -= revokeAmount; } /** * @notice Revokes votes from a validator group. It first attempts to revoke pending votes, * and then active votes if necessary. * @dev Reverts if `revokeAmount` exceeds the total number of pending and active votes for * the group from this contract. * @param group The group to withdraw CELO from. * @param revokeAmount The amount of votes to revoke. * @param lesserAfterPendingRevoke Used by Election's `revokePending`. This is the group that * is before `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of pending votes has occurred. * @param greaterAfterPendingRevoke Used by Election's `revokePending`. This is the group that * is after `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of pending votes has occurred. * @param lesserAfterActiveRevoke Used by Election's `revokeActive`. This is the group that * is before `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of active votes has occurred. * @param greaterAfterActiveRevoke Used by Election's `revokeActive`. This is the group that * is after `group` within the validators sorted LinkedList, or address(0) if there isn't one, * after the revoke of active votes has occurred. * @param index Used by Election's `revokePending` and `revokeActive`. This is the index of * `group` in the this contract's array of groups it is voting for. */ function _revokeVotes( address group, uint256 revokeAmount, address lesserAfterPendingRevoke, address greaterAfterPendingRevoke, address lesserAfterActiveRevoke, address greaterAfterActiveRevoke, uint256 index ) internal { IElection election = getElection(); uint256 pendingVotesAmount = election.getPendingVotesForGroupByAccount( group, address(this) ); uint256 toRevokeFromPending = Math.min(revokeAmount, pendingVotesAmount); if (toRevokeFromPending > 0) { if ( !election.revokePending( group, toRevokeFromPending, lesserAfterPendingRevoke, greaterAfterPendingRevoke, index ) ) { revert RevokePendingFailed(group, revokeAmount); } } uint256 toRevokeFromActive = revokeAmount - toRevokeFromPending; if (toRevokeFromActive == 0) { return; } uint256 activeVotesAmount = election.getActiveVotesForGroupByAccount(group, address(this)); if (activeVotesAmount < toRevokeFromActive) { revert InsufficientRevokableVotes(group, revokeAmount); } if ( !election.revokeActive( group, toRevokeFromActive, lesserAfterActiveRevoke, greaterAfterActiveRevoke, index ) ) { revert RevokeActiveFailed(group, revokeAmount); } } /** * @notice Validates a local pending withdrawal matches a given beneficiary and LockedGold * pending withdrawal. * @dev See finishPendingWithdrawal. * @param beneficiary The account that owns the pending withdrawal being processed. * @param localPendingWithdrawalIndex The index of the pending withdrawal to finish * in pendingWithdrawals[beneficiary] array. * @param lockedGoldPendingWithdrawalIndex The index of the pending withdrawal to finish * in LockedGold. * @return value The value of the pending withdrawal. * @return timestamp The timestamp of the pending withdrawal. */ function validatePendingWithdrawalRequest( address beneficiary, uint256 localPendingWithdrawalIndex, uint256 lockedGoldPendingWithdrawalIndex ) internal view returns (uint256 value, uint256 timestamp) { if (localPendingWithdrawalIndex >= pendingWithdrawals[beneficiary].length) { revert PendingWithdrawalIndexTooHigh( localPendingWithdrawalIndex, pendingWithdrawals[beneficiary].length ); } ( uint256 lockedGoldPendingWithdrawalValue, uint256 lockedGoldPendingWithdrawalTimestamp ) = getLockedGold().getPendingWithdrawal(address(this), lockedGoldPendingWithdrawalIndex); PendingWithdrawal memory pendingWithdrawal = pendingWithdrawals[beneficiary][ localPendingWithdrawalIndex ]; if (pendingWithdrawal.value != lockedGoldPendingWithdrawalValue) { revert InconsistentPendingWithdrawalValues( pendingWithdrawal.value, lockedGoldPendingWithdrawalValue ); } if (pendingWithdrawal.timestamp != lockedGoldPendingWithdrawalTimestamp) { revert InconsistentPendingWithdrawalTimestamps( pendingWithdrawal.timestamp, lockedGoldPendingWithdrawalTimestamp ); } return (pendingWithdrawal.value, pendingWithdrawal.timestamp); } /** * @notice Adds amount to `toVote` and `toRevoke` and returns the `toVote` * and `toRevoke` amount of CELO directed towards `group`. This is the `toVote` * CELO balance for `group` minus the `toRevoke` amount and vice versa. * Both `toRevoke` and `toVote` are updated. * @param group The address of the validator group. * @param addToVote The amount to add to `toVote`. * @param addToRevoke The amount to add to `toRevoke`. * @return toVote The `toVote` amount of CELO directed towards `group`. * @return toRevoke The `toRevoke` amount of CELO directed towards `group`. */ function getAndUpdateToVoteAndToRevoke( address group, uint256 addToVote, uint256 addToRevoke ) private returns (uint256 toVote, uint256 toRevoke) { toVote = scheduledVotes[group].toVote + addToVote; toRevoke = scheduledVotes[group].toRevoke + addToRevoke; if (toVote > toRevoke) { scheduledVotes[group].toVote = toVote = toVote - toRevoke; scheduledVotes[group].toRevoke = toRevoke = 0; } else { scheduledVotes[group].toRevoke = toRevoke = toRevoke - toVote; scheduledVotes[group].toVote = toVote = 0; } if (addToVote > 0) { emit VotesScheduled(group, addToVote); } if (addToRevoke > 0) { emit RevocationScheduled(group, addToRevoke); } } }
/_openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeacon.sol"; import "../../utils/Address.sol"; import "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967Upgrade { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); // Initial upgrade and setup call _setImplementation(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } // Perform rollback test if not already in progress StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { // Trigger rollback using upgradeTo from the new implementation rollbackTesting.value = true; Address.functionDelegateCall( newImplementation, abi.encodeWithSignature("upgradeTo(address)", oldImplementation) ); rollbackTesting.value = false; // Check rollback was effective require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); // Finally reset to the new implementation and log the upgrade _upgradeTo(newImplementation); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } }
/_openzeppelin/contracts/proxy/beacon/IBeacon.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
/_openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../ERC1967/ERC1967Upgrade.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is ERC1967Upgrade { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; }
/_openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
/_openzeppelin/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol) pragma solidity ^0.8.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. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
/_openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
/_openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
/_openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
/contracts/Managed.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title Used via inheritance to grant special access control to the Manager * contract. */ abstract contract Managed is Initializable, OwnableUpgradeable { address public manager; /** * @notice Emitted when the manager is initially set or later modified. * @param manager The new managing account address. */ event ManagerSet(address indexed manager); /** * @notice Used when an `onlyManager` function is called by a non-manager. * @param caller `msg.sender` that called the function. */ error CallerNotManager(address caller); /** * @notice Used when a passed address is address(0). */ error NullAddress(); /** * @dev Throws if called by any account other than the manager. */ modifier onlyManager() { if (manager != msg.sender) { revert CallerNotManager(msg.sender); } _; } /** * @notice Sets the manager address. * @param _manager The new manager address. */ function setManager(address _manager) external onlyOwner { _setManager(_manager); } /** * @dev Initializes the contract in an upgradable context. * @param _manager The initial managing address. */ // solhint-disable-next-line func-name-mixedcase function __Managed_init(address _manager) internal onlyInitializing { _setManager(_manager); } /** * @notice Sets the manager address. * @param _manager The new manager address. */ function _setManager(address _manager) internal { if (_manager == address(0)) { revert NullAddress(); } manager = _manager; emit ManagerSet(_manager); } }
/contracts/common/UUPSOwnableUpgradeable.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; /** * @title A contract that links UUPSUUpgradeable with OwanbleUpgradeable to gate upgrades. */ abstract contract UUPSOwnableUpgradeable is UUPSUpgradeable, OwnableUpgradeable { /** * @notice Guard method for UUPS (Universal Upgradable Proxy Standard) * See: https://docs.openzeppelin.com/contracts/4.x/api/proxy#transparent-vs-uups * @dev This methods overrides the virtual one in UUPSUpgradeable and * adds the onlyOwner modifer. */ // solhint-disable-next-line no-empty-blocks function _authorizeUpgrade(address) internal override onlyOwner {} }
/contracts/common/UsingRegistryUpgradeable.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "../interfaces/IAccounts.sol"; import "../interfaces/IElection.sol"; import "../interfaces/IGoldToken.sol"; import "../interfaces/ILockedGold.sol"; import "../interfaces/IRegistry.sol"; import "../interfaces/IGovernance.sol"; import "../interfaces/IValidators.sol"; /** * @title A helper for getting Celo core contracts from the Registry. */ abstract contract UsingRegistryUpgradeable is Initializable { /// @notice The canonical address of the Registry. address internal constant CANONICAL_REGISTRY = 0x000000000000000000000000000000000000ce10; /// @notice The registry ID for the Accounts contract. bytes32 private constant ACCOUNTS_REGISTRY_ID = keccak256(abi.encodePacked("Accounts")); /// @notice The registry ID for the Election contract. bytes32 private constant ELECTION_REGISTRY_ID = keccak256(abi.encodePacked("Election")); /// @notice The registry ID for the GoldToken contract. bytes32 private constant GOLD_TOKEN_REGISTRY_ID = keccak256(abi.encodePacked("GoldToken")); /// @notice The registry ID for the LockedGold contract. bytes32 private constant LOCKED_GOLD_REGISTRY_ID = keccak256(abi.encodePacked("LockedGold")); /// @notice The registry ID for the Governance contract. bytes32 private constant GOVERNANCE_REGISTRY_ID = keccak256(abi.encodePacked("Governance")); /// @notice The registry ID for the Validator contract. bytes32 private constant VALIDATORS_REGISTRY_ID = keccak256(abi.encodePacked("Validators")); /// @notice The Registry. IRegistry public registry; /** * @notice Initializes the UsingRegistryUpgradable contract in an upgradable scenario * @param _registry The address of the Registry. For convenience, if the zero address is * provided, the registry is set to the canonical Registry address, i.e. 0x0...ce10. This * parameter should only be a non-zero address when testing. */ // solhint-disable-next-line func-name-mixedcase function __UsingRegistry_init(address _registry) internal onlyInitializing { if (_registry == address(0)) { registry = IRegistry(CANONICAL_REGISTRY); } else { registry = IRegistry(_registry); } } /** * @notice Gets the Accounts contract from the Registry. * @return The Accounts contract from the Registry. */ function getAccounts() internal view returns (IAccounts) { return IAccounts(registry.getAddressForOrDie(ACCOUNTS_REGISTRY_ID)); } /** * @notice Gets the Election contract from the Registry. * @return The Election contract from the Registry. */ function getElection() internal view returns (IElection) { return IElection(registry.getAddressForOrDie(ELECTION_REGISTRY_ID)); } /** * @notice Gets the GoldToken contract from the Registry. * @return The GoldToken contract from the Registry. */ function getGoldToken() internal view returns (IGoldToken) { return IGoldToken(registry.getAddressForOrDie(GOLD_TOKEN_REGISTRY_ID)); } /** * @notice Gets the LockedGold contract from the Registry. * @return The LockedGold contract from the Registry. */ function getLockedGold() internal view returns (ILockedGold) { return ILockedGold(registry.getAddressForOrDie(LOCKED_GOLD_REGISTRY_ID)); } /** * @notice Gets the Governance contract from the Registry. * @return The Governance contract from the Registry. */ function getGovernance() internal view returns (IGovernance) { return IGovernance(registry.getAddressForOrDie(GOVERNANCE_REGISTRY_ID)); } /** * @notice Gets the validators contract from the Registry. * @return The validators contract from the Registry. */ function getValidators() internal view returns (IValidators) { return IValidators(registry.getAddressForOrDie(VALIDATORS_REGISTRY_ID)); } }
/contracts/interfaces/IAccount.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IAccount { function scheduleVotes(address[] calldata group, uint256[] calldata votes) external payable; function scheduleTransfer( address[] calldata fromGroups, uint256[] calldata fromVotes, address[] calldata toGroups, uint256[] calldata toVotess ) external; function scheduleWithdrawals( address beneficiary, address[] calldata group, uint256[] calldata withdrawals ) external; function votePartially( uint256 proposalId, uint256 index, uint256 yesVotes, uint256 noVotes, uint256 abstainVotes ) external; function getTotalCelo() external view returns (uint256); function getCeloForGroup(address) external view returns (uint256); function scheduledVotesForGroup(address group) external view returns (uint256); function scheduledRevokeForGroup(address group) external view returns (uint256); function scheduledWithdrawalsForGroup(address group) external view returns (uint256); }
/contracts/interfaces/IAccounts.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IAccounts { function isAccount(address) external view returns (bool); function voteSignerToAccount(address) external view returns (address); function validatorSignerToAccount(address) external view returns (address); function attestationSignerToAccount(address) external view returns (address); function signerToAccount(address) external view returns (address); function getAttestationSigner(address) external view returns (address); function getValidatorSigner(address) external view returns (address); function getVoteSigner(address) external view returns (address); function hasAuthorizedVoteSigner(address) external view returns (bool); function hasAuthorizedValidatorSigner(address) external view returns (bool); function hasAuthorizedAttestationSigner(address) external view returns (bool); function setAccountDataEncryptionKey(bytes calldata) external; function setMetadataURL(string calldata) external; function setName(string calldata) external; function setWalletAddress( address, uint8, bytes32, bytes32 ) external; function setAccount( string calldata, bytes calldata, address, uint8, bytes32, bytes32 ) external; function getDataEncryptionKey(address) external view returns (bytes memory); function getWalletAddress(address) external view returns (address); function getMetadataURL(address) external view returns (string memory); function batchGetMetadataURL(address[] calldata) external view returns (uint256[] memory, bytes memory); function getName(address) external view returns (string memory); function authorizeVoteSigner( address, uint8, bytes32, bytes32 ) external; function authorizeValidatorSigner( address, uint8, bytes32, bytes32 ) external; function authorizeValidatorSignerWithPublicKey( address, uint8, bytes32, bytes32, bytes calldata ) external; function authorizeValidatorSignerWithKeys( address, uint8, bytes32, bytes32, bytes calldata, bytes calldata, bytes calldata ) external; function authorizeAttestationSigner( address, uint8, bytes32, bytes32 ) external; function createAccount() external returns (bool); }
/contracts/interfaces/IElection.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IElection { function vote( address, uint256, address, address ) external returns (bool); function activate(address) external returns (bool); function activateForAccount(address, address) external returns (bool); function revokeActive( address, uint256, address, address, uint256 ) external returns (bool); function revokeAllActive( address, address, address, uint256 ) external returns (bool); function revokePending( address, uint256, address, address, uint256 ) external returns (bool); function markGroupIneligible(address) external; function markGroupEligible( address, address, address ) external; function forceDecrementVotes( address, uint256, address[] calldata, address[] calldata, uint256[] calldata ) external returns (uint256); // only owner function setElectableValidators(uint256, uint256) external returns (bool); function setMaxNumGroupsVotedFor(uint256) external returns (bool); function setElectabilityThreshold(uint256) external returns (bool); // only VM function distributeEpochRewards( address, uint256, address, address ) external; function allowedToVoteOverMaxNumberOfGroups(address) external returns (bool); function setAllowedToVoteOverMaxNumberOfGroups(bool flag) external; // view functions function electValidatorSigners() external view returns (address[] memory); function electNValidatorSigners(uint256, uint256) external view returns (address[] memory); function getElectableValidators() external view returns (uint256, uint256); function getElectabilityThreshold() external view returns (uint256); function getNumVotesReceivable(address) external view returns (uint256); function getTotalVotes() external view returns (uint256); function getActiveVotes() external view returns (uint256); function getTotalVotesByAccount(address) external view returns (uint256); function getPendingVotesForGroupByAccount(address, address) external view returns (uint256); function getActiveVotesForGroupByAccount(address, address) external view returns (uint256); function getTotalVotesForGroupByAccount(address, address) external view returns (uint256); function getActiveVoteUnitsForGroupByAccount(address, address) external view returns (uint256); function getTotalVotesForGroup(address) external view returns (uint256); function getActiveVotesForGroup(address) external view returns (uint256); function getPendingVotesForGroup(address) external view returns (uint256); function getGroupEligibility(address) external view returns (bool); function getGroupEpochRewards( address, uint256, uint256[] calldata ) external view returns (uint256); function getGroupsVotedForByAccount(address) external view returns (address[] memory); function getEligibleValidatorGroups() external view returns (address[] memory); function getTotalVotesForEligibleValidatorGroups() external view returns (address[] memory, uint256[] memory); function getCurrentValidatorSigners() external view returns (address[] memory); function canReceiveVotes(address, uint256) external view returns (bool); function hasActivatablePendingVotes(address, address) external view returns (bool); function maxNumGroupsVotedFor() external view returns (uint256); function validatorSignerAddressFromCurrentSet(uint256 index) external view returns (address); function numberValidatorsInCurrentSet() external view returns (uint256); function getEpochNumber() external view returns (uint256); }
/contracts/interfaces/IGoldToken.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IGoldToken { function transfer(address to, uint256 value) external returns (bool); function transferWithComment( address to, uint256 value, string calldata comment ) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function increaseAllowance(address spender, uint256 value) external returns (bool); function decreaseAllowance(address spender, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function balanceOf(address owner) external view returns (uint256); }
/contracts/interfaces/IGovernance.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IGovernance { function votePartially( uint256 proposalId, uint256 index, uint256 yesVotes, uint256 noVotes, uint256 abstainVotes ) external returns (bool); function getProposal(uint256 proposalId) external view returns ( address, uint256, uint256, uint256, string memory ); function getReferendumStageDuration() external view returns (uint256); }
/contracts/interfaces/ILockedGold.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface ILockedGold { function lock() external payable; function incrementNonvotingAccountBalance(address, uint256) external; function unlock(uint256) external; function relock(uint256, uint256) external; function withdraw(uint256) external; function slash( address account, uint256 penalty, address reporter, uint256 reward, address[] calldata lessers, address[] calldata greaters, uint256[] calldata indices ) external; function decrementNonvotingAccountBalance(address, uint256) external; function unlockingPeriod() external view returns (uint256); function getAccountTotalLockedGold(address) external view returns (uint256); function getTotalLockedGold() external view returns (uint256); function getPendingWithdrawal(address, uint256) external view returns (uint256, uint256); function getSlashingWhitelist() external view returns (bytes32[] memory); function getPendingWithdrawals(address) external view returns (uint256[] memory, uint256[] memory); function getTotalPendingWithdrawals(address) external view returns (uint256); function isSlasher(address) external view returns (bool); function owner() external view returns (address); function getAccountNonvotingLockedGold(address account) external view returns (uint256); }
/contracts/interfaces/IRegistry.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IRegistry { function setAddressFor(string calldata, address) external; function getAddressForOrDie(bytes32) external view returns (address); function getAddressFor(bytes32) external view returns (address); function getAddressForStringOrDie(string calldata identifier) external view returns (address); function getAddressForString(string calldata identifier) external view returns (address); function isOneOf(bytes32[] calldata, address) external view returns (bool); }
/contracts/interfaces/IValidators.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity ^0.8.11; interface IValidators { function registerValidator( bytes calldata, bytes calldata, bytes calldata ) external returns (bool); function deregisterValidator(uint256) external returns (bool); function affiliate(address) external returns (bool); function deaffiliate() external returns (bool); function updateBlsPublicKey(bytes calldata, bytes calldata) external returns (bool); function registerValidatorGroup(uint256) external returns (bool); function deregisterValidatorGroup(uint256) external returns (bool); function addMember(address) external returns (bool); function addFirstMember( address, address, address ) external returns (bool); function removeMember(address) external returns (bool); function reorderMember( address, address, address ) external returns (bool); function updateCommission() external; function setNextCommissionUpdate(uint256) external; function resetSlashingMultiplier() external; // only owner function setCommissionUpdateDelay(uint256) external; function setMaxGroupSize(uint256) external returns (bool); function setMembershipHistoryLength(uint256) external returns (bool); function setValidatorScoreParameters(uint256, uint256) external returns (bool); function setGroupLockedGoldRequirements(uint256, uint256) external returns (bool); function setValidatorLockedGoldRequirements(uint256, uint256) external returns (bool); function setSlashingMultiplierResetPeriod(uint256) external; // view functions function getMaxGroupSize() external view returns (uint256); function getCommissionUpdateDelay() external view returns (uint256); function getValidatorScoreParameters() external view returns (uint256, uint256); function getMembershipHistory(address) external view returns ( uint256[] memory, address[] memory, uint256, uint256 ); function calculateEpochScore(uint256) external view returns (uint256); function calculateGroupEpochScore(uint256[] calldata) external view returns (uint256); function getAccountLockedGoldRequirement(address) external view returns (uint256); function meetsAccountLockedGoldRequirements(address) external view returns (bool); function getValidatorBlsPublicKeyFromSigner(address) external view returns (bytes memory); function getValidator(address account) external view returns ( bytes memory, bytes memory, address, uint256, address ); function getValidatorGroup(address) external view returns ( address[] memory, uint256, uint256, uint256, uint256[] memory, uint256, uint256 ); function getGroupNumMembers(address) external view returns (uint256); function getTopGroupValidators(address, uint256) external view returns (address[] memory); function getGroupsNumMembers(address[] calldata accounts) external view returns (uint256[] memory); function getNumRegisteredValidators() external view returns (uint256); function groupMembershipInEpoch( address, uint256, uint256 ) external view returns (address); // only registered contract function updateEcdsaPublicKey( address, address, bytes calldata ) external returns (bool); function updatePublicKeys( address, address, bytes calldata, bytes calldata, bytes calldata ) external returns (bool); function getValidatorLockedGoldRequirements() external view returns (uint256, uint256); function getGroupLockedGoldRequirements() external view returns (uint256, uint256); function getRegisteredValidators() external view returns (address[] memory); function getRegisteredValidatorSigners() external view returns (address[] memory); function getRegisteredValidatorGroups() external view returns (address[] memory); function isValidatorGroup(address) external view returns (bool); function isValidator(address) external view returns (bool); function getValidatorGroupSlashingMultiplier(address) external view returns (uint256); function getMembershipInLastEpoch(address) external view returns (address); function getMembershipInLastEpochFromSigner(address) external view returns (address); // only VM function updateValidatorScoreFromSigner(address, uint256) external; function distributeEpochPaymentsFromSigner(address, uint256) external returns (uint256); // only slasher function forceDeaffiliateIfValidator(address) external; function halveSlashingMultiplier(address) external; }
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":false},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"contracts/Account.sol":"Account"}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"AccountCreationFailed","inputs":[]},{"type":"error","name":"ActivatePendingVotesFailed","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"CallerNotManager","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"error","name":"CeloTransferFailed","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"GroupsAndVotesArrayLengthsMismatch","inputs":[]},{"type":"error","name":"InconsistentPendingWithdrawalTimestamps","inputs":[{"type":"uint256","name":"localPendingWithdrawalTimestamp","internalType":"uint256"},{"type":"uint256","name":"lockedGoldPendingWithdrawalTimestamp","internalType":"uint256"}]},{"type":"error","name":"InconsistentPendingWithdrawalValues","inputs":[{"type":"uint256","name":"localPendingWithdrawalValue","internalType":"uint256"},{"type":"uint256","name":"lockedGoldPendingWithdrawalValue","internalType":"uint256"}]},{"type":"error","name":"InsufficientRevokableVotes","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"NoScheduledWithdrawal","inputs":[{"type":"address","name":"beneficiary","internalType":"address"},{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"NullAddress","inputs":[]},{"type":"error","name":"PendingWithdrawalIndexTooHigh","inputs":[{"type":"uint256","name":"pendingWithdrawalIndex","internalType":"uint256"},{"type":"uint256","name":"pendingWithdrawalsLength","internalType":"uint256"}]},{"type":"error","name":"RevokeActiveFailed","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"RevokePendingFailed","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"TotalVotesMismatch","inputs":[{"type":"uint256","name":"sentValue","internalType":"uint256"},{"type":"uint256","name":"expectedValue","internalType":"uint256"}]},{"type":"error","name":"TransferAmountMisalignment","inputs":[]},{"type":"error","name":"VoteFailed","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"error","name":"VotingNotSuccessful","inputs":[{"type":"uint256","name":"proposalId","internalType":"uint256"}]},{"type":"error","name":"WithdrawalAmountTooHigh","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"uint256","name":"celoAvailable","internalType":"uint256"},{"type":"uint256","name":"celoToWindraw","internalType":"uint256"}]},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"CeloWithdrawalFinished","inputs":[{"type":"address","name":"beneficiary","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"CeloWithdrawalScheduled","inputs":[{"type":"address","name":"beneficiary","internalType":"address","indexed":true},{"type":"address","name":"group","internalType":"address","indexed":true},{"type":"uint256","name":"withdrawalAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"CeloWithdrawalStarted","inputs":[{"type":"address","name":"beneficiary","internalType":"address","indexed":true},{"type":"address","name":"group","internalType":"address","indexed":true},{"type":"uint256","name":"withdrawalAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ManagerSet","inputs":[{"type":"address","name":"manager","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RevocationScheduled","inputs":[{"type":"address","name":"group","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"VotesScheduled","inputs":[{"type":"address","name":"group","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"activateAndVote","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"address","name":"voteLesser","internalType":"address"},{"type":"address","name":"voteGreater","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"}],"name":"finishPendingWithdrawal","inputs":[{"type":"address","name":"beneficiary","internalType":"address"},{"type":"uint256","name":"localPendingWithdrawalIndex","internalType":"uint256"},{"type":"uint256","name":"lockedGoldPendingWithdrawalIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCeloForGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNumberPendingWithdrawals","inputs":[{"type":"address","name":"beneficiary","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"value","internalType":"uint256"},{"type":"uint256","name":"timestamp","internalType":"uint256"}],"name":"getPendingWithdrawal","inputs":[{"type":"address","name":"beneficiary","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"values","internalType":"uint256[]"},{"type":"uint256[]","name":"timestamps","internalType":"uint256[]"}],"name":"getPendingWithdrawals","inputs":[{"type":"address","name":"beneficiary","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalCelo","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getVersionNumber","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_registry","internalType":"address"},{"type":"address","name":"_manager","internalType":"address"},{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"manager","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"value","internalType":"uint256"},{"type":"uint256","name":"timestamp","internalType":"uint256"}],"name":"pendingWithdrawals","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IRegistry"}],"name":"registry","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeVotes","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"address","name":"lesserAfterPendingRevoke","internalType":"address"},{"type":"address","name":"greaterAfterPendingRevoke","internalType":"address"},{"type":"address","name":"lesserAfterActiveRevoke","internalType":"address"},{"type":"address","name":"greaterAfterActiveRevoke","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"scheduleTransfer","inputs":[{"type":"address[]","name":"fromGroups","internalType":"address[]"},{"type":"uint256[]","name":"fromVotes","internalType":"uint256[]"},{"type":"address[]","name":"toGroups","internalType":"address[]"},{"type":"uint256[]","name":"toVotes","internalType":"uint256[]"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"scheduleVotes","inputs":[{"type":"address[]","name":"groups","internalType":"address[]"},{"type":"uint256[]","name":"votes","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"scheduleWithdrawals","inputs":[{"type":"address","name":"beneficiary","internalType":"address"},{"type":"address[]","name":"groups","internalType":"address[]"},{"type":"uint256[]","name":"withdrawals","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"scheduledRevokeForGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"scheduledVotesForGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"scheduledWithdrawalsForGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"scheduledWithdrawalsForGroupAndBeneficiary","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"address","name":"beneficiary","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAllowedToVoteOverMaxNumberOfGroups","inputs":[{"type":"bool","name":"flag","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setManager","inputs":[{"type":"address","name":"_manager","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalScheduledWithdrawals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"votePartially","inputs":[{"type":"uint256","name":"proposalId","internalType":"uint256"},{"type":"uint256","name":"index","internalType":"uint256"},{"type":"uint256","name":"yesVotes","internalType":"uint256"},{"type":"uint256","name":"noVotes","internalType":"uint256"},{"type":"uint256","name":"abstainVotes","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdraw","inputs":[{"type":"address","name":"beneficiary","internalType":"address"},{"type":"address","name":"group","internalType":"address"},{"type":"address","name":"lesserAfterPendingRevoke","internalType":"address"},{"type":"address","name":"greaterAfterPendingRevoke","internalType":"address"},{"type":"address","name":"lesserAfterActiveRevoke","internalType":"address"},{"type":"address","name":"greaterAfterActiveRevoke","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff168152503480156200004457600080fd5b50600060019054906101000a900460ff166200006f5760008054906101000a900460ff161562000080565b6200007f6200013c60201b60201c565b5b620000c2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000b99062000204565b60405180910390fd5b60008060019054906101000a900460ff16159050801562000113576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b8015620001355760008060016101000a81548160ff0219169083151502179055505b5062000226565b600062000154306200015a60201b62002c191760201c565b15905090565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000620001ec602e836200017d565b9150620001f9826200018e565b604082019050919050565b600060208201905081810360008301526200021f81620001dd565b9050919050565b608051615823620002576000396000818161106e015281816110fd0152818161125e01526112ed01526158236000f3fe6080604052600436106101d15760003560e01c806384aff2e7116100f7578063c7fb232811610095578063d52758aa11610064578063d52758aa146106b4578063f2fde38b146106dd578063f340c0d014610706578063f380ade314610744576101d8565b8063c7fb2328146105e7578063c9a101f314610624578063d0ebdbe71461064d578063d15ca4ed14610676576101d8565b8063a020c8de116100d1578063a020c8de14610507578063acd201d014610544578063b09bdc5e14610581578063c0c53b8b146105be576101d8565b806384aff2e7146104765780638da5cb5b146104b357806395145221146104de576101d8565b80633659cfe61161016f57806354255be01161013e57806354255be0146103c95780635fd5c95e146103f7578063715018a6146104345780637b1039991461044b576101d8565b80633659cfe61461031b57806344dc497014610344578063481c6a75146103825780634f1ef286146103ad576101d8565b806322e59bd4116101ab57806322e59bd4146102615780632ad9ac411461029e5780632edfd12e146102c95780632f842a1a146102f2576101d8565b806301c21d59146101dd57806301d2b6ea146101f95780631449edb014610224576101d8565b366101d857005b600080fd5b6101f760048036038101906101f291906141d7565b61076d565b005b34801561020557600080fd5b5061020e610927565b60405161021b9190614271565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906142ea565b6109c7565b6040516102589190614271565b60405180910390f35b34801561026d57600080fd5b50610288600480360381019061028391906142ea565b610a13565b6040516102959190614271565b60405180910390f35b3480156102aa57600080fd5b506102b3610a5f565b6040516102c09190614271565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190614343565b610a65565b005b3480156102fe57600080fd5b50610319600480360381019061031491906143be565b610bd0565b005b34801561032757600080fd5b50610342600480360381019061033d91906142ea565b61106c565b005b34801561035057600080fd5b5061036b60048036038101906103669190614453565b6111f5565b604051610379929190614493565b60405180910390f35b34801561038e57600080fd5b50610397611236565b6040516103a491906144cb565b60405180910390f35b6103c760048036038101906103c29190614627565b61125c565b005b3480156103d557600080fd5b506103de611399565b6040516103ee9493929190614683565b60405180910390f35b34801561040357600080fd5b5061041e600480360381019061041991906142ea565b6113b4565b60405161042b9190614271565b60405180910390f35b34801561044057600080fd5b50610449611400565b005b34801561045757600080fd5b50610460611488565b60405161046d9190614727565b60405180910390f35b34801561048257600080fd5b5061049d60048036038101906104989190614742565b6114ae565b6040516104aa9190614271565b60405180910390f35b3480156104bf57600080fd5b506104c8611745565b6040516104d591906144cb565b60405180910390f35b3480156104ea57600080fd5b5061050560048036038101906105009190614795565b61176f565b005b34801561051357600080fd5b5061052e60048036038101906105299190614822565b611801565b60405161053b9190614271565b60405180910390f35b34801561055057600080fd5b5061056b600480360381019061056691906142ea565b611d50565b6040516105789190614271565b60405180910390f35b34801561058d57600080fd5b506105a860048036038101906105a391906142ea565b611ec3565b6040516105b59190614271565b60405180910390f35b3480156105ca57600080fd5b506105e560048036038101906105e091906148c4565b611f0f565b005b3480156105f357600080fd5b5061060e60048036038101906106099190614917565b6120bf565b60405161061b9190614271565b60405180910390f35b34801561063057600080fd5b5061064b600480360381019061064691906148c4565b612149565b005b34801561065957600080fd5b50610674600480360381019061066f91906142ea565b6124e3565b005b34801561068257600080fd5b5061069d60048036038101906106989190614453565b61256b565b6040516106ab929190614493565b60405180910390f35b3480156106c057600080fd5b506106db60048036038101906106d6919061498f565b612606565b005b3480156106e957600080fd5b5061070460048036038101906106ff91906142ea565b6126f7565b005b34801561071257600080fd5b5061072d600480360381019061072891906142ea565b6127ef565b60405161073b929190614a7a565b60405180910390f35b34801561075057600080fd5b5061076b60048036038101906107669190614ab1565b6129bf565b005b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ff57336040517f3b2495f10000000000000000000000000000000000000000000000000000000081526004016107f691906144cb565b60405180910390fd5b81819050848490501461083e576040517f8cd9cb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600090505b858590508110156108d95761089d86868381811061086757610866614b9a565b5b905060200201602081019061087c91906142ea565b85858481811061088f5761088e614b9a565b5b905060200201356000612c3c565b50508383828181106108b2576108b1614b9a565b5b90506020020135826108c49190614bf8565b915080806108d190614c4e565b915050610846565b503481146109205734816040517f02760fce000000000000000000000000000000000000000000000000000000008152600401610917929190614493565b60405180910390fd5b5050505050565b6000606954610934612ee5565b73ffffffffffffffffffffffffffffffffffffffff166330ec70f5306040518263ffffffff1660e01b815260040161096c91906144cb565b602060405180830381865afa158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad9190614cac565b476109b89190614bf8565b6109c29190614cd9565b905090565b6000606760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b60695481565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610af757336040517f3b2495f1000000000000000000000000000000000000000000000000000000008152600401610aee91906144cb565b60405180910390fd5b6000610b01612fac565b73ffffffffffffffffffffffffffffffffffffffff16632edfd12e87878787876040518663ffffffff1660e01b8152600401610b41959493929190614d0d565b6020604051808303816000875af1158015610b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b849190614d75565b905080610bc857856040517f30b7d05a000000000000000000000000000000000000000000000000000000008152600401610bbf9190614271565b60405180910390fd5b505050505050565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6257336040517f3b2495f1000000000000000000000000000000000000000000000000000000008152600401610c5991906144cb565b60405180910390fd5b818190508484905014610ca1576040517f8cd9cb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600090505b8383905081101561104a5760003073ffffffffffffffffffffffffffffffffffffffff1663acd201d0888885818110610ce557610ce4614b9a565b5b9050602002016020810190610cfa91906142ea565b6040518263ffffffff1660e01b8152600401610d1691906144cb565b602060405180830381865afa158015610d33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d579190614cac565b9050848483818110610d6c57610d6b614b9a565b5b90506020020135811015610dfb57868683818110610d8d57610d8c614b9a565b5b9050602002016020810190610da291906142ea565b81868685818110610db657610db5614b9a565b5b905060200201356040517fd5493527000000000000000000000000000000000000000000000000000000008152600401610df293929190614da2565b60405180910390fd5b848483818110610e0e57610e0d614b9a565b5b9050602002013560686000898986818110610e2c57610e2b614b9a565b5b9050602002016020810190610e4191906142ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254610e8d9190614bf8565b92505081905550848483818110610ea757610ea6614b9a565b5b9050602002013560686000898986818110610ec557610ec4614b9a565b5b9050602002016020810190610eda91906142ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f639190614bf8565b92505081905550848483818110610f7d57610f7c614b9a565b5b9050602002013583610f8f9190614bf8565b9250868683818110610fa457610fa3614b9a565b5b9050602002016020810190610fb991906142ea565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f6b63acc273560d01b849e2d77c42ac2cd2b6ff5e1c775423c52a6e50be320e7b87878681811061101a57611019614b9a565b5b9050602002013560405161102e9190614271565b60405180910390a350808061104290614c4e565b915050610ca9565b50806069600082825461105d9190614bf8565b92505081905550505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156110fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f290614e5c565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661113a613073565b73ffffffffffffffffffffffffffffffffffffffff1614611190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118790614eee565b60405180910390fd5b611199816130ca565b6111f281600067ffffffffffffffff8111156111b8576111b76144fc565b5b6040519080825280601f01601f1916602001820160405280156111ea5781602001600182028036833780820191505090505b506000613149565b50565b6067602052816000526040600020818154811061121157600080fd5b9060005260206000209060020201600091509150508060000154908060010154905082565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156112eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e290614e5c565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661132a613073565b73ffffffffffffffffffffffffffffffffffffffff1614611380576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137790614eee565b60405180910390fd5b611389826130ca565b61139582826001613149565b5050565b60008060008060016002600080935093509350935090919293565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b61140861331a565b73ffffffffffffffffffffffffffffffffffffffff16611426611745565b73ffffffffffffffffffffffffffffffffffffffff161461147c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147390614f5a565b60405180910390fd5b6114866000613322565b565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006114be8686866133e8565b915091506000606760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600182805490506115179190614cd9565b8154811061152857611527614b9a565b5b906000526020600020906002020181878154811061154957611548614b9a565b5b906000526020600020906002020160008201548160000155600182015481600101559050508080548061157f5761157e614f7a565b5b60019003818190600052602060002090600202016000808201600090556001820160009055505090556115b0612ee5565b73ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d866040518263ffffffff1660e01b81526004016115e89190614271565b600060405180830381600087803b15801561160257600080fd5b505af1158015611616573d6000803e3d6000fd5b505050506000611624613675565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb89866040518363ffffffff1660e01b815260040161165e929190614fa9565b6020604051808303816000875af115801561167d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a19190614d75565b9050806116e75787846040517fbe1b53150000000000000000000000000000000000000000000000000000000081526004016116de929190614fa9565b60405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff167f3bb2914428a7565afeafb57ef1a5bad4a2de7be9bf7b41b7e5da505f4b974ce2858560405161172f929190614493565b60405180910390a2839450505050509392505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061177d87600080612c3c565b915050600081141561178f57506117f9565b61179e8782888888888861373c565b80606860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282546117f09190614cd9565b92505081905550505b505050505050565b600080606860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008114156118ce5788886040517f7a9a71fb0000000000000000000000000000000000000000000000000000000081526004016118c5929190614fd2565b60405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f6e250cfd645a8eac07044223b0b240549b17fe4a71aab09d925cb413b72b00ae8360405161192b9190614271565b60405180910390a36000606860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080606860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254611a0a9190614cd9565b925050819055508060696000828254611a239190614cd9565b925050819055506000611a3889600080612c3c565b5090506000611a474783613a66565b90506000811115611b9a5782811115611a5e578290505b80606860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254611ab09190614cd9565b925050819055506000611ac1613675565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8d846040518363ffffffff1660e01b8152600401611afb929190614fa9565b6020604051808303816000875af1158015611b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3e9190614d75565b905080611b84578b826040517fbe1b5315000000000000000000000000000000000000000000000000000000008152600401611b7b929190614fa9565b60405180910390fd5b83821415611b985781945050505050611d45565b505b60008184611ba89190614cd9565b90506000611bb4612ee5565b9050606760008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180604001604052808481526020018373ffffffffffffffffffffffffffffffffffffffff166320637d8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c759190614cac565b42611c809190614bf8565b815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000155602082015181600101555050611cd18c838d8d8d8d8d61373c565b8073ffffffffffffffffffffffffffffffffffffffff16636198e339836040518263ffffffff1660e01b8152600401611d0a9190614271565b600060405180830381600087803b158015611d2457600080fd5b505af1158015611d38573d6000803e3d6000fd5b5050505082955050505050505b979650505050505050565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e23613a7f565b73ffffffffffffffffffffffffffffffffffffffff16633861727286306040518363ffffffff1660e01b8152600401611e5d929190614fd2565b602060405180830381865afa158015611e7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9e9190614cac565b611ea89190614bf8565b611eb29190614cd9565b611ebc9190614cd9565b9050919050565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b600060019054906101000a900460ff16611f375760008054906101000a900460ff1615611f40565b611f3f613b46565b5b611f7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f769061506d565b60405180910390fd5b60008060019054906101000a900460ff161590508015611fcf576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b611fd884613b57565b611fe183613c68565b611fea82613322565b611ff2613cc3565b73ffffffffffffffffffffffffffffffffffffffff16639dca362f6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561203e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120629190614d75565b612098576040517f20188a5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156120b95760008060016101000a81548160ff0219169083151502179055505b50505050565b6000606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000612153613a7f565b9050600061216385600080612c3c565b5090506000606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508173ffffffffffffffffffffffffffffffffffffffff1663263ecf7430876040518363ffffffff1660e01b81526004016121e9929190614fd2565b602060405180830381865afa158015612206573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222a9190614d75565b156122ed578173ffffffffffffffffffffffffffffffffffffffff16631c5a9d9c866040518263ffffffff1660e01b815260040161226891906144cb565b6020604051808303816000875af1158015612287573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ab9190614d75565b6122ec57846040517fbafbcc570000000000000000000000000000000000000000000000000000000081526004016122e391906144cb565b60405180910390fd5b5b60008114156122fd5750506124de565b6000612307612ee5565b73ffffffffffffffffffffffffffffffffffffffff16633f199b40306040518263ffffffff1660e01b815260040161233f91906144cb565b602060405180830381865afa15801561235c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123809190614cac565b905060008282101561239d5781836123989190614cd9565b6123a0565b60005b90506000811115612414576123b3612ee5565b73ffffffffffffffffffffffffffffffffffffffff1663f83d08ba826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156123fa57600080fd5b505af115801561240e573d6000803e3d6000fd5b50505050505b8373ffffffffffffffffffffffffffffffffffffffff1663580d747a888589896040518563ffffffff1660e01b8152600401612453949392919061508d565b6020604051808303816000875af1158015612472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124969190614d75565b6124d95786836040517fcbf8d8ef0000000000000000000000000000000000000000000000000000000081526004016124d0929190614fa9565b60405180910390fd5b505050505b505050565b6124eb61331a565b73ffffffffffffffffffffffffffffffffffffffff16612509611745565b73ffffffffffffffffffffffffffffffffffffffff161461255f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255690614f5a565b60405180910390fd5b61256881613d8a565b50565b6000806000606760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481106125c1576125c0614b9a565b5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090508060000151816020015192509250509250929050565b61260e61331a565b73ffffffffffffffffffffffffffffffffffffffff1661262c611745565b73ffffffffffffffffffffffffffffffffffffffff1614612682576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267990614f5a565b60405180910390fd5b61268a613a7f565b73ffffffffffffffffffffffffffffffffffffffff1663d52758aa826040518263ffffffff1660e01b81526004016126c291906150e1565b600060405180830381600087803b1580156126dc57600080fd5b505af11580156126f0573d6000803e3d6000fd5b5050505050565b6126ff61331a565b73ffffffffffffffffffffffffffffffffffffffff1661271d611745565b73ffffffffffffffffffffffffffffffffffffffff1614612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614f5a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156127e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127da9061516e565b60405180910390fd5b6127ec81613322565b50565b6060806000606760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090508067ffffffffffffffff811115612853576128526144fc565b5b6040519080825280602002602001820160405280156128815781602001602082028036833780820191505090505b5092508067ffffffffffffffff81111561289e5761289d6144fc565b5b6040519080825280602002602001820160405280156128cc5781602001602082028036833780820191505090505b50915060005b818110156129b8576000606760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061292d5761292c614b9a565b5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050806000015185838151811061297457612973614b9a565b5b602002602001018181525050806020015184838151811061299857612997614b9a565b5b6020026020010181815250505080806129b090614c4e565b9150506128d2565b5050915091565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a5157336040517f3b2495f1000000000000000000000000000000000000000000000000000000008152600401612a4891906144cb565b60405180910390fd5b8585905088889050141580612a6c5750818190508484905014155b15612aa3576040517f8cd9cb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060005b8a8a9050811015612b3c57612b008b8b83818110612aca57612ac9614b9a565b5b9050602002016020810190612adf91906142ea565b60008b8b85818110612af457612af3614b9a565b5b90506020020135612c3c565b5050888882818110612b1557612b14614b9a565b5b9050602002013583612b279190614bf8565b92508080612b3490614c4e565b915050612aa9565b5060005b86869050811015612bd357612b97878783818110612b6157612b60614b9a565b5b9050602002016020810190612b7691906142ea565b868684818110612b8957612b88614b9a565b5b905060200201356000612c3c565b5050848482818110612bac57612bab614b9a565b5b9050602002013582612bbe9190614bf8565b91508080612bcb90614c4e565b915050612b40565b50808214612c0d576040517f97df2d4f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008083606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612c8d9190614bf8565b915082606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154612cdd9190614bf8565b905080821115612d8c578082612cf39190614cd9565b915081606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506000905080606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550612e2d565b8181612d989190614cd9565b905080606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506000915081606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b6000841115612e85578473ffffffffffffffffffffffffffffffffffffffff167f3ee8e5d1cb8671d12b5b20284bb69c7fc325211a1f957cab060d8a78dcc64fba85604051612e7c9190614271565b60405180910390a25b6000831115612edd578473ffffffffffffffffffffffffffffffffffffffff167fd1689364af36a1aad50a34377d3bf08cc89d0e1f2ebc154359eb9087a6e81a3e84604051612ed49190614271565b60405180910390a25b935093915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001612f34906151e5565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401612f669190615213565b602060405180830381865afa158015612f83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fa79190615243565b905090565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001612ffb906152bc565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161302d9190615213565b602060405180830381865afa15801561304a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306e9190615243565b905090565b60006130a17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613e78565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6130d261331a565b73ffffffffffffffffffffffffffffffffffffffff166130f0611745565b73ffffffffffffffffffffffffffffffffffffffff1614613146576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161313d90614f5a565b60405180910390fd5b50565b6000613153613073565b905061315e84613e82565b60008351118061316b5750815b1561317c5761317a8484613f3b565b505b60006131aa7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b613f68565b90508060000160009054906101000a900460ff166133135760018160000160006101000a81548160ff02191690831515021790555061327685836040516024016131f491906144cb565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613f3b565b5060008160000160006101000a81548160ff02191690831515021790555061329c613073565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614613309576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161330090615343565b60405180910390fd5b61331285613f72565b5b5050505050565b600033905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080606760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905084106134b55783606760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506040517fdee6f5740000000000000000000000000000000000000000000000000000000081526004016134ac929190614493565b60405180910390fd5b6000806134c0612ee5565b73ffffffffffffffffffffffffffffffffffffffff1663d15ca4ed30876040518363ffffffff1660e01b81526004016134fa929190614fa9565b6040805180830381865afa158015613516573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353a9190615363565b915091506000606760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811061359157613590614b9a565b5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090508281600001511461360e578060000151836040517f753c4c22000000000000000000000000000000000000000000000000000000008152600401613605929190614493565b60405180910390fd5b8181602001511461365c578060200151826040517f8acd9503000000000000000000000000000000000000000000000000000000008152600401613653929190614493565b60405180910390fd5b8060000151816020015194509450505050935093915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed6040516020016136c4906153ef565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016136f69190615213565b602060405180830381865afa158015613713573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137379190615243565b905090565b6000613746613a7f565b905060008173ffffffffffffffffffffffffffffffffffffffff16639b95975f8a306040518363ffffffff1660e01b8152600401613785929190614fd2565b602060405180830381865afa1580156137a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c69190614cac565b905060006137d48983613a66565b905060008111156138a7578273ffffffffffffffffffffffffffffffffffffffff16639dfb60818b838b8b896040518663ffffffff1660e01b8152600401613820959493929190615404565b6020604051808303816000875af115801561383f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138639190614d75565b6138a65789896040517f88f72d9900000000000000000000000000000000000000000000000000000000815260040161389d929190614fa9565b60405180910390fd5b5b6000818a6138b59190614cd9565b905060008114156138c95750505050613a5d565b60008473ffffffffffffffffffffffffffffffffffffffff1663d3e242a48d306040518363ffffffff1660e01b8152600401613906929190614fd2565b602060405180830381865afa158015613923573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139479190614cac565b905081811015613990578b8b6040517fc7b27867000000000000000000000000000000000000000000000000000000008152600401613987929190614fa9565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16636e1984758d848b8b8b6040518663ffffffff1660e01b81526004016139d1959493929190615404565b6020604051808303816000875af11580156139f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a149190614d75565b613a57578b8b6040517f21ffa8e9000000000000000000000000000000000000000000000000000000008152600401613a4e929190614fa9565b60405180910390fd5b50505050505b50505050505050565b6000818310613a755781613a77565b825b905092915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001613ace906154a3565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401613b009190615213565b602060405180830381865afa158015613b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b419190615243565b905090565b6000613b5130612c19565b15905090565b600060019054906101000a900460ff16613ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b9d9061552a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613c235761ce10606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613c65565b80606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600060019054906101000a900460ff16613cb7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613cae9061552a565b60405180910390fd5b613cc081613d8a565b50565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001613d1290615596565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401613d449190615213565b602060405180830381865afa158015613d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d859190615243565b905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613df1576040517fe99d5ac500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80606660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f60a0f5b9f9e81e98216071b85826681c796256fe3d1354ecb675580fba64fa6960405160405180910390a250565b6000819050919050565b613e8b81613fc1565b613eca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ec19061561d565b60405180910390fd5b80613ef77f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613e78565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060613f6083836040518060600160405280602781526020016157c760279139613fd4565b905092915050565b6000819050919050565b613f7b81613e82565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b600080823b905060008111915050919050565b6060613fdf84613fc1565b61401e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614015906156af565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516140469190615749565b600060405180830381855af49150503d8060008114614081576040519150601f19603f3d011682016040523d82523d6000602084013e614086565b606091505b50915091506140968282866140a1565b925050509392505050565b606083156140b157829050614101565b6000835111156140c45782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016140f891906157a4565b60405180910390fd5b9392505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126141415761414061411c565b5b8235905067ffffffffffffffff81111561415e5761415d614121565b5b60208301915083602082028301111561417a57614179614126565b5b9250929050565b60008083601f8401126141975761419661411c565b5b8235905067ffffffffffffffff8111156141b4576141b3614121565b5b6020830191508360208202830111156141d0576141cf614126565b5b9250929050565b600080600080604085870312156141f1576141f0614112565b5b600085013567ffffffffffffffff81111561420f5761420e614117565b5b61421b8782880161412b565b9450945050602085013567ffffffffffffffff81111561423e5761423d614117565b5b61424a87828801614181565b925092505092959194509250565b6000819050919050565b61426b81614258565b82525050565b60006020820190506142866000830184614262565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006142b78261428c565b9050919050565b6142c7816142ac565b81146142d257600080fd5b50565b6000813590506142e4816142be565b92915050565b600060208284031215614300576142ff614112565b5b600061430e848285016142d5565b91505092915050565b61432081614258565b811461432b57600080fd5b50565b60008135905061433d81614317565b92915050565b600080600080600060a0868803121561435f5761435e614112565b5b600061436d8882890161432e565b955050602061437e8882890161432e565b945050604061438f8882890161432e565b93505060606143a08882890161432e565b92505060806143b18882890161432e565b9150509295509295909350565b6000806000806000606086880312156143da576143d9614112565b5b60006143e8888289016142d5565b955050602086013567ffffffffffffffff81111561440957614408614117565b5b6144158882890161412b565b9450945050604086013567ffffffffffffffff81111561443857614437614117565b5b61444488828901614181565b92509250509295509295909350565b6000806040838503121561446a57614469614112565b5b6000614478858286016142d5565b92505060206144898582860161432e565b9150509250929050565b60006040820190506144a86000830185614262565b6144b56020830184614262565b9392505050565b6144c5816142ac565b82525050565b60006020820190506144e060008301846144bc565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614534826144eb565b810181811067ffffffffffffffff82111715614553576145526144fc565b5b80604052505050565b6000614566614108565b9050614572828261452b565b919050565b600067ffffffffffffffff821115614592576145916144fc565b5b61459b826144eb565b9050602081019050919050565b82818337600083830152505050565b60006145ca6145c584614577565b61455c565b9050828152602081018484840111156145e6576145e56144e6565b5b6145f18482856145a8565b509392505050565b600082601f83011261460e5761460d61411c565b5b813561461e8482602086016145b7565b91505092915050565b6000806040838503121561463e5761463d614112565b5b600061464c858286016142d5565b925050602083013567ffffffffffffffff81111561466d5761466c614117565b5b614679858286016145f9565b9150509250929050565b60006080820190506146986000830187614262565b6146a56020830186614262565b6146b26040830185614262565b6146bf6060830184614262565b95945050505050565b6000819050919050565b60006146ed6146e86146e38461428c565b6146c8565b61428c565b9050919050565b60006146ff826146d2565b9050919050565b6000614711826146f4565b9050919050565b61472181614706565b82525050565b600060208201905061473c6000830184614718565b92915050565b60008060006060848603121561475b5761475a614112565b5b6000614769868287016142d5565b935050602061477a8682870161432e565b925050604061478b8682870161432e565b9150509250925092565b60008060008060008060c087890312156147b2576147b1614112565b5b60006147c089828a016142d5565b96505060206147d189828a016142d5565b95505060406147e289828a016142d5565b94505060606147f389828a016142d5565b935050608061480489828a016142d5565b92505060a061481589828a0161432e565b9150509295509295509295565b600080600080600080600060e0888a03121561484157614840614112565b5b600061484f8a828b016142d5565b97505060206148608a828b016142d5565b96505060406148718a828b016142d5565b95505060606148828a828b016142d5565b94505060806148938a828b016142d5565b93505060a06148a48a828b016142d5565b92505060c06148b58a828b0161432e565b91505092959891949750929550565b6000806000606084860312156148dd576148dc614112565b5b60006148eb868287016142d5565b93505060206148fc868287016142d5565b925050604061490d868287016142d5565b9150509250925092565b6000806040838503121561492e5761492d614112565b5b600061493c858286016142d5565b925050602061494d858286016142d5565b9150509250929050565b60008115159050919050565b61496c81614957565b811461497757600080fd5b50565b60008135905061498981614963565b92915050565b6000602082840312156149a5576149a4614112565b5b60006149b38482850161497a565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6149f181614258565b82525050565b6000614a0383836149e8565b60208301905092915050565b6000602082019050919050565b6000614a27826149bc565b614a3181856149c7565b9350614a3c836149d8565b8060005b83811015614a6d578151614a5488826149f7565b9750614a5f83614a0f565b925050600181019050614a40565b5085935050505092915050565b60006040820190508181036000830152614a948185614a1c565b90508181036020830152614aa88184614a1c565b90509392505050565b6000806000806000806000806080898b031215614ad157614ad0614112565b5b600089013567ffffffffffffffff811115614aef57614aee614117565b5b614afb8b828c0161412b565b9850985050602089013567ffffffffffffffff811115614b1e57614b1d614117565b5b614b2a8b828c01614181565b9650965050604089013567ffffffffffffffff811115614b4d57614b4c614117565b5b614b598b828c0161412b565b9450945050606089013567ffffffffffffffff811115614b7c57614b7b614117565b5b614b888b828c01614181565b92509250509295985092959890939650565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614c0382614258565b9150614c0e83614258565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614c4357614c42614bc9565b5b828201905092915050565b6000614c5982614258565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614c8c57614c8b614bc9565b5b600182019050919050565b600081519050614ca681614317565b92915050565b600060208284031215614cc257614cc1614112565b5b6000614cd084828501614c97565b91505092915050565b6000614ce482614258565b9150614cef83614258565b925082821015614d0257614d01614bc9565b5b828203905092915050565b600060a082019050614d226000830188614262565b614d2f6020830187614262565b614d3c6040830186614262565b614d496060830185614262565b614d566080830184614262565b9695505050505050565b600081519050614d6f81614963565b92915050565b600060208284031215614d8b57614d8a614112565b5b6000614d9984828501614d60565b91505092915050565b6000606082019050614db760008301866144bc565b614dc46020830185614262565b614dd16040830184614262565b949350505050565b600082825260208201905092915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000614e46602c83614dd9565b9150614e5182614dea565b604082019050919050565b60006020820190508181036000830152614e7581614e39565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000614ed8602c83614dd9565b9150614ee382614e7c565b604082019050919050565b60006020820190508181036000830152614f0781614ecb565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614f44602083614dd9565b9150614f4f82614f0e565b602082019050919050565b60006020820190508181036000830152614f7381614f37565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000604082019050614fbe60008301856144bc565b614fcb6020830184614262565b9392505050565b6000604082019050614fe760008301856144bc565b614ff460208301846144bc565b9392505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000615057602e83614dd9565b915061506282614ffb565b604082019050919050565b600060208201905081810360008301526150868161504a565b9050919050565b60006080820190506150a260008301876144bc565b6150af6020830186614262565b6150bc60408301856144bc565b6150c960608301846144bc565b95945050505050565b6150db81614957565b82525050565b60006020820190506150f660008301846150d2565b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000615158602683614dd9565b9150615163826150fc565b604082019050919050565b600060208201905081810360008301526151878161514b565b9050919050565b600081905092915050565b7f4c6f636b6564476f6c6400000000000000000000000000000000000000000000600082015250565b60006151cf600a8361518e565b91506151da82615199565b600a82019050919050565b60006151f0826151c2565b9150819050919050565b6000819050919050565b61520d816151fa565b82525050565b60006020820190506152286000830184615204565b92915050565b60008151905061523d816142be565b92915050565b60006020828403121561525957615258614112565b5b60006152678482850161522e565b91505092915050565b7f476f7665726e616e636500000000000000000000000000000000000000000000600082015250565b60006152a6600a8361518e565b91506152b182615270565b600a82019050919050565b60006152c782615299565b9150819050919050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b600061532d602f83614dd9565b9150615338826152d1565b604082019050919050565b6000602082019050818103600083015261535c81615320565b9050919050565b6000806040838503121561537a57615379614112565b5b600061538885828601614c97565b925050602061539985828601614c97565b9150509250929050565b7f476f6c64546f6b656e0000000000000000000000000000000000000000000000600082015250565b60006153d960098361518e565b91506153e4826153a3565b600982019050919050565b60006153fa826153cc565b9150819050919050565b600060a08201905061541960008301886144bc565b6154266020830187614262565b61543360408301866144bc565b61544060608301856144bc565b61544d6080830184614262565b9695505050505050565b7f456c656374696f6e000000000000000000000000000000000000000000000000600082015250565b600061548d60088361518e565b915061549882615457565b600882019050919050565b60006154ae82615480565b9150819050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000615514602b83614dd9565b915061551f826154b8565b604082019050919050565b6000602082019050818103600083015261554381615507565b9050919050565b7f4163636f756e7473000000000000000000000000000000000000000000000000600082015250565b600061558060088361518e565b915061558b8261554a565b600882019050919050565b60006155a182615573565b9150819050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b6000615607602d83614dd9565b9150615612826155ab565b604082019050919050565b60006020820190508181036000830152615636816155fa565b9050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b6000615699602683614dd9565b91506156a48261563d565b604082019050919050565b600060208201905081810360008301526156c88161568c565b9050919050565b600081519050919050565b600081905092915050565b60005b838110156157035780820151818401526020810190506156e8565b83811115615712576000848401525b50505050565b6000615723826156cf565b61572d81856156da565b935061573d8185602086016156e5565b80840191505092915050565b60006157558284615718565b915081905092915050565b600081519050919050565b600061577682615760565b6157808185614dd9565b93506157908185602086016156e5565b615799816144eb565b840191505092915050565b600060208201905081810360008301526157be818461576b565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220ed776a9e7412251143ad3fa029b96b1ad1d29b42c7130cc35a5d411a880143ed64736f6c634300080b0033
Deployed ByteCode
0x6080604052600436106101d15760003560e01c806384aff2e7116100f7578063c7fb232811610095578063d52758aa11610064578063d52758aa146106b4578063f2fde38b146106dd578063f340c0d014610706578063f380ade314610744576101d8565b8063c7fb2328146105e7578063c9a101f314610624578063d0ebdbe71461064d578063d15ca4ed14610676576101d8565b8063a020c8de116100d1578063a020c8de14610507578063acd201d014610544578063b09bdc5e14610581578063c0c53b8b146105be576101d8565b806384aff2e7146104765780638da5cb5b146104b357806395145221146104de576101d8565b80633659cfe61161016f57806354255be01161013e57806354255be0146103c95780635fd5c95e146103f7578063715018a6146104345780637b1039991461044b576101d8565b80633659cfe61461031b57806344dc497014610344578063481c6a75146103825780634f1ef286146103ad576101d8565b806322e59bd4116101ab57806322e59bd4146102615780632ad9ac411461029e5780632edfd12e146102c95780632f842a1a146102f2576101d8565b806301c21d59146101dd57806301d2b6ea146101f95780631449edb014610224576101d8565b366101d857005b600080fd5b6101f760048036038101906101f291906141d7565b61076d565b005b34801561020557600080fd5b5061020e610927565b60405161021b9190614271565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906142ea565b6109c7565b6040516102589190614271565b60405180910390f35b34801561026d57600080fd5b50610288600480360381019061028391906142ea565b610a13565b6040516102959190614271565b60405180910390f35b3480156102aa57600080fd5b506102b3610a5f565b6040516102c09190614271565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190614343565b610a65565b005b3480156102fe57600080fd5b50610319600480360381019061031491906143be565b610bd0565b005b34801561032757600080fd5b50610342600480360381019061033d91906142ea565b61106c565b005b34801561035057600080fd5b5061036b60048036038101906103669190614453565b6111f5565b604051610379929190614493565b60405180910390f35b34801561038e57600080fd5b50610397611236565b6040516103a491906144cb565b60405180910390f35b6103c760048036038101906103c29190614627565b61125c565b005b3480156103d557600080fd5b506103de611399565b6040516103ee9493929190614683565b60405180910390f35b34801561040357600080fd5b5061041e600480360381019061041991906142ea565b6113b4565b60405161042b9190614271565b60405180910390f35b34801561044057600080fd5b50610449611400565b005b34801561045757600080fd5b50610460611488565b60405161046d9190614727565b60405180910390f35b34801561048257600080fd5b5061049d60048036038101906104989190614742565b6114ae565b6040516104aa9190614271565b60405180910390f35b3480156104bf57600080fd5b506104c8611745565b6040516104d591906144cb565b60405180910390f35b3480156104ea57600080fd5b5061050560048036038101906105009190614795565b61176f565b005b34801561051357600080fd5b5061052e60048036038101906105299190614822565b611801565b60405161053b9190614271565b60405180910390f35b34801561055057600080fd5b5061056b600480360381019061056691906142ea565b611d50565b6040516105789190614271565b60405180910390f35b34801561058d57600080fd5b506105a860048036038101906105a391906142ea565b611ec3565b6040516105b59190614271565b60405180910390f35b3480156105ca57600080fd5b506105e560048036038101906105e091906148c4565b611f0f565b005b3480156105f357600080fd5b5061060e60048036038101906106099190614917565b6120bf565b60405161061b9190614271565b60405180910390f35b34801561063057600080fd5b5061064b600480360381019061064691906148c4565b612149565b005b34801561065957600080fd5b50610674600480360381019061066f91906142ea565b6124e3565b005b34801561068257600080fd5b5061069d60048036038101906106989190614453565b61256b565b6040516106ab929190614493565b60405180910390f35b3480156106c057600080fd5b506106db60048036038101906106d6919061498f565b612606565b005b3480156106e957600080fd5b5061070460048036038101906106ff91906142ea565b6126f7565b005b34801561071257600080fd5b5061072d600480360381019061072891906142ea565b6127ef565b60405161073b929190614a7a565b60405180910390f35b34801561075057600080fd5b5061076b60048036038101906107669190614ab1565b6129bf565b005b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ff57336040517f3b2495f10000000000000000000000000000000000000000000000000000000081526004016107f691906144cb565b60405180910390fd5b81819050848490501461083e576040517f8cd9cb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600090505b858590508110156108d95761089d86868381811061086757610866614b9a565b5b905060200201602081019061087c91906142ea565b85858481811061088f5761088e614b9a565b5b905060200201356000612c3c565b50508383828181106108b2576108b1614b9a565b5b90506020020135826108c49190614bf8565b915080806108d190614c4e565b915050610846565b503481146109205734816040517f02760fce000000000000000000000000000000000000000000000000000000008152600401610917929190614493565b60405180910390fd5b5050505050565b6000606954610934612ee5565b73ffffffffffffffffffffffffffffffffffffffff166330ec70f5306040518263ffffffff1660e01b815260040161096c91906144cb565b602060405180830381865afa158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad9190614cac565b476109b89190614bf8565b6109c29190614cd9565b905090565b6000606760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b60695481565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610af757336040517f3b2495f1000000000000000000000000000000000000000000000000000000008152600401610aee91906144cb565b60405180910390fd5b6000610b01612fac565b73ffffffffffffffffffffffffffffffffffffffff16632edfd12e87878787876040518663ffffffff1660e01b8152600401610b41959493929190614d0d565b6020604051808303816000875af1158015610b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b849190614d75565b905080610bc857856040517f30b7d05a000000000000000000000000000000000000000000000000000000008152600401610bbf9190614271565b60405180910390fd5b505050505050565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6257336040517f3b2495f1000000000000000000000000000000000000000000000000000000008152600401610c5991906144cb565b60405180910390fd5b818190508484905014610ca1576040517f8cd9cb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600090505b8383905081101561104a5760003073ffffffffffffffffffffffffffffffffffffffff1663acd201d0888885818110610ce557610ce4614b9a565b5b9050602002016020810190610cfa91906142ea565b6040518263ffffffff1660e01b8152600401610d1691906144cb565b602060405180830381865afa158015610d33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d579190614cac565b9050848483818110610d6c57610d6b614b9a565b5b90506020020135811015610dfb57868683818110610d8d57610d8c614b9a565b5b9050602002016020810190610da291906142ea565b81868685818110610db657610db5614b9a565b5b905060200201356040517fd5493527000000000000000000000000000000000000000000000000000000008152600401610df293929190614da2565b60405180910390fd5b848483818110610e0e57610e0d614b9a565b5b9050602002013560686000898986818110610e2c57610e2b614b9a565b5b9050602002016020810190610e4191906142ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254610e8d9190614bf8565b92505081905550848483818110610ea757610ea6614b9a565b5b9050602002013560686000898986818110610ec557610ec4614b9a565b5b9050602002016020810190610eda91906142ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f639190614bf8565b92505081905550848483818110610f7d57610f7c614b9a565b5b9050602002013583610f8f9190614bf8565b9250868683818110610fa457610fa3614b9a565b5b9050602002016020810190610fb991906142ea565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f6b63acc273560d01b849e2d77c42ac2cd2b6ff5e1c775423c52a6e50be320e7b87878681811061101a57611019614b9a565b5b9050602002013560405161102e9190614271565b60405180910390a350808061104290614c4e565b915050610ca9565b50806069600082825461105d9190614bf8565b92505081905550505050505050565b7f0000000000000000000000000a0b728d00f0e3a3d8c6849e76dc98b1d39f3ade73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156110fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f290614e5c565b60405180910390fd5b7f0000000000000000000000000a0b728d00f0e3a3d8c6849e76dc98b1d39f3ade73ffffffffffffffffffffffffffffffffffffffff1661113a613073565b73ffffffffffffffffffffffffffffffffffffffff1614611190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118790614eee565b60405180910390fd5b611199816130ca565b6111f281600067ffffffffffffffff8111156111b8576111b76144fc565b5b6040519080825280601f01601f1916602001820160405280156111ea5781602001600182028036833780820191505090505b506000613149565b50565b6067602052816000526040600020818154811061121157600080fd5b9060005260206000209060020201600091509150508060000154908060010154905082565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f0000000000000000000000000a0b728d00f0e3a3d8c6849e76dc98b1d39f3ade73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156112eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e290614e5c565b60405180910390fd5b7f0000000000000000000000000a0b728d00f0e3a3d8c6849e76dc98b1d39f3ade73ffffffffffffffffffffffffffffffffffffffff1661132a613073565b73ffffffffffffffffffffffffffffffffffffffff1614611380576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137790614eee565b60405180910390fd5b611389826130ca565b61139582826001613149565b5050565b60008060008060016002600080935093509350935090919293565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b61140861331a565b73ffffffffffffffffffffffffffffffffffffffff16611426611745565b73ffffffffffffffffffffffffffffffffffffffff161461147c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147390614f5a565b60405180910390fd5b6114866000613322565b565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006114be8686866133e8565b915091506000606760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600182805490506115179190614cd9565b8154811061152857611527614b9a565b5b906000526020600020906002020181878154811061154957611548614b9a565b5b906000526020600020906002020160008201548160000155600182015481600101559050508080548061157f5761157e614f7a565b5b60019003818190600052602060002090600202016000808201600090556001820160009055505090556115b0612ee5565b73ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d866040518263ffffffff1660e01b81526004016115e89190614271565b600060405180830381600087803b15801561160257600080fd5b505af1158015611616573d6000803e3d6000fd5b505050506000611624613675565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb89866040518363ffffffff1660e01b815260040161165e929190614fa9565b6020604051808303816000875af115801561167d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a19190614d75565b9050806116e75787846040517fbe1b53150000000000000000000000000000000000000000000000000000000081526004016116de929190614fa9565b60405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff167f3bb2914428a7565afeafb57ef1a5bad4a2de7be9bf7b41b7e5da505f4b974ce2858560405161172f929190614493565b60405180910390a2839450505050509392505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061177d87600080612c3c565b915050600081141561178f57506117f9565b61179e8782888888888861373c565b80606860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282546117f09190614cd9565b92505081905550505b505050505050565b600080606860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008114156118ce5788886040517f7a9a71fb0000000000000000000000000000000000000000000000000000000081526004016118c5929190614fd2565b60405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f6e250cfd645a8eac07044223b0b240549b17fe4a71aab09d925cb413b72b00ae8360405161192b9190614271565b60405180910390a36000606860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080606860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254611a0a9190614cd9565b925050819055508060696000828254611a239190614cd9565b925050819055506000611a3889600080612c3c565b5090506000611a474783613a66565b90506000811115611b9a5782811115611a5e578290505b80606860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254611ab09190614cd9565b925050819055506000611ac1613675565b73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8d846040518363ffffffff1660e01b8152600401611afb929190614fa9565b6020604051808303816000875af1158015611b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3e9190614d75565b905080611b84578b826040517fbe1b5315000000000000000000000000000000000000000000000000000000008152600401611b7b929190614fa9565b60405180910390fd5b83821415611b985781945050505050611d45565b505b60008184611ba89190614cd9565b90506000611bb4612ee5565b9050606760008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180604001604052808481526020018373ffffffffffffffffffffffffffffffffffffffff166320637d8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c759190614cac565b42611c809190614bf8565b815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000155602082015181600101555050611cd18c838d8d8d8d8d61373c565b8073ffffffffffffffffffffffffffffffffffffffff16636198e339836040518263ffffffff1660e01b8152600401611d0a9190614271565b600060405180830381600087803b158015611d2457600080fd5b505af1158015611d38573d6000803e3d6000fd5b5050505082955050505050505b979650505050505050565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e23613a7f565b73ffffffffffffffffffffffffffffffffffffffff16633861727286306040518363ffffffff1660e01b8152600401611e5d929190614fd2565b602060405180830381865afa158015611e7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9e9190614cac565b611ea89190614bf8565b611eb29190614cd9565b611ebc9190614cd9565b9050919050565b6000606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b600060019054906101000a900460ff16611f375760008054906101000a900460ff1615611f40565b611f3f613b46565b5b611f7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f769061506d565b60405180910390fd5b60008060019054906101000a900460ff161590508015611fcf576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b611fd884613b57565b611fe183613c68565b611fea82613322565b611ff2613cc3565b73ffffffffffffffffffffffffffffffffffffffff16639dca362f6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561203e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120629190614d75565b612098576040517f20188a5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156120b95760008060016101000a81548160ff0219169083151502179055505b50505050565b6000606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000612153613a7f565b9050600061216385600080612c3c565b5090506000606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508173ffffffffffffffffffffffffffffffffffffffff1663263ecf7430876040518363ffffffff1660e01b81526004016121e9929190614fd2565b602060405180830381865afa158015612206573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222a9190614d75565b156122ed578173ffffffffffffffffffffffffffffffffffffffff16631c5a9d9c866040518263ffffffff1660e01b815260040161226891906144cb565b6020604051808303816000875af1158015612287573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ab9190614d75565b6122ec57846040517fbafbcc570000000000000000000000000000000000000000000000000000000081526004016122e391906144cb565b60405180910390fd5b5b60008114156122fd5750506124de565b6000612307612ee5565b73ffffffffffffffffffffffffffffffffffffffff16633f199b40306040518263ffffffff1660e01b815260040161233f91906144cb565b602060405180830381865afa15801561235c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123809190614cac565b905060008282101561239d5781836123989190614cd9565b6123a0565b60005b90506000811115612414576123b3612ee5565b73ffffffffffffffffffffffffffffffffffffffff1663f83d08ba826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156123fa57600080fd5b505af115801561240e573d6000803e3d6000fd5b50505050505b8373ffffffffffffffffffffffffffffffffffffffff1663580d747a888589896040518563ffffffff1660e01b8152600401612453949392919061508d565b6020604051808303816000875af1158015612472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124969190614d75565b6124d95786836040517fcbf8d8ef0000000000000000000000000000000000000000000000000000000081526004016124d0929190614fa9565b60405180910390fd5b505050505b505050565b6124eb61331a565b73ffffffffffffffffffffffffffffffffffffffff16612509611745565b73ffffffffffffffffffffffffffffffffffffffff161461255f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255690614f5a565b60405180910390fd5b61256881613d8a565b50565b6000806000606760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481106125c1576125c0614b9a565b5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090508060000151816020015192509250509250929050565b61260e61331a565b73ffffffffffffffffffffffffffffffffffffffff1661262c611745565b73ffffffffffffffffffffffffffffffffffffffff1614612682576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267990614f5a565b60405180910390fd5b61268a613a7f565b73ffffffffffffffffffffffffffffffffffffffff1663d52758aa826040518263ffffffff1660e01b81526004016126c291906150e1565b600060405180830381600087803b1580156126dc57600080fd5b505af11580156126f0573d6000803e3d6000fd5b5050505050565b6126ff61331a565b73ffffffffffffffffffffffffffffffffffffffff1661271d611745565b73ffffffffffffffffffffffffffffffffffffffff1614612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614f5a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156127e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127da9061516e565b60405180910390fd5b6127ec81613322565b50565b6060806000606760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090508067ffffffffffffffff811115612853576128526144fc565b5b6040519080825280602002602001820160405280156128815781602001602082028036833780820191505090505b5092508067ffffffffffffffff81111561289e5761289d6144fc565b5b6040519080825280602002602001820160405280156128cc5781602001602082028036833780820191505090505b50915060005b818110156129b8576000606760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061292d5761292c614b9a565b5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050806000015185838151811061297457612973614b9a565b5b602002602001018181525050806020015184838151811061299857612997614b9a565b5b6020026020010181815250505080806129b090614c4e565b9150506128d2565b5050915091565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a5157336040517f3b2495f1000000000000000000000000000000000000000000000000000000008152600401612a4891906144cb565b60405180910390fd5b8585905088889050141580612a6c5750818190508484905014155b15612aa3576040517f8cd9cb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060005b8a8a9050811015612b3c57612b008b8b83818110612aca57612ac9614b9a565b5b9050602002016020810190612adf91906142ea565b60008b8b85818110612af457612af3614b9a565b5b90506020020135612c3c565b5050888882818110612b1557612b14614b9a565b5b9050602002013583612b279190614bf8565b92508080612b3490614c4e565b915050612aa9565b5060005b86869050811015612bd357612b97878783818110612b6157612b60614b9a565b5b9050602002016020810190612b7691906142ea565b868684818110612b8957612b88614b9a565b5b905060200201356000612c3c565b5050848482818110612bac57612bab614b9a565b5b9050602002013582612bbe9190614bf8565b91508080612bcb90614c4e565b915050612b40565b50808214612c0d576040517f97df2d4f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008083606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612c8d9190614bf8565b915082606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154612cdd9190614bf8565b905080821115612d8c578082612cf39190614cd9565b915081606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506000905080606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550612e2d565b8181612d989190614cd9565b905080606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506000915081606860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b6000841115612e85578473ffffffffffffffffffffffffffffffffffffffff167f3ee8e5d1cb8671d12b5b20284bb69c7fc325211a1f957cab060d8a78dcc64fba85604051612e7c9190614271565b60405180910390a25b6000831115612edd578473ffffffffffffffffffffffffffffffffffffffff167fd1689364af36a1aad50a34377d3bf08cc89d0e1f2ebc154359eb9087a6e81a3e84604051612ed49190614271565b60405180910390a25b935093915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001612f34906151e5565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401612f669190615213565b602060405180830381865afa158015612f83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fa79190615243565b905090565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001612ffb906152bc565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161302d9190615213565b602060405180830381865afa15801561304a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306e9190615243565b905090565b60006130a17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613e78565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6130d261331a565b73ffffffffffffffffffffffffffffffffffffffff166130f0611745565b73ffffffffffffffffffffffffffffffffffffffff1614613146576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161313d90614f5a565b60405180910390fd5b50565b6000613153613073565b905061315e84613e82565b60008351118061316b5750815b1561317c5761317a8484613f3b565b505b60006131aa7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b613f68565b90508060000160009054906101000a900460ff166133135760018160000160006101000a81548160ff02191690831515021790555061327685836040516024016131f491906144cb565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613f3b565b5060008160000160006101000a81548160ff02191690831515021790555061329c613073565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614613309576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161330090615343565b60405180910390fd5b61331285613f72565b5b5050505050565b600033905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080606760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905084106134b55783606760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506040517fdee6f5740000000000000000000000000000000000000000000000000000000081526004016134ac929190614493565b60405180910390fd5b6000806134c0612ee5565b73ffffffffffffffffffffffffffffffffffffffff1663d15ca4ed30876040518363ffffffff1660e01b81526004016134fa929190614fa9565b6040805180830381865afa158015613516573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353a9190615363565b915091506000606760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811061359157613590614b9a565b5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090508281600001511461360e578060000151836040517f753c4c22000000000000000000000000000000000000000000000000000000008152600401613605929190614493565b60405180910390fd5b8181602001511461365c578060200151826040517f8acd9503000000000000000000000000000000000000000000000000000000008152600401613653929190614493565b60405180910390fd5b8060000151816020015194509450505050935093915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed6040516020016136c4906153ef565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016136f69190615213565b602060405180830381865afa158015613713573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137379190615243565b905090565b6000613746613a7f565b905060008173ffffffffffffffffffffffffffffffffffffffff16639b95975f8a306040518363ffffffff1660e01b8152600401613785929190614fd2565b602060405180830381865afa1580156137a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c69190614cac565b905060006137d48983613a66565b905060008111156138a7578273ffffffffffffffffffffffffffffffffffffffff16639dfb60818b838b8b896040518663ffffffff1660e01b8152600401613820959493929190615404565b6020604051808303816000875af115801561383f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138639190614d75565b6138a65789896040517f88f72d9900000000000000000000000000000000000000000000000000000000815260040161389d929190614fa9565b60405180910390fd5b5b6000818a6138b59190614cd9565b905060008114156138c95750505050613a5d565b60008473ffffffffffffffffffffffffffffffffffffffff1663d3e242a48d306040518363ffffffff1660e01b8152600401613906929190614fd2565b602060405180830381865afa158015613923573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139479190614cac565b905081811015613990578b8b6040517fc7b27867000000000000000000000000000000000000000000000000000000008152600401613987929190614fa9565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16636e1984758d848b8b8b6040518663ffffffff1660e01b81526004016139d1959493929190615404565b6020604051808303816000875af11580156139f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a149190614d75565b613a57578b8b6040517f21ffa8e9000000000000000000000000000000000000000000000000000000008152600401613a4e929190614fa9565b60405180910390fd5b50505050505b50505050505050565b6000818310613a755781613a77565b825b905092915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001613ace906154a3565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401613b009190615213565b602060405180830381865afa158015613b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b419190615243565b905090565b6000613b5130612c19565b15905090565b600060019054906101000a900460ff16613ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b9d9061552a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613c235761ce10606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613c65565b80606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600060019054906101000a900460ff16613cb7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613cae9061552a565b60405180910390fd5b613cc081613d8a565b50565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001613d1290615596565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401613d449190615213565b602060405180830381865afa158015613d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d859190615243565b905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613df1576040517fe99d5ac500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80606660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f60a0f5b9f9e81e98216071b85826681c796256fe3d1354ecb675580fba64fa6960405160405180910390a250565b6000819050919050565b613e8b81613fc1565b613eca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ec19061561d565b60405180910390fd5b80613ef77f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613e78565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060613f6083836040518060600160405280602781526020016157c760279139613fd4565b905092915050565b6000819050919050565b613f7b81613e82565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b600080823b905060008111915050919050565b6060613fdf84613fc1565b61401e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614015906156af565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516140469190615749565b600060405180830381855af49150503d8060008114614081576040519150601f19603f3d011682016040523d82523d6000602084013e614086565b606091505b50915091506140968282866140a1565b925050509392505050565b606083156140b157829050614101565b6000835111156140c45782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016140f891906157a4565b60405180910390fd5b9392505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126141415761414061411c565b5b8235905067ffffffffffffffff81111561415e5761415d614121565b5b60208301915083602082028301111561417a57614179614126565b5b9250929050565b60008083601f8401126141975761419661411c565b5b8235905067ffffffffffffffff8111156141b4576141b3614121565b5b6020830191508360208202830111156141d0576141cf614126565b5b9250929050565b600080600080604085870312156141f1576141f0614112565b5b600085013567ffffffffffffffff81111561420f5761420e614117565b5b61421b8782880161412b565b9450945050602085013567ffffffffffffffff81111561423e5761423d614117565b5b61424a87828801614181565b925092505092959194509250565b6000819050919050565b61426b81614258565b82525050565b60006020820190506142866000830184614262565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006142b78261428c565b9050919050565b6142c7816142ac565b81146142d257600080fd5b50565b6000813590506142e4816142be565b92915050565b600060208284031215614300576142ff614112565b5b600061430e848285016142d5565b91505092915050565b61432081614258565b811461432b57600080fd5b50565b60008135905061433d81614317565b92915050565b600080600080600060a0868803121561435f5761435e614112565b5b600061436d8882890161432e565b955050602061437e8882890161432e565b945050604061438f8882890161432e565b93505060606143a08882890161432e565b92505060806143b18882890161432e565b9150509295509295909350565b6000806000806000606086880312156143da576143d9614112565b5b60006143e8888289016142d5565b955050602086013567ffffffffffffffff81111561440957614408614117565b5b6144158882890161412b565b9450945050604086013567ffffffffffffffff81111561443857614437614117565b5b61444488828901614181565b92509250509295509295909350565b6000806040838503121561446a57614469614112565b5b6000614478858286016142d5565b92505060206144898582860161432e565b9150509250929050565b60006040820190506144a86000830185614262565b6144b56020830184614262565b9392505050565b6144c5816142ac565b82525050565b60006020820190506144e060008301846144bc565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614534826144eb565b810181811067ffffffffffffffff82111715614553576145526144fc565b5b80604052505050565b6000614566614108565b9050614572828261452b565b919050565b600067ffffffffffffffff821115614592576145916144fc565b5b61459b826144eb565b9050602081019050919050565b82818337600083830152505050565b60006145ca6145c584614577565b61455c565b9050828152602081018484840111156145e6576145e56144e6565b5b6145f18482856145a8565b509392505050565b600082601f83011261460e5761460d61411c565b5b813561461e8482602086016145b7565b91505092915050565b6000806040838503121561463e5761463d614112565b5b600061464c858286016142d5565b925050602083013567ffffffffffffffff81111561466d5761466c614117565b5b614679858286016145f9565b9150509250929050565b60006080820190506146986000830187614262565b6146a56020830186614262565b6146b26040830185614262565b6146bf6060830184614262565b95945050505050565b6000819050919050565b60006146ed6146e86146e38461428c565b6146c8565b61428c565b9050919050565b60006146ff826146d2565b9050919050565b6000614711826146f4565b9050919050565b61472181614706565b82525050565b600060208201905061473c6000830184614718565b92915050565b60008060006060848603121561475b5761475a614112565b5b6000614769868287016142d5565b935050602061477a8682870161432e565b925050604061478b8682870161432e565b9150509250925092565b60008060008060008060c087890312156147b2576147b1614112565b5b60006147c089828a016142d5565b96505060206147d189828a016142d5565b95505060406147e289828a016142d5565b94505060606147f389828a016142d5565b935050608061480489828a016142d5565b92505060a061481589828a0161432e565b9150509295509295509295565b600080600080600080600060e0888a03121561484157614840614112565b5b600061484f8a828b016142d5565b97505060206148608a828b016142d5565b96505060406148718a828b016142d5565b95505060606148828a828b016142d5565b94505060806148938a828b016142d5565b93505060a06148a48a828b016142d5565b92505060c06148b58a828b0161432e565b91505092959891949750929550565b6000806000606084860312156148dd576148dc614112565b5b60006148eb868287016142d5565b93505060206148fc868287016142d5565b925050604061490d868287016142d5565b9150509250925092565b6000806040838503121561492e5761492d614112565b5b600061493c858286016142d5565b925050602061494d858286016142d5565b9150509250929050565b60008115159050919050565b61496c81614957565b811461497757600080fd5b50565b60008135905061498981614963565b92915050565b6000602082840312156149a5576149a4614112565b5b60006149b38482850161497a565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6149f181614258565b82525050565b6000614a0383836149e8565b60208301905092915050565b6000602082019050919050565b6000614a27826149bc565b614a3181856149c7565b9350614a3c836149d8565b8060005b83811015614a6d578151614a5488826149f7565b9750614a5f83614a0f565b925050600181019050614a40565b5085935050505092915050565b60006040820190508181036000830152614a948185614a1c565b90508181036020830152614aa88184614a1c565b90509392505050565b6000806000806000806000806080898b031215614ad157614ad0614112565b5b600089013567ffffffffffffffff811115614aef57614aee614117565b5b614afb8b828c0161412b565b9850985050602089013567ffffffffffffffff811115614b1e57614b1d614117565b5b614b2a8b828c01614181565b9650965050604089013567ffffffffffffffff811115614b4d57614b4c614117565b5b614b598b828c0161412b565b9450945050606089013567ffffffffffffffff811115614b7c57614b7b614117565b5b614b888b828c01614181565b92509250509295985092959890939650565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614c0382614258565b9150614c0e83614258565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614c4357614c42614bc9565b5b828201905092915050565b6000614c5982614258565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614c8c57614c8b614bc9565b5b600182019050919050565b600081519050614ca681614317565b92915050565b600060208284031215614cc257614cc1614112565b5b6000614cd084828501614c97565b91505092915050565b6000614ce482614258565b9150614cef83614258565b925082821015614d0257614d01614bc9565b5b828203905092915050565b600060a082019050614d226000830188614262565b614d2f6020830187614262565b614d3c6040830186614262565b614d496060830185614262565b614d566080830184614262565b9695505050505050565b600081519050614d6f81614963565b92915050565b600060208284031215614d8b57614d8a614112565b5b6000614d9984828501614d60565b91505092915050565b6000606082019050614db760008301866144bc565b614dc46020830185614262565b614dd16040830184614262565b949350505050565b600082825260208201905092915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000614e46602c83614dd9565b9150614e5182614dea565b604082019050919050565b60006020820190508181036000830152614e7581614e39565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000614ed8602c83614dd9565b9150614ee382614e7c565b604082019050919050565b60006020820190508181036000830152614f0781614ecb565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614f44602083614dd9565b9150614f4f82614f0e565b602082019050919050565b60006020820190508181036000830152614f7381614f37565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000604082019050614fbe60008301856144bc565b614fcb6020830184614262565b9392505050565b6000604082019050614fe760008301856144bc565b614ff460208301846144bc565b9392505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000615057602e83614dd9565b915061506282614ffb565b604082019050919050565b600060208201905081810360008301526150868161504a565b9050919050565b60006080820190506150a260008301876144bc565b6150af6020830186614262565b6150bc60408301856144bc565b6150c960608301846144bc565b95945050505050565b6150db81614957565b82525050565b60006020820190506150f660008301846150d2565b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000615158602683614dd9565b9150615163826150fc565b604082019050919050565b600060208201905081810360008301526151878161514b565b9050919050565b600081905092915050565b7f4c6f636b6564476f6c6400000000000000000000000000000000000000000000600082015250565b60006151cf600a8361518e565b91506151da82615199565b600a82019050919050565b60006151f0826151c2565b9150819050919050565b6000819050919050565b61520d816151fa565b82525050565b60006020820190506152286000830184615204565b92915050565b60008151905061523d816142be565b92915050565b60006020828403121561525957615258614112565b5b60006152678482850161522e565b91505092915050565b7f476f7665726e616e636500000000000000000000000000000000000000000000600082015250565b60006152a6600a8361518e565b91506152b182615270565b600a82019050919050565b60006152c782615299565b9150819050919050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b600061532d602f83614dd9565b9150615338826152d1565b604082019050919050565b6000602082019050818103600083015261535c81615320565b9050919050565b6000806040838503121561537a57615379614112565b5b600061538885828601614c97565b925050602061539985828601614c97565b9150509250929050565b7f476f6c64546f6b656e0000000000000000000000000000000000000000000000600082015250565b60006153d960098361518e565b91506153e4826153a3565b600982019050919050565b60006153fa826153cc565b9150819050919050565b600060a08201905061541960008301886144bc565b6154266020830187614262565b61543360408301866144bc565b61544060608301856144bc565b61544d6080830184614262565b9695505050505050565b7f456c656374696f6e000000000000000000000000000000000000000000000000600082015250565b600061548d60088361518e565b915061549882615457565b600882019050919050565b60006154ae82615480565b9150819050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000615514602b83614dd9565b915061551f826154b8565b604082019050919050565b6000602082019050818103600083015261554381615507565b9050919050565b7f4163636f756e7473000000000000000000000000000000000000000000000000600082015250565b600061558060088361518e565b915061558b8261554a565b600882019050919050565b60006155a182615573565b9150819050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b6000615607602d83614dd9565b9150615612826155ab565b604082019050919050565b60006020820190508181036000830152615636816155fa565b9050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b6000615699602683614dd9565b91506156a48261563d565b604082019050919050565b600060208201905081810360008301526156c88161568c565b9050919050565b600081519050919050565b600081905092915050565b60005b838110156157035780820151818401526020810190506156e8565b83811115615712576000848401525b50505050565b6000615723826156cf565b61572d81856156da565b935061573d8185602086016156e5565b80840191505092915050565b60006157558284615718565b915081905092915050565b600081519050919050565b600061577682615760565b6157808185614dd9565b93506157908185602086016156e5565b615799816144eb565b840191505092915050565b600060208201905081810360008301526157be818461576b565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220ed776a9e7412251143ad3fa029b96b1ad1d29b42c7130cc35a5d411a880143ed64736f6c634300080b0033