Address Details
contract
0xA0091608C8C4Df29ADACA90A037caa94Bc271ba0
- Contract Name
- Manager
- Creator
- 0x5bc1c4–68a788 at 0xb6ee50–7c727c
- 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
- 17756922
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- Manager
- Optimization enabled
- false
- Compiler version
- v0.8.11+commit.d7f03943
- EVM Version
- istanbul
- Verified at
- 2023-05-15T12:58:25.316890Z
contracts/Manager.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "./common/UsingRegistryUpgradeable.sol"; import "./common/UUPSOwnableUpgradeable.sol"; import "./interfaces/IAccount.sol"; import "./interfaces/IStakedCelo.sol"; import "./interfaces/IVote.sol"; import "./interfaces/IGroupHealth.sol"; import "./interfaces/ISpecificGroupStrategy.sol"; import "./interfaces/IDefaultStrategy.sol"; /** * @title Manages the StakedCelo system, by controlling the minting and burning * of stCELO and implementing strategies for voting and unvoting of deposited or * withdrawn CELO. */ contract Manager is UUPSOwnableUpgradeable, UsingRegistryUpgradeable { using EnumerableSet for EnumerableSet.AddressSet; /** * @notice An instance of the StakedCelo contract this Manager manages. */ IStakedCelo internal stakedCelo; /** * @notice An instance of the Account contract this Manager manages. */ IAccount internal account; /** * @notice OBSOLETE */ EnumerableSet.AddressSet private activeGroups; /** * @notice OBSOLETE */ EnumerableSet.AddressSet private deprecatedGroups; /** * @notice Contract used during Governance voting. */ address public voteContract; /** * @notice An instance of the GroupHealth contract for the StakedCelo protocol. */ IGroupHealth public groupHealth; /** * @notice An instance of the SpecificGroupStrategy contract for the StakedCelo protocol. */ ISpecificGroupStrategy public specificGroupStrategy; /** * @notice An instance of the DefaultStrategy contract for the StakedCelo protocol. */ IDefaultStrategy public defaultStrategy; /** * @notice address -> strategy used by an address * strategy: address(0) = default strategy * strategy: !address(0) = vote for the group at that address if allowed * by GroupHealth.isGroupValid, otherwise vote according to the default strategy */ mapping(address => address) public strategies; /** * @notice Emitted when the vote contract is initially set or later modified. * @param voteContract The new vote contract address. */ event VoteContractSet(address indexed voteContract); /** * @notice Used when attempting to withdraw 0 value. */ error ZeroWithdrawal(); /** * @notice Used when a group does not meet the validator group health requirements. * @param group The group's address. */ error GroupNotEligible(address group); /** * @notice Used when attempting to pass in address zero where not allowed. */ error AddressZeroNotAllowed(); /** * @notice Used when an `onlyStCelo` function is called by a non-stCELO contract. * @param caller `msg.sender` that called the function. */ error CallerNotStakedCelo(address caller); /** * @notice Used when an `onlyStrategy` function * is called by a non-strategy contract. * @param caller `msg.sender` that called the function. */ error CallerNotStrategy(address caller); /** * @notice Used when rebalancing to non-active nor specific group. * @param group The group's address. */ error InvalidToGroup(address group); /** * @notice Used when rebalancing and fromGroup doesn't have any extra CELO. * @param group The group's address. * @param actualCelo The actual CELO value. * @param expectedCelo The expected CELO value. */ error RebalanceNoExtraCelo(address group, uint256 actualCelo, uint256 expectedCelo); /** * @notice Used when rebalancing and toGroup has enough CELO. * @param group The group's address. * @param actualCelo The actual CELO value. * @param expectedCelo The expected CELO value. */ error RebalanceEnoughCelo(address group, uint256 actualCelo, uint256 expectedCelo); /** * @notice Used when trying to overflow rebalance group that is not overflowing. * @param group The group's address. */ error FromGroupNotOverflowing(address group); /** * @notice Used when trying to rebalance to a group that is overflowing. * @param group The group's address. */ error ToGroupOverflowing(address group); /** * @dev Throws if called by any address other than StakedCelo. */ modifier onlyStakedCelo() { if (address(stakedCelo) != msg.sender) { revert CallerNotStakedCelo(msg.sender); } _; } /** * @dev Throws if called by any address other than one of the strategy contracts. */ modifier onlyStrategy() { if ( address(defaultStrategy) != msg.sender && address(specificGroupStrategy) != msg.sender ) { revert CallerNotStrategy(msg.sender); } _; } /** * @notice Empty constructor for proxy implementation, `initializer` modifer ensures the * implementation gets initialized. */ // solhint-disable-next-line no-empty-blocks constructor() initializer {} /** * @notice Initialize the contract with registry and owner. * @param _registry The address of the Celo Registry. * @param _owner The address of the contract owner. */ function initialize(address _registry, address _owner) external initializer { _transferOwnership(_owner); __UsingRegistry_init(_registry); } /** * @notice Set this contract's dependencies in the StakedCelo system. * @dev The StakedCelo contracts all reference each other * so we need a way of setting these after all contracts are * deployed and initialized. * @param _stakedCelo the address of the StakedCelo contract. * @param _account The address of the Account contract. * @param _vote The address of the Vote contract. * @param _groupHealth The address of the GroupHealth contract. * @param _specificGroupStrategy The address of the SpecificGroupStrategy contract. * @param _defaultStrategy The address of the DefaultStrategy contract. */ function setDependencies( address _stakedCelo, address _account, address _vote, address _groupHealth, address _specificGroupStrategy, address _defaultStrategy ) external onlyOwner { if ( _stakedCelo == address(0) || _account == address(0) || _vote == address(0) || _groupHealth == address(0) || _specificGroupStrategy == address(0) || _defaultStrategy == address(0) ) { revert AddressZeroNotAllowed(); } stakedCelo = IStakedCelo(_stakedCelo); account = IAccount(_account); voteContract = _vote; groupHealth = IGroupHealth(_groupHealth); specificGroupStrategy = ISpecificGroupStrategy(_specificGroupStrategy); defaultStrategy = IDefaultStrategy(_defaultStrategy); emit VoteContractSet(_vote); } /** * @notice Used to withdraw CELO from the system, in exchange for burning * stCELO. * @param stCeloAmount The amount of stCELO to burn. * @dev Calculates the CELO amount based on the ratio of outstanding stCELO * and the total amount of CELO owned and used for voting by Account. See * `toCelo`. * @dev The funds need to be withdrawn using calls to `Account.withdraw` and * `Account.finishPendingWithdrawal`. */ function withdraw(uint256 stCeloAmount) external { ( address[] memory groupsWithdrawn, uint256[] memory withdrawalsPerGroup ) = distributeWithdrawals(stCeloAmount, strategies[msg.sender], false); account.scheduleWithdrawals(msg.sender, groupsWithdrawn, withdrawalsPerGroup); stakedCelo.burn(msg.sender, stCeloAmount); } /** * @notice Revokes votes on already voted proposal. * @param proposalId The ID of the proposal to revoke from. * @param index The index of the proposal ID in `dequeued`. */ function revokeVotes(uint256 proposalId, uint256 index) external { IVote vote = IVote(voteContract); (uint256 totalYesVotes, uint256 totalNoVotes, uint256 totalAbstainVotes) = vote.revokeVotes( msg.sender, proposalId ); account.votePartially(proposalId, index, totalYesVotes, totalNoVotes, totalAbstainVotes); } /** * @notice Unlock balance of vote stCELO and update beneficiary vote history. * @param beneficiary The address to be unlocked. */ function updateHistoryAndReturnLockedStCeloInVoting(address beneficiary) external returns (uint256) { IVote vote = IVote(voteContract); return vote.updateHistoryAndReturnLockedStCeloInVoting(beneficiary); } /** * @notice Used to deposit CELO into the StakedCelo system. The user will * receive an amount of stCELO proportional to their contribution. The CELO * will be scheduled to be voted for with the Account contract. * The CELO will be distributed based on address strategy. */ function deposit() external payable { uint256 stCeloAmount = toStakedCelo(msg.value); (address[] memory finalGroups, uint256[] memory finalVotes) = distributeVotes( msg.value, stCeloAmount, strategies[msg.sender] ); stakedCelo.mint(msg.sender, stCeloAmount); account.scheduleVotes{value: msg.value}(finalGroups, finalVotes); } /** * @notice Returns which strategy an address is using * address(0) = default strategy * !address(0) = voting for specific validator group. * Unhealthy and blocked strategies are reverted to default. * @param accountAddress The account address. * @return The strategy. */ function getAddressStrategy(address accountAddress) external view returns (address) { address strategy = strategies[accountAddress]; if ( strategy != address(0) && (specificGroupStrategy.isBlockedGroup(strategy) || !groupHealth.isGroupValid(strategy)) ) { // strategy not allowed revert to default strategy return address(0); } return strategy; } /** * @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, 3, 0, 0); } /** * @notice Whenever stCELO is being transferd we will check whether origin and target * account use same strategy. If strategy differs we will schedule votes for transfer. * @param from The from account. * @param to The to account. * @param stCeloAmount The stCELO amount. */ function transfer( address from, address to, uint256 stCeloAmount ) public onlyStakedCelo { _transfer(strategies[from], strategies[to], stCeloAmount); } /** * @notice Allows account to change strategy. * address(0) = default strategy * !address(0) = voting for allowed validator group. Group needs to be in allowed * @param newStrategy The from account. */ function changeStrategy(address newStrategy) public { if ( newStrategy != address(0) && (specificGroupStrategy.isBlockedGroup(newStrategy) || !groupHealth.isGroupValid(newStrategy)) ) { revert GroupNotEligible(newStrategy); } uint256 stCeloAmount = stakedCelo.balanceOf(msg.sender); if (stCeloAmount != 0) { _transfer(strategies[msg.sender], newStrategy, stCeloAmount); } strategies[msg.sender] = newStrategy; } /** * @notice Unlock vote balance of stCELO. * @param accountAddress The account to be unlocked. */ function unlockBalance(address accountAddress) public { stakedCelo.unlockVoteBalance(accountAddress); } /** * @notice Rebalances CELO between groups that have incorrect CELO-stCELO ratio. * `fromGroup` is required to have more CELO than it should and `toGroup` needs * to have less CELO than it should. * @param fromGroup The from group. * @param toGroup The to group. */ function rebalance(address fromGroup, address toGroup) public { if (!defaultStrategy.isActive(toGroup) && specificGroupStrategy.isBlockedGroup(toGroup)) { // rebalancing to deactivated/non-existent group is not allowed revert InvalidToGroup(toGroup); } (uint256 expectedFromCelo, uint256 actualFromCelo) = getExpectedAndActualCeloForGroup( fromGroup ); if (actualFromCelo <= expectedFromCelo) { // fromGroup needs to have more CELO than it should revert RebalanceNoExtraCelo(fromGroup, actualFromCelo, expectedFromCelo); } (uint256 expectedToCelo, uint256 actualToCelo) = getExpectedAndActualCeloForGroup(toGroup); if (actualToCelo >= expectedToCelo) { // toGroup needs to have less CELO than it should revert RebalanceEnoughCelo(toGroup, actualToCelo, expectedToCelo); } uint256 receivableVotes = getReceivableVotesForGroup(toGroup); if (receivableVotes == 0) { revert ToGroupOverflowing(toGroup); } uint256 toMove = Math.min( Math.min(actualFromCelo - expectedFromCelo, expectedToCelo - actualToCelo), receivableVotes ); scheduleRebalanceTransfer(fromGroup, toGroup, toMove); } /** * @notice Rebalance according to CELO overflow rather than stCELO ratio. * If one of the groups is overflowing and there are still some votes that * are scheduled for the group, this function allows to transfer these * votes to any active group in protocol that is not overflowing yet. * @param fromGroup The group to unschedule votes from. * @param toGroup The group to schedule votes to. */ function rebalanceOverflow(address fromGroup, address toGroup) public { if (!defaultStrategy.isActive(toGroup)) { revert InvalidToGroup(toGroup); } uint256 fromReceivableVotesByElection = getElectionReceivableVotes(fromGroup); uint256 scheduledVotesToCancel = account.scheduledRevokeForGroup(fromGroup) + account.scheduledWithdrawalsForGroup(fromGroup); uint256 scheduledVotes = account.scheduledVotesForGroup(fromGroup); uint256 protocolScheduledVotes = scheduledVotes > scheduledVotesToCancel ? scheduledVotes - scheduledVotesToCancel : 0; uint256 overflowingCelo = protocolScheduledVotes > fromReceivableVotesByElection ? protocolScheduledVotes - fromReceivableVotesByElection : 0; if (overflowingCelo == 0) { revert FromGroupNotOverflowing(fromGroup); } uint256 toReceivableVotes = getReceivableVotesForGroup(toGroup); if (toReceivableVotes == 0) { revert ToGroupOverflowing(toGroup); } uint256 toMove = Math.min(overflowingCelo, toReceivableVotes); scheduleRebalanceTransfer(fromGroup, toGroup, toMove); } /** * @notice Allows strategy to initiate transfer without any checks. * This method is supposed to be used for transfers between groups * only within strategy * @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 `toGroups`. */ function scheduleTransferWithinStrategy( address[] calldata fromGroups, address[] calldata toGroups, uint256[] calldata fromVotes, uint256[] calldata toVotes ) public onlyStrategy { account.scheduleTransfer(fromGroups, fromVotes, toGroups, toVotes); } /** * @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 voteProposal( uint256 proposalId, uint256 index, uint256 yesVotes, uint256 noVotes, uint256 abstainVotes ) public { IVote vote = IVote(voteContract); ( uint256 stCeloUsedForVoting, uint256 totalYesVotes, uint256 totalNoVotes, uint256 totalAbstainVotes ) = vote.voteProposal(msg.sender, proposalId, yesVotes, noVotes, abstainVotes); stakedCelo.lockVoteBalance(msg.sender, stCeloUsedForVoting); account.votePartially(proposalId, index, totalYesVotes, totalNoVotes, totalAbstainVotes); } /** * @notice Returns expected CELO amount voted for by Account contract * vs actual amount voted for by Account contract. * @param group The group. * @return expectedCelo The CELO which group should have. * @return actualCelo The CELO which group has. */ function getExpectedAndActualCeloForGroup(address group) public view returns (uint256 expectedCelo, uint256 actualCelo) { actualCelo = account.getCeloForGroup(group); bool isSpecificGroupStrategy = !specificGroupStrategy.isBlockedGroup(group); bool isActiveGroup = defaultStrategy.isActive(group); uint256 stCeloFromSpecificStrategy; uint256 stCeloFromDefaultStrategy; if (isSpecificGroupStrategy) { uint256 overflow; uint256 unhealthy; (stCeloFromSpecificStrategy, overflow, unhealthy) = specificGroupStrategy .getStCeloInGroup(group); stCeloFromSpecificStrategy -= overflow + unhealthy; } if (isActiveGroup) { stCeloFromDefaultStrategy = defaultStrategy.stCeloInGroup(group); } expectedCelo = toCelo(stCeloFromSpecificStrategy + stCeloFromDefaultStrategy); } /** * @notice Computes the amount of stCELO that should be minted for a given * amount of CELO deposited. * @param celoAmount The amount of CELO deposited. * @return The amount of stCELO that should be minted. */ function toStakedCelo(uint256 celoAmount) public view returns (uint256) { uint256 stCeloSupply = stakedCelo.totalSupply(); uint256 celoBalance = account.getTotalCelo(); if (stCeloSupply == 0 || celoBalance == 0) { return celoAmount; } return (celoAmount * stCeloSupply) / celoBalance; } /** * @notice Computes the amount of CELO that should be withdrawn for a given * amount of stCELO burned. * @param stCeloAmount The amount of stCELO burned. * @return The amount of CELO that should be withdrawn. */ function toCelo(uint256 stCeloAmount) public view returns (uint256) { uint256 stCeloSupply = stakedCelo.totalSupply(); uint256 celoBalance = account.getTotalCelo(); if (stCeloSupply == 0 || celoBalance == 0) { return stCeloAmount; } return (stCeloAmount * celoBalance) / stCeloSupply; } /** * Returns votes count that can be received by group through stCELO protocol. * @param group The group that can receive votes. * @return The amount of CELO that can be received by group though stCELO protocol. */ function getReceivableVotesForGroup(address group) public view returns (uint256) { uint256 receivableVotes = getElectionReceivableVotes(group); if (receivableVotes == 0) { return 0; } uint256 totalVotesForGroupByAccount = getElection().getTotalVotesForGroupByAccount( group, address(account) ); uint256 votesForGroupByAccountInProtocol = account.getCeloForGroup(group); receivableVotes += totalVotesForGroupByAccount; if (receivableVotes < votesForGroupByAccountInProtocol) { return 0; } return receivableVotes - votesForGroupByAccountInProtocol; } /** * @notice Distributes votes according to chosen strategy. * @param votes The amount of votes to distribute. * @param stCeloAmount The amount of stCELO that was minted. * @param strategy The chosen strategy. */ function distributeVotes( uint256 votes, uint256 stCeloAmount, address strategy ) private returns (address[] memory finalGroups, uint256[] memory finalVotes) { if (strategy != address(0)) { (finalGroups, finalVotes) = specificGroupStrategy.generateDepositVoteDistribution( strategy, votes, stCeloAmount ); } else { (finalGroups, finalVotes) = defaultStrategy.generateDepositVoteDistribution( votes, address(0) ); } return (finalGroups, finalVotes); } /** * @notice Distributes withdrawals according to chosen strategy. * @param stCeloAmount The amount of stCELO to be withdrawn. * @param strategy The strategy that will be used for withdrawal distribution. * @param isTransfer Whether or not withdrawal is calculated for transfer. **/ function distributeWithdrawals( uint256 stCeloAmount, address strategy, bool isTransfer ) private returns (address[] memory, uint256[] memory) { uint256 celoAmount = toCelo(stCeloAmount); if (celoAmount == 0) { revert ZeroWithdrawal(); } address[] memory groupsWithdrawn; uint256[] memory withdrawalsPerGroup; if (strategy != address(0)) { (groupsWithdrawn, withdrawalsPerGroup) = specificGroupStrategy .generateWithdrawalVoteDistribution(strategy, celoAmount, stCeloAmount, isTransfer); } else { (groupsWithdrawn, withdrawalsPerGroup) = defaultStrategy .generateWithdrawalVoteDistribution(celoAmount); } return (groupsWithdrawn, withdrawalsPerGroup); } /** * @notice Schedules transfer of CELO between strategies. * @param fromStrategy The from validator group. * @param toStrategy The to validator group. * @param stCeloAmount The stCELO amount. */ function _transfer( address fromStrategy, address toStrategy, uint256 stCeloAmount ) private { if (fromStrategy == toStrategy) { // either both addresses use default strategy // or both addresses use same specific strategy return; } _transferWithoutChecks(fromStrategy, toStrategy, stCeloAmount); } /** * @notice Schedules transfer of CELO between strategies. * @param fromStrategy The from validator group. * @param toStrategy The to validator group. * @param stCeloAmount The stCELO amount. */ function _transferWithoutChecks( address fromStrategy, address toStrategy, uint256 stCeloAmount ) private { address[] memory fromGroups; uint256[] memory fromVotes; (fromGroups, fromVotes) = distributeWithdrawals(stCeloAmount, fromStrategy, true); address[] memory toGroups; uint256[] memory toVotes; (toGroups, toVotes) = distributeVotes(toCelo(stCeloAmount), stCeloAmount, toStrategy); account.scheduleTransfer(fromGroups, fromVotes, toGroups, toVotes); } /** * @notice Schedules transfer between 2 groups. * @param fromGroup The group the deposited CELO is intended to be revoked from. * @param toGroup The group the transferred CELO is intended to vote for. * @param votes The amount of CELO to be transfered. */ function scheduleRebalanceTransfer( address fromGroup, address toGroup, uint256 votes ) private { address[] memory fromGroups = new address[](1); address[] memory toGroups = new address[](1); uint256[] memory fromVotes = new uint256[](1); uint256[] memory toVotes = new uint256[](1); fromGroups[0] = fromGroup; fromVotes[0] = votes; toGroups[0] = toGroup; toVotes[0] = fromVotes[0]; account.scheduleTransfer(fromGroups, fromVotes, toGroups, toVotes); } /** * Returns votes count that can be received by group directly in Election contract. * @param group The group that can receive votes. */ function getElectionReceivableVotes(address group) private view returns (uint256) { uint256 receivable = getElection().getNumVotesReceivable(group); uint256 totalVotes = getElection().getTotalVotesForGroup(group); if (receivable < totalVotes) { return 0; } return receivable - totalVotes; } }
/_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/utils/structs/EnumerableSet.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
/_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/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/IDefaultStrategy.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IDefaultStrategy { function generateDepositVoteDistribution(uint256 celoAmount, address depositGroupToIgnore) external returns (address[] memory finalGroups, uint256[] memory finalVotes); function generateWithdrawalVoteDistribution(uint256 celoAmount) external returns (address[] memory finalGroups, uint256[] memory finalVotes); function activateGroup(address group) external; function isActive(address group) external view returns (bool); function getNumberOfGroups() external view returns (uint256); function stCeloInGroup(address group) external view returns (uint256); }
/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/IGroupHealth.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IGroupHealth { function isGroupValid(address group) external view returns (bool); }
/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/ISpecificGroupStrategy.sol
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface ISpecificGroupStrategy { function generateDepositVoteDistribution( address group, uint256 votes, uint256 stCeloAmount ) external returns (address[] memory finalGroups, uint256[] memory finalVotes); function generateWithdrawalVoteDistribution( address group, uint256 celoWithdrawalAmount, uint256 stCeloWithdrawalAmount, bool isTransfer ) external returns (address[] memory groups, uint256[] memory votes); function isVotedGroup(address group) external view returns (bool); function isBlockedGroup(address group) external view returns (bool); function getStCeloInGroup(address group) external view returns ( uint256 total, uint256 overflow, uint256 unhealthy ); function totalStCeloLocked() external view returns (uint256); function totalStCeloOverflow() external view returns (uint256); function getNumberOfVotedGroups() external view returns (uint256); }
/contracts/interfaces/IStakedCelo.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IStakedCelo { function totalSupply() external view returns (uint256); function mint(address, uint256) external; function burn(address, uint256) external; function transfer(address, uint256) external returns (bool); function transferFrom( address, address, uint256 ) external returns (bool); function balanceOf(address account) external view returns (uint256); function lockVoteBalance(address account, uint256 amount) external; function unlockVoteBalance(address account) external; function lockedVoteBalanceOf(address account) external view returns (uint256); }
/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; }
/contracts/interfaces/IVote.sol
//SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.8.11; interface IVote { function updateHistoryAndReturnLockedStCeloInVoting(address beneficiary) external returns (uint256); function voteProposal( address accountVoter, uint256 proposalId, uint256 yesVotes, uint256 noVotes, uint256 abstainVotes ) external returns ( uint256 stCeloUsedForVoting, uint256 totalYesVotes, uint256 totalNoVotes, uint256 totalAbstainVotes ); function revokeVotes(address accountVoter, uint256 proposalId) external returns ( uint256 totalYesVotes, uint256 totalNoVotes, uint256 totalAbstainVotes ); }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"AddressZeroNotAllowed","inputs":[]},{"type":"error","name":"CallerNotStakedCelo","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"error","name":"CallerNotStrategy","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"error","name":"FromGroupNotOverflowing","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"GroupNotEligible","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"InvalidToGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"RebalanceEnoughCelo","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"uint256","name":"actualCelo","internalType":"uint256"},{"type":"uint256","name":"expectedCelo","internalType":"uint256"}]},{"type":"error","name":"RebalanceNoExtraCelo","inputs":[{"type":"address","name":"group","internalType":"address"},{"type":"uint256","name":"actualCelo","internalType":"uint256"},{"type":"uint256","name":"expectedCelo","internalType":"uint256"}]},{"type":"error","name":"ToGroupOverflowing","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"ZeroWithdrawal","inputs":[]},{"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":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"VoteContractSet","inputs":[{"type":"address","name":"voteContract","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeStrategy","inputs":[{"type":"address","name":"newStrategy","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IDefaultStrategy"}],"name":"defaultStrategy","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getAddressStrategy","inputs":[{"type":"address","name":"accountAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"expectedCelo","internalType":"uint256"},{"type":"uint256","name":"actualCelo","internalType":"uint256"}],"name":"getExpectedAndActualCeloForGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getReceivableVotesForGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"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":"view","outputs":[{"type":"address","name":"","internalType":"contract IGroupHealth"}],"name":"groupHealth","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_registry","internalType":"address"},{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rebalance","inputs":[{"type":"address","name":"fromGroup","internalType":"address"},{"type":"address","name":"toGroup","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rebalanceOverflow","inputs":[{"type":"address","name":"fromGroup","internalType":"address"},{"type":"address","name":"toGroup","internalType":"address"}]},{"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":"uint256","name":"proposalId","internalType":"uint256"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"scheduleTransferWithinStrategy","inputs":[{"type":"address[]","name":"fromGroups","internalType":"address[]"},{"type":"address[]","name":"toGroups","internalType":"address[]"},{"type":"uint256[]","name":"fromVotes","internalType":"uint256[]"},{"type":"uint256[]","name":"toVotes","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDependencies","inputs":[{"type":"address","name":"_stakedCelo","internalType":"address"},{"type":"address","name":"_account","internalType":"address"},{"type":"address","name":"_vote","internalType":"address"},{"type":"address","name":"_groupHealth","internalType":"address"},{"type":"address","name":"_specificGroupStrategy","internalType":"address"},{"type":"address","name":"_defaultStrategy","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ISpecificGroupStrategy"}],"name":"specificGroupStrategy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"strategies","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"toCelo","inputs":[{"type":"uint256","name":"stCeloAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"toStakedCelo","inputs":[{"type":"uint256","name":"celoAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transfer","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"stCeloAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unlockBalance","inputs":[{"type":"address","name":"accountAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"updateHistoryAndReturnLockedStCeloInVoting","inputs":[{"type":"address","name":"beneficiary","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":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"voteContract","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"voteProposal","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":[],"name":"withdraw","inputs":[{"type":"uint256","name":"stCeloAmount","internalType":"uint256"}]}]
Contract Creation Code
0x60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff168152503480156200004457600080fd5b50600060019054906101000a900460ff166200006f5760008054906101000a900460ff161562000080565b6200007f6200013c60201b60201c565b5b620000c2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000b99062000204565b60405180910390fd5b60008060019054906101000a900460ff16159050801562000113576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b8015620001355760008060016101000a81548160ff0219169083151502179055505b5062000226565b600062000154306200015a60201b62002fa01760201c565b15905090565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000620001ec602e836200017d565b9150620001f9826200018e565b604082019050919050565b600060208201905081810360008301526200021f81620001dd565b9050919050565b608051615a2b62000257600039600081816111000152818161118f0152818161165701526116e60152615a2b6000f3fe6080604052600436106101cd5760003560e01c80637b103999116100f7578063beabacc811610095578063d0e30db011610064578063d0e30db014610677578063ee183c4a14610681578063f2fde38b146106ac578063fac5bb9b146106d5576101cd565b8063beabacc8146105bd578063c494ec1e146105e6578063ce7a60ab14610623578063cf009f7a1461064c576101cd565b8063a0fefe25116100d1578063a0fefe2514610502578063a3f16ef114610540578063b0ef81de1461056b578063bc4d3bb314610594576101cd565b80637b103999146104835780637e72dd66146104ae5780638da5cb5b146104d7576101cd565b8063485cc9551161016f57806354255be01161013e57806354255be0146103ec5780636fe958d81461041a578063715018a6146104435780637a9024bd1461045a576101cd565b8063485cc9551461032d57806348fd6ea6146103565780634e4e5efb146103935780634f1ef286146103d0576101cd565b80632c431058116101ab5780632c431058146102615780632e1a7d4d1461029e5780633659cfe6146102c757806339ebf823146102f0576101cd565b80630567847f146101d25780630c4d4e401461020f578063114e6b3714610238575b600080fd5b3480156101de57600080fd5b506101f960048036038101906101f491906140c9565b610700565b6040516102069190614105565b60405180910390f35b34801561021b57600080fd5b50610236600480360381019061023191906141db565b61086a565b005b34801561024457600080fd5b5061025f600480360381019061025a9190614322565b6109fd565b005b34801561026d57600080fd5b50610288600480360381019061028391906143af565b610dc4565b6040516102959190614105565b60405180910390f35b3480156102aa57600080fd5b506102c560048036038101906102c091906140c9565b610f67565b005b3480156102d357600080fd5b506102ee60048036038101906102e991906143af565b6110fe565b005b3480156102fc57600080fd5b50610317600480360381019061031291906143af565b611287565b60405161032491906143eb565b60405180910390f35b34801561033957600080fd5b50610354600480360381019061034f9190614406565b6112ba565b005b34801561036257600080fd5b5061037d600480360381019061037891906143af565b6113b2565b60405161038a9190614105565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b591906143af565b61145e565b6040516103c791906143eb565b60405180910390f35b6103ea60048036038101906103e59190614587565b611655565b005b3480156103f857600080fd5b50610401611792565b60405161041194939291906145e3565b60405180910390f35b34801561042657600080fd5b50610441600480360381019061043c9190614406565b6117ad565b005b34801561044f57600080fd5b50610458611a75565b005b34801561046657600080fd5b50610481600480360381019061047c91906143af565b611afd565b005b34801561048f57600080fd5b50610498611e4d565b6040516104a59190614687565b60405180910390f35b3480156104ba57600080fd5b506104d560048036038101906104d09190614406565b611e73565b005b3480156104e357600080fd5b506104ec61223e565b6040516104f991906143eb565b60405180910390f35b34801561050e57600080fd5b50610529600480360381019061052491906143af565b612268565b6040516105379291906146a2565b60405180910390f35b34801561054c57600080fd5b506105556125de565b60405161056291906146ec565b60405180910390f35b34801561057757600080fd5b50610592600480360381019061058d9190614707565b612604565b005b3480156105a057600080fd5b506105bb60048036038101906105b69190614747565b612751565b005b3480156105c957600080fd5b506105e460048036038101906105df91906147c2565b61293a565b005b3480156105f257600080fd5b5061060d600480360381019061060891906140c9565b612a9a565b60405161061a9190614105565b60405180910390f35b34801561062f57600080fd5b5061064a600480360381019061064591906143af565b612c04565b005b34801561065857600080fd5b50610661612c94565b60405161066e9190614836565b60405180910390f35b61067f612cba565b005b34801561068d57600080fd5b50610696612e5c565b6040516106a391906143eb565b60405180910390f35b3480156106b857600080fd5b506106d360048036038101906106ce91906143af565b612e82565b005b3480156106e157600080fd5b506106ea612f7a565b6040516106f79190614872565b60405180910390f35b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610770573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079491906148a2565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610805573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082991906148a2565b9050600082148061083a5750600081145b15610849578392505050610865565b81818561085691906148fe565b6108609190614987565b925050505b919050565b3373ffffffffffffffffffffffffffffffffffffffff16606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415801561091657503373ffffffffffffffffffffffffffffffffffffffff16606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561095857336040517ff7eb25ef00000000000000000000000000000000000000000000000000000000815260040161094f91906143eb565b60405180910390fd5b606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f380ade3898987878b8b89896040518963ffffffff1660e01b81526004016109c1989796959493929190614aed565b600060405180830381600087803b1580156109db57600080fd5b505af11580156109ef573d6000803e3d6000fd5b505050505050505050505050565b610a05612fc3565b73ffffffffffffffffffffffffffffffffffffffff16610a2361223e565b73ffffffffffffffffffffffffffffffffffffffff1614610a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7090614bb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161480610ae05750600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b80610b175750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610b4e5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610b855750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80610bbc5750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b15610bf3576040517f0855380c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85606660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084606760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083606c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082606d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081606e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080606f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167f77001ab3bb5b4e91a2a4021cec272d6505154d5ff1fb2e8426752b15bd8ef16d60405160405180910390a2505050505050565b600080610dd083612fcb565b90506000811415610de5576000915050610f62565b6000610def6130ff565b73ffffffffffffffffffffffffffffffffffffffff16633861727285606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610e4b929190614bd3565b602060405180830381865afa158015610e68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c91906148a2565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0866040518263ffffffff1660e01b8152600401610eeb91906143eb565b602060405180830381865afa158015610f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2c91906148a2565b90508183610f3a9190614bfc565b925080831015610f505760009350505050610f62565b8083610f5c9190614c52565b93505050505b919050565b600080610fd583607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006131c6565b91509150606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f842a1a3384846040518463ffffffff1660e01b815260040161103893929190614db9565b600060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b50505050606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33856040518363ffffffff1660e01b81526004016110c7929190614dfe565b600060405180830381600087803b1580156110e157600080fd5b505af11580156110f5573d6000803e3d6000fd5b50505050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16141561118d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118490614e99565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166111cc6133bb565b73ffffffffffffffffffffffffffffffffffffffff1614611222576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121990614f2b565b60405180910390fd5b61122b81613412565b61128481600067ffffffffffffffff81111561124a5761124961445c565b5b6040519080825280601f01601f19166020018201604052801561127c5781602001600182028036833780820191505090505b506000613491565b50565b60706020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060019054906101000a900460ff166112e25760008054906101000a900460ff16156112eb565b6112ea613662565b5b61132a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132190614fbd565b60405180910390fd5b60008060019054906101000a900460ff16159050801561137a576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b61138382613673565b61138c83613739565b80156113ad5760008060016101000a81548160ff0219169083151502179055505b505050565b600080606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166348fd6ea6846040518263ffffffff1660e01b815260040161141391906143eb565b6020604051808303816000875af1158015611432573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145691906148a2565b915050919050565b600080607060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561163c5750606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d826040518263ffffffff1660e01b815260040161155691906143eb565b602060405180830381865afa158015611573573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115979190615015565b8061163b5750606d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ac8f4425826040518263ffffffff1660e01b81526004016115f891906143eb565b602060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116399190615015565b155b5b1561164b576000915050611650565b809150505b919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156116e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116db90614e99565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166117236133bb565b73ffffffffffffffffffffffffffffffffffffffff1614611779576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177090614f2b565b60405180910390fd5b61178282613412565b61178e82826001613491565b5050565b60008060008060016003600080935093509350935090919293565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f8a13d7826040518263ffffffff1660e01b815260040161180891906143eb565b602060405180830381865afa158015611825573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118499190615015565b1580156118ee5750606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d826040518263ffffffff1660e01b81526004016118ac91906143eb565b602060405180830381865afa1580156118c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ed9190615015565b5b1561193057806040517f5a08158400000000000000000000000000000000000000000000000000000000815260040161192791906143eb565b60405180910390fd5b60008061193c84612268565b91509150818111611988578381836040517f2c4f8ec800000000000000000000000000000000000000000000000000000000815260040161197f93929190615042565b60405180910390fd5b60008061199485612268565b915091508181106119e0578481836040517fb0006ace0000000000000000000000000000000000000000000000000000000081526004016119d793929190615042565b60405180910390fd5b60006119eb86610dc4565b90506000811415611a3357856040517fb9183a08000000000000000000000000000000000000000000000000000000008152600401611a2a91906143eb565b60405180910390fd5b6000611a5e611a588787611a479190614c52565b8587611a539190614c52565b61384a565b8361384a565b9050611a6b888883613863565b5050505050505050565b611a7d612fc3565b73ffffffffffffffffffffffffffffffffffffffff16611a9b61223e565b73ffffffffffffffffffffffffffffffffffffffff1614611af1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae890614bb3565b60405180910390fd5b611afb6000613673565b565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015611c765750606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d826040518263ffffffff1660e01b8152600401611b9091906143eb565b602060405180830381865afa158015611bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd19190615015565b80611c755750606d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ac8f4425826040518263ffffffff1660e01b8152600401611c3291906143eb565b602060405180830381865afa158015611c4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c739190615015565b155b5b15611cb857806040517f10a7bc6b000000000000000000000000000000000000000000000000000000008152600401611caf91906143eb565b60405180910390fd5b6000606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401611d1591906143eb565b602060405180830381865afa158015611d32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5691906148a2565b905060008114611dcb57611dca607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168383613b32565b5b81607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f8a13d7826040518263ffffffff1660e01b8152600401611ece91906143eb565b602060405180830381865afa158015611eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0f9190615015565b611f5057806040517f5a081584000000000000000000000000000000000000000000000000000000008152600401611f4791906143eb565b60405180910390fd5b6000611f5b83612fcb565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b09bdc5e856040518263ffffffff1660e01b8152600401611fba91906143eb565b602060405180830381865afa158015611fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ffb91906148a2565b606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166322e59bd4866040518263ffffffff1660e01b815260040161205691906143eb565b602060405180830381865afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209791906148a2565b6120a19190614bfc565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd5c95e866040518263ffffffff1660e01b815260040161210091906143eb565b602060405180830381865afa15801561211d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214191906148a2565b90506000828211612153576000612160565b828261215f9190614c52565b5b9050600084821161217257600061217f565b848261217e9190614c52565b5b905060008114156121c757866040517f1eeadf530000000000000000000000000000000000000000000000000000000081526004016121be91906143eb565b60405180910390fd5b60006121d287610dc4565b9050600081141561221a57866040517fb9183a0800000000000000000000000000000000000000000000000000000000815260040161221191906143eb565b60405180910390fd5b6000612226838361384a565b9050612233898983613863565b505050505050505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0846040518263ffffffff1660e01b81526004016122c691906143eb565b602060405180830381865afa1580156122e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230791906148a2565b90506000606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d856040518263ffffffff1660e01b815260040161236691906143eb565b602060405180830381865afa158015612383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123a79190615015565b1590506000606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f8a13d7866040518263ffffffff1660e01b815260040161240791906143eb565b602060405180830381865afa158015612424573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124489190615015565b9050600080831561251a57600080606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166356ab819f8a6040518263ffffffff1660e01b81526004016124b191906143eb565b606060405180830381865afa1580156124ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f29190615079565b809350819450829650505050808261250a9190614bfc565b846125159190614c52565b935050505b82156125bf57606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166385a92cb7886040518263ffffffff1660e01b815260040161257b91906143eb565b602060405180830381865afa158015612598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125bc91906148a2565b90505b6125d381836125ce9190614bfc565b610700565b955050505050915091565b606d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008060008373ffffffffffffffffffffffffffffffffffffffff1663c40da15c33886040518363ffffffff1660e01b815260040161266b929190614dfe565b6060604051808303816000875af115801561268a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ae9190615079565b925092509250606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e87878686866040518663ffffffff1660e01b81526004016127179594939291906150cc565b600060405180830381600087803b15801561273157600080fd5b505af1158015612745573d6000803e3d6000fd5b50505050505050505050565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000806000808473ffffffffffffffffffffffffffffffffffffffff16634c23f22e338c8b8b8b6040518663ffffffff1660e01b81526004016127bf95949392919061511f565b6080604051808303816000875af11580156127de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128029190615172565b9350935093509350606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639caa9e2933866040518363ffffffff1660e01b8152600401612867929190614dfe565b600060405180830381600087803b15801561288157600080fd5b505af1158015612895573d6000803e3d6000fd5b50505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e8b8b8686866040518663ffffffff1660e01b81526004016128fc9594939291906150cc565b600060405180830381600087803b15801561291657600080fd5b505af115801561292a573d6000803e3d6000fd5b5050505050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129cc57336040517f4a653c6a0000000000000000000000000000000000000000000000000000000081526004016129c391906143eb565b60405180910390fd5b612a95607060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16607060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683613b32565b505050565b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b2e91906148a2565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bc391906148a2565b90506000821480612bd45750600081145b15612be3578392505050612bff565b808285612bf091906148fe565b612bfa9190614987565b925050505b919050565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e37d49b8826040518263ffffffff1660e01b8152600401612c5f91906143eb565b600060405180830381600087803b158015612c7957600080fd5b505af1158015612c8d573d6000803e3d6000fd5b5050505050565b606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000612cc534612a9a565b9050600080612d343484607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16613b7c565b91509150606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933856040518363ffffffff1660e01b8152600401612d95929190614dfe565b600060405180830381600087803b158015612daf57600080fd5b505af1158015612dc3573d6000803e3d6000fd5b50505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301c21d593484846040518463ffffffff1660e01b8152600401612e259291906151d9565b6000604051808303818588803b158015612e3e57600080fd5b505af1158015612e52573d6000803e3d6000fd5b5050505050505050565b606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612e8a612fc3565b73ffffffffffffffffffffffffffffffffffffffff16612ea861223e565b73ffffffffffffffffffffffffffffffffffffffff1614612efe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ef590614bb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f6590615282565b60405180910390fd5b612f7781613673565b50565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600033905090565b600080612fd66130ff565b73ffffffffffffffffffffffffffffffffffffffff16632c3b7916846040518263ffffffff1660e01b815260040161300e91906143eb565b602060405180830381865afa15801561302b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061304f91906148a2565b9050600061305b6130ff565b73ffffffffffffffffffffffffffffffffffffffff1663dedafeae856040518263ffffffff1660e01b815260040161309391906143eb565b602060405180830381865afa1580156130b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130d491906148a2565b9050808210156130e9576000925050506130fa565b80826130f59190614c52565b925050505b919050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed60405160200161314e906152f9565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016131809190615327565b602060405180830381865afa15801561319d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c19190615357565b905090565b60608060006131d486610700565b90506000811415613211576040517fc60050c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606080600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16146132fe57606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c650b5f88858b8a6040518563ffffffff1660e01b81526004016132a99493929190615393565b6000604051808303816000875af11580156132c8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906132f1919061555e565b80925081935050506133aa565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166336691a41846040518263ffffffff1660e01b81526004016133599190614105565b6000604051808303816000875af1158015613378573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906133a1919061555e565b80925081935050505b818194509450505050935093915050565b60006133e97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613d1e565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61341a612fc3565b73ffffffffffffffffffffffffffffffffffffffff1661343861223e565b73ffffffffffffffffffffffffffffffffffffffff161461348e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161348590614bb3565b60405180910390fd5b50565b600061349b6133bb565b90506134a684613d28565b6000835111806134b35750815b156134c4576134c28484613de1565b505b60006134f27f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b613e0e565b90508060000160009054906101000a900460ff1661365b5760018160000160006101000a81548160ff0219169083151502179055506135be858360405160240161353c91906143eb565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613de1565b5060008160000160006101000a81548160ff0219169083151502179055506135e46133bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614613651576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161364890615648565b60405180910390fd5b61365a85613e18565b5b5050505050565b600061366d30612fa0565b15905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060019054906101000a900460ff16613788576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161377f906156da565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156138055761ce10606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613847565b80606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000818310613859578161385b565b825b905092915050565b6000600167ffffffffffffffff8111156138805761387f61445c565b5b6040519080825280602002602001820160405280156138ae5781602001602082028036833780820191505090505b5090506000600167ffffffffffffffff8111156138ce576138cd61445c565b5b6040519080825280602002602001820160405280156138fc5781602001602082028036833780820191505090505b5090506000600167ffffffffffffffff81111561391c5761391b61445c565b5b60405190808252806020026020018201604052801561394a5781602001602082028036833780820191505090505b5090506000600167ffffffffffffffff81111561396a5761396961445c565b5b6040519080825280602002602001820160405280156139985781602001602082028036833780820191505090505b50905086846000815181106139b0576139af6156fa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505084826000815181106139ff576139fe6156fa565b5b6020026020010181815250508583600081518110613a2057613a1f6156fa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081600081518110613a6e57613a6d6156fa565b5b602002602001015181600081518110613a8a57613a896156fa565b5b602002602001018181525050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f380ade3858486856040518563ffffffff1660e01b8152600401613af79493929190615729565b600060405180830381600087803b158015613b1157600080fd5b505af1158015613b25573d6000803e3d6000fd5b5050505050505050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415613b6b57613b77565b613b76838383613e67565b5b505050565b606080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614613c6757606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd1528588487876040518463ffffffff1660e01b8152600401613c1293929190615042565b6000604051808303816000875af1158015613c31573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190613c5a919061555e565b8092508193505050613d16565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e0cd8d278660006040518363ffffffff1660e01b8152600401613cc592919061578a565b6000604051808303816000875af1158015613ce4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190613d0d919061555e565b80925081935050505b935093915050565b6000819050919050565b613d3181613f38565b613d70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d6790615825565b60405180910390fd5b80613d9d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613d1e565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060613e0683836040518060600160405280602781526020016159cf60279139613f4b565b905092915050565b6000819050919050565b613e2181613d28565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b606080613e76838660016131c6565b8092508193505050606080613e94613e8d86610700565b8688613b7c565b8092508193505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f380ade3858585856040518563ffffffff1660e01b8152600401613efd9493929190615729565b600060405180830381600087803b158015613f1757600080fd5b505af1158015613f2b573d6000803e3d6000fd5b5050505050505050505050565b600080823b905060008111915050919050565b6060613f5684613f38565b613f95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613f8c906158b7565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051613fbd9190615951565b600060405180830381855af49150503d8060008114613ff8576040519150601f19603f3d011682016040523d82523d6000602084013e613ffd565b606091505b509150915061400d828286614018565b925050509392505050565b6060831561402857829050614078565b60008351111561403b5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161406f91906159ac565b60405180910390fd5b9392505050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b6140a681614093565b81146140b157600080fd5b50565b6000813590506140c38161409d565b92915050565b6000602082840312156140df576140de614089565b5b60006140ed848285016140b4565b91505092915050565b6140ff81614093565b82525050565b600060208201905061411a60008301846140f6565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261414557614144614120565b5b8235905067ffffffffffffffff81111561416257614161614125565b5b60208301915083602082028301111561417e5761417d61412a565b5b9250929050565b60008083601f84011261419b5761419a614120565b5b8235905067ffffffffffffffff8111156141b8576141b7614125565b5b6020830191508360208202830111156141d4576141d361412a565b5b9250929050565b6000806000806000806000806080898b0312156141fb576141fa614089565b5b600089013567ffffffffffffffff8111156142195761421861408e565b5b6142258b828c0161412f565b9850985050602089013567ffffffffffffffff8111156142485761424761408e565b5b6142548b828c0161412f565b9650965050604089013567ffffffffffffffff8111156142775761427661408e565b5b6142838b828c01614185565b9450945050606089013567ffffffffffffffff8111156142a6576142a561408e565b5b6142b28b828c01614185565b92509250509295985092959890939650565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006142ef826142c4565b9050919050565b6142ff816142e4565b811461430a57600080fd5b50565b60008135905061431c816142f6565b92915050565b60008060008060008060c0878903121561433f5761433e614089565b5b600061434d89828a0161430d565b965050602061435e89828a0161430d565b955050604061436f89828a0161430d565b945050606061438089828a0161430d565b935050608061439189828a0161430d565b92505060a06143a289828a0161430d565b9150509295509295509295565b6000602082840312156143c5576143c4614089565b5b60006143d38482850161430d565b91505092915050565b6143e5816142e4565b82525050565b600060208201905061440060008301846143dc565b92915050565b6000806040838503121561441d5761441c614089565b5b600061442b8582860161430d565b925050602061443c8582860161430d565b9150509250929050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6144948261444b565b810181811067ffffffffffffffff821117156144b3576144b261445c565b5b80604052505050565b60006144c661407f565b90506144d2828261448b565b919050565b600067ffffffffffffffff8211156144f2576144f161445c565b5b6144fb8261444b565b9050602081019050919050565b82818337600083830152505050565b600061452a614525846144d7565b6144bc565b90508281526020810184848401111561454657614545614446565b5b614551848285614508565b509392505050565b600082601f83011261456e5761456d614120565b5b813561457e848260208601614517565b91505092915050565b6000806040838503121561459e5761459d614089565b5b60006145ac8582860161430d565b925050602083013567ffffffffffffffff8111156145cd576145cc61408e565b5b6145d985828601614559565b9150509250929050565b60006080820190506145f860008301876140f6565b61460560208301866140f6565b61461260408301856140f6565b61461f60608301846140f6565b95945050505050565b6000819050919050565b600061464d614648614643846142c4565b614628565b6142c4565b9050919050565b600061465f82614632565b9050919050565b600061467182614654565b9050919050565b61468181614666565b82525050565b600060208201905061469c6000830184614678565b92915050565b60006040820190506146b760008301856140f6565b6146c460208301846140f6565b9392505050565b60006146d682614654565b9050919050565b6146e6816146cb565b82525050565b600060208201905061470160008301846146dd565b92915050565b6000806040838503121561471e5761471d614089565b5b600061472c858286016140b4565b925050602061473d858286016140b4565b9150509250929050565b600080600080600060a0868803121561476357614762614089565b5b6000614771888289016140b4565b9550506020614782888289016140b4565b9450506040614793888289016140b4565b93505060606147a4888289016140b4565b92505060806147b5888289016140b4565b9150509295509295909350565b6000806000606084860312156147db576147da614089565b5b60006147e98682870161430d565b93505060206147fa8682870161430d565b925050604061480b868287016140b4565b9150509250925092565b600061482082614654565b9050919050565b61483081614815565b82525050565b600060208201905061484b6000830184614827565b92915050565b600061485c82614654565b9050919050565b61486c81614851565b82525050565b60006020820190506148876000830184614863565b92915050565b60008151905061489c8161409d565b92915050565b6000602082840312156148b8576148b7614089565b5b60006148c68482850161488d565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061490982614093565b915061491483614093565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561494d5761494c6148cf565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061499282614093565b915061499d83614093565b9250826149ad576149ac614958565b5b828204905092915050565b600082825260208201905092915050565b6000819050919050565b6149dc816142e4565b82525050565b60006149ee83836149d3565b60208301905092915050565b6000614a09602084018461430d565b905092915050565b6000602082019050919050565b6000614a2a83856149b8565b9350614a35826149c9565b8060005b85811015614a6e57614a4b82846149fa565b614a5588826149e2565b9750614a6083614a11565b925050600181019050614a39565b5085925050509392505050565b600082825260208201905092915050565b600080fd5b6000614a9d8385614a7b565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115614ad057614acf614a8c565b5b602083029250614ae1838584614508565b82840190509392505050565b60006080820190508181036000830152614b08818a8c614a1e565b90508181036020830152614b1d81888a614a91565b90508181036040830152614b32818688614a1e565b90508181036060830152614b47818486614a91565b90509998505050505050505050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614b9d602083614b56565b9150614ba882614b67565b602082019050919050565b60006020820190508181036000830152614bcc81614b90565b9050919050565b6000604082019050614be860008301856143dc565b614bf560208301846143dc565b9392505050565b6000614c0782614093565b9150614c1283614093565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614c4757614c466148cf565b5b828201905092915050565b6000614c5d82614093565b9150614c6883614093565b925082821015614c7b57614c7a6148cf565b5b828203905092915050565b600081519050919050565b6000819050602082019050919050565b6000602082019050919050565b6000614cb982614c86565b614cc381856149b8565b9350614cce83614c91565b8060005b83811015614cff578151614ce688826149e2565b9750614cf183614ca1565b925050600181019050614cd2565b5085935050505092915050565b600081519050919050565b6000819050602082019050919050565b614d3081614093565b82525050565b6000614d428383614d27565b60208301905092915050565b6000602082019050919050565b6000614d6682614d0c565b614d708185614a7b565b9350614d7b83614d17565b8060005b83811015614dac578151614d938882614d36565b9750614d9e83614d4e565b925050600181019050614d7f565b5085935050505092915050565b6000606082019050614dce60008301866143dc565b8181036020830152614de08185614cae565b90508181036040830152614df48184614d5b565b9050949350505050565b6000604082019050614e1360008301856143dc565b614e2060208301846140f6565b9392505050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000614e83602c83614b56565b9150614e8e82614e27565b604082019050919050565b60006020820190508181036000830152614eb281614e76565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000614f15602c83614b56565b9150614f2082614eb9565b604082019050919050565b60006020820190508181036000830152614f4481614f08565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000614fa7602e83614b56565b9150614fb282614f4b565b604082019050919050565b60006020820190508181036000830152614fd681614f9a565b9050919050565b60008115159050919050565b614ff281614fdd565b8114614ffd57600080fd5b50565b60008151905061500f81614fe9565b92915050565b60006020828403121561502b5761502a614089565b5b600061503984828501615000565b91505092915050565b600060608201905061505760008301866143dc565b61506460208301856140f6565b61507160408301846140f6565b949350505050565b60008060006060848603121561509257615091614089565b5b60006150a08682870161488d565b93505060206150b18682870161488d565b92505060406150c28682870161488d565b9150509250925092565b600060a0820190506150e160008301886140f6565b6150ee60208301876140f6565b6150fb60408301866140f6565b61510860608301856140f6565b61511560808301846140f6565b9695505050505050565b600060a08201905061513460008301886143dc565b61514160208301876140f6565b61514e60408301866140f6565b61515b60608301856140f6565b61516860808301846140f6565b9695505050505050565b6000806000806080858703121561518c5761518b614089565b5b600061519a8782880161488d565b94505060206151ab8782880161488d565b93505060406151bc8782880161488d565b92505060606151cd8782880161488d565b91505092959194509250565b600060408201905081810360008301526151f38185614cae565b905081810360208301526152078184614d5b565b90509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061526c602683614b56565b915061527782615210565b604082019050919050565b6000602082019050818103600083015261529b8161525f565b9050919050565b600081905092915050565b7f456c656374696f6e000000000000000000000000000000000000000000000000600082015250565b60006152e36008836152a2565b91506152ee826152ad565b600882019050919050565b6000615304826152d6565b9150819050919050565b6000819050919050565b6153218161530e565b82525050565b600060208201905061533c6000830184615318565b92915050565b600081519050615351816142f6565b92915050565b60006020828403121561536d5761536c614089565b5b600061537b84828501615342565b91505092915050565b61538d81614fdd565b82525050565b60006080820190506153a860008301876143dc565b6153b560208301866140f6565b6153c260408301856140f6565b6153cf6060830184615384565b95945050505050565b600067ffffffffffffffff8211156153f3576153f261445c565b5b602082029050602081019050919050565b6000615417615412846153d8565b6144bc565b9050808382526020820190506020840283018581111561543a5761543961412a565b5b835b81811015615463578061544f8882615342565b84526020840193505060208101905061543c565b5050509392505050565b600082601f83011261548257615481614120565b5b8151615492848260208601615404565b91505092915050565b600067ffffffffffffffff8211156154b6576154b561445c565b5b602082029050602081019050919050565b60006154da6154d58461549b565b6144bc565b905080838252602082019050602084028301858111156154fd576154fc61412a565b5b835b818110156155265780615512888261488d565b8452602084019350506020810190506154ff565b5050509392505050565b600082601f83011261554557615544614120565b5b81516155558482602086016154c7565b91505092915050565b6000806040838503121561557557615574614089565b5b600083015167ffffffffffffffff8111156155935761559261408e565b5b61559f8582860161546d565b925050602083015167ffffffffffffffff8111156155c0576155bf61408e565b5b6155cc85828601615530565b9150509250929050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b6000615632602f83614b56565b915061563d826155d6565b604082019050919050565b6000602082019050818103600083015261566181615625565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b60006156c4602b83614b56565b91506156cf82615668565b604082019050919050565b600060208201905081810360008301526156f3816156b7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060808201905081810360008301526157438187614cae565b905081810360208301526157578186614d5b565b9050818103604083015261576b8185614cae565b9050818103606083015261577f8184614d5b565b905095945050505050565b600060408201905061579f60008301856140f6565b6157ac60208301846143dc565b9392505050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b600061580f602d83614b56565b915061581a826157b3565b604082019050919050565b6000602082019050818103600083015261583e81615802565b9050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b60006158a1602683614b56565b91506158ac82615845565b604082019050919050565b600060208201905081810360008301526158d081615894565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561590b5780820151818401526020810190506158f0565b8381111561591a576000848401525b50505050565b600061592b826158d7565b61593581856158e2565b93506159458185602086016158ed565b80840191505092915050565b600061595d8284615920565b915081905092915050565b600081519050919050565b600061597e82615968565b6159888185614b56565b93506159988185602086016158ed565b6159a18161444b565b840191505092915050565b600060208201905081810360008301526159c68184615973565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d3f400a05419d0bc5ab9889a2a7f561acff7f86b3b271dafda9a01791255d21264736f6c634300080b0033
Deployed ByteCode
0x6080604052600436106101cd5760003560e01c80637b103999116100f7578063beabacc811610095578063d0e30db011610064578063d0e30db014610677578063ee183c4a14610681578063f2fde38b146106ac578063fac5bb9b146106d5576101cd565b8063beabacc8146105bd578063c494ec1e146105e6578063ce7a60ab14610623578063cf009f7a1461064c576101cd565b8063a0fefe25116100d1578063a0fefe2514610502578063a3f16ef114610540578063b0ef81de1461056b578063bc4d3bb314610594576101cd565b80637b103999146104835780637e72dd66146104ae5780638da5cb5b146104d7576101cd565b8063485cc9551161016f57806354255be01161013e57806354255be0146103ec5780636fe958d81461041a578063715018a6146104435780637a9024bd1461045a576101cd565b8063485cc9551461032d57806348fd6ea6146103565780634e4e5efb146103935780634f1ef286146103d0576101cd565b80632c431058116101ab5780632c431058146102615780632e1a7d4d1461029e5780633659cfe6146102c757806339ebf823146102f0576101cd565b80630567847f146101d25780630c4d4e401461020f578063114e6b3714610238575b600080fd5b3480156101de57600080fd5b506101f960048036038101906101f491906140c9565b610700565b6040516102069190614105565b60405180910390f35b34801561021b57600080fd5b50610236600480360381019061023191906141db565b61086a565b005b34801561024457600080fd5b5061025f600480360381019061025a9190614322565b6109fd565b005b34801561026d57600080fd5b50610288600480360381019061028391906143af565b610dc4565b6040516102959190614105565b60405180910390f35b3480156102aa57600080fd5b506102c560048036038101906102c091906140c9565b610f67565b005b3480156102d357600080fd5b506102ee60048036038101906102e991906143af565b6110fe565b005b3480156102fc57600080fd5b50610317600480360381019061031291906143af565b611287565b60405161032491906143eb565b60405180910390f35b34801561033957600080fd5b50610354600480360381019061034f9190614406565b6112ba565b005b34801561036257600080fd5b5061037d600480360381019061037891906143af565b6113b2565b60405161038a9190614105565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b591906143af565b61145e565b6040516103c791906143eb565b60405180910390f35b6103ea60048036038101906103e59190614587565b611655565b005b3480156103f857600080fd5b50610401611792565b60405161041194939291906145e3565b60405180910390f35b34801561042657600080fd5b50610441600480360381019061043c9190614406565b6117ad565b005b34801561044f57600080fd5b50610458611a75565b005b34801561046657600080fd5b50610481600480360381019061047c91906143af565b611afd565b005b34801561048f57600080fd5b50610498611e4d565b6040516104a59190614687565b60405180910390f35b3480156104ba57600080fd5b506104d560048036038101906104d09190614406565b611e73565b005b3480156104e357600080fd5b506104ec61223e565b6040516104f991906143eb565b60405180910390f35b34801561050e57600080fd5b50610529600480360381019061052491906143af565b612268565b6040516105379291906146a2565b60405180910390f35b34801561054c57600080fd5b506105556125de565b60405161056291906146ec565b60405180910390f35b34801561057757600080fd5b50610592600480360381019061058d9190614707565b612604565b005b3480156105a057600080fd5b506105bb60048036038101906105b69190614747565b612751565b005b3480156105c957600080fd5b506105e460048036038101906105df91906147c2565b61293a565b005b3480156105f257600080fd5b5061060d600480360381019061060891906140c9565b612a9a565b60405161061a9190614105565b60405180910390f35b34801561062f57600080fd5b5061064a600480360381019061064591906143af565b612c04565b005b34801561065857600080fd5b50610661612c94565b60405161066e9190614836565b60405180910390f35b61067f612cba565b005b34801561068d57600080fd5b50610696612e5c565b6040516106a391906143eb565b60405180910390f35b3480156106b857600080fd5b506106d360048036038101906106ce91906143af565b612e82565b005b3480156106e157600080fd5b506106ea612f7a565b6040516106f79190614872565b60405180910390f35b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610770573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079491906148a2565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610805573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082991906148a2565b9050600082148061083a5750600081145b15610849578392505050610865565b81818561085691906148fe565b6108609190614987565b925050505b919050565b3373ffffffffffffffffffffffffffffffffffffffff16606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415801561091657503373ffffffffffffffffffffffffffffffffffffffff16606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561095857336040517ff7eb25ef00000000000000000000000000000000000000000000000000000000815260040161094f91906143eb565b60405180910390fd5b606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f380ade3898987878b8b89896040518963ffffffff1660e01b81526004016109c1989796959493929190614aed565b600060405180830381600087803b1580156109db57600080fd5b505af11580156109ef573d6000803e3d6000fd5b505050505050505050505050565b610a05612fc3565b73ffffffffffffffffffffffffffffffffffffffff16610a2361223e565b73ffffffffffffffffffffffffffffffffffffffff1614610a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7090614bb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161480610ae05750600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b80610b175750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610b4e5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610b855750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80610bbc5750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b15610bf3576040517f0855380c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85606660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084606760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083606c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082606d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081606e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080606f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167f77001ab3bb5b4e91a2a4021cec272d6505154d5ff1fb2e8426752b15bd8ef16d60405160405180910390a2505050505050565b600080610dd083612fcb565b90506000811415610de5576000915050610f62565b6000610def6130ff565b73ffffffffffffffffffffffffffffffffffffffff16633861727285606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610e4b929190614bd3565b602060405180830381865afa158015610e68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c91906148a2565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0866040518263ffffffff1660e01b8152600401610eeb91906143eb565b602060405180830381865afa158015610f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2c91906148a2565b90508183610f3a9190614bfc565b925080831015610f505760009350505050610f62565b8083610f5c9190614c52565b93505050505b919050565b600080610fd583607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006131c6565b91509150606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f842a1a3384846040518463ffffffff1660e01b815260040161103893929190614db9565b600060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b50505050606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33856040518363ffffffff1660e01b81526004016110c7929190614dfe565b600060405180830381600087803b1580156110e157600080fd5b505af11580156110f5573d6000803e3d6000fd5b50505050505050565b7f000000000000000000000000a0091608c8c4df29adaca90a037caa94bc271ba073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16141561118d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118490614e99565b60405180910390fd5b7f000000000000000000000000a0091608c8c4df29adaca90a037caa94bc271ba073ffffffffffffffffffffffffffffffffffffffff166111cc6133bb565b73ffffffffffffffffffffffffffffffffffffffff1614611222576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121990614f2b565b60405180910390fd5b61122b81613412565b61128481600067ffffffffffffffff81111561124a5761124961445c565b5b6040519080825280601f01601f19166020018201604052801561127c5781602001600182028036833780820191505090505b506000613491565b50565b60706020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060019054906101000a900460ff166112e25760008054906101000a900460ff16156112eb565b6112ea613662565b5b61132a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132190614fbd565b60405180910390fd5b60008060019054906101000a900460ff16159050801561137a576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b61138382613673565b61138c83613739565b80156113ad5760008060016101000a81548160ff0219169083151502179055505b505050565b600080606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166348fd6ea6846040518263ffffffff1660e01b815260040161141391906143eb565b6020604051808303816000875af1158015611432573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145691906148a2565b915050919050565b600080607060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561163c5750606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d826040518263ffffffff1660e01b815260040161155691906143eb565b602060405180830381865afa158015611573573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115979190615015565b8061163b5750606d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ac8f4425826040518263ffffffff1660e01b81526004016115f891906143eb565b602060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116399190615015565b155b5b1561164b576000915050611650565b809150505b919050565b7f000000000000000000000000a0091608c8c4df29adaca90a037caa94bc271ba073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614156116e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116db90614e99565b60405180910390fd5b7f000000000000000000000000a0091608c8c4df29adaca90a037caa94bc271ba073ffffffffffffffffffffffffffffffffffffffff166117236133bb565b73ffffffffffffffffffffffffffffffffffffffff1614611779576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177090614f2b565b60405180910390fd5b61178282613412565b61178e82826001613491565b5050565b60008060008060016003600080935093509350935090919293565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f8a13d7826040518263ffffffff1660e01b815260040161180891906143eb565b602060405180830381865afa158015611825573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118499190615015565b1580156118ee5750606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d826040518263ffffffff1660e01b81526004016118ac91906143eb565b602060405180830381865afa1580156118c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ed9190615015565b5b1561193057806040517f5a08158400000000000000000000000000000000000000000000000000000000815260040161192791906143eb565b60405180910390fd5b60008061193c84612268565b91509150818111611988578381836040517f2c4f8ec800000000000000000000000000000000000000000000000000000000815260040161197f93929190615042565b60405180910390fd5b60008061199485612268565b915091508181106119e0578481836040517fb0006ace0000000000000000000000000000000000000000000000000000000081526004016119d793929190615042565b60405180910390fd5b60006119eb86610dc4565b90506000811415611a3357856040517fb9183a08000000000000000000000000000000000000000000000000000000008152600401611a2a91906143eb565b60405180910390fd5b6000611a5e611a588787611a479190614c52565b8587611a539190614c52565b61384a565b8361384a565b9050611a6b888883613863565b5050505050505050565b611a7d612fc3565b73ffffffffffffffffffffffffffffffffffffffff16611a9b61223e565b73ffffffffffffffffffffffffffffffffffffffff1614611af1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae890614bb3565b60405180910390fd5b611afb6000613673565b565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015611c765750606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d826040518263ffffffff1660e01b8152600401611b9091906143eb565b602060405180830381865afa158015611bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd19190615015565b80611c755750606d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ac8f4425826040518263ffffffff1660e01b8152600401611c3291906143eb565b602060405180830381865afa158015611c4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c739190615015565b155b5b15611cb857806040517f10a7bc6b000000000000000000000000000000000000000000000000000000008152600401611caf91906143eb565b60405180910390fd5b6000606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401611d1591906143eb565b602060405180830381865afa158015611d32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5691906148a2565b905060008114611dcb57611dca607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168383613b32565b5b81607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f8a13d7826040518263ffffffff1660e01b8152600401611ece91906143eb565b602060405180830381865afa158015611eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0f9190615015565b611f5057806040517f5a081584000000000000000000000000000000000000000000000000000000008152600401611f4791906143eb565b60405180910390fd5b6000611f5b83612fcb565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b09bdc5e856040518263ffffffff1660e01b8152600401611fba91906143eb565b602060405180830381865afa158015611fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ffb91906148a2565b606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166322e59bd4866040518263ffffffff1660e01b815260040161205691906143eb565b602060405180830381865afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209791906148a2565b6120a19190614bfc565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd5c95e866040518263ffffffff1660e01b815260040161210091906143eb565b602060405180830381865afa15801561211d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214191906148a2565b90506000828211612153576000612160565b828261215f9190614c52565b5b9050600084821161217257600061217f565b848261217e9190614c52565b5b905060008114156121c757866040517f1eeadf530000000000000000000000000000000000000000000000000000000081526004016121be91906143eb565b60405180910390fd5b60006121d287610dc4565b9050600081141561221a57866040517fb9183a0800000000000000000000000000000000000000000000000000000000815260040161221191906143eb565b60405180910390fd5b6000612226838361384a565b9050612233898983613863565b505050505050505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0846040518263ffffffff1660e01b81526004016122c691906143eb565b602060405180830381865afa1580156122e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230791906148a2565b90506000606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cc222f8d856040518263ffffffff1660e01b815260040161236691906143eb565b602060405180830381865afa158015612383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123a79190615015565b1590506000606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f8a13d7866040518263ffffffff1660e01b815260040161240791906143eb565b602060405180830381865afa158015612424573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124489190615015565b9050600080831561251a57600080606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166356ab819f8a6040518263ffffffff1660e01b81526004016124b191906143eb565b606060405180830381865afa1580156124ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f29190615079565b809350819450829650505050808261250a9190614bfc565b846125159190614c52565b935050505b82156125bf57606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166385a92cb7886040518263ffffffff1660e01b815260040161257b91906143eb565b602060405180830381865afa158015612598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125bc91906148a2565b90505b6125d381836125ce9190614bfc565b610700565b955050505050915091565b606d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008060008373ffffffffffffffffffffffffffffffffffffffff1663c40da15c33886040518363ffffffff1660e01b815260040161266b929190614dfe565b6060604051808303816000875af115801561268a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ae9190615079565b925092509250606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e87878686866040518663ffffffff1660e01b81526004016127179594939291906150cc565b600060405180830381600087803b15801561273157600080fd5b505af1158015612745573d6000803e3d6000fd5b50505050505050505050565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000806000808473ffffffffffffffffffffffffffffffffffffffff16634c23f22e338c8b8b8b6040518663ffffffff1660e01b81526004016127bf95949392919061511f565b6080604051808303816000875af11580156127de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128029190615172565b9350935093509350606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639caa9e2933866040518363ffffffff1660e01b8152600401612867929190614dfe565b600060405180830381600087803b15801561288157600080fd5b505af1158015612895573d6000803e3d6000fd5b50505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e8b8b8686866040518663ffffffff1660e01b81526004016128fc9594939291906150cc565b600060405180830381600087803b15801561291657600080fd5b505af115801561292a573d6000803e3d6000fd5b5050505050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff16606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129cc57336040517f4a653c6a0000000000000000000000000000000000000000000000000000000081526004016129c391906143eb565b60405180910390fd5b612a95607060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16607060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683613b32565b505050565b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b2e91906148a2565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bc391906148a2565b90506000821480612bd45750600081145b15612be3578392505050612bff565b808285612bf091906148fe565b612bfa9190614987565b925050505b919050565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e37d49b8826040518263ffffffff1660e01b8152600401612c5f91906143eb565b600060405180830381600087803b158015612c7957600080fd5b505af1158015612c8d573d6000803e3d6000fd5b5050505050565b606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000612cc534612a9a565b9050600080612d343484607060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16613b7c565b91509150606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933856040518363ffffffff1660e01b8152600401612d95929190614dfe565b600060405180830381600087803b158015612daf57600080fd5b505af1158015612dc3573d6000803e3d6000fd5b50505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301c21d593484846040518463ffffffff1660e01b8152600401612e259291906151d9565b6000604051808303818588803b158015612e3e57600080fd5b505af1158015612e52573d6000803e3d6000fd5b5050505050505050565b606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612e8a612fc3565b73ffffffffffffffffffffffffffffffffffffffff16612ea861223e565b73ffffffffffffffffffffffffffffffffffffffff1614612efe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ef590614bb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f6590615282565b60405180910390fd5b612f7781613673565b50565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600033905090565b600080612fd66130ff565b73ffffffffffffffffffffffffffffffffffffffff16632c3b7916846040518263ffffffff1660e01b815260040161300e91906143eb565b602060405180830381865afa15801561302b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061304f91906148a2565b9050600061305b6130ff565b73ffffffffffffffffffffffffffffffffffffffff1663dedafeae856040518263ffffffff1660e01b815260040161309391906143eb565b602060405180830381865afa1580156130b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130d491906148a2565b9050808210156130e9576000925050506130fa565b80826130f59190614c52565b925050505b919050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed60405160200161314e906152f9565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016131809190615327565b602060405180830381865afa15801561319d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c19190615357565b905090565b60608060006131d486610700565b90506000811415613211576040517fc60050c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606080600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16146132fe57606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c650b5f88858b8a6040518563ffffffff1660e01b81526004016132a99493929190615393565b6000604051808303816000875af11580156132c8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906132f1919061555e565b80925081935050506133aa565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166336691a41846040518263ffffffff1660e01b81526004016133599190614105565b6000604051808303816000875af1158015613378573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906133a1919061555e565b80925081935050505b818194509450505050935093915050565b60006133e97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613d1e565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61341a612fc3565b73ffffffffffffffffffffffffffffffffffffffff1661343861223e565b73ffffffffffffffffffffffffffffffffffffffff161461348e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161348590614bb3565b60405180910390fd5b50565b600061349b6133bb565b90506134a684613d28565b6000835111806134b35750815b156134c4576134c28484613de1565b505b60006134f27f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b613e0e565b90508060000160009054906101000a900460ff1661365b5760018160000160006101000a81548160ff0219169083151502179055506135be858360405160240161353c91906143eb565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613de1565b5060008160000160006101000a81548160ff0219169083151502179055506135e46133bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614613651576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161364890615648565b60405180910390fd5b61365a85613e18565b5b5050505050565b600061366d30612fa0565b15905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060019054906101000a900460ff16613788576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161377f906156da565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156138055761ce10606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613847565b80606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000818310613859578161385b565b825b905092915050565b6000600167ffffffffffffffff8111156138805761387f61445c565b5b6040519080825280602002602001820160405280156138ae5781602001602082028036833780820191505090505b5090506000600167ffffffffffffffff8111156138ce576138cd61445c565b5b6040519080825280602002602001820160405280156138fc5781602001602082028036833780820191505090505b5090506000600167ffffffffffffffff81111561391c5761391b61445c565b5b60405190808252806020026020018201604052801561394a5781602001602082028036833780820191505090505b5090506000600167ffffffffffffffff81111561396a5761396961445c565b5b6040519080825280602002602001820160405280156139985781602001602082028036833780820191505090505b50905086846000815181106139b0576139af6156fa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505084826000815181106139ff576139fe6156fa565b5b6020026020010181815250508583600081518110613a2057613a1f6156fa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081600081518110613a6e57613a6d6156fa565b5b602002602001015181600081518110613a8a57613a896156fa565b5b602002602001018181525050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f380ade3858486856040518563ffffffff1660e01b8152600401613af79493929190615729565b600060405180830381600087803b158015613b1157600080fd5b505af1158015613b25573d6000803e3d6000fd5b5050505050505050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415613b6b57613b77565b613b76838383613e67565b5b505050565b606080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614613c6757606e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd1528588487876040518463ffffffff1660e01b8152600401613c1293929190615042565b6000604051808303816000875af1158015613c31573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190613c5a919061555e565b8092508193505050613d16565b606f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e0cd8d278660006040518363ffffffff1660e01b8152600401613cc592919061578a565b6000604051808303816000875af1158015613ce4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190613d0d919061555e565b80925081935050505b935093915050565b6000819050919050565b613d3181613f38565b613d70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d6790615825565b60405180910390fd5b80613d9d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613d1e565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060613e0683836040518060600160405280602781526020016159cf60279139613f4b565b905092915050565b6000819050919050565b613e2181613d28565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b606080613e76838660016131c6565b8092508193505050606080613e94613e8d86610700565b8688613b7c565b8092508193505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f380ade3858585856040518563ffffffff1660e01b8152600401613efd9493929190615729565b600060405180830381600087803b158015613f1757600080fd5b505af1158015613f2b573d6000803e3d6000fd5b5050505050505050505050565b600080823b905060008111915050919050565b6060613f5684613f38565b613f95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613f8c906158b7565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051613fbd9190615951565b600060405180830381855af49150503d8060008114613ff8576040519150601f19603f3d011682016040523d82523d6000602084013e613ffd565b606091505b509150915061400d828286614018565b925050509392505050565b6060831561402857829050614078565b60008351111561403b5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161406f91906159ac565b60405180910390fd5b9392505050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b6140a681614093565b81146140b157600080fd5b50565b6000813590506140c38161409d565b92915050565b6000602082840312156140df576140de614089565b5b60006140ed848285016140b4565b91505092915050565b6140ff81614093565b82525050565b600060208201905061411a60008301846140f6565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261414557614144614120565b5b8235905067ffffffffffffffff81111561416257614161614125565b5b60208301915083602082028301111561417e5761417d61412a565b5b9250929050565b60008083601f84011261419b5761419a614120565b5b8235905067ffffffffffffffff8111156141b8576141b7614125565b5b6020830191508360208202830111156141d4576141d361412a565b5b9250929050565b6000806000806000806000806080898b0312156141fb576141fa614089565b5b600089013567ffffffffffffffff8111156142195761421861408e565b5b6142258b828c0161412f565b9850985050602089013567ffffffffffffffff8111156142485761424761408e565b5b6142548b828c0161412f565b9650965050604089013567ffffffffffffffff8111156142775761427661408e565b5b6142838b828c01614185565b9450945050606089013567ffffffffffffffff8111156142a6576142a561408e565b5b6142b28b828c01614185565b92509250509295985092959890939650565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006142ef826142c4565b9050919050565b6142ff816142e4565b811461430a57600080fd5b50565b60008135905061431c816142f6565b92915050565b60008060008060008060c0878903121561433f5761433e614089565b5b600061434d89828a0161430d565b965050602061435e89828a0161430d565b955050604061436f89828a0161430d565b945050606061438089828a0161430d565b935050608061439189828a0161430d565b92505060a06143a289828a0161430d565b9150509295509295509295565b6000602082840312156143c5576143c4614089565b5b60006143d38482850161430d565b91505092915050565b6143e5816142e4565b82525050565b600060208201905061440060008301846143dc565b92915050565b6000806040838503121561441d5761441c614089565b5b600061442b8582860161430d565b925050602061443c8582860161430d565b9150509250929050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6144948261444b565b810181811067ffffffffffffffff821117156144b3576144b261445c565b5b80604052505050565b60006144c661407f565b90506144d2828261448b565b919050565b600067ffffffffffffffff8211156144f2576144f161445c565b5b6144fb8261444b565b9050602081019050919050565b82818337600083830152505050565b600061452a614525846144d7565b6144bc565b90508281526020810184848401111561454657614545614446565b5b614551848285614508565b509392505050565b600082601f83011261456e5761456d614120565b5b813561457e848260208601614517565b91505092915050565b6000806040838503121561459e5761459d614089565b5b60006145ac8582860161430d565b925050602083013567ffffffffffffffff8111156145cd576145cc61408e565b5b6145d985828601614559565b9150509250929050565b60006080820190506145f860008301876140f6565b61460560208301866140f6565b61461260408301856140f6565b61461f60608301846140f6565b95945050505050565b6000819050919050565b600061464d614648614643846142c4565b614628565b6142c4565b9050919050565b600061465f82614632565b9050919050565b600061467182614654565b9050919050565b61468181614666565b82525050565b600060208201905061469c6000830184614678565b92915050565b60006040820190506146b760008301856140f6565b6146c460208301846140f6565b9392505050565b60006146d682614654565b9050919050565b6146e6816146cb565b82525050565b600060208201905061470160008301846146dd565b92915050565b6000806040838503121561471e5761471d614089565b5b600061472c858286016140b4565b925050602061473d858286016140b4565b9150509250929050565b600080600080600060a0868803121561476357614762614089565b5b6000614771888289016140b4565b9550506020614782888289016140b4565b9450506040614793888289016140b4565b93505060606147a4888289016140b4565b92505060806147b5888289016140b4565b9150509295509295909350565b6000806000606084860312156147db576147da614089565b5b60006147e98682870161430d565b93505060206147fa8682870161430d565b925050604061480b868287016140b4565b9150509250925092565b600061482082614654565b9050919050565b61483081614815565b82525050565b600060208201905061484b6000830184614827565b92915050565b600061485c82614654565b9050919050565b61486c81614851565b82525050565b60006020820190506148876000830184614863565b92915050565b60008151905061489c8161409d565b92915050565b6000602082840312156148b8576148b7614089565b5b60006148c68482850161488d565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061490982614093565b915061491483614093565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561494d5761494c6148cf565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061499282614093565b915061499d83614093565b9250826149ad576149ac614958565b5b828204905092915050565b600082825260208201905092915050565b6000819050919050565b6149dc816142e4565b82525050565b60006149ee83836149d3565b60208301905092915050565b6000614a09602084018461430d565b905092915050565b6000602082019050919050565b6000614a2a83856149b8565b9350614a35826149c9565b8060005b85811015614a6e57614a4b82846149fa565b614a5588826149e2565b9750614a6083614a11565b925050600181019050614a39565b5085925050509392505050565b600082825260208201905092915050565b600080fd5b6000614a9d8385614a7b565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115614ad057614acf614a8c565b5b602083029250614ae1838584614508565b82840190509392505050565b60006080820190508181036000830152614b08818a8c614a1e565b90508181036020830152614b1d81888a614a91565b90508181036040830152614b32818688614a1e565b90508181036060830152614b47818486614a91565b90509998505050505050505050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614b9d602083614b56565b9150614ba882614b67565b602082019050919050565b60006020820190508181036000830152614bcc81614b90565b9050919050565b6000604082019050614be860008301856143dc565b614bf560208301846143dc565b9392505050565b6000614c0782614093565b9150614c1283614093565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614c4757614c466148cf565b5b828201905092915050565b6000614c5d82614093565b9150614c6883614093565b925082821015614c7b57614c7a6148cf565b5b828203905092915050565b600081519050919050565b6000819050602082019050919050565b6000602082019050919050565b6000614cb982614c86565b614cc381856149b8565b9350614cce83614c91565b8060005b83811015614cff578151614ce688826149e2565b9750614cf183614ca1565b925050600181019050614cd2565b5085935050505092915050565b600081519050919050565b6000819050602082019050919050565b614d3081614093565b82525050565b6000614d428383614d27565b60208301905092915050565b6000602082019050919050565b6000614d6682614d0c565b614d708185614a7b565b9350614d7b83614d17565b8060005b83811015614dac578151614d938882614d36565b9750614d9e83614d4e565b925050600181019050614d7f565b5085935050505092915050565b6000606082019050614dce60008301866143dc565b8181036020830152614de08185614cae565b90508181036040830152614df48184614d5b565b9050949350505050565b6000604082019050614e1360008301856143dc565b614e2060208301846140f6565b9392505050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000614e83602c83614b56565b9150614e8e82614e27565b604082019050919050565b60006020820190508181036000830152614eb281614e76565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000614f15602c83614b56565b9150614f2082614eb9565b604082019050919050565b60006020820190508181036000830152614f4481614f08565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000614fa7602e83614b56565b9150614fb282614f4b565b604082019050919050565b60006020820190508181036000830152614fd681614f9a565b9050919050565b60008115159050919050565b614ff281614fdd565b8114614ffd57600080fd5b50565b60008151905061500f81614fe9565b92915050565b60006020828403121561502b5761502a614089565b5b600061503984828501615000565b91505092915050565b600060608201905061505760008301866143dc565b61506460208301856140f6565b61507160408301846140f6565b949350505050565b60008060006060848603121561509257615091614089565b5b60006150a08682870161488d565b93505060206150b18682870161488d565b92505060406150c28682870161488d565b9150509250925092565b600060a0820190506150e160008301886140f6565b6150ee60208301876140f6565b6150fb60408301866140f6565b61510860608301856140f6565b61511560808301846140f6565b9695505050505050565b600060a08201905061513460008301886143dc565b61514160208301876140f6565b61514e60408301866140f6565b61515b60608301856140f6565b61516860808301846140f6565b9695505050505050565b6000806000806080858703121561518c5761518b614089565b5b600061519a8782880161488d565b94505060206151ab8782880161488d565b93505060406151bc8782880161488d565b92505060606151cd8782880161488d565b91505092959194509250565b600060408201905081810360008301526151f38185614cae565b905081810360208301526152078184614d5b565b90509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061526c602683614b56565b915061527782615210565b604082019050919050565b6000602082019050818103600083015261529b8161525f565b9050919050565b600081905092915050565b7f456c656374696f6e000000000000000000000000000000000000000000000000600082015250565b60006152e36008836152a2565b91506152ee826152ad565b600882019050919050565b6000615304826152d6565b9150819050919050565b6000819050919050565b6153218161530e565b82525050565b600060208201905061533c6000830184615318565b92915050565b600081519050615351816142f6565b92915050565b60006020828403121561536d5761536c614089565b5b600061537b84828501615342565b91505092915050565b61538d81614fdd565b82525050565b60006080820190506153a860008301876143dc565b6153b560208301866140f6565b6153c260408301856140f6565b6153cf6060830184615384565b95945050505050565b600067ffffffffffffffff8211156153f3576153f261445c565b5b602082029050602081019050919050565b6000615417615412846153d8565b6144bc565b9050808382526020820190506020840283018581111561543a5761543961412a565b5b835b81811015615463578061544f8882615342565b84526020840193505060208101905061543c565b5050509392505050565b600082601f83011261548257615481614120565b5b8151615492848260208601615404565b91505092915050565b600067ffffffffffffffff8211156154b6576154b561445c565b5b602082029050602081019050919050565b60006154da6154d58461549b565b6144bc565b905080838252602082019050602084028301858111156154fd576154fc61412a565b5b835b818110156155265780615512888261488d565b8452602084019350506020810190506154ff565b5050509392505050565b600082601f83011261554557615544614120565b5b81516155558482602086016154c7565b91505092915050565b6000806040838503121561557557615574614089565b5b600083015167ffffffffffffffff8111156155935761559261408e565b5b61559f8582860161546d565b925050602083015167ffffffffffffffff8111156155c0576155bf61408e565b5b6155cc85828601615530565b9150509250929050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b6000615632602f83614b56565b915061563d826155d6565b604082019050919050565b6000602082019050818103600083015261566181615625565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b60006156c4602b83614b56565b91506156cf82615668565b604082019050919050565b600060208201905081810360008301526156f3816156b7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060808201905081810360008301526157438187614cae565b905081810360208301526157578186614d5b565b9050818103604083015261576b8185614cae565b9050818103606083015261577f8184614d5b565b905095945050505050565b600060408201905061579f60008301856140f6565b6157ac60208301846143dc565b9392505050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b600061580f602d83614b56565b915061581a826157b3565b604082019050919050565b6000602082019050818103600083015261583e81615802565b9050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b60006158a1602683614b56565b91506158ac82615845565b604082019050919050565b600060208201905081810360008301526158d081615894565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561590b5780820151818401526020810190506158f0565b8381111561591a576000848401525b50505050565b600061592b826158d7565b61593581856158e2565b93506159458185602086016158ed565b80840191505092915050565b600061595d8284615920565b915081905092915050565b600081519050919050565b600061597e82615968565b6159888185614b56565b93506159988185602086016158ed565b6159a18161444b565b840191505092915050565b600060208201905081810360008301526159c68184615973565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d3f400a05419d0bc5ab9889a2a7f561acff7f86b3b271dafda9a01791255d21264736f6c634300080b0033