MATIC Price: $0.533658 (+2.09%)
Gas: 30.1 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
0x60806040363326652022-12-02 11:19:51600 days ago1669979991IN
 Create: Governor
0 MATIC2.1435685636.18398834

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Governor

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 14 : Governor.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

import '@openzeppelin/contracts-upgradeable/token/ERC777/IERC777RecipientUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC777/IERC777Upgradeable.sol';
import '@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';
import '@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/introspection/IERC1820RegistryUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol';

contract Governor is Initializable, IERC777RecipientUpgradeable, AccessControlUpgradeable {
  using ECDSAUpgradeable for bytes32;

  struct Poll {
    string title;
    string[] candidates; // candidate id: candidate name
    uint256 startAt;
    uint256 due;
    uint256 minimumCOMO;
    CommitData[] votes;
    uint256 totalVotedCOMO;
    uint256 revealedVotes;
    uint256[] votesPerCandidates; // candidate id: vote result
    bool finalized;
  }

  struct CommitData {
    uint256 comoAmount;
    bytes32 hash;
  }

  struct RevealData {
    uint256 votedCandidateId;
    bytes32 salt;
  }

  struct Tally {
    string candidate;
    uint256 votes;
  }

  /** @dev OPERATOR_ROLE can manage polls */
  bytes32 public constant OPERATOR_ROLE = keccak256('OPERATOR_ROLE');

  /** @dev ERC1820 */
  IERC1820RegistryUpgradeable internal constant _ERC1820_REGISTRY =
    IERC1820RegistryUpgradeable(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
  bytes32 private constant _TOKENS_RECIPIENT_INTERFACE_HASH = keccak256('ERC777TokensRecipient');

  // global variables
  Poll[] public polls;
  address public voteSignerAddress;
  IERC777Upgradeable public comoContract;
  mapping(uint256 => mapping(bytes32 => bool)) public hashes; // pollId => hash => isUsed
  mapping(uint256 => mapping(uint256 => address)) public voters; // pollId => voteIndex => voter address
  mapping(uint256 => mapping(address => uint256[])) public userVoteResults; // pollId => voter => votes[candidateId]
  mapping(uint256 => mapping(uint256 => bool)) public isRevealedVote; // pollId => voteIndex => isRevealed

  // events
  event PollCreated(uint256 pollId);
  event Voted(uint256 indexed pollId, uint256 voteIndex, address voter, uint256 comoAmount, bytes32 hash);
  event Revealed(uint256 indexed pollId, uint256 revealedVotes, uint256 remainingVotes);
  event Finalized(uint256 indexed pollId, uint256 burned);

  modifier afterDue(uint256 pollId) {
    require(block.timestamp > polls[pollId].due, 'Governor: not become due');
    _;
  }

  function initialize(address voteSignerAddress_, address comoAddress_) public initializer {
    require(voteSignerAddress_ != address(0), 'Governor: invalid vote signer address');
    _grantRole(AccessControlUpgradeable.DEFAULT_ADMIN_ROLE, msg.sender);
    _grantRole(OPERATOR_ROLE, msg.sender);
    voteSignerAddress = voteSignerAddress_;
    comoContract = IERC777Upgradeable(comoAddress_);

    // register ERC1820 interface
    _ERC1820_REGISTRY.setInterfaceImplementer(address(this), _TOKENS_RECIPIENT_INTERFACE_HASH, address(this));
  }

  function setVoteSignerAddress(address addr) external onlyRole(OPERATOR_ROLE) {
    require(addr != address(0), 'Governor: invalid vote signer address');
    voteSignerAddress = addr;
  }

  function createPoll(
    string memory title_,
    string[] memory candidates_,
    uint256 startAt_,
    uint256 due_,
    uint256 minimumCOMO_
  ) external onlyRole(OPERATOR_ROLE) {
    require(candidates_.length > 1, 'Governor: need candidates at least more than 1');
    require(startAt_ > block.timestamp, 'Governor: cannot start poll from the past');
    require(due_ > startAt_, 'Governor: cannot end poll before the start');

    polls.push(); // initialize empty array at storage
    uint256 id = polls.length - 1;

    polls[id].title = title_;
    polls[id].candidates = candidates_;
    polls[id].startAt = startAt_;
    polls[id].due = due_;
    polls[id].minimumCOMO = minimumCOMO_;
    polls[id].votesPerCandidates = new uint256[](candidates_.length);

    emit PollCreated(polls.length - 1);
  }

  /** @dev implement IERC777RecipientUpgradeable tokensReceived() */
  function tokensReceived(
    address operator,
    address from,
    address to,
    uint256 amount,
    bytes calldata userData,
    bytes calldata operatorData
  ) external {
    require(msg.sender == address(comoContract), 'Governor: Invalid token');

    (uint256 pollId, bytes32 hash, bytes memory signature) = abi.decode(userData, (uint256, bytes32, bytes));
    _vote(pollId, from, amount, hash, signature);
  }

  function _vote(
    uint256 pollId,
    address voter,
    uint256 comoAmount,
    bytes32 hash,
    bytes memory signature
  ) private {
    // check validity of pollId, poll status
    require(pollId < polls.length, 'Governor: invalid poll id');
    require(isInProgress(pollId), 'Governor: not in progress');

    // check minimum como amount
    require(comoAmount >= polls[pollId].minimumCOMO, 'Governor: cannot vote less than minimum amount');

    // verify operator's signature
    address recovered = hash.toEthSignedMessageHash().recover(signature);
    require(recovered == voteSignerAddress, 'Governor: invalid signature');

    // prevent hash replay
    require(!_isReplay(pollId, hash), 'Governor: hash cannot be replayed');

    // mark hash as used
    hashes[pollId][hash] = true;

    // record vote
    Poll storage poll = polls[pollId];
    CommitData memory commitData = CommitData(comoAmount, hash);
    poll.votes.push(commitData);
    poll.totalVotedCOMO += comoAmount;

    // record voter address
    uint256 voteIndex = poll.votes.length - 1;
    voters[pollId][voteIndex] = voter;

    emit Voted(pollId, voteIndex, voter, comoAmount, hash);
  }

  function reveal(
    uint256 pollId,
    RevealData[] calldata data,
    uint256 offset
  ) external afterDue(pollId) onlyRole(OPERATOR_ROLE) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    require(data.length > 0, 'Governor: data should not be empty');
    require(!polls[pollId].finalized, 'Governor: already finalized');
    require(remainingVotes(pollId) > 0, 'Governor: all votes are already revealed');
    require(offset + data.length <= polls[pollId].votes.length, 'Governor: invalid offset');

    Poll storage poll = polls[pollId];
    uint256[] memory tempResults = poll.votesPerCandidates;
    uint256 revealedVoteCount = 0;

    // verify salted hash vote messages
    for (uint256 i = 0; i < data.length; i++) {
      // continue if already revealed vote
      if (isRevealedVote[pollId][offset + i]) {
        continue;
      }

      require(
        _verifyHash(poll.votes[offset + i].hash, data[i]),
        'Governor: reveal data does not match with commit data'
      );
      // aggregate tentative results in memory
      tempResults[data[i].votedCandidateId] += poll.votes[offset + i].comoAmount;

      // record user vote results
      address voter = voters[pollId][offset + i];
      if (userVoteResults[pollId][voter].length == 0) {
        for (uint256 i = 0; i < poll.candidates.length; i++) {
          userVoteResults[pollId][voter].push(); // initialize empty array
        }
      }
      userVoteResults[pollId][voter][data[i].votedCandidateId] += poll.votes[offset + i].comoAmount;
      isRevealedVote[pollId][offset + i] = true;
      revealedVoteCount++;
    }

    poll.votesPerCandidates = tempResults;
    poll.revealedVotes += revealedVoteCount;

    emit Revealed(pollId, revealedVoteCount, remainingVotes(pollId));
  }

  function finalize(uint256 pollId) external afterDue(pollId) onlyRole(OPERATOR_ROLE) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    require(!polls[pollId].finalized, 'Governor: already finalized');
    require(remainingVotes(pollId) == 0, 'Governor: not revealed yet');
    polls[pollId].finalized = true;

    uint256 comoAmountToBurn = MathUpgradeable.min(polls[pollId].totalVotedCOMO, comoContract.balanceOf(address(this)));
    comoContract.burn(comoAmountToBurn, '');
    emit Finalized(pollId, polls[pollId].totalVotedCOMO);
  }

  function _verifyHash(bytes32 hash, RevealData calldata data) private pure returns (bool) {
    return hash == keccak256(abi.encodePacked(data.votedCandidateId, data.salt));
  }

  function _isReplay(uint256 pollId, bytes32 targetHash) private view returns (bool) {
    return hashes[pollId][targetHash];
  }

  function candidates(uint256 pollId) public view returns (string[] memory) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    return polls[pollId].candidates;
  }

  function votes(uint256 pollId) public view returns (CommitData[] memory) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    return polls[pollId].votes;
  }

  function votesPerCandidates(uint256 pollId) public view returns (uint256[] memory) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    return polls[pollId].votesPerCandidates;
  }

  function isInProgress(uint256 pollId) public view returns (bool) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    return block.timestamp >= polls[pollId].startAt && block.timestamp < polls[pollId].due;
  }

  function totalVotes(uint256 pollId) public view returns (uint256) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    return polls[pollId].votes.length;
  }

  function remainingVotes(uint256 pollId) public view returns (uint256) {
    return totalVotes(pollId) - polls[pollId].revealedVotes;
  }

  function pollResult(uint256 pollId) public view returns (Tally[] memory) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    require(polls[pollId].finalized, 'Governor: not finalized');

    Tally[] memory tally = new Tally[](polls[pollId].candidates.length);

    for (uint256 i = 0; i < polls[pollId].candidates.length; i++) {
      tally[i].candidate = polls[pollId].candidates[i];
      tally[i].votes = polls[pollId].votesPerCandidates[i];
    }
    return tally;
  }

  function userVoteResult(uint256 pollId, address voter) public view returns (Tally[] memory) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    require(polls[pollId].finalized, 'Governor: not finalized');

    Tally[] memory userTally = new Tally[](polls[pollId].candidates.length);

    for (uint256 i = 0; i < polls[pollId].candidates.length; i++) {
      userTally[i].candidate = polls[pollId].candidates[i];
      userTally[i].votes = userVoteResults[pollId][voter][i];
    }

    return userTally;
  }

  function reset(
    uint256 pollId,
    uint256 missingOffset,
    CommitData[] memory missingCommitData
  ) external afterDue(pollId) onlyRole(OPERATOR_ROLE) {
    require(pollId < polls.length, 'Governor: invalid poll id');
    require(polls[pollId].finalized, 'Governor: not finalized');

    Poll storage poll = polls[pollId];

    poll.finalized = false;
    poll.votesPerCandidates = new uint256[](poll.candidates.length);
    poll.revealedVotes = 0;

    // provide missing data if it has
    for (uint256 i = 0; i < missingCommitData.length; i++) {
      poll.votes[missingOffset + i] = missingCommitData[i];
    }
  }
}

File 2 of 14 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(uint160(account), 20),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }

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

File 3 of 14 : IERC777RecipientUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC777/IERC777Recipient.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.
 *
 * Accounts can be notified of {IERC777} tokens being sent to them by having a
 * contract implement this interface (contract holders can be their own
 * implementer) and registering it on the
 * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
 *
 * See {IERC1820Registry} and {ERC1820Implementer}.
 */
interface IERC777RecipientUpgradeable {
    /**
     * @dev Called by an {IERC777} token contract whenever tokens are being
     * moved or created into a registered account (`to`). The type of operation
     * is conveyed by `from` being the zero address or not.
     *
     * This call occurs _after_ the token contract's state is updated, so
     * {IERC777-balanceOf}, etc., can be used to query the post-operation state.
     *
     * This function may revert to prevent the operation from being executed.
     */
    function tokensReceived(
        address operator,
        address from,
        address to,
        uint256 amount,
        bytes calldata userData,
        bytes calldata operatorData
    ) external;
}

File 4 of 14 : IERC777Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC777/IERC777.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC777Token standard as defined in the EIP.
 *
 * This contract uses the
 * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 registry standard] to let
 * token holders and recipients react to token movements by using setting implementers
 * for the associated interfaces in said registry. See {IERC1820Registry} and
 * {ERC1820Implementer}.
 */
interface IERC777Upgradeable {
    /**
     * @dev Emitted when `amount` tokens are created by `operator` and assigned to `to`.
     *
     * Note that some additional user `data` and `operatorData` can be logged in the event.
     */
    event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);

    /**
     * @dev Emitted when `operator` destroys `amount` tokens from `account`.
     *
     * Note that some additional user `data` and `operatorData` can be logged in the event.
     */
    event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);

    /**
     * @dev Emitted when `operator` is made operator for `tokenHolder`
     */
    event AuthorizedOperator(address indexed operator, address indexed tokenHolder);

    /**
     * @dev Emitted when `operator` is revoked its operator status for `tokenHolder`
     */
    event RevokedOperator(address indexed operator, address indexed tokenHolder);

    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the smallest part of the token that is not divisible. This
     * means all token operations (creation, movement and destruction) must have
     * amounts that are a multiple of this number.
     *
     * For most token contracts, this value will equal 1.
     */
    function granularity() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * If send or receive hooks are registered for the caller and `recipient`,
     * the corresponding functions will be called with `data` and empty
     * `operatorData`. See {IERC777Sender} and {IERC777Recipient}.
     *
     * Emits a {Sent} event.
     *
     * Requirements
     *
     * - the caller must have at least `amount` tokens.
     * - `recipient` cannot be the zero address.
     * - if `recipient` is a contract, it must implement the {IERC777Recipient}
     * interface.
     */
    function send(
        address recipient,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev Destroys `amount` tokens from the caller's account, reducing the
     * total supply.
     *
     * If a send hook is registered for the caller, the corresponding function
     * will be called with `data` and empty `operatorData`. See {IERC777Sender}.
     *
     * Emits a {Burned} event.
     *
     * Requirements
     *
     * - the caller must have at least `amount` tokens.
     */
    function burn(uint256 amount, bytes calldata data) external;

    /**
     * @dev Returns true if an account is an operator of `tokenHolder`.
     * Operators can send and burn tokens on behalf of their owners. All
     * accounts are their own operator.
     *
     * See {operatorSend} and {operatorBurn}.
     */
    function isOperatorFor(address operator, address tokenHolder) external view returns (bool);

    /**
     * @dev Make an account an operator of the caller.
     *
     * See {isOperatorFor}.
     *
     * Emits an {AuthorizedOperator} event.
     *
     * Requirements
     *
     * - `operator` cannot be calling address.
     */
    function authorizeOperator(address operator) external;

    /**
     * @dev Revoke an account's operator status for the caller.
     *
     * See {isOperatorFor} and {defaultOperators}.
     *
     * Emits a {RevokedOperator} event.
     *
     * Requirements
     *
     * - `operator` cannot be calling address.
     */
    function revokeOperator(address operator) external;

    /**
     * @dev Returns the list of default operators. These accounts are operators
     * for all token holders, even if {authorizeOperator} was never called on
     * them.
     *
     * This list is immutable, but individual holders may revoke these via
     * {revokeOperator}, in which case {isOperatorFor} will return false.
     */
    function defaultOperators() external view returns (address[] memory);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient`. The caller must
     * be an operator of `sender`.
     *
     * If send or receive hooks are registered for `sender` and `recipient`,
     * the corresponding functions will be called with `data` and
     * `operatorData`. See {IERC777Sender} and {IERC777Recipient}.
     *
     * Emits a {Sent} event.
     *
     * Requirements
     *
     * - `sender` cannot be the zero address.
     * - `sender` must have at least `amount` tokens.
     * - the caller must be an operator for `sender`.
     * - `recipient` cannot be the zero address.
     * - if `recipient` is a contract, it must implement the {IERC777Recipient}
     * interface.
     */
    function operatorSend(
        address sender,
        address recipient,
        uint256 amount,
        bytes calldata data,
        bytes calldata operatorData
    ) external;

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the total supply.
     * The caller must be an operator of `account`.
     *
     * If a send hook is registered for `account`, the corresponding function
     * will be called with `data` and `operatorData`. See {IERC777Sender}.
     *
     * Emits a {Burned} event.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     * - the caller must be an operator for `account`.
     */
    function operatorBurn(
        address account,
        uint256 amount,
        bytes calldata data,
        bytes calldata operatorData
    ) external;

    event Sent(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256 amount,
        bytes data,
        bytes operatorData
    );
}

File 5 of 14 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * 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 prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 6 of 14 : IERC1820RegistryUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/introspection/IERC1820Registry.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the global ERC1820 Registry, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register
 * implementers for interfaces in this registry, as well as query support.
 *
 * Implementers may be shared by multiple accounts, and can also implement more
 * than a single interface for each account. Contracts can implement interfaces
 * for themselves, but externally-owned accounts (EOA) must delegate this to a
 * contract.
 *
 * {IERC165} interfaces can also be queried via the registry.
 *
 * For an in-depth explanation and source code analysis, see the EIP text.
 */
interface IERC1820RegistryUpgradeable {
    event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);

    event ManagerChanged(address indexed account, address indexed newManager);

    /**
     * @dev Sets `newManager` as the manager for `account`. A manager of an
     * account is able to set interface implementers for it.
     *
     * By default, each account is its own manager. Passing a value of `0x0` in
     * `newManager` will reset the manager to this initial state.
     *
     * Emits a {ManagerChanged} event.
     *
     * Requirements:
     *
     * - the caller must be the current manager for `account`.
     */
    function setManager(address account, address newManager) external;

    /**
     * @dev Returns the manager for `account`.
     *
     * See {setManager}.
     */
    function getManager(address account) external view returns (address);

    /**
     * @dev Sets the `implementer` contract as ``account``'s implementer for
     * `interfaceHash`.
     *
     * `account` being the zero address is an alias for the caller's address.
     * The zero address can also be used in `implementer` to remove an old one.
     *
     * See {interfaceHash} to learn how these are created.
     *
     * Emits an {InterfaceImplementerSet} event.
     *
     * Requirements:
     *
     * - the caller must be the current manager for `account`.
     * - `interfaceHash` must not be an {IERC165} interface id (i.e. it must not
     * end in 28 zeroes).
     * - `implementer` must implement {IERC1820Implementer} and return true when
     * queried for support, unless `implementer` is the caller. See
     * {IERC1820Implementer-canImplementInterfaceForAddress}.
     */
    function setInterfaceImplementer(
        address account,
        bytes32 _interfaceHash,
        address implementer
    ) external;

    /**
     * @dev Returns the implementer of `interfaceHash` for `account`. If no such
     * implementer is registered, returns the zero address.
     *
     * If `interfaceHash` is an {IERC165} interface id (i.e. it ends with 28
     * zeroes), `account` will be queried for support of it.
     *
     * `account` being the zero address is an alias for the caller's address.
     */
    function getInterfaceImplementer(address account, bytes32 _interfaceHash) external view returns (address);

    /**
     * @dev Returns the interface hash for an `interfaceName`, as defined in the
     * corresponding
     * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].
     */
    function interfaceHash(string calldata interfaceName) external pure returns (bytes32);

    /**
     * @notice Updates the cache with whether the contract implements an ERC165 interface or not.
     * @param account Address of the contract for which to update the cache.
     * @param interfaceId ERC165 interface for which to update the cache.
     */
    function updateERC165Cache(address account, bytes4 interfaceId) external;

    /**
     * @notice Checks whether a contract implements an ERC165 interface or not.
     * If the result is not cached a direct lookup on the contract address is performed.
     * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
     * {updateERC165Cache} with the contract address.
     * @param account Address of the contract to check.
     * @param interfaceId ERC165 interface to check.
     * @return True if `account` implements `interfaceId`, false otherwise.
     */
    function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);

    /**
     * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
     * @param account Address of the contract to check.
     * @param interfaceId ERC165 interface to check.
     * @return True if `account` implements `interfaceId`, false otherwise.
     */
    function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
}

File 7 of 14 : ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSAUpgradeable {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 8 of 14 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @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 == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. It the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`.
        // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`.
        // This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`.
        // Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a
        // good first aproximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1;
        uint256 x = a;
        if (x >> 128 > 0) {
            x >>= 128;
            result <<= 64;
        }
        if (x >> 64 > 0) {
            x >>= 64;
            result <<= 32;
        }
        if (x >> 32 > 0) {
            x >>= 32;
            result <<= 16;
        }
        if (x >> 16 > 0) {
            x >>= 16;
            result <<= 8;
        }
        if (x >> 8 > 0) {
            x >>= 8;
            result <<= 4;
        }
        if (x >> 4 > 0) {
            x >>= 4;
            result <<= 2;
        }
        if (x >> 2 > 0) {
            result <<= 1;
        }

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        uint256 result = sqrt(a);
        if (rounding == Rounding.Up && result * result < a) {
            result += 1;
        }
        return result;
    }
}

File 9 of 14 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 10 of 14 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 11 of 14 : 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;
}

File 12 of 14 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

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

File 13 of 14 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 14 of 14 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pollId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burned","type":"uint256"}],"name":"Finalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"PollCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pollId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"revealedVotes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remainingVotes","type":"uint256"}],"name":"Revealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pollId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"voteIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"comoAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"Voted","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"candidates","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"comoContract","outputs":[{"internalType":"contract IERC777Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"title_","type":"string"},{"internalType":"string[]","name":"candidates_","type":"string[]"},{"internalType":"uint256","name":"startAt_","type":"uint256"},{"internalType":"uint256","name":"due_","type":"uint256"},{"internalType":"uint256","name":"minimumCOMO_","type":"uint256"}],"name":"createPoll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"finalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"hashes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"voteSignerAddress_","type":"address"},{"internalType":"address","name":"comoAddress_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"isInProgress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"isRevealedVote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"pollResult","outputs":[{"components":[{"internalType":"string","name":"candidate","type":"string"},{"internalType":"uint256","name":"votes","type":"uint256"}],"internalType":"struct Governor.Tally[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"polls","outputs":[{"internalType":"string","name":"title","type":"string"},{"internalType":"uint256","name":"startAt","type":"uint256"},{"internalType":"uint256","name":"due","type":"uint256"},{"internalType":"uint256","name":"minimumCOMO","type":"uint256"},{"internalType":"uint256","name":"totalVotedCOMO","type":"uint256"},{"internalType":"uint256","name":"revealedVotes","type":"uint256"},{"internalType":"bool","name":"finalized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"remainingVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"},{"internalType":"uint256","name":"missingOffset","type":"uint256"},{"components":[{"internalType":"uint256","name":"comoAmount","type":"uint256"},{"internalType":"bytes32","name":"hash","type":"bytes32"}],"internalType":"struct Governor.CommitData[]","name":"missingCommitData","type":"tuple[]"}],"name":"reset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"},{"components":[{"internalType":"uint256","name":"votedCandidateId","type":"uint256"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"internalType":"struct Governor.RevealData[]","name":"data","type":"tuple[]"},{"internalType":"uint256","name":"offset","type":"uint256"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setVoteSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"},{"internalType":"bytes","name":"operatorData","type":"bytes"}],"name":"tokensReceived","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"totalVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"},{"internalType":"address","name":"voter","type":"address"}],"name":"userVoteResult","outputs":[{"components":[{"internalType":"string","name":"candidate","type":"string"},{"internalType":"uint256","name":"votes","type":"uint256"}],"internalType":"struct Governor.Tally[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userVoteResults","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voteSignerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"voters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"votes","outputs":[{"components":[{"internalType":"uint256","name":"comoAmount","type":"uint256"},{"internalType":"bytes32","name":"hash","type":"bytes32"}],"internalType":"struct Governor.CommitData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pollId","type":"uint256"}],"name":"votesPerCandidates","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50613c1f806100206000396000f3fe608060405234801561001057600080fd5b50600436106101d95760003560e01c80635df8133011610104578063bdd98d0a116100a2578063e5b2c25211610071578063e5b2c252146104b1578063f5b541a6146104c4578063f7729a2c146104eb578063fba00cbd146104fe57600080fd5b8063bdd98d0a1461042f578063d547741f14610442578063e28f80ce14610455578063e4490ce21461048357600080fd5b8063a217fddf116100de578063a217fddf146103ce578063a9448999146103d6578063abfecc48146103f6578063ac2f00741461040957600080fd5b80635df81330146103625780638e6a82331461038257806391d148541461039557600080fd5b8063248a9ca31161017c578063482671861161014b57806348267186146102f1578063485cc955146103115780634b11709414610324578063525e70f61461033757600080fd5b8063248a9ca3146102885780632f2ff15d146102ab5780633477ee2e146102be57806336568abe146102de57600080fd5b806305261aea116101b857806305261aea1461023c5780630f9acac61461024f5780631728fad11461026257806319e6e1581461027557600080fd5b806223de29146101de57806301ffc9a7146101f3578063034970ca1461021b575b600080fd5b6101f16101ec3660046132b2565b610532565b005b61020661020136600461335d565b6105c1565b60405190151581526020015b60405180910390f35b61022e61022936600461339f565b61065a565b604051908152602001610212565b6101f161024a36600461339f565b610694565b6101f161025d3660046133b8565b610a2b565b61020661027036600461339f565b611106565b61022e61028336600461339f565b6111b2565b61022e61029636600461339f565b60009081526065602052604090206001015490565b6101f16102b936600461343d565b61122f565b6102d16102cc36600461339f565b611259565b60405161021291906134c5565b6101f16102ec36600461343d565b6113a4565b6103046102ff36600461339f565b611430565b6040516102129190613527565b6101f161031f36600461356b565b6114fa565b6101f16103323660046136a1565b611793565b60985461034a906001600160a01b031681565b6040516001600160a01b039091168152602001610212565b61037561037036600461339f565b611aef565b6040516102129190613794565b6101f16103903660046137e3565b611bc9565b6102066103a336600461343d565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61022e600081565b6103e96103e436600461339f565b611e43565b60405161021291906138ad565b60995461034a906001600160a01b031681565b61041c61041736600461339f565b612128565b6040516102129796959493929190613923565b61022e61043d366004613969565b612208565b6101f161045036600461343d565b612246565b61020661046336600461399e565b609a60209081526000928352604080842090915290825290205460ff1681565b61020661049136600461399e565b609d60209081526000928352604080842090915290825290205460ff1681565b6103e96104bf36600461343d565b61226b565b61022e7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b6101f16104f93660046139c0565b61254d565b61034a61050c36600461399e565b609b6020908152600092835260408084209091529082529020546001600160a01b031681565b6099546001600160a01b031633146105915760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a20496e76616c696420746f6b656e00000000000000000060448201526064015b60405180910390fd5b600080806105a1868801886139db565b9250925092506105b4838b8a858561260b565b5050505050505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061065457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60006097828154811061066f5761066f613a3f565b90600052602060002090600a02016007015461068a836111b2565b6106549190613a6b565b80609781815481106106a8576106a8613a3f565b90600052602060002090600a02016003015442116107085760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a206e6f74206265636f6d652064756500000000000000006044820152606401610588565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610732816129d9565b609754831061077f5760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097838154811061079257610792613a3f565b600091825260209091206009600a90920201015460ff16156107f65760405162461bcd60e51b815260206004820152601b60248201527f476f7665726e6f723a20616c72656164792066696e616c697a656400000000006044820152606401610588565b6107ff8361065a565b1561084c5760405162461bcd60e51b815260206004820152601a60248201527f476f7665726e6f723a206e6f742072657665616c6564207965740000000000006044820152606401610588565b60016097848154811061086157610861613a3f565b90600052602060002090600a020160090160006101000a81548160ff021916908315150217905550600061093f609785815481106108a1576108a1613a3f565b60009182526020909120600a90910201600601546099546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610916573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093a9190613a82565b6129e6565b609954604080517ffe9d9303000000000000000000000000000000000000000000000000000000008152600481018490526024810191909152600060448201529192506001600160a01b03169063fe9d930390606401600060405180830381600087803b1580156109af57600080fd5b505af11580156109c3573d6000803e3d6000fd5b50505050837fb968440accd1ce5fa60b00de8bb8d8487eb2fda3c3701fb30fea3f69aa910a48609786815481106109fc576109fc613a3f565b90600052602060002090600a020160060154604051610a1d91815260200190565b60405180910390a250505050565b8360978181548110610a3f57610a3f613a3f565b90600052602060002090600a0201600301544211610a9f5760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a206e6f74206265636f6d652064756500000000000000006044820152606401610588565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610ac9816129d9565b6097548610610b165760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b83610b895760405162461bcd60e51b815260206004820152602260248201527f476f7665726e6f723a20646174612073686f756c64206e6f7420626520656d7060448201527f74790000000000000000000000000000000000000000000000000000000000006064820152608401610588565b60978681548110610b9c57610b9c613a3f565b600091825260209091206009600a90920201015460ff1615610c005760405162461bcd60e51b815260206004820152601b60248201527f476f7665726e6f723a20616c72656164792066696e616c697a656400000000006044820152606401610588565b6000610c0b8761065a565b11610c7e5760405162461bcd60e51b815260206004820152602860248201527f476f7665726e6f723a20616c6c20766f7465732061726520616c72656164792060448201527f72657665616c65640000000000000000000000000000000000000000000000006064820152608401610588565b60978681548110610c9157610c91613a3f565b600091825260209091206005600a909202010154610caf8585613a9b565b1115610cfd5760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a20696e76616c6964206f666673657400000000000000006044820152606401610588565b600060978781548110610d1257610d12613a3f565b90600052602060002090600a02019050600081600801805480602002602001604051908101604052809291908181526020018280548015610d7257602002820191906000526020600020905b815481526020019060010190808311610d5e575b505050505090506000805b878110156110855760008a8152609d6020526040812090610d9e838a613a9b565b815260208101919091526040016000205460ff1615610dbc57611073565b610e0c60058501610dcd838a613a9b565b81548110610ddd57610ddd613a3f565b9060005260206000209060020201600101548a8a84818110610e0157610e01613a3f565b9050604002016129fe565b610e7e5760405162461bcd60e51b815260206004820152603560248201527f476f7665726e6f723a2072657665616c206461746120646f6573206e6f74206d60448201527f61746368207769746820636f6d6d6974206461746100000000000000000000006064820152608401610588565b60058401610e8c8289613a9b565b81548110610e9c57610e9c613a3f565b906000526020600020906002020160000154838a8a84818110610ec157610ec1613a3f565b9050604002016000013581518110610edb57610edb613a3f565b60200260200101818151610eef9190613a9b565b90525060008a8152609b6020526040812081610f0b848b613a9b565b815260208082019290925260409081016000908120548e8252609c84528282206001600160a01b0390911680835293522054909150610f925760005b6001860154811015610f905760008c8152609c602090815260408083206001600160a01b0386168452909152812080546001018155905280610f8881613ab3565b915050610f47565b505b60058501610fa0838a613a9b565b81548110610fb057610fb0613a3f565b600091825260208083206002909202909101548d8352609c825260408084206001600160a01b038616855290925291208b8b85818110610ff257610ff2613a3f565b905060400201600001358154811061100c5761100c613a3f565b9060005260206000200160008282546110259190613a9b565b909155505060008b8152609d60205260408120600191611045858c613a9b565b81526020810191909152604001600020805460ff19169115159190911790558261106e81613ab3565b935050505b8061107d81613ab3565b915050610d7d565b50815161109b90600885019060208501906130d1565b50808360070160008282546110b09190613a9b565b909155508990507f7162321ecace9c982905ec8d8000eb292887b6befedc98e18dbb27fa95e752d7826110e28361065a565b604080519283526020830191909152015b60405180910390a2505050505050505050565b60975460009082106111565760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097828154811061116957611169613a3f565b90600052602060002090600a020160020154421015801561065457506097828154811061119857611198613a3f565b90600052602060002090600a020160030154421092915050565b60975460009082106112025760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097828154811061121557611215613a3f565b600091825260209091206005600a90920201015492915050565b60008281526065602052604090206001015461124a816129d9565b6112548383612a41565b505050565b60975460609082106112a95760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b609782815481106112bc576112bc613a3f565b90600052602060002090600a0201600101805480602002602001604051908101604052809291908181526020016000905b8282101561139957838290600052602060002001805461130c90613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461133890613ace565b80156113855780601f1061135a57610100808354040283529160200191611385565b820191906000526020600020905b81548152906001019060200180831161136857829003601f168201915b5050505050815260200190600101906112ed565b505050509050919050565b6001600160a01b03811633146114225760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610588565b61142c8282612ae3565b5050565b60975460609082106114805760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097828154811061149357611493613a3f565b90600052602060002090600a02016008018054806020026020016040519081016040528092919081815260200182805480156114ee57602002820191906000526020600020905b8154815260200190600101908083116114da575b50505050509050919050565b600054610100900460ff161580801561151a5750600054600160ff909116105b806115345750303b158015611534575060005460ff166001145b6115a65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610588565b6000805460ff1916600117905580156115c9576000805461ff0019166101001790555b6001600160a01b03831661162d5760405162461bcd60e51b815260206004820152602560248201527f476f7665726e6f723a20696e76616c696420766f7465207369676e6572206164604482015264647265737360d81b6064820152608401610588565b611638600033612a41565b6116627f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92933612a41565b609880546001600160a01b0385811673ffffffffffffffffffffffffffffffffffffffff199283161790925560998054928516929091169190911790556040517f29965a1d00000000000000000000000000000000000000000000000000000000815230600482018190527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b15801561173157600080fd5b505af1158015611745573d6000803e3d6000fd5b505050508015611254576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296117bd816129d9565b60018551116118345760405162461bcd60e51b815260206004820152602e60248201527f476f7665726e6f723a206e6565642063616e64696461746573206174206c656160448201527f7374206d6f7265207468616e20310000000000000000000000000000000000006064820152608401610588565b4284116118a95760405162461bcd60e51b815260206004820152602960248201527f476f7665726e6f723a2063616e6e6f7420737461727420706f6c6c2066726f6d60448201527f20746865207061737400000000000000000000000000000000000000000000006064820152608401610588565b83831161191e5760405162461bcd60e51b815260206004820152602a60248201527f476f7665726e6f723a2063616e6e6f7420656e6420706f6c6c206265666f726560448201527f20746865207374617274000000000000000000000000000000000000000000006064820152608401610588565b60978054600190810180835560009283526119399190613a6b565b9050866097828154811061194f5761194f613a3f565b90600052602060002090600a0201600001908051906020019061197392919061311c565b50856097828154811061198857611988613a3f565b90600052602060002090600a020160010190805190602001906119ac92919061318f565b5084609782815481106119c1576119c1613a3f565b90600052602060002090600a02016002018190555083609782815481106119ea576119ea613a3f565b90600052602060002090600a0201600301819055508260978281548110611a1357611a13613a3f565b90600052602060002090600a020160040181905550855167ffffffffffffffff811115611a4257611a42613595565b604051908082528060200260200182016040528015611a6b578160200160208202803683370190505b5060978281548110611a7f57611a7f613a3f565b90600052602060002090600a02016008019080519060200190611aa39291906130d1565b506097547fab0309b6731a34e8750174d3c2c9591a34a2bf0c1425a30b34122be08d05073990611ad590600190613a6b565b60405190815260200160405180910390a150505050505050565b6097546060908210611b3f5760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b60978281548110611b5257611b52613a3f565b90600052602060002090600a0201600501805480602002602001604051908101604052809291908181526020016000905b8282101561139957838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611b83565b8260978181548110611bdd57611bdd613a3f565b90600052602060002090600a0201600301544211611c3d5760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a206e6f74206265636f6d652064756500000000000000006044820152606401610588565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611c67816129d9565b6097548510611cb45760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b60978581548110611cc757611cc7613a3f565b600091825260209091206009600a90920201015460ff16611d2a5760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a206e6f742066696e616c697a65640000000000000000006044820152606401610588565b600060978681548110611d3f57611d3f613a3f565b60009182526020909120600a9091020160098101805460ff19169055600181015490915067ffffffffffffffff811115611d7b57611d7b613595565b604051908082528060200260200182016040528015611da4578160200160208202803683370190505b508051611dbb9160088401916020909101906130d1565b506000600782018190555b8451811015611e3a57848181518110611de157611de1613a3f565b6020026020010151826005018288611df99190613a9b565b81548110611e0957611e09613a3f565b6000918252602091829020835160029092020190815591015160019091015580611e3281613ab3565b915050611dc6565b50505050505050565b6097546060908210611e935760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b60978281548110611ea657611ea6613a3f565b600091825260209091206009600a90920201015460ff16611f095760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a206e6f742066696e616c697a65640000000000000000006044820152606401610588565b600060978381548110611f1e57611f1e613a3f565b90600052602060002090600a02016001018054905067ffffffffffffffff811115611f4b57611f4b613595565b604051908082528060200260200182016040528015611f9157816020015b604080518082019091526060815260006020820152815260200190600190039081611f695790505b50905060005b60978481548110611faa57611faa613a3f565b90600052602060002090600a0201600101805490508110156121215760978481548110611fd957611fd9613a3f565b90600052602060002090600a02016001018181548110611ffb57611ffb613a3f565b90600052602060002001805461201090613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461203c90613ace565b80156120895780601f1061205e57610100808354040283529160200191612089565b820191906000526020600020905b81548152906001019060200180831161206c57829003601f168201915b50505050508282815181106120a0576120a0613a3f565b602002602001015160000181905250609784815481106120c2576120c2613a3f565b90600052602060002090600a020160080181815481106120e4576120e4613a3f565b906000526020600020015482828151811061210157612101613a3f565b60209081029190910181015101528061211981613ab3565b915050611f97565b5092915050565b6097818154811061213857600080fd5b90600052602060002090600a020160009150905080600001805461215b90613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461218790613ace565b80156121d45780601f106121a9576101008083540402835291602001916121d4565b820191906000526020600020905b8154815290600101906020018083116121b757829003601f168201915b5050506002840154600385015460048601546006870154600788015460099098015496979396929550909350919060ff1687565b609c602052826000526040600020602052816000526040600020818154811061223057600080fd5b9060005260206000200160009250925050505481565b600082815260656020526040902060010154612261816129d9565b6112548383612ae3565b60975460609083106122bb5760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b609783815481106122ce576122ce613a3f565b600091825260209091206009600a90920201015460ff166123315760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a206e6f742066696e616c697a65640000000000000000006044820152606401610588565b60006097848154811061234657612346613a3f565b90600052602060002090600a02016001018054905067ffffffffffffffff81111561237357612373613595565b6040519080825280602002602001820160405280156123b957816020015b6040805180820190915260608152600060208201528152602001906001900390816123915790505b50905060005b609785815481106123d2576123d2613a3f565b90600052602060002090600a020160010180549050811015612545576097858154811061240157612401613a3f565b90600052602060002090600a0201600101818154811061242357612423613a3f565b90600052602060002001805461243890613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461246490613ace565b80156124b15780601f10612486576101008083540402835291602001916124b1565b820191906000526020600020905b81548152906001019060200180831161249457829003601f168201915b50505050508282815181106124c8576124c8613a3f565b602090810291909101810151919091526000868152609c825260408082206001600160a01b03881683529092522080548290811061250857612508613a3f565b906000526020600020015482828151811061252557612525613a3f565b60209081029190910181015101528061253d81613ab3565b9150506123bf565b509392505050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929612577816129d9565b6001600160a01b0382166125db5760405162461bcd60e51b815260206004820152602560248201527f476f7665726e6f723a20696e76616c696420766f7465207369676e6572206164604482015264647265737360d81b6064820152608401610588565b506098805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60975485106126585760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b61266185611106565b6126ad5760405162461bcd60e51b815260206004820152601960248201527f476f7665726e6f723a206e6f7420696e2070726f6772657373000000000000006044820152606401610588565b609785815481106126c0576126c0613a3f565b90600052602060002090600a0201600401548310156127475760405162461bcd60e51b815260206004820152602e60248201527f476f7665726e6f723a2063616e6e6f7420766f7465206c657373207468616e2060448201527f6d696e696d756d20616d6f756e740000000000000000000000000000000000006064820152608401610588565b60006127aa826127a4856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90612b66565b6098549091506001600160a01b0380831691161461280a5760405162461bcd60e51b815260206004820152601b60248201527f476f7665726e6f723a20696e76616c6964207369676e617475726500000000006044820152606401610588565b6000868152609a6020908152604080832086845290915290205460ff161561289a5760405162461bcd60e51b815260206004820152602160248201527f476f7665726e6f723a20686173682063616e6e6f74206265207265706c61796560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610588565b6000868152609a602090815260408083208684529091528120805460ff1916600117905560978054889081106128d2576128d2613a3f565b60009182526020808320604080518082019091528981528083018981526005600a90950290920193840180546001818101835591875293862082516002909502019384559151929091019190915560068201805492945090928892612938908490613a9b565b9091555050600582015460009061295190600190613a6b565b60008a8152609b60209081526040808320848452825291829020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038d169081179091558251848152918201529081018990526060810188905290915089907f0f066129e5902e103e22209fff5d12a79f07dc9ef7c78fe10ff64c741a20c8ec906080016110f3565b6129e38133612b82565b50565b60008183106129f557816129f7565b825b9392505050565b604051600090612a21908335906020808601359101918252602082015260400190565b604051602081830303815290604052805190602001208314905092915050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1661142c5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612a9f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff161561142c5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806000612b758585612c02565b9150915061254581612c48565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1661142c57612bc0816001600160a01b03166014612e03565b612bcb836020612e03565b604051602001612bdc929190613b09565b60408051601f198184030181529082905262461bcd60e51b825261058891600401613b8a565b600080825160411415612c395760208301516040840151606085015160001a612c2d87828585612fe4565b94509450505050612c41565b506000905060025b9250929050565b6000816004811115612c5c57612c5c613b9d565b1415612c655750565b6001816004811115612c7957612c79613b9d565b1415612cc75760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610588565b6002816004811115612cdb57612cdb613b9d565b1415612d295760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610588565b6003816004811115612d3d57612d3d613b9d565b1415612d965760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610588565b6004816004811115612daa57612daa613b9d565b14156129e35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610588565b60606000612e12836002613bb3565b612e1d906002613a9b565b67ffffffffffffffff811115612e3557612e35613595565b6040519080825280601f01601f191660200182016040528015612e5f576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612e9657612e96613a3f565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612ee157612ee1613a3f565b60200101906001600160f81b031916908160001a9053506000612f05846002613bb3565b612f10906001613a9b565b90505b6001811115612f95577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612f5157612f51613a3f565b1a60f81b828281518110612f6757612f67613a3f565b60200101906001600160f81b031916908160001a90535060049490941c93612f8e81613bd2565b9050612f13565b5083156129f75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610588565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561301b57506000905060036130c8565b8460ff16601b1415801561303357508460ff16601c14155b1561304457506000905060046130c8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613098573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166130c1576000600192509250506130c8565b9150600090505b94509492505050565b82805482825590600052602060002090810192821561310c579160200282015b8281111561310c5782518255916020019190600101906130f1565b506131189291506131e8565b5090565b82805461312890613ace565b90600052602060002090601f01602090048101928261314a576000855561310c565b82601f1061316357805160ff191683800117855561310c565b8280016001018555821561310c579182018281111561310c5782518255916020019190600101906130f1565b8280548282559060005260206000209081019282156131dc579160200282015b828111156131dc57825180516131cc91849160209091019061311c565b50916020019190600101906131af565b506131189291506131fd565b5b8082111561311857600081556001016131e9565b80821115613118576000613211828261321a565b506001016131fd565b50805461322690613ace565b6000825580601f10613236575050565b601f0160209004906000526020600020908101906129e391906131e8565b80356001600160a01b038116811461326b57600080fd5b919050565b60008083601f84011261328257600080fd5b50813567ffffffffffffffff81111561329a57600080fd5b602083019150836020828501011115612c4157600080fd5b60008060008060008060008060c0898b0312156132ce57600080fd5b6132d789613254565b97506132e560208a01613254565b96506132f360408a01613254565b955060608901359450608089013567ffffffffffffffff8082111561331757600080fd5b6133238c838d01613270565b909650945060a08b013591508082111561333c57600080fd5b506133498b828c01613270565b999c989b5096995094979396929594505050565b60006020828403121561336f57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146129f757600080fd5b6000602082840312156133b157600080fd5b5035919050565b600080600080606085870312156133ce57600080fd5b84359350602085013567ffffffffffffffff808211156133ed57600080fd5b818701915087601f83011261340157600080fd5b81358181111561341057600080fd5b8860208260061b850101111561342557600080fd5b95986020929092019750949560400135945092505050565b6000806040838503121561345057600080fd5b8235915061346060208401613254565b90509250929050565b60005b8381101561348457818101518382015260200161346c565b83811115613493576000848401525b50505050565b600081518084526134b1816020860160208601613469565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561351a57603f19888603018452613508858351613499565b945092850192908501906001016134ec565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561355f57835183529284019291840191600101613543565b50909695505050505050565b6000806040838503121561357e57600080fd5b61358783613254565b915061346060208401613254565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156135ce576135ce613595565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156135fd576135fd613595565b604052919050565b600067ffffffffffffffff83111561361f5761361f613595565b613632601f8401601f19166020016135d4565b905082815283838301111561364657600080fd5b828260208301376000602084830101529392505050565b600082601f83011261366e57600080fd5b6129f783833560208501613605565b600067ffffffffffffffff82111561369757613697613595565b5060051b60200190565b600080600080600060a086880312156136b957600080fd5b853567ffffffffffffffff808211156136d157600080fd5b6136dd89838a0161365d565b96506020915081880135818111156136f457600080fd5b8801601f81018a1361370557600080fd5b80356137186137138261367d565b6135d4565b81815260059190911b8201840190848101908c83111561373757600080fd5b8584015b8381101561376f578035868111156137535760008081fd5b6137618f898389010161365d565b84525091860191860161373b565b50999c999b505050506040880135976060810135976080909101359650945050505050565b602080825282518282018190526000919060409081850190868401855b828110156137d6578151805185528601518685015292840192908501906001016137b1565b5091979650505050505050565b6000806000606084860312156137f857600080fd5b83359250602080850135925060408086013567ffffffffffffffff81111561381f57600080fd5b8601601f8101881361383057600080fd5b803561383e6137138261367d565b81815260069190911b8201840190848101908a83111561385d57600080fd5b928501925b8284101561389d5784848c03121561387a5760008081fd5b6138826135ab565b84358152868501358782015282529284019290850190613862565b8096505050505050509250925092565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561391557888303603f19018552815180518785526138f888860182613499565b9189015194890194909452948701949250908601906001016138d4565b509098975050505050505050565b60e08152600061393660e083018a613499565b60208301989098525060408101959095526060850193909352608084019190915260a0830152151560c090910152919050565b60008060006060848603121561397e57600080fd5b8335925061398e60208501613254565b9150604084013590509250925092565b600080604083850312156139b157600080fd5b50508035926020909101359150565b6000602082840312156139d257600080fd5b6129f782613254565b6000806000606084860312156139f057600080fd5b8335925060208401359150604084013567ffffffffffffffff811115613a1557600080fd5b8401601f81018613613a2657600080fd5b613a3586823560208401613605565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015613a7d57613a7d613a55565b500390565b600060208284031215613a9457600080fd5b5051919050565b60008219821115613aae57613aae613a55565b500190565b6000600019821415613ac757613ac7613a55565b5060010190565b600181811c90821680613ae257607f821691505b60208210811415613b0357634e487b7160e01b600052602260045260246000fd5b50919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613b41816017850160208801613469565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613b7e816028840160208801613469565b01602801949350505050565b6020815260006129f76020830184613499565b634e487b7160e01b600052602160045260246000fd5b6000816000190483118215151615613bcd57613bcd613a55565b500290565b600081613be157613be1613a55565b50600019019056fea264697066735822122029c41b3de5af47dab25bcfdf6f21975851a81a20ad1ac2b436eaaa1644e183a764736f6c634300080c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101d95760003560e01c80635df8133011610104578063bdd98d0a116100a2578063e5b2c25211610071578063e5b2c252146104b1578063f5b541a6146104c4578063f7729a2c146104eb578063fba00cbd146104fe57600080fd5b8063bdd98d0a1461042f578063d547741f14610442578063e28f80ce14610455578063e4490ce21461048357600080fd5b8063a217fddf116100de578063a217fddf146103ce578063a9448999146103d6578063abfecc48146103f6578063ac2f00741461040957600080fd5b80635df81330146103625780638e6a82331461038257806391d148541461039557600080fd5b8063248a9ca31161017c578063482671861161014b57806348267186146102f1578063485cc955146103115780634b11709414610324578063525e70f61461033757600080fd5b8063248a9ca3146102885780632f2ff15d146102ab5780633477ee2e146102be57806336568abe146102de57600080fd5b806305261aea116101b857806305261aea1461023c5780630f9acac61461024f5780631728fad11461026257806319e6e1581461027557600080fd5b806223de29146101de57806301ffc9a7146101f3578063034970ca1461021b575b600080fd5b6101f16101ec3660046132b2565b610532565b005b61020661020136600461335d565b6105c1565b60405190151581526020015b60405180910390f35b61022e61022936600461339f565b61065a565b604051908152602001610212565b6101f161024a36600461339f565b610694565b6101f161025d3660046133b8565b610a2b565b61020661027036600461339f565b611106565b61022e61028336600461339f565b6111b2565b61022e61029636600461339f565b60009081526065602052604090206001015490565b6101f16102b936600461343d565b61122f565b6102d16102cc36600461339f565b611259565b60405161021291906134c5565b6101f16102ec36600461343d565b6113a4565b6103046102ff36600461339f565b611430565b6040516102129190613527565b6101f161031f36600461356b565b6114fa565b6101f16103323660046136a1565b611793565b60985461034a906001600160a01b031681565b6040516001600160a01b039091168152602001610212565b61037561037036600461339f565b611aef565b6040516102129190613794565b6101f16103903660046137e3565b611bc9565b6102066103a336600461343d565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61022e600081565b6103e96103e436600461339f565b611e43565b60405161021291906138ad565b60995461034a906001600160a01b031681565b61041c61041736600461339f565b612128565b6040516102129796959493929190613923565b61022e61043d366004613969565b612208565b6101f161045036600461343d565b612246565b61020661046336600461399e565b609a60209081526000928352604080842090915290825290205460ff1681565b61020661049136600461399e565b609d60209081526000928352604080842090915290825290205460ff1681565b6103e96104bf36600461343d565b61226b565b61022e7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b6101f16104f93660046139c0565b61254d565b61034a61050c36600461399e565b609b6020908152600092835260408084209091529082529020546001600160a01b031681565b6099546001600160a01b031633146105915760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a20496e76616c696420746f6b656e00000000000000000060448201526064015b60405180910390fd5b600080806105a1868801886139db565b9250925092506105b4838b8a858561260b565b5050505050505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061065457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60006097828154811061066f5761066f613a3f565b90600052602060002090600a02016007015461068a836111b2565b6106549190613a6b565b80609781815481106106a8576106a8613a3f565b90600052602060002090600a02016003015442116107085760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a206e6f74206265636f6d652064756500000000000000006044820152606401610588565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610732816129d9565b609754831061077f5760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097838154811061079257610792613a3f565b600091825260209091206009600a90920201015460ff16156107f65760405162461bcd60e51b815260206004820152601b60248201527f476f7665726e6f723a20616c72656164792066696e616c697a656400000000006044820152606401610588565b6107ff8361065a565b1561084c5760405162461bcd60e51b815260206004820152601a60248201527f476f7665726e6f723a206e6f742072657665616c6564207965740000000000006044820152606401610588565b60016097848154811061086157610861613a3f565b90600052602060002090600a020160090160006101000a81548160ff021916908315150217905550600061093f609785815481106108a1576108a1613a3f565b60009182526020909120600a90910201600601546099546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610916573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093a9190613a82565b6129e6565b609954604080517ffe9d9303000000000000000000000000000000000000000000000000000000008152600481018490526024810191909152600060448201529192506001600160a01b03169063fe9d930390606401600060405180830381600087803b1580156109af57600080fd5b505af11580156109c3573d6000803e3d6000fd5b50505050837fb968440accd1ce5fa60b00de8bb8d8487eb2fda3c3701fb30fea3f69aa910a48609786815481106109fc576109fc613a3f565b90600052602060002090600a020160060154604051610a1d91815260200190565b60405180910390a250505050565b8360978181548110610a3f57610a3f613a3f565b90600052602060002090600a0201600301544211610a9f5760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a206e6f74206265636f6d652064756500000000000000006044820152606401610588565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610ac9816129d9565b6097548610610b165760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b83610b895760405162461bcd60e51b815260206004820152602260248201527f476f7665726e6f723a20646174612073686f756c64206e6f7420626520656d7060448201527f74790000000000000000000000000000000000000000000000000000000000006064820152608401610588565b60978681548110610b9c57610b9c613a3f565b600091825260209091206009600a90920201015460ff1615610c005760405162461bcd60e51b815260206004820152601b60248201527f476f7665726e6f723a20616c72656164792066696e616c697a656400000000006044820152606401610588565b6000610c0b8761065a565b11610c7e5760405162461bcd60e51b815260206004820152602860248201527f476f7665726e6f723a20616c6c20766f7465732061726520616c72656164792060448201527f72657665616c65640000000000000000000000000000000000000000000000006064820152608401610588565b60978681548110610c9157610c91613a3f565b600091825260209091206005600a909202010154610caf8585613a9b565b1115610cfd5760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a20696e76616c6964206f666673657400000000000000006044820152606401610588565b600060978781548110610d1257610d12613a3f565b90600052602060002090600a02019050600081600801805480602002602001604051908101604052809291908181526020018280548015610d7257602002820191906000526020600020905b815481526020019060010190808311610d5e575b505050505090506000805b878110156110855760008a8152609d6020526040812090610d9e838a613a9b565b815260208101919091526040016000205460ff1615610dbc57611073565b610e0c60058501610dcd838a613a9b565b81548110610ddd57610ddd613a3f565b9060005260206000209060020201600101548a8a84818110610e0157610e01613a3f565b9050604002016129fe565b610e7e5760405162461bcd60e51b815260206004820152603560248201527f476f7665726e6f723a2072657665616c206461746120646f6573206e6f74206d60448201527f61746368207769746820636f6d6d6974206461746100000000000000000000006064820152608401610588565b60058401610e8c8289613a9b565b81548110610e9c57610e9c613a3f565b906000526020600020906002020160000154838a8a84818110610ec157610ec1613a3f565b9050604002016000013581518110610edb57610edb613a3f565b60200260200101818151610eef9190613a9b565b90525060008a8152609b6020526040812081610f0b848b613a9b565b815260208082019290925260409081016000908120548e8252609c84528282206001600160a01b0390911680835293522054909150610f925760005b6001860154811015610f905760008c8152609c602090815260408083206001600160a01b0386168452909152812080546001018155905280610f8881613ab3565b915050610f47565b505b60058501610fa0838a613a9b565b81548110610fb057610fb0613a3f565b600091825260208083206002909202909101548d8352609c825260408084206001600160a01b038616855290925291208b8b85818110610ff257610ff2613a3f565b905060400201600001358154811061100c5761100c613a3f565b9060005260206000200160008282546110259190613a9b565b909155505060008b8152609d60205260408120600191611045858c613a9b565b81526020810191909152604001600020805460ff19169115159190911790558261106e81613ab3565b935050505b8061107d81613ab3565b915050610d7d565b50815161109b90600885019060208501906130d1565b50808360070160008282546110b09190613a9b565b909155508990507f7162321ecace9c982905ec8d8000eb292887b6befedc98e18dbb27fa95e752d7826110e28361065a565b604080519283526020830191909152015b60405180910390a2505050505050505050565b60975460009082106111565760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097828154811061116957611169613a3f565b90600052602060002090600a020160020154421015801561065457506097828154811061119857611198613a3f565b90600052602060002090600a020160030154421092915050565b60975460009082106112025760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097828154811061121557611215613a3f565b600091825260209091206005600a90920201015492915050565b60008281526065602052604090206001015461124a816129d9565b6112548383612a41565b505050565b60975460609082106112a95760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b609782815481106112bc576112bc613a3f565b90600052602060002090600a0201600101805480602002602001604051908101604052809291908181526020016000905b8282101561139957838290600052602060002001805461130c90613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461133890613ace565b80156113855780601f1061135a57610100808354040283529160200191611385565b820191906000526020600020905b81548152906001019060200180831161136857829003601f168201915b5050505050815260200190600101906112ed565b505050509050919050565b6001600160a01b03811633146114225760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610588565b61142c8282612ae3565b5050565b60975460609082106114805760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b6097828154811061149357611493613a3f565b90600052602060002090600a02016008018054806020026020016040519081016040528092919081815260200182805480156114ee57602002820191906000526020600020905b8154815260200190600101908083116114da575b50505050509050919050565b600054610100900460ff161580801561151a5750600054600160ff909116105b806115345750303b158015611534575060005460ff166001145b6115a65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610588565b6000805460ff1916600117905580156115c9576000805461ff0019166101001790555b6001600160a01b03831661162d5760405162461bcd60e51b815260206004820152602560248201527f476f7665726e6f723a20696e76616c696420766f7465207369676e6572206164604482015264647265737360d81b6064820152608401610588565b611638600033612a41565b6116627f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92933612a41565b609880546001600160a01b0385811673ffffffffffffffffffffffffffffffffffffffff199283161790925560998054928516929091169190911790556040517f29965a1d00000000000000000000000000000000000000000000000000000000815230600482018190527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b15801561173157600080fd5b505af1158015611745573d6000803e3d6000fd5b505050508015611254576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296117bd816129d9565b60018551116118345760405162461bcd60e51b815260206004820152602e60248201527f476f7665726e6f723a206e6565642063616e64696461746573206174206c656160448201527f7374206d6f7265207468616e20310000000000000000000000000000000000006064820152608401610588565b4284116118a95760405162461bcd60e51b815260206004820152602960248201527f476f7665726e6f723a2063616e6e6f7420737461727420706f6c6c2066726f6d60448201527f20746865207061737400000000000000000000000000000000000000000000006064820152608401610588565b83831161191e5760405162461bcd60e51b815260206004820152602a60248201527f476f7665726e6f723a2063616e6e6f7420656e6420706f6c6c206265666f726560448201527f20746865207374617274000000000000000000000000000000000000000000006064820152608401610588565b60978054600190810180835560009283526119399190613a6b565b9050866097828154811061194f5761194f613a3f565b90600052602060002090600a0201600001908051906020019061197392919061311c565b50856097828154811061198857611988613a3f565b90600052602060002090600a020160010190805190602001906119ac92919061318f565b5084609782815481106119c1576119c1613a3f565b90600052602060002090600a02016002018190555083609782815481106119ea576119ea613a3f565b90600052602060002090600a0201600301819055508260978281548110611a1357611a13613a3f565b90600052602060002090600a020160040181905550855167ffffffffffffffff811115611a4257611a42613595565b604051908082528060200260200182016040528015611a6b578160200160208202803683370190505b5060978281548110611a7f57611a7f613a3f565b90600052602060002090600a02016008019080519060200190611aa39291906130d1565b506097547fab0309b6731a34e8750174d3c2c9591a34a2bf0c1425a30b34122be08d05073990611ad590600190613a6b565b60405190815260200160405180910390a150505050505050565b6097546060908210611b3f5760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b60978281548110611b5257611b52613a3f565b90600052602060002090600a0201600501805480602002602001604051908101604052809291908181526020016000905b8282101561139957838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611b83565b8260978181548110611bdd57611bdd613a3f565b90600052602060002090600a0201600301544211611c3d5760405162461bcd60e51b815260206004820152601860248201527f476f7665726e6f723a206e6f74206265636f6d652064756500000000000000006044820152606401610588565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611c67816129d9565b6097548510611cb45760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b60978581548110611cc757611cc7613a3f565b600091825260209091206009600a90920201015460ff16611d2a5760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a206e6f742066696e616c697a65640000000000000000006044820152606401610588565b600060978681548110611d3f57611d3f613a3f565b60009182526020909120600a9091020160098101805460ff19169055600181015490915067ffffffffffffffff811115611d7b57611d7b613595565b604051908082528060200260200182016040528015611da4578160200160208202803683370190505b508051611dbb9160088401916020909101906130d1565b506000600782018190555b8451811015611e3a57848181518110611de157611de1613a3f565b6020026020010151826005018288611df99190613a9b565b81548110611e0957611e09613a3f565b6000918252602091829020835160029092020190815591015160019091015580611e3281613ab3565b915050611dc6565b50505050505050565b6097546060908210611e935760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b60978281548110611ea657611ea6613a3f565b600091825260209091206009600a90920201015460ff16611f095760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a206e6f742066696e616c697a65640000000000000000006044820152606401610588565b600060978381548110611f1e57611f1e613a3f565b90600052602060002090600a02016001018054905067ffffffffffffffff811115611f4b57611f4b613595565b604051908082528060200260200182016040528015611f9157816020015b604080518082019091526060815260006020820152815260200190600190039081611f695790505b50905060005b60978481548110611faa57611faa613a3f565b90600052602060002090600a0201600101805490508110156121215760978481548110611fd957611fd9613a3f565b90600052602060002090600a02016001018181548110611ffb57611ffb613a3f565b90600052602060002001805461201090613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461203c90613ace565b80156120895780601f1061205e57610100808354040283529160200191612089565b820191906000526020600020905b81548152906001019060200180831161206c57829003601f168201915b50505050508282815181106120a0576120a0613a3f565b602002602001015160000181905250609784815481106120c2576120c2613a3f565b90600052602060002090600a020160080181815481106120e4576120e4613a3f565b906000526020600020015482828151811061210157612101613a3f565b60209081029190910181015101528061211981613ab3565b915050611f97565b5092915050565b6097818154811061213857600080fd5b90600052602060002090600a020160009150905080600001805461215b90613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461218790613ace565b80156121d45780601f106121a9576101008083540402835291602001916121d4565b820191906000526020600020905b8154815290600101906020018083116121b757829003601f168201915b5050506002840154600385015460048601546006870154600788015460099098015496979396929550909350919060ff1687565b609c602052826000526040600020602052816000526040600020818154811061223057600080fd5b9060005260206000200160009250925050505481565b600082815260656020526040902060010154612261816129d9565b6112548383612ae3565b60975460609083106122bb5760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b609783815481106122ce576122ce613a3f565b600091825260209091206009600a90920201015460ff166123315760405162461bcd60e51b815260206004820152601760248201527f476f7665726e6f723a206e6f742066696e616c697a65640000000000000000006044820152606401610588565b60006097848154811061234657612346613a3f565b90600052602060002090600a02016001018054905067ffffffffffffffff81111561237357612373613595565b6040519080825280602002602001820160405280156123b957816020015b6040805180820190915260608152600060208201528152602001906001900390816123915790505b50905060005b609785815481106123d2576123d2613a3f565b90600052602060002090600a020160010180549050811015612545576097858154811061240157612401613a3f565b90600052602060002090600a0201600101818154811061242357612423613a3f565b90600052602060002001805461243890613ace565b80601f016020809104026020016040519081016040528092919081815260200182805461246490613ace565b80156124b15780601f10612486576101008083540402835291602001916124b1565b820191906000526020600020905b81548152906001019060200180831161249457829003601f168201915b50505050508282815181106124c8576124c8613a3f565b602090810291909101810151919091526000868152609c825260408082206001600160a01b03881683529092522080548290811061250857612508613a3f565b906000526020600020015482828151811061252557612525613a3f565b60209081029190910181015101528061253d81613ab3565b9150506123bf565b509392505050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929612577816129d9565b6001600160a01b0382166125db5760405162461bcd60e51b815260206004820152602560248201527f476f7665726e6f723a20696e76616c696420766f7465207369676e6572206164604482015264647265737360d81b6064820152608401610588565b506098805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60975485106126585760405162461bcd60e51b815260206004820152601960248201527811dbdd995c9b9bdc8e881a5b9d985b1a59081c1bdb1b081a59603a1b6044820152606401610588565b61266185611106565b6126ad5760405162461bcd60e51b815260206004820152601960248201527f476f7665726e6f723a206e6f7420696e2070726f6772657373000000000000006044820152606401610588565b609785815481106126c0576126c0613a3f565b90600052602060002090600a0201600401548310156127475760405162461bcd60e51b815260206004820152602e60248201527f476f7665726e6f723a2063616e6e6f7420766f7465206c657373207468616e2060448201527f6d696e696d756d20616d6f756e740000000000000000000000000000000000006064820152608401610588565b60006127aa826127a4856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90612b66565b6098549091506001600160a01b0380831691161461280a5760405162461bcd60e51b815260206004820152601b60248201527f476f7665726e6f723a20696e76616c6964207369676e617475726500000000006044820152606401610588565b6000868152609a6020908152604080832086845290915290205460ff161561289a5760405162461bcd60e51b815260206004820152602160248201527f476f7665726e6f723a20686173682063616e6e6f74206265207265706c61796560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610588565b6000868152609a602090815260408083208684529091528120805460ff1916600117905560978054889081106128d2576128d2613a3f565b60009182526020808320604080518082019091528981528083018981526005600a90950290920193840180546001818101835591875293862082516002909502019384559151929091019190915560068201805492945090928892612938908490613a9b565b9091555050600582015460009061295190600190613a6b565b60008a8152609b60209081526040808320848452825291829020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038d169081179091558251848152918201529081018990526060810188905290915089907f0f066129e5902e103e22209fff5d12a79f07dc9ef7c78fe10ff64c741a20c8ec906080016110f3565b6129e38133612b82565b50565b60008183106129f557816129f7565b825b9392505050565b604051600090612a21908335906020808601359101918252602082015260400190565b604051602081830303815290604052805190602001208314905092915050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1661142c5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612a9f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff161561142c5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806000612b758585612c02565b9150915061254581612c48565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1661142c57612bc0816001600160a01b03166014612e03565b612bcb836020612e03565b604051602001612bdc929190613b09565b60408051601f198184030181529082905262461bcd60e51b825261058891600401613b8a565b600080825160411415612c395760208301516040840151606085015160001a612c2d87828585612fe4565b94509450505050612c41565b506000905060025b9250929050565b6000816004811115612c5c57612c5c613b9d565b1415612c655750565b6001816004811115612c7957612c79613b9d565b1415612cc75760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610588565b6002816004811115612cdb57612cdb613b9d565b1415612d295760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610588565b6003816004811115612d3d57612d3d613b9d565b1415612d965760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610588565b6004816004811115612daa57612daa613b9d565b14156129e35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610588565b60606000612e12836002613bb3565b612e1d906002613a9b565b67ffffffffffffffff811115612e3557612e35613595565b6040519080825280601f01601f191660200182016040528015612e5f576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612e9657612e96613a3f565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612ee157612ee1613a3f565b60200101906001600160f81b031916908160001a9053506000612f05846002613bb3565b612f10906001613a9b565b90505b6001811115612f95577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612f5157612f51613a3f565b1a60f81b828281518110612f6757612f67613a3f565b60200101906001600160f81b031916908160001a90535060049490941c93612f8e81613bd2565b9050612f13565b5083156129f75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610588565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561301b57506000905060036130c8565b8460ff16601b1415801561303357508460ff16601c14155b1561304457506000905060046130c8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613098573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166130c1576000600192509250506130c8565b9150600090505b94509492505050565b82805482825590600052602060002090810192821561310c579160200282015b8281111561310c5782518255916020019190600101906130f1565b506131189291506131e8565b5090565b82805461312890613ace565b90600052602060002090601f01602090048101928261314a576000855561310c565b82601f1061316357805160ff191683800117855561310c565b8280016001018555821561310c579182018281111561310c5782518255916020019190600101906130f1565b8280548282559060005260206000209081019282156131dc579160200282015b828111156131dc57825180516131cc91849160209091019061311c565b50916020019190600101906131af565b506131189291506131fd565b5b8082111561311857600081556001016131e9565b80821115613118576000613211828261321a565b506001016131fd565b50805461322690613ace565b6000825580601f10613236575050565b601f0160209004906000526020600020908101906129e391906131e8565b80356001600160a01b038116811461326b57600080fd5b919050565b60008083601f84011261328257600080fd5b50813567ffffffffffffffff81111561329a57600080fd5b602083019150836020828501011115612c4157600080fd5b60008060008060008060008060c0898b0312156132ce57600080fd5b6132d789613254565b97506132e560208a01613254565b96506132f360408a01613254565b955060608901359450608089013567ffffffffffffffff8082111561331757600080fd5b6133238c838d01613270565b909650945060a08b013591508082111561333c57600080fd5b506133498b828c01613270565b999c989b5096995094979396929594505050565b60006020828403121561336f57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146129f757600080fd5b6000602082840312156133b157600080fd5b5035919050565b600080600080606085870312156133ce57600080fd5b84359350602085013567ffffffffffffffff808211156133ed57600080fd5b818701915087601f83011261340157600080fd5b81358181111561341057600080fd5b8860208260061b850101111561342557600080fd5b95986020929092019750949560400135945092505050565b6000806040838503121561345057600080fd5b8235915061346060208401613254565b90509250929050565b60005b8381101561348457818101518382015260200161346c565b83811115613493576000848401525b50505050565b600081518084526134b1816020860160208601613469565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561351a57603f19888603018452613508858351613499565b945092850192908501906001016134ec565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561355f57835183529284019291840191600101613543565b50909695505050505050565b6000806040838503121561357e57600080fd5b61358783613254565b915061346060208401613254565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156135ce576135ce613595565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156135fd576135fd613595565b604052919050565b600067ffffffffffffffff83111561361f5761361f613595565b613632601f8401601f19166020016135d4565b905082815283838301111561364657600080fd5b828260208301376000602084830101529392505050565b600082601f83011261366e57600080fd5b6129f783833560208501613605565b600067ffffffffffffffff82111561369757613697613595565b5060051b60200190565b600080600080600060a086880312156136b957600080fd5b853567ffffffffffffffff808211156136d157600080fd5b6136dd89838a0161365d565b96506020915081880135818111156136f457600080fd5b8801601f81018a1361370557600080fd5b80356137186137138261367d565b6135d4565b81815260059190911b8201840190848101908c83111561373757600080fd5b8584015b8381101561376f578035868111156137535760008081fd5b6137618f898389010161365d565b84525091860191860161373b565b50999c999b505050506040880135976060810135976080909101359650945050505050565b602080825282518282018190526000919060409081850190868401855b828110156137d6578151805185528601518685015292840192908501906001016137b1565b5091979650505050505050565b6000806000606084860312156137f857600080fd5b83359250602080850135925060408086013567ffffffffffffffff81111561381f57600080fd5b8601601f8101881361383057600080fd5b803561383e6137138261367d565b81815260069190911b8201840190848101908a83111561385d57600080fd5b928501925b8284101561389d5784848c03121561387a5760008081fd5b6138826135ab565b84358152868501358782015282529284019290850190613862565b8096505050505050509250925092565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561391557888303603f19018552815180518785526138f888860182613499565b9189015194890194909452948701949250908601906001016138d4565b509098975050505050505050565b60e08152600061393660e083018a613499565b60208301989098525060408101959095526060850193909352608084019190915260a0830152151560c090910152919050565b60008060006060848603121561397e57600080fd5b8335925061398e60208501613254565b9150604084013590509250925092565b600080604083850312156139b157600080fd5b50508035926020909101359150565b6000602082840312156139d257600080fd5b6129f782613254565b6000806000606084860312156139f057600080fd5b8335925060208401359150604084013567ffffffffffffffff811115613a1557600080fd5b8401601f81018613613a2657600080fd5b613a3586823560208401613605565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015613a7d57613a7d613a55565b500390565b600060208284031215613a9457600080fd5b5051919050565b60008219821115613aae57613aae613a55565b500190565b6000600019821415613ac757613ac7613a55565b5060010190565b600181811c90821680613ae257607f821691505b60208210811415613b0357634e487b7160e01b600052602260045260246000fd5b50919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613b41816017850160208801613469565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613b7e816028840160208801613469565b01602801949350505050565b6020815260006129f76020830184613499565b634e487b7160e01b600052602160045260246000fd5b6000816000190483118215151615613bcd57613bcd613a55565b500290565b600081613be157613be1613a55565b50600019019056fea264697066735822122029c41b3de5af47dab25bcfdf6f21975851a81a20ad1ac2b436eaaa1644e183a764736f6c634300080c0033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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

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