Address Details
contract

0x9C4E650e068D5923e56D509EEEE420327c11820e

Contract Name
Manager
Creator
0x5bc1c4–68a788 at 0x008989–35efb4
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
17220730
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-01-28T20:49:19.080442Z

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";

/**
 * @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 Holds a group's address and votes.
     * @param group The address of the group.
     * @param votes The votes assigned to the group.
     */
    struct GroupWithVotes {
        address group;
        uint256 votes;
    }

    /**
     * @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 The set of currently active groups that will be voted for with
     * new deposits.
     */
    EnumerableSet.AddressSet private activeGroups;

    /**
     * @notice The set of deprecated groups. These are groups that should no
     * longer receive new votes from deposits, but still need to be kept track
     * of because the Account contract is still voting for them.
     */
    EnumerableSet.AddressSet private deprecatedGroups;

    /**
     * @notice Contract used during Governance voting.
     */
    address public voteContract;

    /**
     * @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 Emitted when a new group is activated for voting.
     * @param group The group's address.
     */
    event GroupActivated(address indexed group);
    /**
     * @notice Emitted when a group is deprecated.
     * @param group The group's address.
     */
    event GroupDeprecated(address indexed group);
    /**
     * @notice Emitted when a deprecated group is no longer being voted for and
     * the contract forgets about it entirely.
     * @param group The group's address.
     */
    event GroupRemoved(address indexed group);

    /**
     * @notice Used when attempting to activate a group that is already active.
     * @param group The group's address.
     */
    error GroupAlreadyAdded(address group);

    /**
     * @notice Used when attempting to deprecate a group that is not active.
     * @param group The group's address.
     */
    error GroupNotActive(address group);

    /**
     * @notice Used when an attempt to add an active group to the EnumerableSet
     * fails.
     * @param group The group's address.
     */
    error FailedToAddActiveGroup(address group);

    /**
     * @notice Used when an attempt to add a deprecated group to the
     * EnumerableSet fails.
     * @param group The group's address.
     */
    error FailedToAddDeprecatedGroup(address group);

    /**
     * @notice Used when an attempt to remove a deprecated group from the
     * EnumerableSet fails.
     * @param group The group's address.
     */
    error FailedToRemoveDeprecatedGroup(address group);

    /**
     * @notice Used when attempting to activate a group when the maximum number
     * of groups voted (as allowed by the Election contract) is already being
     * voted for.
     */
    error MaxGroupsVotedForReached();

    /**
     * @notice Used when attempting to deposit when there are not active groups
     * to vote for.
     */
    error NoActiveGroups();

    /**
     * @notice Used when attempting to deposit when the total deposit amount
     * would tip each active group over the voting limit as defined in
     * Election.sol.
     */
    error NoVotableGroups();

    /**
     * @notice Used when attempting to withdraw but there are no groups being
     * voted for.
     */
    error NoGroups();

    /**
     * @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 deprecated a healthy group using deprecateUnhealthyGroup().
     * @param group The group's address.
     */
    error HealthyGroup(address group);

    /**
     * @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 Manager, Account and StakedCelo 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.
     */
    function setDependencies(
        address _stakedCelo,
        address _account,
        address _vote
    ) external onlyOwner {
        require(_stakedCelo != address(0), "stakedCelo null address");
        require(_account != address(0), "account null address");
        require(_vote != address(0), "vote null address");

        stakedCelo = IStakedCelo(_stakedCelo);
        account = IAccount(_account);
        voteContract = _vote;
        emit VoteContractSet(_vote);
    }

    /**
     * @notice Marks a group as votable.
     * @param group The address of the group to add to the set of votable
     * groups.
     * @dev Fails if the maximum number of groups are already being voted for by
     * the Account smart contract (as per the `maxNumGroupsVotedFor` in the
     * Election contract).
     */
    function activateGroup(address group) external onlyOwner {
        if (!isValidGroup(group)) {
            revert GroupNotEligible(group);
        }

        if (activeGroups.contains(group)) {
            revert GroupAlreadyAdded(group);
        }

        if (deprecatedGroups.contains(group)) {
            if (!deprecatedGroups.remove(group)) {
                revert FailedToRemoveDeprecatedGroup(group);
            }
        }

        if (
            activeGroups.length() + deprecatedGroups.length() >=
            getElection().maxNumGroupsVotedFor()
        ) {
            revert MaxGroupsVotedForReached();
        }

        if (!activeGroups.add(group)) {
            revert FailedToAddActiveGroup(group);
        }
        emit GroupActivated(group);
    }

    /**
     * @notice Returns the array of active groups.
     * @return The array of active groups.
     */
    function getGroups() external view returns (address[] memory) {
        return activeGroups.values();
    }

    /**
     * @notice Marks a group as deprecated.
     * @param group The group to deprecate.
     * @dev A deprecated group will remain in the `deprecatedGroups` array as
     * long as it is still being voted for by the Account contract. Deprecated
     * groups will be the first to have their votes withdrawn.
     */
    function deprecateGroup(address group) external onlyOwner {
        _deprecateGroup(group);
    }

    /**
     * @notice Checks if a group meets the validator group health requirements.
     * @param group The group to check for.
     * @return Whether or not the group is valid.
     */
    function isValidGroup(address group) public view returns (bool) {
        IValidators validators = getValidators();

        // add check if group is !registered
        if (!validators.isValidatorGroup(group)) {
            return false;
        }

        (address[] memory members, , , , , uint256 slashMultiplier, ) = validators
            .getValidatorGroup(group);

        // check if group has no members
        if (members.length == 0) {
            return false;
        }
        // check for recent slash
        if (slashMultiplier < 10**24) {
            return false;
        }
        // check that at least one member is elected.
        for (uint256 i = 0; i < members.length; i++) {
            if (isGroupMemberElected(members[i])) {
                return true;
            }
        }
        return false;
    }

    /**
     * @notice Marks an unhealthy group as deprecated.
     * @param group The group to deprecate if unhealthy.
     * @dev A deprecated group will remain in the `deprecatedGroups` array as
     * long as it is still being voted for by the Account contract. Deprecated
     * groups will be the first to have their votes withdrawn.
     */
    function deprecateUnhealthyGroup(address group) external {
        if (isValidGroup(group)) {
            revert HealthyGroup(group);
        }
        _deprecateGroup((group));
    }

    /**
     * @notice Returns the list of deprecated groups.
     * @return The list of deprecated groups.
     */
    function getDeprecatedGroups() external view returns (address[] memory) {
        return deprecatedGroups.values();
    }

    /**
     * @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.
     */
    function deposit() external payable {
        if (activeGroups.length() == 0) {
            revert NoActiveGroups();
        }

        stakedCelo.mint(msg.sender, toStakedCelo(msg.value));

        distributeVotes(msg.value);
    }

    /**
     * @notice Used to withdraw CELO from the system, in exchange for burning
     * stCELO.
     * @param stakedCeloAmount 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 stakedCeloAmount) external {
        if (activeGroups.length() + deprecatedGroups.length() == 0) {
            revert NoGroups();
        }

        distributeWithdrawals(toCelo(stakedCeloAmount), msg.sender);

        stakedCelo.burn(msg.sender, stakedCeloAmount);
    }

    /**
     * @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;
    }

    /**
     * @notice Distributes votes by computing the number of votes each active
     * group should receive, then calling out to `Account.scheduleVotes`.
     * @param votes The amount of votes to distribute.
     * @dev The vote distribution strategy is to try and have each validator
     * group to be receiving the same amount of votes from the system. If a
     * group already has more votes than the average of the total available
     * votes it will not be voted for, and instead we'll try to evenly
     * distribute between the remaining groups.
     * @dev Election.sol sets a dynamic limit on the number of votes receivable
     * by a group, based on the group's size, the total amount of Locked
     * CELO, and the total number of electable validators. We don't want to
     * schedule votes for a group when the amount would exceed this threshold.
     * `getVotableGroups` below selects those groups that could receive the
     * entire `votes` amount, and filters out the rest. This is a heuristic:
     * when distributing votes evenly, the group might receive less than
     * `votes`, and the total amount could end up being under the limit.
     * However, doing an exact computation would be both complex and cost a lot
     * of additional gas, hence the heuristic. If indeed all groups are close to
     * their voting limit, causing a larger deposit to revert with
     * NoVotableGroups, despite there still being some room for deposits, this
     * can be worked around by sending a few smaller deposits.
     */
    function distributeVotes(uint256 votes) internal {
        /*
         * "Votable" groups are those that will currently fit under the voting
         * limit in Election.sol even if voted for with the entire `votes`
         * amount. Note that some might still not end up getting voted for given
         * the distribution logic below.
         */
        address[] memory votableGroups = getVotableGroups(votes);
        if (votableGroups.length == 0) {
            revert NoVotableGroups();
        }

        GroupWithVotes[] memory sortedGroups;
        uint256 availableVotes;
        (sortedGroups, availableVotes) = getSortedGroupsWithVotes(votableGroups);
        availableVotes += votes;

        uint256[] memory votesPerGroup = new uint256[](votableGroups.length);
        uint256 groupsVoted = votableGroups.length;
        uint256 targetVotes = availableVotes / groupsVoted;

        /*
         * This would normally be (i = votableGroups.length - 1; i >=0; i--),
         * but we can't i-- on the last iteration when i=0, since i is an
         * unsigned integer. So we iterate with the loop variable 1 greater than
         * expected, set index = i-1, and use index inside the loop.
         */
        for (uint256 i = votableGroups.length; i > 0; i--) {
            uint256 index = i - 1;
            if (sortedGroups[index].votes >= targetVotes) {
                groupsVoted--;
                availableVotes -= sortedGroups[index].votes;
                targetVotes = availableVotes / groupsVoted;
                votesPerGroup[index] = 0;
            } else {
                votesPerGroup[index] = targetVotes - sortedGroups[index].votes;

                if (availableVotes % groupsVoted > index) {
                    votesPerGroup[index]++;
                }
            }
        }

        address[] memory finalGroups = new address[](groupsVoted);
        uint256[] memory finalVotes = new uint256[](groupsVoted);

        for (uint256 i = 0; i < groupsVoted; i++) {
            finalGroups[i] = sortedGroups[i].group;
            finalVotes[i] = votesPerGroup[i];
        }

        account.scheduleVotes{value: votes}(finalGroups, finalVotes);
    }

    /**
     * @notice Distributes withdrawals by computing the number of votes that
     * should be withdrawn from each group, then calling out to
     * `Account.scheduleVotes`.
     * @param withdrawal The amount of votes to withdraw.
     * @param beneficiary The address that should end up receiving the withdrawn
     * CELO.
     * @dev The withdrawal distribution strategy is to:
     * 1. Withdraw as much as possible from any deprecated groups.
     * 2. If more votes still need to be withdrawn, try and have each validator
     * group end up receiving the same amount of votes from the system. If a
     * group already has less votes than the average of the total remaining
     * votes, it will not be withdrawn from, and instead we'll try to evenly
     * distribute between the remaining groups.
     */
    function distributeWithdrawals(uint256 withdrawal, address beneficiary) internal {
        if (withdrawal == 0) {
            revert ZeroWithdrawal();
        }

        address[] memory deprecatedGroupsWithdrawn;
        uint256[] memory deprecatedWithdrawalsPerGroup;
        uint256 numberDeprecatedGroupsWithdrawn;

        (
            deprecatedGroupsWithdrawn,
            deprecatedWithdrawalsPerGroup,
            numberDeprecatedGroupsWithdrawn,
            withdrawal
        ) = getDeprecatedGroupsWithdrawalDistribution(withdrawal);

        address[] memory groupsWithdrawn;
        uint256[] memory withdrawalsPerGroup;

        (groupsWithdrawn, withdrawalsPerGroup) = getActiveGroupWithdrawalDistribution(withdrawal);

        address[] memory finalGroups = new address[](
            groupsWithdrawn.length + numberDeprecatedGroupsWithdrawn
        );
        uint256[] memory finalVotes = new uint256[](
            groupsWithdrawn.length + numberDeprecatedGroupsWithdrawn
        );

        for (uint256 i = 0; i < numberDeprecatedGroupsWithdrawn; i++) {
            finalGroups[i] = deprecatedGroupsWithdrawn[i];
            finalVotes[i] = deprecatedWithdrawalsPerGroup[i];
        }

        for (uint256 i = 0; i < groupsWithdrawn.length; i++) {
            finalGroups[i + numberDeprecatedGroupsWithdrawn] = groupsWithdrawn[i];
            finalVotes[i + numberDeprecatedGroupsWithdrawn] = withdrawalsPerGroup[i];
        }

        account.scheduleWithdrawals(beneficiary, finalGroups, finalVotes);
    }

    /**
     * @notice Calculates how many votes should be withdrawn from each
     * deprecated group.
     * @param withdrawal The total amount of votes that needs to be withdrawn.
     * @return deprecatedGroupsWithdrawn The array of deprecated groups to be
     * withdrawn from.
     * @return deprecatedWithdrawalsPerGroup The amount of votes to withdraw
     * from the respective deprecated group in `deprecatedGroupsWithdrawn`.
     * @return numberDeprecatedGroupsWithdrawn The number of groups in
     * `deprecatedGroupsWithdrawn` that have a non zero withdrawal.
     * @return remainingWithdrawal The number of votes that still need to be
     * withdrawn after withdrawing from deprecated groups.
     * @dev Non zero entries of `deprecatedWithdrawalsPerGroup` will be exactly
     * a prefix of length `numberDeprecatedGroupsWithdrawn`.
     */
    function getDeprecatedGroupsWithdrawalDistribution(uint256 withdrawal)
        internal
        returns (
            address[] memory deprecatedGroupsWithdrawn,
            uint256[] memory deprecatedWithdrawalsPerGroup,
            uint256 numberDeprecatedGroupsWithdrawn,
            uint256 remainingWithdrawal
        )
    {
        remainingWithdrawal = withdrawal;
        uint256 numberDeprecatedGroups = deprecatedGroups.length();
        deprecatedGroupsWithdrawn = new address[](numberDeprecatedGroups);
        deprecatedWithdrawalsPerGroup = new uint256[](numberDeprecatedGroups);
        numberDeprecatedGroupsWithdrawn = 0;

        for (uint256 i = 0; i < numberDeprecatedGroups; i++) {
            numberDeprecatedGroupsWithdrawn++;
            deprecatedGroupsWithdrawn[i] = deprecatedGroups.at(i);
            uint256 currentVotes = account.getCeloForGroup(deprecatedGroupsWithdrawn[i]);
            deprecatedWithdrawalsPerGroup[i] = Math.min(remainingWithdrawal, currentVotes);
            remainingWithdrawal -= deprecatedWithdrawalsPerGroup[i];

            if (currentVotes == deprecatedWithdrawalsPerGroup[i]) {
                if (!deprecatedGroups.remove(deprecatedGroupsWithdrawn[i])) {
                    revert FailedToRemoveDeprecatedGroup(deprecatedGroupsWithdrawn[i]);
                }
                emit GroupRemoved(deprecatedGroupsWithdrawn[i]);
            }

            if (remainingWithdrawal == 0) {
                break;
            }
        }

        return (
            deprecatedGroupsWithdrawn,
            deprecatedWithdrawalsPerGroup,
            numberDeprecatedGroupsWithdrawn,
            remainingWithdrawal
        );
    }

    /**
     * @notice Calculates how votes should be withdrawn from each active group.
     * @param withdrawal The number of votes that need to be withdrawn.
     * @return The array of group addresses that should be withdrawn from.
     * @return The amount of votes to withdraw from the respective group in the
     * array of groups withdrawn from.
     */
    function getActiveGroupWithdrawalDistribution(uint256 withdrawal)
        internal
        view
        returns (address[] memory, uint256[] memory)
    {
        if (withdrawal == 0) {
            address[] memory noGroups = new address[](0);
            uint256[] memory noWithdrawals = new uint256[](0);
            return (noGroups, noWithdrawals);
        }

        uint256 numberGroups = activeGroups.length();
        GroupWithVotes[] memory sortedGroups;
        uint256 availableVotes;
        (sortedGroups, availableVotes) = getSortedGroupsWithVotes(activeGroups.values());
        availableVotes -= withdrawal;

        uint256 numberGroupsWithdrawn = numberGroups;
        uint256 targetVotes = availableVotes / numberGroupsWithdrawn;

        for (uint256 i = 0; i < numberGroups; i++) {
            if (sortedGroups[i].votes <= targetVotes) {
                numberGroupsWithdrawn--;
                availableVotes -= sortedGroups[i].votes;
                targetVotes = availableVotes / numberGroupsWithdrawn;
            } else {
                break;
            }
        }

        uint256[] memory withdrawalsPerGroup = new uint256[](numberGroupsWithdrawn);
        address[] memory groupsWithdrawn = new address[](numberGroupsWithdrawn);
        uint256 offset = numberGroups - numberGroupsWithdrawn;

        for (uint256 i = 0; i < numberGroupsWithdrawn; i++) {
            groupsWithdrawn[i] = sortedGroups[i + offset].group;
            withdrawalsPerGroup[i] = sortedGroups[i + offset].votes - targetVotes;
            if (availableVotes % numberGroupsWithdrawn > i) {
                withdrawalsPerGroup[i]--;
            }
        }

        return (groupsWithdrawn, withdrawalsPerGroup);
    }

    /**
     * @notice Returns a list of group addresses with their corresponding
     * current total votes, sorted by the number of votes, and the total number
     * of votes in the system.
     * @param groups The array of addresses of the groups to sort.
     * @return The array of GroupWithVotes structs, sorted by number of votes.
     * @return The total number of votes assigned to active groups.
     */
    function getSortedGroupsWithVotes(address[] memory groups)
        internal
        view
        returns (GroupWithVotes[] memory, uint256)
    {
        GroupWithVotes[] memory groupsWithVotes = new GroupWithVotes[](groups.length);
        uint256 totalVotes = 0;
        for (uint256 i = 0; i < groups.length; i++) {
            uint256 votes = account.getCeloForGroup(groups[i]);
            totalVotes += votes;
            groupsWithVotes[i] = GroupWithVotes(groups[i], votes);
        }

        sortGroupsWithVotes(groupsWithVotes);
        return (groupsWithVotes, totalVotes);
    }

    /**
     * @notice Returns the active groups that can receive the entire `votes`
     * amount based on their current receivable votes limit in Election.sol.
     * @param votes The number of votes that would potentially be added.
     * @return The list of votable active groups.
     */
    function getVotableGroups(uint256 votes) internal returns (address[] memory) {
        uint256 numberGroups = activeGroups.length();
        uint256 numberVotableGroups = 0;
        address[] memory votableGroups = new address[](numberGroups);

        for (uint256 i = 0; i < numberGroups; i++) {
            address group = activeGroups.at(i);
            uint256 scheduledVotes = account.scheduledVotesForGroup(group);
            if (getElection().canReceiveVotes(group, votes + scheduledVotes)) {
                votableGroups[numberVotableGroups] = group;
                numberVotableGroups++;
            }
        }

        address[] memory votableGroupsFinal = new address[](numberVotableGroups);
        for (uint256 i = 0; i < numberVotableGroups; i++) {
            votableGroupsFinal[i] = votableGroups[i];
        }

        return votableGroupsFinal;
    }

    /**
     * @notice Sorts an array of GroupWithVotes structs based on increasing
     * `votes` values.
     * @param groupsWithVotes The array to sort.
     * @dev This is an in-place insertion sort. In general in Solidity we should
     * be careful of algorithms on arrays, especially O(n^2) ones, but here
     * we're guaranteed to be working with a small array, its length is bounded
     * by the maximum number of groups that can be voted for in Elections.sol.
     */
    function sortGroupsWithVotes(GroupWithVotes[] memory groupsWithVotes) internal pure {
        for (uint256 i = 1; i < groupsWithVotes.length; i++) {
            uint256 j = i;
            while (j > 0 && groupsWithVotes[j].votes < groupsWithVotes[j - 1].votes) {
                (groupsWithVotes[j], groupsWithVotes[j - 1]) = (
                    groupsWithVotes[j - 1],
                    groupsWithVotes[j]
                );
                j--;
            }
        }
    }

    /**
     * @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 Revokes votes on already voted proposal.
     * @param proposalId The ID of the proposal to vote on.
     * @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 account to be unlocked.
     */
    function updateHistoryAndReturnLockedStCeloInVoting(address beneficiary)
        external
        returns (uint256)
    {
        IVote vote = IVote(voteContract);
        return vote.updateHistoryAndReturnLockedStCeloInVoting(beneficiary);
    }

    /**
     * @notice Unlock vote balance of stCelo.
     * @param accountAddress The account to be unlocked.
     */
    function unlockBalance(address accountAddress) public {
        stakedCelo.unlockVoteBalance(accountAddress);
    }

    /**
     * @notice Marks a group as deprecated.
     * @param group The group to deprecate.
     */
    function _deprecateGroup(address group) private {
        if (!activeGroups.remove(group)) {
            revert GroupNotActive(group);
        }

        emit GroupDeprecated(group);

        if (account.getCeloForGroup(group) > 0) {
            if (!deprecatedGroups.add(group)) {
                revert FailedToAddDeprecatedGroup(group);
            }
        } else {
            emit GroupRemoved(group);
        }
    }

    /**
     * @notice Checks if a group member is elected.
     * @param groupMember The member of the group to check election status for.
     * @return Whether or not the group member is elected.
     */
    function isGroupMemberElected(address groupMember) private view returns (bool) {
        IElection election = getElection();

        address[] memory electedValidatorSigners = election.electValidatorSigners();

        for (uint256 i = 0; i < electedValidatorSigners.length; i++) {
            if (electedValidatorSigners[i] == groupMember) {
                return true;
            }
        }

        return false;
    }

    /**
     * @notice Returns the storage, major, minor, and patch version of the contract.
     * @return Storage version of the contract.
     * @return Major version of the contract.
     * @return Minor version of the contract.
     * @return Patch version of the contract.
     */
    function getVersionNumber()
        external
        pure
        returns (
            uint256,
            uint256,
            uint256,
            uint256
        )
    {
        return (1, 2, 0, 0);
    }
}
        

/_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 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 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 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 getTotalCelo() external view returns (uint256);

    function getCeloForGroup(address) external view returns (uint256);

    function scheduleVotes(address[] calldata group, uint256[] calldata votes) external payable;

    function scheduledVotesForGroup(address group) external returns (uint256);

    function scheduleWithdrawals(
        address beneficiary,
        address[] calldata group,
        uint256[] calldata withdrawals
    ) external;

    function votePartially(
        uint256 proposalId,
        uint256 index,
        uint256 yesVotes,
        uint256 noVotes,
        uint256 abstainVotes
    ) external;
}
          

/contracts/interfaces/IAccounts.sol

//SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.11;

interface IAccounts {
    function isAccount(address) external view returns (bool);

    function voteSignerToAccount(address) external view returns (address);

    function validatorSignerToAccount(address) external view returns (address);

    function attestationSignerToAccount(address) external view returns (address);

    function signerToAccount(address) external view returns (address);

    function getAttestationSigner(address) external view returns (address);

    function getValidatorSigner(address) external view returns (address);

    function getVoteSigner(address) external view returns (address);

    function hasAuthorizedVoteSigner(address) external view returns (bool);

    function hasAuthorizedValidatorSigner(address) external view returns (bool);

    function hasAuthorizedAttestationSigner(address) external view returns (bool);

    function setAccountDataEncryptionKey(bytes calldata) external;

    function setMetadataURL(string calldata) external;

    function setName(string calldata) external;

    function setWalletAddress(
        address,
        uint8,
        bytes32,
        bytes32
    ) external;

    function setAccount(
        string calldata,
        bytes calldata,
        address,
        uint8,
        bytes32,
        bytes32
    ) external;

    function getDataEncryptionKey(address) external view returns (bytes memory);

    function getWalletAddress(address) external view returns (address);

    function getMetadataURL(address) external view returns (string memory);

    function batchGetMetadataURL(address[] calldata)
        external
        view
        returns (uint256[] memory, bytes memory);

    function getName(address) external view returns (string memory);

    function authorizeVoteSigner(
        address,
        uint8,
        bytes32,
        bytes32
    ) external;

    function authorizeValidatorSigner(
        address,
        uint8,
        bytes32,
        bytes32
    ) external;

    function authorizeValidatorSignerWithPublicKey(
        address,
        uint8,
        bytes32,
        bytes32,
        bytes calldata
    ) external;

    function authorizeValidatorSignerWithKeys(
        address,
        uint8,
        bytes32,
        bytes32,
        bytes calldata,
        bytes calldata,
        bytes calldata
    ) external;

    function authorizeAttestationSigner(
        address,
        uint8,
        bytes32,
        bytes32
    ) external;

    function createAccount() external returns (bool);
}
          

/contracts/interfaces/IElection.sol

//SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.11;

interface IElection {
    function electValidatorSigners() external view returns (address[] memory);

    function electNValidatorSigners(uint256, uint256) external view returns (address[] memory);

    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);

    // view functions
    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);

    // 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 maxNumGroupsVotedFor() external view returns (uint256);
}
          

/contracts/interfaces/IGoldToken.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.11;

interface IGoldToken {
    function transfer(address to, uint256 value) external returns (bool);

    function transferWithComment(
        address to,
        uint256 value,
        string calldata comment
    ) external returns (bool);

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

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

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

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

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    function totalSupply() external view returns (uint256);

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

    function balanceOf(address owner) external view returns (uint256);
}
          

/contracts/interfaces/IGovernance.sol

//SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.11;

interface IGovernance {
    function votePartially(
        uint256 proposalId,
        uint256 index,
        uint256 yesVotes,
        uint256 noVotes,
        uint256 abstainVotes
    ) external returns (bool);

    function getProposal(uint256 proposalId)
        external
        view
        returns (
            address,
            uint256,
            uint256,
            uint256,
            string memory
        );

    function getReferendumStageDuration() external view returns (uint256);
}
          

/contracts/interfaces/ILockedGold.sol

//SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.11;

interface ILockedGold {
    function unlockingPeriod() external view returns (uint256);

    function incrementNonvotingAccountBalance(address, uint256) external;

    function decrementNonvotingAccountBalance(address, uint256) external;

    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 lock() external payable;

    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 isSlasher(address) external view returns (bool);

    function owner() external view returns (address);
}
          

/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/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":"FailedToAddActiveGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"FailedToAddDeprecatedGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"FailedToRemoveDeprecatedGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"GroupAlreadyAdded","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"GroupNotActive","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"GroupNotEligible","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"HealthyGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"error","name":"MaxGroupsVotedForReached","inputs":[]},{"type":"error","name":"NoActiveGroups","inputs":[]},{"type":"error","name":"NoGroups","inputs":[]},{"type":"error","name":"NoVotableGroups","inputs":[]},{"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":"GroupActivated","inputs":[{"type":"address","name":"group","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"GroupDeprecated","inputs":[{"type":"address","name":"group","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"GroupRemoved","inputs":[{"type":"address","name":"group","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":"activateGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deprecateGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deprecateUnhealthyGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getDeprecatedGroups","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getGroups","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getVersionNumber","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_registry","internalType":"address"},{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isValidGroup","inputs":[{"type":"address","name":"group","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"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":"setDependencies","inputs":[{"type":"address","name":"_stakedCelo","internalType":"address"},{"type":"address","name":"_account","internalType":"address"},{"type":"address","name":"_vote","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":"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":"stakedCeloAmount","internalType":"uint256"}]}]
              

Contract Creation Code

0x60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff168152503480156200004457600080fd5b50600060019054906101000a900460ff166200006f5760008054906101000a900460ff161562000080565b6200007f6200013c60201b60201c565b5b620000c2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000b99062000204565b60405180910390fd5b60008060019054906101000a900460ff16159050801562000113576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b8015620001355760008060016101000a81548160ff0219169083151502179055505b5062000226565b600062000154306200015a60201b62001cbf1760201c565b15905090565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000620001ec602e836200017d565b9150620001f9826200018e565b604082019050919050565b600060208201905081810360008301526200021f81620001dd565b9050919050565b6080516157b662000257600039600081816108900152818161091f01528181610bbd0152610c4c01526157b66000f3fe60806040526004361061014b5760003560e01c80637b4c1b75116100b6578063c494ec1e1161006f578063c494ec1e1461045a578063c72b517614610497578063ce7a60ab146104c2578063d0e30db0146104eb578063ee183c4a146104f5578063f2fde38b146105205761014b565b80637b4c1b751461034c5780638da5cb5b14610377578063b0ef81de146103a2578063b52d326c146103cb578063bc4d3bb3146103f4578063c2e70bb61461041d5761014b565b806348fd6ea61161010857806348fd6ea61461025a5780634f1ef2861461029757806354255be0146102b3578063715018a6146102e157806375688730146102f85780637b103999146103215761014b565b806304de86e8146101505780630567847f146101795780631937dc1f146101b65780632e1a7d4d146101df5780633659cfe614610208578063485cc95514610231575b600080fd5b34801561015c57600080fd5b50610177600480360381019061017291906140a4565b610549565b005b34801561018557600080fd5b506101a0600480360381019061019b9190614107565b6105d1565b6040516101ad9190614143565b60405180910390f35b3480156101c257600080fd5b506101dd60048036038101906101d891906140a4565b61073b565b005b3480156101eb57600080fd5b5061020660048036038101906102019190614107565b610792565b005b34801561021457600080fd5b5061022f600480360381019061022a91906140a4565b61088e565b005b34801561023d57600080fd5b506102586004803603810190610253919061415e565b610a17565b005b34801561026657600080fd5b50610281600480360381019061027c91906140a4565b610b0f565b60405161028e9190614143565b60405180910390f35b6102b160048036038101906102ac91906142e4565b610bbb565b005b3480156102bf57600080fd5b506102c8610cf8565b6040516102d89493929190614340565b60405180910390f35b3480156102ed57600080fd5b506102f6610d13565b005b34801561030457600080fd5b5061031f600480360381019061031a91906140a4565b610d9b565b005b34801561032d57600080fd5b5061033661108c565b60405161034391906143e4565b60405180910390f35b34801561035857600080fd5b506103616110b2565b60405161036e91906144bd565b60405180910390f35b34801561038357600080fd5b5061038c6110c3565b60405161039991906144ee565b60405180910390f35b3480156103ae57600080fd5b506103c960048036038101906103c49190614509565b6110ed565b005b3480156103d757600080fd5b506103f260048036038101906103ed9190614549565b61123a565b005b34801561040057600080fd5b5061041b6004803603810190610416919061459c565b611511565b005b34801561042957600080fd5b50610444600480360381019061043f91906140a4565b6116fa565b6040516104519190614632565b60405180910390f35b34801561046657600080fd5b50610481600480360381019061047c9190614107565b6118b0565b60405161048e9190614143565b60405180910390f35b3480156104a357600080fd5b506104ac611a1a565b6040516104b991906144bd565b60405180910390f35b3480156104ce57600080fd5b506104e960048036038101906104e491906140a4565b611a2b565b005b6104f3611abb565b005b34801561050157600080fd5b5061050a611ba1565b60405161051791906144ee565b60405180910390f35b34801561052c57600080fd5b50610547600480360381019061054291906140a4565b611bc7565b005b610551611ce2565b73ffffffffffffffffffffffffffffffffffffffff1661056f6110c3565b73ffffffffffffffffffffffffffffffffffffffff16146105c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bc906146aa565b60405180910390fd5b6105ce81611cea565b50565b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610641573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066591906146df565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fa91906146df565b9050600082148061070b5750600081145b1561071a578392505050610736565b818185610727919061473b565b61073191906147c4565b925050505b919050565b610744816116fa565b1561078657806040517fe3bd013b00000000000000000000000000000000000000000000000000000000815260040161077d91906144ee565b60405180910390fd5b61078f81611cea565b50565b600061079e606a611ec7565b6107a86068611ec7565b6107b291906147f5565b14156107ea576040517f377b56d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107fc6107f6826105d1565b33611edc565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33836040518363ffffffff1660e01b815260040161085992919061484b565b600060405180830381600087803b15801561087357600080fd5b505af1158015610887573d6000803e3d6000fd5b5050505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16141561091d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610914906148e6565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661095c612230565b73ffffffffffffffffffffffffffffffffffffffff16146109b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a990614978565b60405180910390fd5b6109bb81612287565b610a1481600067ffffffffffffffff8111156109da576109d96141b9565b5b6040519080825280601f01601f191660200182016040528015610a0c5781602001600182028036833780820191505090505b506000612306565b50565b600060019054906101000a900460ff16610a3f5760008054906101000a900460ff1615610a48565b610a476124d7565b5b610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90614a0a565b60405180910390fd5b60008060019054906101000a900460ff161590508015610ad7576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b610ae0826124e8565b610ae9836125ae565b8015610b0a5760008060016101000a81548160ff0219169083151502179055505b505050565b600080606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166348fd6ea6846040518263ffffffff1660e01b8152600401610b7091906144ee565b6020604051808303816000875af1158015610b8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb391906146df565b915050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906148e6565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610c89612230565b73ffffffffffffffffffffffffffffffffffffffff1614610cdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd690614978565b60405180910390fd5b610ce882612287565b610cf482826001612306565b5050565b60008060008060016002600080935093509350935090919293565b610d1b611ce2565b73ffffffffffffffffffffffffffffffffffffffff16610d396110c3565b73ffffffffffffffffffffffffffffffffffffffff1614610d8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d86906146aa565b60405180910390fd5b610d9960006124e8565b565b610da3611ce2565b73ffffffffffffffffffffffffffffffffffffffff16610dc16110c3565b73ffffffffffffffffffffffffffffffffffffffff1614610e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0e906146aa565b60405180910390fd5b610e20816116fa565b610e6157806040517f10a7bc6b000000000000000000000000000000000000000000000000000000008152600401610e5891906144ee565b60405180910390fd5b610e758160686126bf90919063ffffffff16565b15610eb757806040517fbd133eee000000000000000000000000000000000000000000000000000000008152600401610eae91906144ee565b60405180910390fd5b610ecb81606a6126bf90919063ffffffff16565b15610f2657610ee481606a6126ef90919063ffffffff16565b610f2557806040517fbe8534b7000000000000000000000000000000000000000000000000000000008152600401610f1c91906144ee565b60405180910390fd5b5b610f2e61271f565b73ffffffffffffffffffffffffffffffffffffffff1663ac839d696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9c91906146df565b610fa6606a611ec7565b610fb06068611ec7565b610fba91906147f5565b10610ff1576040517fae906d4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110058160686127e690919063ffffffff16565b61104657806040517f620f409a00000000000000000000000000000000000000000000000000000000815260040161103d91906144ee565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f0503b4748a47435f2432d46ef300e0e2dc47baa0e5f04bb3bd8a355ee1e1dbe660405160405180910390a250565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606110be606a612816565b905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008060008373ffffffffffffffffffffffffffffffffffffffff1663c40da15c33886040518363ffffffff1660e01b815260040161115492919061484b565b6060604051808303816000875af1158015611173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111979190614a2a565b925092509250606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e87878686866040518663ffffffff1660e01b8152600401611200959493929190614a7d565b600060405180830381600087803b15801561121a57600080fd5b505af115801561122e573d6000803e3d6000fd5b50505050505050505050565b611242611ce2565b73ffffffffffffffffffffffffffffffffffffffff166112606110c3565b73ffffffffffffffffffffffffffffffffffffffff16146112b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ad906146aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131d90614b1c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611396576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138d90614b88565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611406576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fd90614bf4565b60405180910390fd5b82606660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081606760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080606c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f77001ab3bb5b4e91a2a4021cec272d6505154d5ff1fb2e8426752b15bd8ef16d60405160405180910390a2505050565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000806000808473ffffffffffffffffffffffffffffffffffffffff16634c23f22e338c8b8b8b6040518663ffffffff1660e01b815260040161157f959493929190614c14565b6080604051808303816000875af115801561159e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c29190614c67565b9350935093509350606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639caa9e2933866040518363ffffffff1660e01b815260040161162792919061484b565b600060405180830381600087803b15801561164157600080fd5b505af1158015611655573d6000803e3d6000fd5b50505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e8b8b8686866040518663ffffffff1660e01b81526004016116bc959493929190614a7d565b600060405180830381600087803b1580156116d657600080fd5b505af11580156116ea573d6000803e3d6000fd5b5050505050505050505050505050565b600080611705612837565b90508073ffffffffffffffffffffffffffffffffffffffff166352f13a4e846040518263ffffffff1660e01b815260040161174091906144ee565b602060405180830381865afa15801561175d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117819190614cfa565b61178f5760009150506118ab565b6000808273ffffffffffffffffffffffffffffffffffffffff16639b9d5161866040518263ffffffff1660e01b81526004016117cb91906144ee565b600060405180830381865afa1580156117e8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906118119190614ec7565b50955050505050915060008251141561183057600093505050506118ab565b69d3c21bcecceda100000081101561184e57600093505050506118ab565b60005b82518110156118a25761187d8382815181106118705761186f614fa1565b5b60200260200101516128fe565b1561188f5760019450505050506118ab565b808061189a90614fd0565b915050611851565b50600093505050505b919050565b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611920573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194491906146df565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d991906146df565b905060008214806119ea5750600081145b156119f9578392505050611a15565b808285611a06919061473b565b611a1091906147c4565b925050505b919050565b6060611a266068612816565b905090565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e37d49b8826040518263ffffffff1660e01b8152600401611a8691906144ee565b600060405180830381600087803b158015611aa057600080fd5b505af1158015611ab4573d6000803e3d6000fd5b5050505050565b6000611ac76068611ec7565b1415611aff576040517f7818a60e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933611b47346118b0565b6040518363ffffffff1660e01b8152600401611b6492919061484b565b600060405180830381600087803b158015611b7e57600080fd5b505af1158015611b92573d6000803e3d6000fd5b50505050611b9f34612a09565b565b606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611bcf611ce2565b73ffffffffffffffffffffffffffffffffffffffff16611bed6110c3565b73ffffffffffffffffffffffffffffffffffffffff1614611c43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3a906146aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caa9061508b565b60405180910390fd5b611cbc816124e8565b50565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600033905090565b611cfe8160686126ef90919063ffffffff16565b611d3f57806040517f1adbb153000000000000000000000000000000000000000000000000000000008152600401611d3691906144ee565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f9d43d19c4e20849e2330b455068517bf1ebb0ebf9f9ad171e6906743aa65318660405160405180910390a26000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0836040518263ffffffff1660e01b8152600401611ddf91906144ee565b602060405180830381865afa158015611dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2091906146df565b1115611e8057611e3a81606a6127e690919063ffffffff16565b611e7b57806040517f817469c1000000000000000000000000000000000000000000000000000000008152600401611e7291906144ee565b60405180910390fd5b611ec4565b8073ffffffffffffffffffffffffffffffffffffffff167fa78a88a551e130ce9732be17784bdff12f72ab4a2c833fb2dcb3ef0818956b0360405160405180910390a25b50565b6000611ed582600001612e26565b9050919050565b6000821415611f17576040517fc60050c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060806000611f2585612e37565b80985081945082955083965050505050606080611f41876131a2565b80925081935050506000838351611f5891906147f5565b67ffffffffffffffff811115611f7157611f706141b9565b5b604051908082528060200260200182016040528015611f9f5781602001602082028036833780820191505090505b5090506000848451611fb191906147f5565b67ffffffffffffffff811115611fca57611fc96141b9565b5b604051908082528060200260200182016040528015611ff85781602001602082028036833780820191505090505b50905060005b858110156120bb5787818151811061201957612018614fa1565b5b602002602001015183828151811061203457612033614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505086818151811061208157612080614fa1565b5b602002602001015182828151811061209c5761209b614fa1565b5b60200260200101818152505080806120b390614fd0565b915050611ffe565b5060005b8451811015612193578481815181106120db576120da614fa1565b5b60200260200101518387836120f091906147f5565b8151811061210157612100614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083818151811061214e5761214d614fa1565b5b602002602001015182878361216391906147f5565b8151811061217457612173614fa1565b5b602002602001018181525050808061218b90614fd0565b9150506120bf565b50606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f842a1a8984846040518463ffffffff1660e01b81526004016121f393929190615169565b600060405180830381600087803b15801561220d57600080fd5b505af1158015612221573d6000803e3d6000fd5b50505050505050505050505050565b600061225e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613522565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61228f611ce2565b73ffffffffffffffffffffffffffffffffffffffff166122ad6110c3565b73ffffffffffffffffffffffffffffffffffffffff1614612303576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122fa906146aa565b60405180910390fd5b50565b6000612310612230565b905061231b8461352c565b6000835111806123285750815b156123395761233784846135e5565b505b60006123677f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b613612565b90508060000160009054906101000a900460ff166124d05760018160000160006101000a81548160ff02191690831515021790555061243385836040516024016123b191906144ee565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506135e5565b5060008160000160006101000a81548160ff021916908315150217905550612459612230565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146124c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bd90615220565b60405180910390fd5b6124cf8561361c565b5b5050505050565b60006124e230611cbf565b15905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060019054906101000a900460ff166125fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f4906152b2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561267a5761ce10606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506126bc565b80606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60006126e7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61366b565b905092915050565b6000612717836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61368e565b905092915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed60405160200161276e90615329565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016127a09190615357565b602060405180830381865afa1580156127bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e19190615372565b905090565b600061280e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6137a2565b905092915050565b6060600061282683600001613812565b905060608190508092505050919050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001612886906153eb565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016128b89190615357565b602060405180830381865afa1580156128d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f99190615372565b905090565b60008061290961271f565b905060008173ffffffffffffffffffffffffffffffffffffffff16632ba38e696040518163ffffffff1660e01b8152600401600060405180830381865afa158015612958573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906129819190615400565b905060005b81518110156129fc578473ffffffffffffffffffffffffffffffffffffffff168282815181106129b9576129b8614fa1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614156129e95760019350505050612a04565b80806129f490614fd0565b915050612986565b506000925050505b919050565b6000612a148261386e565b9050600081511415612a52576040517fd978e43100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000612a5f83613b77565b80925081935050508381612a7391906147f5565b90506000835167ffffffffffffffff811115612a9257612a916141b9565b5b604051908082528060200260200182016040528015612ac05781602001602082028036833780820191505090505b50905060008451905060008184612ad791906147c4565b90506000865190505b6000811115612c2b576000600182612af89190615449565b905082878281518110612b0e57612b0d614fa1565b5b60200260200101516020015110612b8d578380612b2a9061547d565b945050868181518110612b4057612b3f614fa1565b5b60200260200101516020015186612b579190615449565b95508386612b6591906147c4565b92506000858281518110612b7c57612b7b614fa1565b5b602002602001018181525050612c17565b868181518110612ba057612b9f614fa1565b5b60200260200101516020015183612bb79190615449565b858281518110612bca57612bc9614fa1565b5b602002602001018181525050808487612be391906154a7565b1115612c1657848181518110612bfc57612bfb614fa1565b5b602002602001018051809190612c1190614fd0565b815250505b5b508080612c239061547d565b915050612ae0565b5060008267ffffffffffffffff811115612c4857612c476141b9565b5b604051908082528060200260200182016040528015612c765781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811115612c9557612c946141b9565b5b604051908082528060200260200182016040528015612cc35781602001602082028036833780820191505090505b50905060005b84811015612d8a57878181518110612ce457612ce3614fa1565b5b602002602001015160000151838281518110612d0357612d02614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050858181518110612d5057612d4f614fa1565b5b6020026020010151828281518110612d6b57612d6a614fa1565b5b6020026020010181815250508080612d8290614fd0565b915050612cc9565b50606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301c21d598a84846040518463ffffffff1660e01b8152600401612de99291906154d8565b6000604051808303818588803b158015612e0257600080fd5b505af1158015612e16573d6000803e3d6000fd5b5050505050505050505050505050565b600081600001805490509050919050565b6060806000808490506000612e4c606a611ec7565b90508067ffffffffffffffff811115612e6857612e676141b9565b5b604051908082528060200260200182016040528015612e965781602001602082028036833780820191505090505b5094508067ffffffffffffffff811115612eb357612eb26141b9565b5b604051908082528060200260200182016040528015612ee15781602001602082028036833780820191505090505b5093506000925060005b81811015613199578380612efe90614fd0565b945050612f1581606a613d3690919063ffffffff16565b868281518110612f2857612f27614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0888481518110612fb557612fb4614fa1565b5b60200260200101516040518263ffffffff1660e01b8152600401612fd991906144ee565b602060405180830381865afa158015612ff6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301a91906146df565b90506130268482613d50565b86838151811061303957613038614fa1565b5b60200260200101818152505085828151811061305857613057614fa1565b5b60200260200101518461306b9190615449565b93508582815181106130805761307f614fa1565b5b6020026020010151811415613176576130bd8783815181106130a5576130a4614fa1565b5b6020026020010151606a6126ef90919063ffffffff16565b613118578682815181106130d4576130d3614fa1565b5b60200260200101516040517fbe8534b700000000000000000000000000000000000000000000000000000000815260040161310f91906144ee565b60405180910390fd5b86828151811061312b5761312a614fa1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fa78a88a551e130ce9732be17784bdff12f72ab4a2c833fb2dcb3ef0818956b0360405160405180910390a25b60008414156131855750613199565b50808061319190614fd0565b915050612eeb565b50509193509193565b60608060008314156132555760008067ffffffffffffffff8111156131ca576131c96141b9565b5b6040519080825280602002602001820160405280156131f85781602001602082028036833780820191505090505b50905060008067ffffffffffffffff811115613217576132166141b9565b5b6040519080825280602002602001820160405280156132455781602001602082028036833780820191505090505b509050818193509350505061351d565b60006132616068611ec7565b9050606060006132796132746068612816565b613b77565b8092508193505050858161328d9190615449565b90506000839050600081836132a291906147c4565b905060005b8581101561333957818582815181106132c3576132c2614fa1565b5b602002602001015160200151116133215782806132df9061547d565b9350508481815181106132f5576132f4614fa1565b5b6020026020010151602001518461330c9190615449565b9350828461331a91906147c4565b9150613326565b613339565b808061333190614fd0565b9150506132a7565b5060008267ffffffffffffffff811115613356576133556141b9565b5b6040519080825280602002602001820160405280156133845781602001602082028036833780820191505090505b50905060008367ffffffffffffffff8111156133a3576133a26141b9565b5b6040519080825280602002602001820160405280156133d15781602001602082028036833780820191505090505b509050600084886133e29190615449565b905060005b8581101561350d578782826133fc91906147f5565b8151811061340d5761340c614fa1565b5b60200260200101516000015183828151811061342c5761342b614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508488838361347491906147f5565b8151811061348557613484614fa1565b5b60200260200101516020015161349b9190615449565b8482815181106134ae576134ad614fa1565b5b6020026020010181815250508086886134c791906154a7565b11156134fa578381815181106134e0576134df614fa1565b5b6020026020010180518091906134f59061547d565b815250505b808061350590614fd0565b9150506133e7565b5081839950995050505050505050505b915091565b6000819050919050565b61353581613d69565b613574576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161356b90615581565b60405180910390fd5b806135a17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613522565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606061360a838360405180606001604052806027815260200161575a60279139613d7c565b905092915050565b6000819050919050565b6136258161352c565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146137965760006001826136c09190615449565b90506000600186600001805490506136d89190615449565b90508181146137475760008660000182815481106136f9576136f8614fa1565b5b906000526020600020015490508087600001848154811061371d5761371c614fa1565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b8560000180548061375b5761375a6155a1565b5b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061379c565b60009150505b92915050565b60006137ae838361366b565b61380757826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061380c565b600090505b92915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561386257602002820191906000526020600020905b81548152602001906001019080831161384e575b50505050509050919050565b6060600061387c6068611ec7565b90506000808267ffffffffffffffff81111561389b5761389a6141b9565b5b6040519080825280602002602001820160405280156138c95781602001602082028036833780820191505090505b50905060005b83811015613a965760006138ed826068613d3690919063ffffffff16565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd5c95e836040518263ffffffff1660e01b815260040161394c91906144ee565b6020604051808303816000875af115801561396b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398f91906146df565b905061399961271f565b73ffffffffffffffffffffffffffffffffffffffff1663e59ea3e883838b6139c191906147f5565b6040518363ffffffff1660e01b81526004016139de92919061484b565b602060405180830381865afa1580156139fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a1f9190614cfa565b15613a815781848681518110613a3857613a37614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508480613a7d90614fd0565b9550505b50508080613a8e90614fd0565b9150506138cf565b5060008267ffffffffffffffff811115613ab357613ab26141b9565b5b604051908082528060200260200182016040528015613ae15781602001602082028036833780820191505090505b50905060005b83811015613b6a57828181518110613b0257613b01614fa1565b5b6020026020010151828281518110613b1d57613b1c614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080613b6290614fd0565b915050613ae7565b5080945050505050919050565b6060600080835167ffffffffffffffff811115613b9757613b966141b9565b5b604051908082528060200260200182016040528015613bd057816020015b613bbd614002565b815260200190600190039081613bb55790505b5090506000805b8551811015613d1f576000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0888481518110613c3357613c32614fa1565b5b60200260200101516040518263ffffffff1660e01b8152600401613c5791906144ee565b602060405180830381865afa158015613c74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9891906146df565b90508083613ca691906147f5565b92506040518060400160405280888481518110613cc657613cc5614fa1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200182815250848381518110613d0057613cff614fa1565b5b6020026020010181905250508080613d1790614fd0565b915050613bd7565b50613d2982613e49565b8181935093505050915091565b6000613d458360000183613f70565b60001c905092915050565b6000818310613d5f5781613d61565b825b905092915050565b600080823b905060008111915050919050565b6060613d8784613d69565b613dc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613dbd90615642565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051613dee91906156dc565b600060405180830381855af49150503d8060008114613e29576040519150601f19603f3d011682016040523d82523d6000602084013e613e2e565b606091505b5091509150613e3e828286613f9b565b925050509392505050565b6000600190505b8151811015613f6c5760008190505b600081118015613eb6575082600182613e789190615449565b81518110613e8957613e88614fa1565b5b602002602001015160200151838281518110613ea857613ea7614fa1565b5b602002602001015160200151105b15613f585782600182613ec99190615449565b81518110613eda57613ed9614fa1565b5b6020026020010151838281518110613ef557613ef4614fa1565b5b6020026020010151848381518110613f1057613f0f614fa1565b5b6020026020010185600185613f259190615449565b81518110613f3657613f35614fa1565b5b6020026020010182905282905250508080613f509061547d565b915050613e5f565b508080613f6490614fd0565b915050613e50565b5050565b6000826000018281548110613f8857613f87614fa1565b5b9060005260206000200154905092915050565b60608315613fab57829050613ffb565b600083511115613fbe5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ff29190615737565b60405180910390fd5b9392505050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061407182614046565b9050919050565b61408181614066565b811461408c57600080fd5b50565b60008135905061409e81614078565b92915050565b6000602082840312156140ba576140b961403c565b5b60006140c88482850161408f565b91505092915050565b6000819050919050565b6140e4816140d1565b81146140ef57600080fd5b50565b600081359050614101816140db565b92915050565b60006020828403121561411d5761411c61403c565b5b600061412b848285016140f2565b91505092915050565b61413d816140d1565b82525050565b60006020820190506141586000830184614134565b92915050565b600080604083850312156141755761417461403c565b5b60006141838582860161408f565b92505060206141948582860161408f565b9150509250929050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6141f1826141a8565b810181811067ffffffffffffffff821117156142105761420f6141b9565b5b80604052505050565b6000614223614032565b905061422f82826141e8565b919050565b600067ffffffffffffffff82111561424f5761424e6141b9565b5b614258826141a8565b9050602081019050919050565b82818337600083830152505050565b600061428761428284614234565b614219565b9050828152602081018484840111156142a3576142a26141a3565b5b6142ae848285614265565b509392505050565b600082601f8301126142cb576142ca61419e565b5b81356142db848260208601614274565b91505092915050565b600080604083850312156142fb576142fa61403c565b5b60006143098582860161408f565b925050602083013567ffffffffffffffff81111561432a57614329614041565b5b614336858286016142b6565b9150509250929050565b60006080820190506143556000830187614134565b6143626020830186614134565b61436f6040830185614134565b61437c6060830184614134565b95945050505050565b6000819050919050565b60006143aa6143a56143a084614046565b614385565b614046565b9050919050565b60006143bc8261438f565b9050919050565b60006143ce826143b1565b9050919050565b6143de816143c3565b82525050565b60006020820190506143f960008301846143d5565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61443481614066565b82525050565b6000614446838361442b565b60208301905092915050565b6000602082019050919050565b600061446a826143ff565b614474818561440a565b935061447f8361441b565b8060005b838110156144b0578151614497888261443a565b97506144a283614452565b925050600181019050614483565b5085935050505092915050565b600060208201905081810360008301526144d7818461445f565b905092915050565b6144e881614066565b82525050565b600060208201905061450360008301846144df565b92915050565b600080604083850312156145205761451f61403c565b5b600061452e858286016140f2565b925050602061453f858286016140f2565b9150509250929050565b6000806000606084860312156145625761456161403c565b5b60006145708682870161408f565b93505060206145818682870161408f565b92505060406145928682870161408f565b9150509250925092565b600080600080600060a086880312156145b8576145b761403c565b5b60006145c6888289016140f2565b95505060206145d7888289016140f2565b94505060406145e8888289016140f2565b93505060606145f9888289016140f2565b925050608061460a888289016140f2565b9150509295509295909350565b60008115159050919050565b61462c81614617565b82525050565b60006020820190506146476000830184614623565b92915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061469460208361464d565b915061469f8261465e565b602082019050919050565b600060208201905081810360008301526146c381614687565b9050919050565b6000815190506146d9816140db565b92915050565b6000602082840312156146f5576146f461403c565b5b6000614703848285016146ca565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614746826140d1565b9150614751836140d1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561478a5761478961470c565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006147cf826140d1565b91506147da836140d1565b9250826147ea576147e9614795565b5b828204905092915050565b6000614800826140d1565b915061480b836140d1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156148405761483f61470c565b5b828201905092915050565b600060408201905061486060008301856144df565b61486d6020830184614134565b9392505050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b60006148d0602c8361464d565b91506148db82614874565b604082019050919050565b600060208201905081810360008301526148ff816148c3565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000614962602c8361464d565b915061496d82614906565b604082019050919050565b6000602082019050818103600083015261499181614955565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b60006149f4602e8361464d565b91506149ff82614998565b604082019050919050565b60006020820190508181036000830152614a23816149e7565b9050919050565b600080600060608486031215614a4357614a4261403c565b5b6000614a51868287016146ca565b9350506020614a62868287016146ca565b9250506040614a73868287016146ca565b9150509250925092565b600060a082019050614a926000830188614134565b614a9f6020830187614134565b614aac6040830186614134565b614ab96060830185614134565b614ac66080830184614134565b9695505050505050565b7f7374616b656443656c6f206e756c6c2061646472657373000000000000000000600082015250565b6000614b0660178361464d565b9150614b1182614ad0565b602082019050919050565b60006020820190508181036000830152614b3581614af9565b9050919050565b7f6163636f756e74206e756c6c2061646472657373000000000000000000000000600082015250565b6000614b7260148361464d565b9150614b7d82614b3c565b602082019050919050565b60006020820190508181036000830152614ba181614b65565b9050919050565b7f766f7465206e756c6c2061646472657373000000000000000000000000000000600082015250565b6000614bde60118361464d565b9150614be982614ba8565b602082019050919050565b60006020820190508181036000830152614c0d81614bd1565b9050919050565b600060a082019050614c2960008301886144df565b614c366020830187614134565b614c436040830186614134565b614c506060830185614134565b614c5d6080830184614134565b9695505050505050565b60008060008060808587031215614c8157614c8061403c565b5b6000614c8f878288016146ca565b9450506020614ca0878288016146ca565b9350506040614cb1878288016146ca565b9250506060614cc2878288016146ca565b91505092959194509250565b614cd781614617565b8114614ce257600080fd5b50565b600081519050614cf481614cce565b92915050565b600060208284031215614d1057614d0f61403c565b5b6000614d1e84828501614ce5565b91505092915050565b600067ffffffffffffffff821115614d4257614d416141b9565b5b602082029050602081019050919050565b600080fd5b600081519050614d6781614078565b92915050565b6000614d80614d7b84614d27565b614219565b90508083825260208201905060208402830185811115614da357614da2614d53565b5b835b81811015614dcc5780614db88882614d58565b845260208401935050602081019050614da5565b5050509392505050565b600082601f830112614deb57614dea61419e565b5b8151614dfb848260208601614d6d565b91505092915050565b600067ffffffffffffffff821115614e1f57614e1e6141b9565b5b602082029050602081019050919050565b6000614e43614e3e84614e04565b614219565b90508083825260208201905060208402830185811115614e6657614e65614d53565b5b835b81811015614e8f5780614e7b88826146ca565b845260208401935050602081019050614e68565b5050509392505050565b600082601f830112614eae57614ead61419e565b5b8151614ebe848260208601614e30565b91505092915050565b600080600080600080600060e0888a031215614ee657614ee561403c565b5b600088015167ffffffffffffffff811115614f0457614f03614041565b5b614f108a828b01614dd6565b9750506020614f218a828b016146ca565b9650506040614f328a828b016146ca565b9550506060614f438a828b016146ca565b945050608088015167ffffffffffffffff811115614f6457614f63614041565b5b614f708a828b01614e99565b93505060a0614f818a828b016146ca565b92505060c0614f928a828b016146ca565b91505092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614fdb826140d1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561500e5761500d61470c565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061507560268361464d565b915061508082615019565b604082019050919050565b600060208201905081810360008301526150a481615068565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6150e0816140d1565b82525050565b60006150f283836150d7565b60208301905092915050565b6000602082019050919050565b6000615116826150ab565b61512081856150b6565b935061512b836150c7565b8060005b8381101561515c57815161514388826150e6565b975061514e836150fe565b92505060018101905061512f565b5085935050505092915050565b600060608201905061517e60008301866144df565b8181036020830152615190818561445f565b905081810360408301526151a4818461510b565b9050949350505050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b600061520a602f8361464d565b9150615215826151ae565b604082019050919050565b60006020820190508181036000830152615239816151fd565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b600061529c602b8361464d565b91506152a782615240565b604082019050919050565b600060208201905081810360008301526152cb8161528f565b9050919050565b600081905092915050565b7f456c656374696f6e000000000000000000000000000000000000000000000000600082015250565b60006153136008836152d2565b915061531e826152dd565b600882019050919050565b600061533482615306565b9150819050919050565b6000819050919050565b6153518161533e565b82525050565b600060208201905061536c6000830184615348565b92915050565b6000602082840312156153885761538761403c565b5b600061539684828501614d58565b91505092915050565b7f56616c696461746f727300000000000000000000000000000000000000000000600082015250565b60006153d5600a836152d2565b91506153e08261539f565b600a82019050919050565b60006153f6826153c8565b9150819050919050565b6000602082840312156154165761541561403c565b5b600082015167ffffffffffffffff81111561543457615433614041565b5b61544084828501614dd6565b91505092915050565b6000615454826140d1565b915061545f836140d1565b9250828210156154725761547161470c565b5b828203905092915050565b6000615488826140d1565b9150600082141561549c5761549b61470c565b5b600182039050919050565b60006154b2826140d1565b91506154bd836140d1565b9250826154cd576154cc614795565b5b828206905092915050565b600060408201905081810360008301526154f2818561445f565b90508181036020830152615506818461510b565b90509392505050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b600061556b602d8361464d565b91506155768261550f565b604082019050919050565b6000602082019050818103600083015261559a8161555e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b600061562c60268361464d565b9150615637826155d0565b604082019050919050565b6000602082019050818103600083015261565b8161561f565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561569657808201518184015260208101905061567b565b838111156156a5576000848401525b50505050565b60006156b682615662565b6156c0818561566d565b93506156d0818560208601615678565b80840191505092915050565b60006156e882846156ab565b915081905092915050565b600081519050919050565b6000615709826156f3565b615713818561464d565b9350615723818560208601615678565b61572c816141a8565b840191505092915050565b6000602082019050818103600083015261575181846156fe565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b5e49e2115dbd6efe60a807ff6fa9c8b86be662a5b06fc3f5bddb86b36f0b65264736f6c634300080b0033

Deployed ByteCode

0x60806040526004361061014b5760003560e01c80637b4c1b75116100b6578063c494ec1e1161006f578063c494ec1e1461045a578063c72b517614610497578063ce7a60ab146104c2578063d0e30db0146104eb578063ee183c4a146104f5578063f2fde38b146105205761014b565b80637b4c1b751461034c5780638da5cb5b14610377578063b0ef81de146103a2578063b52d326c146103cb578063bc4d3bb3146103f4578063c2e70bb61461041d5761014b565b806348fd6ea61161010857806348fd6ea61461025a5780634f1ef2861461029757806354255be0146102b3578063715018a6146102e157806375688730146102f85780637b103999146103215761014b565b806304de86e8146101505780630567847f146101795780631937dc1f146101b65780632e1a7d4d146101df5780633659cfe614610208578063485cc95514610231575b600080fd5b34801561015c57600080fd5b50610177600480360381019061017291906140a4565b610549565b005b34801561018557600080fd5b506101a0600480360381019061019b9190614107565b6105d1565b6040516101ad9190614143565b60405180910390f35b3480156101c257600080fd5b506101dd60048036038101906101d891906140a4565b61073b565b005b3480156101eb57600080fd5b5061020660048036038101906102019190614107565b610792565b005b34801561021457600080fd5b5061022f600480360381019061022a91906140a4565b61088e565b005b34801561023d57600080fd5b506102586004803603810190610253919061415e565b610a17565b005b34801561026657600080fd5b50610281600480360381019061027c91906140a4565b610b0f565b60405161028e9190614143565b60405180910390f35b6102b160048036038101906102ac91906142e4565b610bbb565b005b3480156102bf57600080fd5b506102c8610cf8565b6040516102d89493929190614340565b60405180910390f35b3480156102ed57600080fd5b506102f6610d13565b005b34801561030457600080fd5b5061031f600480360381019061031a91906140a4565b610d9b565b005b34801561032d57600080fd5b5061033661108c565b60405161034391906143e4565b60405180910390f35b34801561035857600080fd5b506103616110b2565b60405161036e91906144bd565b60405180910390f35b34801561038357600080fd5b5061038c6110c3565b60405161039991906144ee565b60405180910390f35b3480156103ae57600080fd5b506103c960048036038101906103c49190614509565b6110ed565b005b3480156103d757600080fd5b506103f260048036038101906103ed9190614549565b61123a565b005b34801561040057600080fd5b5061041b6004803603810190610416919061459c565b611511565b005b34801561042957600080fd5b50610444600480360381019061043f91906140a4565b6116fa565b6040516104519190614632565b60405180910390f35b34801561046657600080fd5b50610481600480360381019061047c9190614107565b6118b0565b60405161048e9190614143565b60405180910390f35b3480156104a357600080fd5b506104ac611a1a565b6040516104b991906144bd565b60405180910390f35b3480156104ce57600080fd5b506104e960048036038101906104e491906140a4565b611a2b565b005b6104f3611abb565b005b34801561050157600080fd5b5061050a611ba1565b60405161051791906144ee565b60405180910390f35b34801561052c57600080fd5b50610547600480360381019061054291906140a4565b611bc7565b005b610551611ce2565b73ffffffffffffffffffffffffffffffffffffffff1661056f6110c3565b73ffffffffffffffffffffffffffffffffffffffff16146105c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bc906146aa565b60405180910390fd5b6105ce81611cea565b50565b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610641573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066591906146df565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fa91906146df565b9050600082148061070b5750600081145b1561071a578392505050610736565b818185610727919061473b565b61073191906147c4565b925050505b919050565b610744816116fa565b1561078657806040517fe3bd013b00000000000000000000000000000000000000000000000000000000815260040161077d91906144ee565b60405180910390fd5b61078f81611cea565b50565b600061079e606a611ec7565b6107a86068611ec7565b6107b291906147f5565b14156107ea576040517f377b56d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107fc6107f6826105d1565b33611edc565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33836040518363ffffffff1660e01b815260040161085992919061484b565b600060405180830381600087803b15801561087357600080fd5b505af1158015610887573d6000803e3d6000fd5b5050505050565b7f0000000000000000000000009c4e650e068d5923e56d509eeee420327c11820e73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16141561091d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610914906148e6565b60405180910390fd5b7f0000000000000000000000009c4e650e068d5923e56d509eeee420327c11820e73ffffffffffffffffffffffffffffffffffffffff1661095c612230565b73ffffffffffffffffffffffffffffffffffffffff16146109b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a990614978565b60405180910390fd5b6109bb81612287565b610a1481600067ffffffffffffffff8111156109da576109d96141b9565b5b6040519080825280601f01601f191660200182016040528015610a0c5781602001600182028036833780820191505090505b506000612306565b50565b600060019054906101000a900460ff16610a3f5760008054906101000a900460ff1615610a48565b610a476124d7565b5b610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90614a0a565b60405180910390fd5b60008060019054906101000a900460ff161590508015610ad7576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b610ae0826124e8565b610ae9836125ae565b8015610b0a5760008060016101000a81548160ff0219169083151502179055505b505050565b600080606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166348fd6ea6846040518263ffffffff1660e01b8152600401610b7091906144ee565b6020604051808303816000875af1158015610b8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb391906146df565b915050919050565b7f0000000000000000000000009c4e650e068d5923e56d509eeee420327c11820e73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161415610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906148e6565b60405180910390fd5b7f0000000000000000000000009c4e650e068d5923e56d509eeee420327c11820e73ffffffffffffffffffffffffffffffffffffffff16610c89612230565b73ffffffffffffffffffffffffffffffffffffffff1614610cdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd690614978565b60405180910390fd5b610ce882612287565b610cf482826001612306565b5050565b60008060008060016002600080935093509350935090919293565b610d1b611ce2565b73ffffffffffffffffffffffffffffffffffffffff16610d396110c3565b73ffffffffffffffffffffffffffffffffffffffff1614610d8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d86906146aa565b60405180910390fd5b610d9960006124e8565b565b610da3611ce2565b73ffffffffffffffffffffffffffffffffffffffff16610dc16110c3565b73ffffffffffffffffffffffffffffffffffffffff1614610e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0e906146aa565b60405180910390fd5b610e20816116fa565b610e6157806040517f10a7bc6b000000000000000000000000000000000000000000000000000000008152600401610e5891906144ee565b60405180910390fd5b610e758160686126bf90919063ffffffff16565b15610eb757806040517fbd133eee000000000000000000000000000000000000000000000000000000008152600401610eae91906144ee565b60405180910390fd5b610ecb81606a6126bf90919063ffffffff16565b15610f2657610ee481606a6126ef90919063ffffffff16565b610f2557806040517fbe8534b7000000000000000000000000000000000000000000000000000000008152600401610f1c91906144ee565b60405180910390fd5b5b610f2e61271f565b73ffffffffffffffffffffffffffffffffffffffff1663ac839d696040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9c91906146df565b610fa6606a611ec7565b610fb06068611ec7565b610fba91906147f5565b10610ff1576040517fae906d4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110058160686127e690919063ffffffff16565b61104657806040517f620f409a00000000000000000000000000000000000000000000000000000000815260040161103d91906144ee565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f0503b4748a47435f2432d46ef300e0e2dc47baa0e5f04bb3bd8a355ee1e1dbe660405160405180910390a250565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606110be606a612816565b905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008060008373ffffffffffffffffffffffffffffffffffffffff1663c40da15c33886040518363ffffffff1660e01b815260040161115492919061484b565b6060604051808303816000875af1158015611173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111979190614a2a565b925092509250606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e87878686866040518663ffffffff1660e01b8152600401611200959493929190614a7d565b600060405180830381600087803b15801561121a57600080fd5b505af115801561122e573d6000803e3d6000fd5b50505050505050505050565b611242611ce2565b73ffffffffffffffffffffffffffffffffffffffff166112606110c3565b73ffffffffffffffffffffffffffffffffffffffff16146112b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ad906146aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131d90614b1c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611396576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138d90614b88565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611406576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fd90614bf4565b60405180910390fd5b82606660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081606760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080606c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f77001ab3bb5b4e91a2a4021cec272d6505154d5ff1fb2e8426752b15bd8ef16d60405160405180910390a2505050565b6000606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000806000808473ffffffffffffffffffffffffffffffffffffffff16634c23f22e338c8b8b8b6040518663ffffffff1660e01b815260040161157f959493929190614c14565b6080604051808303816000875af115801561159e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c29190614c67565b9350935093509350606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639caa9e2933866040518363ffffffff1660e01b815260040161162792919061484b565b600060405180830381600087803b15801561164157600080fd5b505af1158015611655573d6000803e3d6000fd5b50505050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632edfd12e8b8b8686866040518663ffffffff1660e01b81526004016116bc959493929190614a7d565b600060405180830381600087803b1580156116d657600080fd5b505af11580156116ea573d6000803e3d6000fd5b5050505050505050505050505050565b600080611705612837565b90508073ffffffffffffffffffffffffffffffffffffffff166352f13a4e846040518263ffffffff1660e01b815260040161174091906144ee565b602060405180830381865afa15801561175d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117819190614cfa565b61178f5760009150506118ab565b6000808273ffffffffffffffffffffffffffffffffffffffff16639b9d5161866040518263ffffffff1660e01b81526004016117cb91906144ee565b600060405180830381865afa1580156117e8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906118119190614ec7565b50955050505050915060008251141561183057600093505050506118ab565b69d3c21bcecceda100000081101561184e57600093505050506118ab565b60005b82518110156118a25761187d8382815181106118705761186f614fa1565b5b60200260200101516128fe565b1561188f5760019450505050506118ab565b808061189a90614fd0565b915050611851565b50600093505050505b919050565b600080606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611920573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194491906146df565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301d2b6ea6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d991906146df565b905060008214806119ea5750600081145b156119f9578392505050611a15565b808285611a06919061473b565b611a1091906147c4565b925050505b919050565b6060611a266068612816565b905090565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e37d49b8826040518263ffffffff1660e01b8152600401611a8691906144ee565b600060405180830381600087803b158015611aa057600080fd5b505af1158015611ab4573d6000803e3d6000fd5b5050505050565b6000611ac76068611ec7565b1415611aff576040517f7818a60e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933611b47346118b0565b6040518363ffffffff1660e01b8152600401611b6492919061484b565b600060405180830381600087803b158015611b7e57600080fd5b505af1158015611b92573d6000803e3d6000fd5b50505050611b9f34612a09565b565b606c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611bcf611ce2565b73ffffffffffffffffffffffffffffffffffffffff16611bed6110c3565b73ffffffffffffffffffffffffffffffffffffffff1614611c43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3a906146aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caa9061508b565b60405180910390fd5b611cbc816124e8565b50565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600033905090565b611cfe8160686126ef90919063ffffffff16565b611d3f57806040517f1adbb153000000000000000000000000000000000000000000000000000000008152600401611d3691906144ee565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f9d43d19c4e20849e2330b455068517bf1ebb0ebf9f9ad171e6906743aa65318660405160405180910390a26000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0836040518263ffffffff1660e01b8152600401611ddf91906144ee565b602060405180830381865afa158015611dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2091906146df565b1115611e8057611e3a81606a6127e690919063ffffffff16565b611e7b57806040517f817469c1000000000000000000000000000000000000000000000000000000008152600401611e7291906144ee565b60405180910390fd5b611ec4565b8073ffffffffffffffffffffffffffffffffffffffff167fa78a88a551e130ce9732be17784bdff12f72ab4a2c833fb2dcb3ef0818956b0360405160405180910390a25b50565b6000611ed582600001612e26565b9050919050565b6000821415611f17576040517fc60050c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060806000611f2585612e37565b80985081945082955083965050505050606080611f41876131a2565b80925081935050506000838351611f5891906147f5565b67ffffffffffffffff811115611f7157611f706141b9565b5b604051908082528060200260200182016040528015611f9f5781602001602082028036833780820191505090505b5090506000848451611fb191906147f5565b67ffffffffffffffff811115611fca57611fc96141b9565b5b604051908082528060200260200182016040528015611ff85781602001602082028036833780820191505090505b50905060005b858110156120bb5787818151811061201957612018614fa1565b5b602002602001015183828151811061203457612033614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505086818151811061208157612080614fa1565b5b602002602001015182828151811061209c5761209b614fa1565b5b60200260200101818152505080806120b390614fd0565b915050611ffe565b5060005b8451811015612193578481815181106120db576120da614fa1565b5b60200260200101518387836120f091906147f5565b8151811061210157612100614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083818151811061214e5761214d614fa1565b5b602002602001015182878361216391906147f5565b8151811061217457612173614fa1565b5b602002602001018181525050808061218b90614fd0565b9150506120bf565b50606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632f842a1a8984846040518463ffffffff1660e01b81526004016121f393929190615169565b600060405180830381600087803b15801561220d57600080fd5b505af1158015612221573d6000803e3d6000fd5b50505050505050505050505050565b600061225e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613522565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61228f611ce2565b73ffffffffffffffffffffffffffffffffffffffff166122ad6110c3565b73ffffffffffffffffffffffffffffffffffffffff1614612303576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122fa906146aa565b60405180910390fd5b50565b6000612310612230565b905061231b8461352c565b6000835111806123285750815b156123395761233784846135e5565b505b60006123677f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b613612565b90508060000160009054906101000a900460ff166124d05760018160000160006101000a81548160ff02191690831515021790555061243385836040516024016123b191906144ee565b6040516020818303038152906040527f3659cfe6000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506135e5565b5060008160000160006101000a81548160ff021916908315150217905550612459612230565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146124c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bd90615220565b60405180910390fd5b6124cf8561361c565b5b5050505050565b60006124e230611cbf565b15905090565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060019054906101000a900460ff166125fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f4906152b2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561267a5761ce10606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506126bc565b80606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60006126e7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61366b565b905092915050565b6000612717836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61368e565b905092915050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed60405160200161276e90615329565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016127a09190615357565b602060405180830381865afa1580156127bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e19190615372565b905090565b600061280e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6137a2565b905092915050565b6060600061282683600001613812565b905060608190508092505050919050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001612886906153eb565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016128b89190615357565b602060405180830381865afa1580156128d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f99190615372565b905090565b60008061290961271f565b905060008173ffffffffffffffffffffffffffffffffffffffff16632ba38e696040518163ffffffff1660e01b8152600401600060405180830381865afa158015612958573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906129819190615400565b905060005b81518110156129fc578473ffffffffffffffffffffffffffffffffffffffff168282815181106129b9576129b8614fa1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614156129e95760019350505050612a04565b80806129f490614fd0565b915050612986565b506000925050505b919050565b6000612a148261386e565b9050600081511415612a52576040517fd978e43100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000612a5f83613b77565b80925081935050508381612a7391906147f5565b90506000835167ffffffffffffffff811115612a9257612a916141b9565b5b604051908082528060200260200182016040528015612ac05781602001602082028036833780820191505090505b50905060008451905060008184612ad791906147c4565b90506000865190505b6000811115612c2b576000600182612af89190615449565b905082878281518110612b0e57612b0d614fa1565b5b60200260200101516020015110612b8d578380612b2a9061547d565b945050868181518110612b4057612b3f614fa1565b5b60200260200101516020015186612b579190615449565b95508386612b6591906147c4565b92506000858281518110612b7c57612b7b614fa1565b5b602002602001018181525050612c17565b868181518110612ba057612b9f614fa1565b5b60200260200101516020015183612bb79190615449565b858281518110612bca57612bc9614fa1565b5b602002602001018181525050808487612be391906154a7565b1115612c1657848181518110612bfc57612bfb614fa1565b5b602002602001018051809190612c1190614fd0565b815250505b5b508080612c239061547d565b915050612ae0565b5060008267ffffffffffffffff811115612c4857612c476141b9565b5b604051908082528060200260200182016040528015612c765781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811115612c9557612c946141b9565b5b604051908082528060200260200182016040528015612cc35781602001602082028036833780820191505090505b50905060005b84811015612d8a57878181518110612ce457612ce3614fa1565b5b602002602001015160000151838281518110612d0357612d02614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050858181518110612d5057612d4f614fa1565b5b6020026020010151828281518110612d6b57612d6a614fa1565b5b6020026020010181815250508080612d8290614fd0565b915050612cc9565b50606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166301c21d598a84846040518463ffffffff1660e01b8152600401612de99291906154d8565b6000604051808303818588803b158015612e0257600080fd5b505af1158015612e16573d6000803e3d6000fd5b5050505050505050505050505050565b600081600001805490509050919050565b6060806000808490506000612e4c606a611ec7565b90508067ffffffffffffffff811115612e6857612e676141b9565b5b604051908082528060200260200182016040528015612e965781602001602082028036833780820191505090505b5094508067ffffffffffffffff811115612eb357612eb26141b9565b5b604051908082528060200260200182016040528015612ee15781602001602082028036833780820191505090505b5093506000925060005b81811015613199578380612efe90614fd0565b945050612f1581606a613d3690919063ffffffff16565b868281518110612f2857612f27614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0888481518110612fb557612fb4614fa1565b5b60200260200101516040518263ffffffff1660e01b8152600401612fd991906144ee565b602060405180830381865afa158015612ff6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301a91906146df565b90506130268482613d50565b86838151811061303957613038614fa1565b5b60200260200101818152505085828151811061305857613057614fa1565b5b60200260200101518461306b9190615449565b93508582815181106130805761307f614fa1565b5b6020026020010151811415613176576130bd8783815181106130a5576130a4614fa1565b5b6020026020010151606a6126ef90919063ffffffff16565b613118578682815181106130d4576130d3614fa1565b5b60200260200101516040517fbe8534b700000000000000000000000000000000000000000000000000000000815260040161310f91906144ee565b60405180910390fd5b86828151811061312b5761312a614fa1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff167fa78a88a551e130ce9732be17784bdff12f72ab4a2c833fb2dcb3ef0818956b0360405160405180910390a25b60008414156131855750613199565b50808061319190614fd0565b915050612eeb565b50509193509193565b60608060008314156132555760008067ffffffffffffffff8111156131ca576131c96141b9565b5b6040519080825280602002602001820160405280156131f85781602001602082028036833780820191505090505b50905060008067ffffffffffffffff811115613217576132166141b9565b5b6040519080825280602002602001820160405280156132455781602001602082028036833780820191505090505b509050818193509350505061351d565b60006132616068611ec7565b9050606060006132796132746068612816565b613b77565b8092508193505050858161328d9190615449565b90506000839050600081836132a291906147c4565b905060005b8581101561333957818582815181106132c3576132c2614fa1565b5b602002602001015160200151116133215782806132df9061547d565b9350508481815181106132f5576132f4614fa1565b5b6020026020010151602001518461330c9190615449565b9350828461331a91906147c4565b9150613326565b613339565b808061333190614fd0565b9150506132a7565b5060008267ffffffffffffffff811115613356576133556141b9565b5b6040519080825280602002602001820160405280156133845781602001602082028036833780820191505090505b50905060008367ffffffffffffffff8111156133a3576133a26141b9565b5b6040519080825280602002602001820160405280156133d15781602001602082028036833780820191505090505b509050600084886133e29190615449565b905060005b8581101561350d578782826133fc91906147f5565b8151811061340d5761340c614fa1565b5b60200260200101516000015183828151811061342c5761342b614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508488838361347491906147f5565b8151811061348557613484614fa1565b5b60200260200101516020015161349b9190615449565b8482815181106134ae576134ad614fa1565b5b6020026020010181815250508086886134c791906154a7565b11156134fa578381815181106134e0576134df614fa1565b5b6020026020010180518091906134f59061547d565b815250505b808061350590614fd0565b9150506133e7565b5081839950995050505050505050505b915091565b6000819050919050565b61353581613d69565b613574576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161356b90615581565b60405180910390fd5b806135a17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b613522565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606061360a838360405180606001604052806027815260200161575a60279139613d7c565b905092915050565b6000819050919050565b6136258161352c565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146137965760006001826136c09190615449565b90506000600186600001805490506136d89190615449565b90508181146137475760008660000182815481106136f9576136f8614fa1565b5b906000526020600020015490508087600001848154811061371d5761371c614fa1565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b8560000180548061375b5761375a6155a1565b5b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061379c565b60009150505b92915050565b60006137ae838361366b565b61380757826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061380c565b600090505b92915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561386257602002820191906000526020600020905b81548152602001906001019080831161384e575b50505050509050919050565b6060600061387c6068611ec7565b90506000808267ffffffffffffffff81111561389b5761389a6141b9565b5b6040519080825280602002602001820160405280156138c95781602001602082028036833780820191505090505b50905060005b83811015613a965760006138ed826068613d3690919063ffffffff16565b90506000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd5c95e836040518263ffffffff1660e01b815260040161394c91906144ee565b6020604051808303816000875af115801561396b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398f91906146df565b905061399961271f565b73ffffffffffffffffffffffffffffffffffffffff1663e59ea3e883838b6139c191906147f5565b6040518363ffffffff1660e01b81526004016139de92919061484b565b602060405180830381865afa1580156139fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a1f9190614cfa565b15613a815781848681518110613a3857613a37614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508480613a7d90614fd0565b9550505b50508080613a8e90614fd0565b9150506138cf565b5060008267ffffffffffffffff811115613ab357613ab26141b9565b5b604051908082528060200260200182016040528015613ae15781602001602082028036833780820191505090505b50905060005b83811015613b6a57828181518110613b0257613b01614fa1565b5b6020026020010151828281518110613b1d57613b1c614fa1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080613b6290614fd0565b915050613ae7565b5080945050505050919050565b6060600080835167ffffffffffffffff811115613b9757613b966141b9565b5b604051908082528060200260200182016040528015613bd057816020015b613bbd614002565b815260200190600190039081613bb55790505b5090506000805b8551811015613d1f576000606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663acd201d0888481518110613c3357613c32614fa1565b5b60200260200101516040518263ffffffff1660e01b8152600401613c5791906144ee565b602060405180830381865afa158015613c74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9891906146df565b90508083613ca691906147f5565b92506040518060400160405280888481518110613cc657613cc5614fa1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200182815250848381518110613d0057613cff614fa1565b5b6020026020010181905250508080613d1790614fd0565b915050613bd7565b50613d2982613e49565b8181935093505050915091565b6000613d458360000183613f70565b60001c905092915050565b6000818310613d5f5781613d61565b825b905092915050565b600080823b905060008111915050919050565b6060613d8784613d69565b613dc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613dbd90615642565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051613dee91906156dc565b600060405180830381855af49150503d8060008114613e29576040519150601f19603f3d011682016040523d82523d6000602084013e613e2e565b606091505b5091509150613e3e828286613f9b565b925050509392505050565b6000600190505b8151811015613f6c5760008190505b600081118015613eb6575082600182613e789190615449565b81518110613e8957613e88614fa1565b5b602002602001015160200151838281518110613ea857613ea7614fa1565b5b602002602001015160200151105b15613f585782600182613ec99190615449565b81518110613eda57613ed9614fa1565b5b6020026020010151838281518110613ef557613ef4614fa1565b5b6020026020010151848381518110613f1057613f0f614fa1565b5b6020026020010185600185613f259190615449565b81518110613f3657613f35614fa1565b5b6020026020010182905282905250508080613f509061547d565b915050613e5f565b508080613f6490614fd0565b915050613e50565b5050565b6000826000018281548110613f8857613f87614fa1565b5b9060005260206000200154905092915050565b60608315613fab57829050613ffb565b600083511115613fbe5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ff29190615737565b60405180910390fd5b9392505050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061407182614046565b9050919050565b61408181614066565b811461408c57600080fd5b50565b60008135905061409e81614078565b92915050565b6000602082840312156140ba576140b961403c565b5b60006140c88482850161408f565b91505092915050565b6000819050919050565b6140e4816140d1565b81146140ef57600080fd5b50565b600081359050614101816140db565b92915050565b60006020828403121561411d5761411c61403c565b5b600061412b848285016140f2565b91505092915050565b61413d816140d1565b82525050565b60006020820190506141586000830184614134565b92915050565b600080604083850312156141755761417461403c565b5b60006141838582860161408f565b92505060206141948582860161408f565b9150509250929050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6141f1826141a8565b810181811067ffffffffffffffff821117156142105761420f6141b9565b5b80604052505050565b6000614223614032565b905061422f82826141e8565b919050565b600067ffffffffffffffff82111561424f5761424e6141b9565b5b614258826141a8565b9050602081019050919050565b82818337600083830152505050565b600061428761428284614234565b614219565b9050828152602081018484840111156142a3576142a26141a3565b5b6142ae848285614265565b509392505050565b600082601f8301126142cb576142ca61419e565b5b81356142db848260208601614274565b91505092915050565b600080604083850312156142fb576142fa61403c565b5b60006143098582860161408f565b925050602083013567ffffffffffffffff81111561432a57614329614041565b5b614336858286016142b6565b9150509250929050565b60006080820190506143556000830187614134565b6143626020830186614134565b61436f6040830185614134565b61437c6060830184614134565b95945050505050565b6000819050919050565b60006143aa6143a56143a084614046565b614385565b614046565b9050919050565b60006143bc8261438f565b9050919050565b60006143ce826143b1565b9050919050565b6143de816143c3565b82525050565b60006020820190506143f960008301846143d5565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61443481614066565b82525050565b6000614446838361442b565b60208301905092915050565b6000602082019050919050565b600061446a826143ff565b614474818561440a565b935061447f8361441b565b8060005b838110156144b0578151614497888261443a565b97506144a283614452565b925050600181019050614483565b5085935050505092915050565b600060208201905081810360008301526144d7818461445f565b905092915050565b6144e881614066565b82525050565b600060208201905061450360008301846144df565b92915050565b600080604083850312156145205761451f61403c565b5b600061452e858286016140f2565b925050602061453f858286016140f2565b9150509250929050565b6000806000606084860312156145625761456161403c565b5b60006145708682870161408f565b93505060206145818682870161408f565b92505060406145928682870161408f565b9150509250925092565b600080600080600060a086880312156145b8576145b761403c565b5b60006145c6888289016140f2565b95505060206145d7888289016140f2565b94505060406145e8888289016140f2565b93505060606145f9888289016140f2565b925050608061460a888289016140f2565b9150509295509295909350565b60008115159050919050565b61462c81614617565b82525050565b60006020820190506146476000830184614623565b92915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061469460208361464d565b915061469f8261465e565b602082019050919050565b600060208201905081810360008301526146c381614687565b9050919050565b6000815190506146d9816140db565b92915050565b6000602082840312156146f5576146f461403c565b5b6000614703848285016146ca565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614746826140d1565b9150614751836140d1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561478a5761478961470c565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006147cf826140d1565b91506147da836140d1565b9250826147ea576147e9614795565b5b828204905092915050565b6000614800826140d1565b915061480b836140d1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156148405761483f61470c565b5b828201905092915050565b600060408201905061486060008301856144df565b61486d6020830184614134565b9392505050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b60006148d0602c8361464d565b91506148db82614874565b604082019050919050565b600060208201905081810360008301526148ff816148c3565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000614962602c8361464d565b915061496d82614906565b604082019050919050565b6000602082019050818103600083015261499181614955565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b60006149f4602e8361464d565b91506149ff82614998565b604082019050919050565b60006020820190508181036000830152614a23816149e7565b9050919050565b600080600060608486031215614a4357614a4261403c565b5b6000614a51868287016146ca565b9350506020614a62868287016146ca565b9250506040614a73868287016146ca565b9150509250925092565b600060a082019050614a926000830188614134565b614a9f6020830187614134565b614aac6040830186614134565b614ab96060830185614134565b614ac66080830184614134565b9695505050505050565b7f7374616b656443656c6f206e756c6c2061646472657373000000000000000000600082015250565b6000614b0660178361464d565b9150614b1182614ad0565b602082019050919050565b60006020820190508181036000830152614b3581614af9565b9050919050565b7f6163636f756e74206e756c6c2061646472657373000000000000000000000000600082015250565b6000614b7260148361464d565b9150614b7d82614b3c565b602082019050919050565b60006020820190508181036000830152614ba181614b65565b9050919050565b7f766f7465206e756c6c2061646472657373000000000000000000000000000000600082015250565b6000614bde60118361464d565b9150614be982614ba8565b602082019050919050565b60006020820190508181036000830152614c0d81614bd1565b9050919050565b600060a082019050614c2960008301886144df565b614c366020830187614134565b614c436040830186614134565b614c506060830185614134565b614c5d6080830184614134565b9695505050505050565b60008060008060808587031215614c8157614c8061403c565b5b6000614c8f878288016146ca565b9450506020614ca0878288016146ca565b9350506040614cb1878288016146ca565b9250506060614cc2878288016146ca565b91505092959194509250565b614cd781614617565b8114614ce257600080fd5b50565b600081519050614cf481614cce565b92915050565b600060208284031215614d1057614d0f61403c565b5b6000614d1e84828501614ce5565b91505092915050565b600067ffffffffffffffff821115614d4257614d416141b9565b5b602082029050602081019050919050565b600080fd5b600081519050614d6781614078565b92915050565b6000614d80614d7b84614d27565b614219565b90508083825260208201905060208402830185811115614da357614da2614d53565b5b835b81811015614dcc5780614db88882614d58565b845260208401935050602081019050614da5565b5050509392505050565b600082601f830112614deb57614dea61419e565b5b8151614dfb848260208601614d6d565b91505092915050565b600067ffffffffffffffff821115614e1f57614e1e6141b9565b5b602082029050602081019050919050565b6000614e43614e3e84614e04565b614219565b90508083825260208201905060208402830185811115614e6657614e65614d53565b5b835b81811015614e8f5780614e7b88826146ca565b845260208401935050602081019050614e68565b5050509392505050565b600082601f830112614eae57614ead61419e565b5b8151614ebe848260208601614e30565b91505092915050565b600080600080600080600060e0888a031215614ee657614ee561403c565b5b600088015167ffffffffffffffff811115614f0457614f03614041565b5b614f108a828b01614dd6565b9750506020614f218a828b016146ca565b9650506040614f328a828b016146ca565b9550506060614f438a828b016146ca565b945050608088015167ffffffffffffffff811115614f6457614f63614041565b5b614f708a828b01614e99565b93505060a0614f818a828b016146ca565b92505060c0614f928a828b016146ca565b91505092959891949750929550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614fdb826140d1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561500e5761500d61470c565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061507560268361464d565b915061508082615019565b604082019050919050565b600060208201905081810360008301526150a481615068565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6150e0816140d1565b82525050565b60006150f283836150d7565b60208301905092915050565b6000602082019050919050565b6000615116826150ab565b61512081856150b6565b935061512b836150c7565b8060005b8381101561515c57815161514388826150e6565b975061514e836150fe565b92505060018101905061512f565b5085935050505092915050565b600060608201905061517e60008301866144df565b8181036020830152615190818561445f565b905081810360408301526151a4818461510b565b9050949350505050565b7f45524331393637557067726164653a207570677261646520627265616b73206660008201527f7572746865722075706772616465730000000000000000000000000000000000602082015250565b600061520a602f8361464d565b9150615215826151ae565b604082019050919050565b60006020820190508181036000830152615239816151fd565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b600061529c602b8361464d565b91506152a782615240565b604082019050919050565b600060208201905081810360008301526152cb8161528f565b9050919050565b600081905092915050565b7f456c656374696f6e000000000000000000000000000000000000000000000000600082015250565b60006153136008836152d2565b915061531e826152dd565b600882019050919050565b600061533482615306565b9150819050919050565b6000819050919050565b6153518161533e565b82525050565b600060208201905061536c6000830184615348565b92915050565b6000602082840312156153885761538761403c565b5b600061539684828501614d58565b91505092915050565b7f56616c696461746f727300000000000000000000000000000000000000000000600082015250565b60006153d5600a836152d2565b91506153e08261539f565b600a82019050919050565b60006153f6826153c8565b9150819050919050565b6000602082840312156154165761541561403c565b5b600082015167ffffffffffffffff81111561543457615433614041565b5b61544084828501614dd6565b91505092915050565b6000615454826140d1565b915061545f836140d1565b9250828210156154725761547161470c565b5b828203905092915050565b6000615488826140d1565b9150600082141561549c5761549b61470c565b5b600182039050919050565b60006154b2826140d1565b91506154bd836140d1565b9250826154cd576154cc614795565b5b828206905092915050565b600060408201905081810360008301526154f2818561445f565b90508181036020830152615506818461510b565b90509392505050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b600061556b602d8361464d565b91506155768261550f565b604082019050919050565b6000602082019050818103600083015261559a8161555e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b600061562c60268361464d565b9150615637826155d0565b604082019050919050565b6000602082019050818103600083015261565b8161561f565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561569657808201518184015260208101905061567b565b838111156156a5576000848401525b50505050565b60006156b682615662565b6156c0818561566d565b93506156d0818560208601615678565b80840191505092915050565b60006156e882846156ab565b915081905092915050565b600081519050919050565b6000615709826156f3565b615713818561464d565b9350615723818560208601615678565b61572c816141a8565b840191505092915050565b6000602082019050818103600083015261575181846156fe565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b5e49e2115dbd6efe60a807ff6fa9c8b86be662a5b06fc3f5bddb86b36f0b65264736f6c634300080b0033