More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 14,434 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deposit | 70617969 | 17 hrs ago | IN | 0 POL | 0.00309995 | ||||
Deposit | 70584721 | 37 hrs ago | IN | 0 POL | 0.00225391 | ||||
Deposit | 70368854 | 6 days ago | IN | 0 POL | 0.00196767 | ||||
Withdraw All | 70278065 | 9 days ago | IN | 0 POL | 0.00203837 | ||||
Deposit | 70224718 | 10 days ago | IN | 0 POL | 0.00218136 | ||||
Deposit | 70137557 | 12 days ago | IN | 0 POL | 0.00205152 | ||||
Deposit | 69820689 | 20 days ago | IN | 0 POL | 0.00215315 | ||||
Withdraw All | 69814865 | 20 days ago | IN | 0 POL | 0.00238744 | ||||
Withdraw All | 69813334 | 20 days ago | IN | 0 POL | 0.00268973 | ||||
Deposit | 69549492 | 27 days ago | IN | 0 POL | 0.00213972 | ||||
Withdraw All | 69455938 | 29 days ago | IN | 0 POL | 0.00236148 | ||||
Deposit | 69144385 | 37 days ago | IN | 0 POL | 0.00195754 | ||||
Deposit | 68970776 | 41 days ago | IN | 0 POL | 0.00195993 | ||||
Withdraw All | 68937054 | 42 days ago | IN | 0 POL | 0.00242452 | ||||
Deposit | 68878815 | 43 days ago | IN | 0 POL | 0.00729228 | ||||
Deposit | 68684145 | 48 days ago | IN | 0 POL | 0.00331555 | ||||
Withdraw All | 68684133 | 48 days ago | IN | 0 POL | 0.00361126 | ||||
Deposit | 68651225 | 49 days ago | IN | 0 POL | 0.00767035 | ||||
Deposit | 68410391 | 55 days ago | IN | 0 POL | 0.00235004 | ||||
Deposit | 68403288 | 55 days ago | IN | 0 POL | 0.00335277 | ||||
Deposit | 68354953 | 56 days ago | IN | 0 POL | 0.00885631 | ||||
Deposit | 68280844 | 58 days ago | IN | 0 POL | 0.0019387 | ||||
Deposit | 68088711 | 63 days ago | IN | 0 POL | 0.00193461 | ||||
Deposit | 68037453 | 64 days ago | IN | 0 POL | 0.00268397 | ||||
Deposit | 68036388 | 64 days ago | IN | 0 POL | 0.00223381 |
Loading...
Loading
Contract Name:
Governance
Compiler Version
v0.7.3+commit.9bfce1f6
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/IGenesis.sol"; import "./common/GovernanceERC20.sol"; contract Governance is AccessControl, ReentrancyGuard { using SafeMath for uint256; struct Proposal { // Unique id for a proposal uint256 id; // Indicates if vote has been passed bool passed; // Indicates if vote has been failed bool failed; // The minimum number of votes in order to pass uint256 threshold; // Timestamp to start voting uint256 startTime; // Timestamp to end voting uint256 endTime; // Total number of votes for this proposal uint256 totalFor; // Total number of votes against this proposal uint256 totalAgainst; // Votes number for each address mapping(address => uint256) votesFor; // Votes Against for each address mapping(address => uint256) votesAgainst; } bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); /// @notice The genesis contract address IGENESIS public genesis; /// @notice The previous governance contract address (locked into the world contract) address public oldGov; /// @notice Maximum number of proposals that a user can participate at a time uint256 public constant maxConcurrentUserVotes = 10; /// @notice Sum of all user's votePower uint256 public totalVotePower = 0; /// @notice votePower for users mapping(address => uint256) public votePower; /// @notice The total number of proposals uint256 public proposalCount; /// @notice The official record of all proposals ever proposed mapping(uint256 => Proposal) public proposals; /// @notice Proposals that user is participating mapping(address => uint256[]) public activeVotes; /// @notice An event emitted when a vote is created event ProposalCreated(uint256 proposalId, uint256 threshold, uint256 startTime, uint256 endTime); /// @notice An event emitted when a vote power changes event VotePower(address voter, uint256 votePower, uint256 totalVotePower); /// @notice An event emitted when a vote happens event Vote( address voter, uint256 proposalId, uint256 myVotesFor, uint256 myVotesAgainst, uint256 totalFor, uint256 totalAgainst ); /// @notice An event emitted when a vote is resolved event VoteResult(uint256 voteId, bool result, uint256 votesFor, uint256 votesAgainst, uint256 threshold); modifier isGlobalAdmin() { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender())); _; } modifier onlyProposer() { require(hasRole(PROPOSER_ROLE, _msgSender()), "sender must be an approved proposer"); _; } constructor(address genesis_, address oldGov_) { genesis = IGENESIS(genesis_); oldGov = oldGov_; _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setRoleAdmin(PROPOSER_ROLE, DEFAULT_ADMIN_ROLE); } // Returns the total amount of GENESIS locked in this contract function totalSupply() external view returns (uint256) { return totalVotePower; } // Returns the total amount of GENESIS owned by this user // Includes the amount that would be collected from the world contract emissions function balanceOf(address user) public view returns (uint256) { if (totalVotePower == 0) return 0; return votePower[user] .mul(genesis.balanceOf(address(this)).add(genesis.balanceOf(oldGov))) .div(totalVotePower); } function getVotesFor(uint256 proposalId, address account) external view returns (uint256) { return proposals[proposalId].votesFor[account]; } function getVotesAgainst(uint256 proposalId, address account) external view returns (uint256) { return proposals[proposalId].votesAgainst[account]; } function setProposer(address proposer, bool isProposer) external isGlobalAdmin() { if (isProposer) grantRole(PROPOSER_ROLE, proposer); else revokeRole(PROPOSER_ROLE, proposer); } function propose( uint256 threshold, uint256 startTime, uint256 endTime ) external onlyProposer { require(startTime > block.timestamp, "Start time must be later than now"); require(endTime > startTime, "End time must be later than start time"); proposalCount = proposalCount.add(1); Proposal storage newProposal = proposals[proposalCount]; newProposal.id = proposalCount; newProposal.threshold = threshold; newProposal.startTime = startTime; newProposal.endTime = endTime; emit ProposalCreated(newProposal.id, threshold, startTime, endTime); } function deposit(uint256 amount) public { moveEmissions(); address voter = _msgSender(); uint256 genesisBalance = genesis.balanceOf(address(this)); uint256 newVotePower; if (totalVotePower == 0) { newVotePower = amount.add(genesisBalance); votePower[voter] = newVotePower; totalVotePower = newVotePower; } else { newVotePower = amount.mul(totalVotePower).div(genesisBalance); votePower[voter] = votePower[voter].add(newVotePower); totalVotePower = totalVotePower.add(newVotePower); } _cleanVotes(voter, 0); uint256[] storage active = activeVotes[voter]; for (uint256 i = 0; i < active.length; i++) { Proposal storage proposal = proposals[active[i]]; if (proposal.votesAgainst[voter] > 0) { proposal.totalAgainst = proposal.totalAgainst.add(amount); proposal.votesAgainst[voter] = proposal.votesAgainst[voter].add(amount); } if (proposal.votesFor[voter] > 0) { proposal.totalFor = proposal.totalFor.add(amount); proposal.votesFor[voter] = proposal.votesFor[voter].add(amount); } } genesis.governanceTransfer(voter, address(this), amount); emit VotePower(voter, votePower[voter], totalVotePower); } function withdrawAll() public { uint256 balance = balanceOf(_msgSender()); withdraw(balance); } function withdraw(uint256 amount) public nonReentrant() { moveEmissions(); address voter = _msgSender(); uint256 genesisBalance = genesis.balanceOf(address(this)); uint256 votePowerReduction = amount.mul(totalVotePower).div(genesisBalance); votePower[voter] = votePower[voter].sub(votePowerReduction); totalVotePower = totalVotePower.sub(votePowerReduction); _cleanVotes(voter, 0); uint256[] storage active = activeVotes[voter]; for (uint256 i = 0; i < active.length; i++) { Proposal storage proposal = proposals[active[i]]; if (proposal.votesAgainst[voter] > 0) { uint256 newTotalAgainst = proposal.totalAgainst.sub(amount); uint256 newMyAgainst = proposal.votesAgainst[voter].sub(amount); proposal.totalAgainst = newTotalAgainst; proposal.votesAgainst[voter] = newMyAgainst; emit Vote(voter, proposal.id, 0, newMyAgainst, proposal.totalFor, newTotalAgainst); if (newMyAgainst == 0) { // remove this from my active votes active[i] = active[active.length - 1]; active.pop(); i--; } } if (proposal.votesFor[voter] > 0) { uint256 newTotalFor = proposal.totalFor.add(amount); uint256 newMyFor = proposal.votesFor[voter].add(amount); proposal.totalFor = newTotalFor; proposal.votesFor[voter] = newMyFor; emit Vote(voter, proposal.id, newMyFor, 0, newTotalFor, proposal.totalAgainst); if (newMyFor == 0) { // remove this from my active votes active[i] = active[active.length - 1]; active.pop(); i--; } } } genesis.governanceTransfer(address(this), voter, amount); emit VotePower(voter, votePower[voter], totalVotePower); } function moveEmissions() internal { uint256 oldGovBalance = genesis.balanceOf(oldGov); if(oldGovBalance > 0) { genesis.governanceTransfer(oldGov, address(this), oldGovBalance); } } function voteFor(uint256 proposalId) public { Proposal storage proposal = proposals[proposalId]; require(proposal.startTime > 0 && proposal.startTime <= block.timestamp, "Vote has not yet started"); require(proposal.endTime >= block.timestamp, "Vote has ended"); address voter = _msgSender(); require(proposal.votesFor[voter] == 0, "not yet voted on this"); uint256 balance = balanceOf(voter); proposal.totalFor = proposal.totalFor.add(balance); proposal.votesFor[voter] = balance; if (proposal.votesAgainst[voter] > 0) { proposal.totalAgainst = proposal.totalAgainst.sub(proposal.votesAgainst[voter]); proposal.votesAgainst[voter] = 0; } _cleanVotes(voter, proposalId); emit Vote(voter, proposalId, proposal.votesFor[voter], 0, proposal.totalFor, proposal.totalAgainst); } function voteAgainst(uint256 proposalId) public { Proposal storage proposal = proposals[proposalId]; require(proposal.startTime > 0 && proposal.startTime <= block.timestamp, "Vote has not yet started"); require(proposal.endTime >= block.timestamp, "Vote has ended"); address voter = _msgSender(); require(proposal.votesAgainst[voter] == 0, "not yet voted on this"); uint256 balance = balanceOf(voter); proposal.totalAgainst = proposal.totalAgainst.add(balance); proposal.votesAgainst[voter] = balance; if (proposal.votesFor[voter] > 0) { proposal.totalFor = proposal.totalFor.sub(proposal.votesFor[voter]); proposal.votesFor[voter] = 0; } _cleanVotes(voter, proposalId); emit Vote(voter, proposalId, 0, proposal.votesAgainst[voter], proposal.totalFor, proposal.totalAgainst); } function abstain(uint256 proposalId) public { Proposal storage proposal = proposals[proposalId]; // remove my values from the vote; remove the vote from my active votes require(proposal.startTime > 0 && proposal.startTime <= block.timestamp, "Vote has not yet started"); require(proposal.endTime >= block.timestamp, "Vote has ended"); address voter = _msgSender(); uint256 balance = balanceOf(voter); if (proposal.votesFor[voter] > 0) { proposal.totalFor = proposal.totalFor.sub(proposal.votesFor[voter]); proposal.votesFor[voter] = 0; } if (proposal.votesAgainst[voter] > 0) { proposal.totalAgainst = proposal.totalAgainst.sub(proposal.votesAgainst[voter]); proposal.votesAgainst[voter] = 0; } _cleanVotes(voter, 0); emit Vote(voter, proposalId, 0, 0, proposal.totalFor, proposal.totalAgainst); } function _cleanVotes(address voter, uint256 proposalId) internal { uint256[] storage active = activeVotes[voter]; bool thisVoteExists = false; for (uint256 i = 0; i < active.length; i++) { if (active[i] == proposalId) { thisVoteExists = true; } else { // if the vote’s concluded, remove from active if (proposals[active[i]].endTime < block.timestamp) { active[i] = active[active.length - 1]; active.pop(); i--; } } } if (proposalId > 0 && !thisVoteExists) { require(active.length < maxConcurrentUserVotes, "you can only have 10 active votes at any one time"); active.push(proposalId); } } function resolveVote(uint256 proposalId) external returns (bool isPassed) { Proposal storage proposal = proposals[proposalId]; require(proposal.endTime > 0, "Vote does not exist"); require(proposal.endTime < block.timestamp, "Vote has not yet ended"); require(proposal.passed == false && proposal.failed == false, "Vote has already resolved"); if (proposal.totalFor >= proposal.threshold && proposal.totalFor > proposal.totalAgainst) { proposal.passed = true; emit VoteResult(proposalId, true, proposal.totalFor, proposal.totalAgainst, proposal.threshold); return true; } else { proposal.failed = true; emit VoteResult(proposalId, false, proposal.totalFor, proposal.totalAgainst, proposal.threshold); return false; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * 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 AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @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 {_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) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @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 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. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _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. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { 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. * * [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}. * ==== */ 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 { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IGENESIS is IERC20 { function mintToAddress(address user, uint256 amount) external; function governanceTransfer( address from, address to, uint256 amount ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; abstract contract GovernanceERC20 is IERC20 { function name() public view returns (string memory) { return "Genesis Worlds Governance"; } function symbol() public view returns (string memory) { return "gVOTE"; } function decimals() public view returns (uint8) { return 18; } function transfer(address recipient, uint256 amount) external override returns (bool) { return false; } function allowance(address owner, address spender) external override view returns (uint256) { return 0; } function approve(address spender, uint256 amount) external override returns (bool) { return false; } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { return false; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"genesis_","type":"address"},{"internalType":"address","name":"oldGov_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"ProposalCreated","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":false,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"myVotesFor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"myVotesAgainst","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalFor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAgainst","type":"uint256"}],"name":"Vote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"votePower","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalVotePower","type":"uint256"}],"name":"VotePower","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voteId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"result","type":"bool"},{"indexed":false,"internalType":"uint256","name":"votesFor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"votesAgainst","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"}],"name":"VoteResult","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROPOSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"}],"name":"abstain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"activeVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"genesis","outputs":[{"internalType":"contract IGENESIS","name":"","type":"address"}],"stateMutability":"view","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":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"getVotesAgainst","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"getVotesFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"maxConcurrentUserVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldGov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposalCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"proposals","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"passed","type":"bool"},{"internalType":"bool","name":"failed","type":"bool"},{"internalType":"uint256","name":"threshold","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"totalFor","type":"uint256"},{"internalType":"uint256","name":"totalAgainst","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"threshold","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"propose","outputs":[],"stateMutability":"nonpayable","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":"proposalId","type":"uint256"}],"name":"resolveVote","outputs":[{"internalType":"bool","name":"isPassed","type":"bool"}],"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":"proposer","type":"address"},{"internalType":"bool","name":"isProposer","type":"bool"}],"name":"setProposer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalVotePower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"}],"name":"voteAgainst","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"}],"name":"voteFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"votePower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405260006004553480156200001657600080fd5b506040516200271738038062002717833981810160405260408110156200003c57600080fd5b50805160209091015160018055600280546001600160a01b038085166001600160a01b03199283161790925560038054928416929091169190911790556200008f600062000089620000c4565b620000c8565b620000bc7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc16000620000d8565b50506200022a565b3390565b620000d482826200012a565b5050565b600082815260208190526040808220600201549051839285917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a460009182526020829052604090912060020155565b6000828152602081815260409091206200014f91839062001c72620001a3821b17901c565b15620000d4576200015f620000c4565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001ba836001600160a01b038416620001c3565b90505b92915050565b6000620001d1838362000212565b6200020957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001bd565b506000620001bd565b60009081526001919091016020526040902054151590565b6124dd806200023a6000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80638f61f4f511610104578063ca15c873116100a2578063e490e69911610071578063e490e69914610547578063e64888bb1461056d578063e9ed9b6414610575578063f5f3d4f7146105a3576101da565b8063ca15c873146104ee578063d547741f1461050b578063d74db6e114610537578063da35c6641461053f576101da565b8063a217fddf116100de578063a217fddf146104a4578063a7f0b3de146104ac578063b6b55f25146104b4578063c1f0fb9f146104d1576101da565b80638f61f4f5146104315780639010d07c1461043957806391d1485414610478576101da565b806330f4ccac1161017c57806370a082311161014b57806370a08231146103c9578063750e443a146103ef578063853828b61461040c57806386a5053514610414576101da565b806330f4ccac14610317578063331023ac1461034857806336568abe1461037457806340376d56146103a0576101da565b80632337f7b6116101b85780632337f7b614610283578063248a9ca3146102af5780632e1a7d4d146102cc5780632f2ff15d146102eb576101da565b8063013cf08b146101df57806318160ddd1461023d57806322d2b3ab14610257575b600080fd5b6101fc600480360360208110156101f557600080fd5b50356105ab565b604080519889529615156020890152941515878701526060870193909352608086019190915260a085015260c084015260e083015251908190036101000190f35b6102456105ed565b60408051918252519081900360200190f35b6102456004803603604081101561026d57600080fd5b50803590602001356001600160a01b03166105f3565b6102456004803603604081101561029957600080fd5b506001600160a01b03813516906020013561061f565b610245600480360360208110156102c557600080fd5b503561064d565b6102e9600480360360208110156102e257600080fd5b5035610665565b005b6102e96004803603604081101561030157600080fd5b50803590602001356001600160a01b0316610b60565b6103346004803603602081101561032d57600080fd5b5035610bcc565b604080519115158252519081900360200190f35b6102456004803603604081101561035e57600080fd5b50803590602001356001600160a01b0316610df8565b6102e96004803603604081101561038a57600080fd5b50803590602001356001600160a01b0316610e24565b6102e9600480360360608110156103b657600080fd5b5080359060208101359060400135610e85565b610245600480360360208110156103df57600080fd5b50356001600160a01b0316610fe0565b6102e96004803603602081101561040557600080fd5b503561111c565b6102e9611359565b6102e96004803603602081101561042a57600080fd5b5035611379565b6102456115b9565b61045c6004803603604081101561044f57600080fd5b50803590602001356115cb565b604080516001600160a01b039092168252519081900360200190f35b6103346004803603604081101561048e57600080fd5b50803590602001356001600160a01b03166115ea565b610245611602565b61045c611607565b6102e9600480360360208110156104ca57600080fd5b5035611616565b6102e9600480360360208110156104e757600080fd5b503561196e565b6102456004803603602081101561050457600080fd5b5035611b7f565b6102e96004803603604081101561052157600080fd5b50803590602001356001600160a01b0316611b96565b61045c611bef565b610245611bfe565b6102456004803603602081101561055d57600080fd5b50356001600160a01b0316611c04565b610245611c16565b6102e96004803603604081101561058b57600080fd5b506001600160a01b0381351690602001351515611c1b565b610245611c6c565b6007602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949560ff80861696610100909604169488565b60045490565b60008281526007602081815260408084206001600160a01b038616855290920190529020545b92915050565b6008602052816000526040600020818154811061063857fe5b90600052602060002001600091509150505481565b6000818152602081905260409020600201545b919050565b600260015414156106bd576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556106ca611c87565b60006106d4611d88565b600254604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561072557600080fd5b505afa158015610739573d6000803e3d6000fd5b505050506040513d602081101561074f57600080fd5b505160045490915060009061077190839061076b908790611d8c565b90611de5565b6001600160a01b0384166000908152600560205260409020549091506107979082611e4c565b6001600160a01b0384166000908152600560205260409020556004546107bd9082611e4c565b6004556107cb836000611ea9565b6001600160a01b0383166000908152600860205260408120905b8154811015610a885760006007600084848154811061080057fe5b6000918252602080832090910154835282810193909352604091820181206001600160a01b038a1682526008810190935220549091501561094d57600681015460009061084d9089611e4c565b6001600160a01b038816600090815260088401602052604081205491925090610876908a611e4c565b600684018390556001600160a01b03891660008181526008860160209081526040808320859055875460058901548251958652928501528381019290925260608301849052608083015260a0820185905251919250600080516020612488833981519152919081900360c00190a18061094a578454859060001981019081106108fb57fe5b906000526020600020015485858154811061091257fe5b90600052602060002001819055508480548061092a57fe5b600190038181906000526020600020016000905590558380600190039450505b50505b6001600160a01b038616600090815260078201602052604090205415610a7f57600581015460009061097f9089611ffe565b6001600160a01b0388166000908152600784016020526040812054919250906109a8908a611ffe565b600584018390556001600160a01b038916600081815260078601602090815260408083208590558754600689015482519586529285015283810185905260608401929092526080830186905260a083015251919250600080516020612488833981519152919081900360c00190a180610a7c57845485906000198101908110610a2d57fe5b9060005260206000200154858581548110610a4457fe5b906000526020600020018190555084805480610a5c57fe5b600190038181906000526020600020016000905590558380600190039450505b50505b506001016107e5565b506002546040805163e4b797c160e01b81523060048201526001600160a01b038781166024830152604482018990529151919092169163e4b797c191606480830192600092919082900301818387803b158015610ae457600080fd5b505af1158015610af8573d6000803e3d6000fd5b5050506001600160a01b0385166000818152600560209081526040918290205460045483519485529184015282820152517f37c6ed19ee3d6e6751900141d82396dacc73573ffc80353065d0cfce731864fc92509081900360600190a1505060018055505050565b600082815260208190526040902060020154610b8390610b7e611d88565b6115ea565b610bbe5760405162461bcd60e51b815260040180806020018281038252602f81526020018061231e602f913960400191505060405180910390fd5b610bc88282612058565b5050565b60008181526007602052604081206004810154610c26576040805162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b42816004015410610c77576040805162461bcd60e51b8152602060048201526016602482015275159bdd19481a185cc81b9bdd081e595d08195b99195960521b604482015290519081900360640190fd5b600181015460ff16158015610c9657506001810154610100900460ff16155b610ce7576040805162461bcd60e51b815260206004820152601960248201527f566f74652068617320616c7265616479207265736f6c76656400000000000000604482015290519081900360640190fd5b8060020154816005015410158015610d06575080600601548160050154115b15610d81576001818101805460ff1916821790556005820154600683015460028401546040805188815260208101959095528481019390935260608401919091526080830152517fee894caf226378836d9dc7b2254746d6e66a05ad334e0629fddcc788ae9147cd9181900360a00190a16001915050610660565b60018101805461ff00191661010017905560058101546006820154600283015460408051878152600060208201528082019490945260608401929092526080830152517fee894caf226378836d9dc7b2254746d6e66a05ad334e0629fddcc788ae9147cd9181900360a00190a16000915050610660565b60008281526007602090815260408083206001600160a01b038516845260080190915290205492915050565b610e2c611d88565b6001600160a01b0316816001600160a01b031614610e7b5760405162461bcd60e51b815260040180806020018281038252602f815260200180612459602f913960400191505060405180910390fd5b610bc882826120c1565b610e9f600080516020612439833981519152610b7e611d88565b610eda5760405162461bcd60e51b815260040180806020018281038252602381526020018061234d6023913960400191505060405180910390fd5b428211610f185760405162461bcd60e51b81526004018080602001828103825260218152602001806123706021913960400191505060405180910390fd5b818111610f565760405162461bcd60e51b81526004018080602001828103825260268152602001806123f26026913960400191505060405180910390fd5b600654610f64906001611ffe565b6006819055600081815260076020908152604091829020838155600281018790556003810186905560048101859055825193845290830186905282820185905260608301849052905190917fafbd5d299242bf861d198949ad835672e2e35b2e1838cee606a0b5aec2b4fa42919081900360800190a150505050565b600060045460001415610ff557506000610660565b60048054600254600354604080516370a0823160e01b81526001600160a01b0392831695810195909552516106199461076b936110fd9316916370a0823191602480820192602092909190829003018186803b15801561105457600080fd5b505afa158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b5051600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156110cb57600080fd5b505afa1580156110df573d6000803e3d6000fd5b505050506040513d60208110156110f557600080fd5b505190611ffe565b6001600160a01b03861660009081526005602052604090205490611d8c565b6000818152600760205260409020600381015415801590611141575042816003015411155b61118d576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481a185cc81b9bdd081e595d081cdd185c9d195960421b604482015290519081900360640190fd5b42816004015410156111d7576040805162461bcd60e51b815260206004820152600e60248201526d159bdd19481a185cc8195b99195960921b604482015290519081900360640190fd5b60006111e1611d88565b6001600160a01b038116600090815260088401602052604090205490915015611249576040805162461bcd60e51b81526020600482015260156024820152746e6f742079657420766f746564206f6e207468697360581b604482015290519081900360640190fd5b600061125482610fe0565b60068401549091506112669082611ffe565b60068401556001600160a01b0382166000908152600884016020908152604080832084905560078601909152902054156112e4576001600160a01b038216600090815260078401602052604090205460058401546112c391611e4c565b60058401556001600160a01b03821660009081526007840160205260408120555b6112ee8285611ea9565b6001600160a01b03821660008181526008850160209081526040808320546005880154600689015483519687529386018a9052858301949094526060850152608084019290925260a0830152516000805160206124888339815191529181900360c00190a150505050565b600061136b611366611d88565b610fe0565b905061137681610665565b50565b600081815260076020526040902060038101541580159061139e575042816003015411155b6113ea576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481a185cc81b9bdd081e595d081cdd185c9d195960421b604482015290519081900360640190fd5b4281600401541015611434576040805162461bcd60e51b815260206004820152600e60248201526d159bdd19481a185cc8195b99195960921b604482015290519081900360640190fd5b600061143e611d88565b6001600160a01b0381166000908152600784016020526040902054909150156114a6576040805162461bcd60e51b81526020600482015260156024820152746e6f742079657420766f746564206f6e207468697360581b604482015290519081900360640190fd5b60006114b182610fe0565b60058401549091506114c39082611ffe565b60058401556001600160a01b038216600090815260078401602090815260408083208490556008860190915290205415611541576001600160a01b0382166000908152600884016020526040902054600684015461152091611e4c565b60068401556001600160a01b03821660009081526008840160205260408120555b61154b8285611ea9565b6001600160a01b03821660008181526007850160209081526040808320546005880154600689015483519687529386018a9052858301919091526060850193909352608084019290925260a0830152516000805160206124888339815191529181900360c00190a150505050565b60008051602061243983398151915281565b60008281526020819052604081206115e3908361212a565b9392505050565b60008281526020819052604081206115e39083612136565b600081565b6002546001600160a01b031681565b61161e611c87565b6000611628611d88565b600254604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561167957600080fd5b505afa15801561168d573d6000803e3d6000fd5b505050506040513d60208110156116a357600080fd5b50516004549091506000906116e3576116bc8483611ffe565b6001600160a01b03841660009081526005602052604090208190556004819055905061174c565b6116fc8261076b60045487611d8c90919063ffffffff16565b6001600160a01b0384166000908152600560205260409020549091506117229082611ffe565b6001600160a01b0384166000908152600560205260409020556004546117489082611ffe565b6004555b611757836000611ea9565b6001600160a01b0383166000908152600860205260408120905b815481101561189a5760006007600084848154811061178c57fe5b6000918252602080832090910154835282810193909352604091820181206001600160a01b038a1682526008810190935220549091501561181c5760068101546117d69088611ffe565b60068201556001600160a01b03861660009081526008820160205260409020546118009088611ffe565b6001600160a01b03871660009081526008830160205260409020555b6001600160a01b03861660009081526007820160205260409020541561189157600581015461184b9088611ffe565b60058201556001600160a01b03861660009081526007820160205260409020546118759088611ffe565b6001600160a01b03871660009081526007830160205260409020555b50600101611771565b506002546040805163e4b797c160e01b81526001600160a01b038781166004830152306024830152604482018990529151919092169163e4b797c191606480830192600092919082900301818387803b1580156118f657600080fd5b505af115801561190a573d6000803e3d6000fd5b5050506001600160a01b0385166000818152600560209081526040918290205460045483519485529184015282820152517f37c6ed19ee3d6e6751900141d82396dacc73573ffc80353065d0cfce731864fc92509081900360600190a15050505050565b6000818152600760205260409020600381015415801590611993575042816003015411155b6119df576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481a185cc81b9bdd081e595d081cdd185c9d195960421b604482015290519081900360640190fd5b4281600401541015611a29576040805162461bcd60e51b815260206004820152600e60248201526d159bdd19481a185cc8195b99195960921b604482015290519081900360640190fd5b6000611a33611d88565b90506000611a4082610fe0565b6001600160a01b038316600090815260078501602052604090205490915015611aad576001600160a01b03821660009081526007840160205260409020546005840154611a8c91611e4c565b60058401556001600160a01b03821660009081526007840160205260408120555b6001600160a01b038216600090815260088401602052604090205415611b17576001600160a01b03821660009081526008840160205260409020546006840154611af691611e4c565b60068401556001600160a01b03821660009081526008840160205260408120555b611b22826000611ea9565b60058301546006840154604080516001600160a01b03861681526020810188905260008183018190526060820152608081019390935260a0830191909152516000805160206124888339815191529181900360c00190a150505050565b60008181526020819052604081206106199061214b565b600082815260208190526040902060020154611bb490610b7e611d88565b610e7b5760405162461bcd60e51b81526004018080602001828103825260308152602001806123916030913960400191505060405180910390fd5b6003546001600160a01b031681565b60065481565b60056020526000908152604090205481565b600a81565b611c286000610b7e611d88565b611c3157600080fd5b8015611c5457611c4f60008051602061243983398151915283610b60565b610bc8565b610bc860008051602061243983398151915283611b96565b60045481565b60006115e3836001600160a01b038416612156565b600254600354604080516370a0823160e01b81526001600160a01b039283166004820152905160009392909216916370a0823191602480820192602092909190829003018186803b158015611cdb57600080fd5b505afa158015611cef573d6000803e3d6000fd5b505050506040513d6020811015611d0557600080fd5b505190508015611376576002546003546040805163e4b797c160e01b81526001600160a01b039283166004820152306024820152604481018590529051919092169163e4b797c191606480830192600092919082900301818387803b158015611d6d57600080fd5b505af1158015611d81573d6000803e3d6000fd5b5050505050565b3390565b600082611d9b57506000610619565b82820282848281611da857fe5b04146115e35760405162461bcd60e51b81526004018080602001828103825260218152602001806124186021913960400191505060405180910390fd5b6000808211611e3b576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611e4457fe5b049392505050565b600082821115611ea3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b038216600090815260086020526040812090805b8254811015611f8e5783838281548110611eda57fe5b90600052602060002001541415611ef45760019150611f86565b4260076000858481548110611f0557fe5b90600052602060002001548152602001908152602001600020600401541015611f8657825483906000198101908110611f3a57fe5b9060005260206000200154838281548110611f5157fe5b906000526020600020018190555082805480611f6957fe5b600082815260208120820160001990810191909155908101909155015b600101611ec4565b50600083118015611f9d575080155b15611ff8578154600a11611fe25760405162461bcd60e51b81526004018080602001828103825260318152602001806123c16031913960400191505060405180910390fd5b8154600181018355600083815260209020018390555b50505050565b6000828201838110156115e3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008281526020819052604090206120709082611c72565b15610bc85761207d611d88565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206120d990826121a0565b15610bc8576120e6611d88565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60006115e383836121b5565b60006115e3836001600160a01b038416612219565b600061061982612231565b60006121628383612219565b61219857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610619565b506000610619565b60006115e3836001600160a01b038416612235565b815460009082106121f75760405162461bcd60e51b81526004018080602001828103825260228152602001806122fc6022913960400191505060405180910390fd5b82600001828154811061220657fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156122f1578354600019808301919081019060009087908390811061226857fe5b906000526020600020015490508087600001848154811061228557fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806122b557fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610619565b600091505061061956fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7473656e646572206d75737420626520616e20617070726f7665642070726f706f73657253746172742074696d65206d757374206265206c61746572207468616e206e6f77416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65796f752063616e206f6e6c7920686176652031302061637469766520766f74657320617420616e79206f6e652074696d65456e642074696d65206d757374206265206c61746572207468616e2073746172742074696d65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66b2446122d14dd123b9d55c7387bf74e9761a6f64b26a724c7f871ad74139c356a2646970667358221220c2b1ac17ab3f58539c0903bfd1bb991d3e745f8394757d8f6f73521f44026a4a64736f6c6343000703003300000000000000000000000051869836681bce74a514625c856afb697a01379700000000000000000000000050e42a476631172d1d8a8411a8cfa9c9cdc913b3
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638f61f4f511610104578063ca15c873116100a2578063e490e69911610071578063e490e69914610547578063e64888bb1461056d578063e9ed9b6414610575578063f5f3d4f7146105a3576101da565b8063ca15c873146104ee578063d547741f1461050b578063d74db6e114610537578063da35c6641461053f576101da565b8063a217fddf116100de578063a217fddf146104a4578063a7f0b3de146104ac578063b6b55f25146104b4578063c1f0fb9f146104d1576101da565b80638f61f4f5146104315780639010d07c1461043957806391d1485414610478576101da565b806330f4ccac1161017c57806370a082311161014b57806370a08231146103c9578063750e443a146103ef578063853828b61461040c57806386a5053514610414576101da565b806330f4ccac14610317578063331023ac1461034857806336568abe1461037457806340376d56146103a0576101da565b80632337f7b6116101b85780632337f7b614610283578063248a9ca3146102af5780632e1a7d4d146102cc5780632f2ff15d146102eb576101da565b8063013cf08b146101df57806318160ddd1461023d57806322d2b3ab14610257575b600080fd5b6101fc600480360360208110156101f557600080fd5b50356105ab565b604080519889529615156020890152941515878701526060870193909352608086019190915260a085015260c084015260e083015251908190036101000190f35b6102456105ed565b60408051918252519081900360200190f35b6102456004803603604081101561026d57600080fd5b50803590602001356001600160a01b03166105f3565b6102456004803603604081101561029957600080fd5b506001600160a01b03813516906020013561061f565b610245600480360360208110156102c557600080fd5b503561064d565b6102e9600480360360208110156102e257600080fd5b5035610665565b005b6102e96004803603604081101561030157600080fd5b50803590602001356001600160a01b0316610b60565b6103346004803603602081101561032d57600080fd5b5035610bcc565b604080519115158252519081900360200190f35b6102456004803603604081101561035e57600080fd5b50803590602001356001600160a01b0316610df8565b6102e96004803603604081101561038a57600080fd5b50803590602001356001600160a01b0316610e24565b6102e9600480360360608110156103b657600080fd5b5080359060208101359060400135610e85565b610245600480360360208110156103df57600080fd5b50356001600160a01b0316610fe0565b6102e96004803603602081101561040557600080fd5b503561111c565b6102e9611359565b6102e96004803603602081101561042a57600080fd5b5035611379565b6102456115b9565b61045c6004803603604081101561044f57600080fd5b50803590602001356115cb565b604080516001600160a01b039092168252519081900360200190f35b6103346004803603604081101561048e57600080fd5b50803590602001356001600160a01b03166115ea565b610245611602565b61045c611607565b6102e9600480360360208110156104ca57600080fd5b5035611616565b6102e9600480360360208110156104e757600080fd5b503561196e565b6102456004803603602081101561050457600080fd5b5035611b7f565b6102e96004803603604081101561052157600080fd5b50803590602001356001600160a01b0316611b96565b61045c611bef565b610245611bfe565b6102456004803603602081101561055d57600080fd5b50356001600160a01b0316611c04565b610245611c16565b6102e96004803603604081101561058b57600080fd5b506001600160a01b0381351690602001351515611c1b565b610245611c6c565b6007602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949560ff80861696610100909604169488565b60045490565b60008281526007602081815260408084206001600160a01b038616855290920190529020545b92915050565b6008602052816000526040600020818154811061063857fe5b90600052602060002001600091509150505481565b6000818152602081905260409020600201545b919050565b600260015414156106bd576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556106ca611c87565b60006106d4611d88565b600254604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561072557600080fd5b505afa158015610739573d6000803e3d6000fd5b505050506040513d602081101561074f57600080fd5b505160045490915060009061077190839061076b908790611d8c565b90611de5565b6001600160a01b0384166000908152600560205260409020549091506107979082611e4c565b6001600160a01b0384166000908152600560205260409020556004546107bd9082611e4c565b6004556107cb836000611ea9565b6001600160a01b0383166000908152600860205260408120905b8154811015610a885760006007600084848154811061080057fe5b6000918252602080832090910154835282810193909352604091820181206001600160a01b038a1682526008810190935220549091501561094d57600681015460009061084d9089611e4c565b6001600160a01b038816600090815260088401602052604081205491925090610876908a611e4c565b600684018390556001600160a01b03891660008181526008860160209081526040808320859055875460058901548251958652928501528381019290925260608301849052608083015260a0820185905251919250600080516020612488833981519152919081900360c00190a18061094a578454859060001981019081106108fb57fe5b906000526020600020015485858154811061091257fe5b90600052602060002001819055508480548061092a57fe5b600190038181906000526020600020016000905590558380600190039450505b50505b6001600160a01b038616600090815260078201602052604090205415610a7f57600581015460009061097f9089611ffe565b6001600160a01b0388166000908152600784016020526040812054919250906109a8908a611ffe565b600584018390556001600160a01b038916600081815260078601602090815260408083208590558754600689015482519586529285015283810185905260608401929092526080830186905260a083015251919250600080516020612488833981519152919081900360c00190a180610a7c57845485906000198101908110610a2d57fe5b9060005260206000200154858581548110610a4457fe5b906000526020600020018190555084805480610a5c57fe5b600190038181906000526020600020016000905590558380600190039450505b50505b506001016107e5565b506002546040805163e4b797c160e01b81523060048201526001600160a01b038781166024830152604482018990529151919092169163e4b797c191606480830192600092919082900301818387803b158015610ae457600080fd5b505af1158015610af8573d6000803e3d6000fd5b5050506001600160a01b0385166000818152600560209081526040918290205460045483519485529184015282820152517f37c6ed19ee3d6e6751900141d82396dacc73573ffc80353065d0cfce731864fc92509081900360600190a1505060018055505050565b600082815260208190526040902060020154610b8390610b7e611d88565b6115ea565b610bbe5760405162461bcd60e51b815260040180806020018281038252602f81526020018061231e602f913960400191505060405180910390fd5b610bc88282612058565b5050565b60008181526007602052604081206004810154610c26576040805162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b42816004015410610c77576040805162461bcd60e51b8152602060048201526016602482015275159bdd19481a185cc81b9bdd081e595d08195b99195960521b604482015290519081900360640190fd5b600181015460ff16158015610c9657506001810154610100900460ff16155b610ce7576040805162461bcd60e51b815260206004820152601960248201527f566f74652068617320616c7265616479207265736f6c76656400000000000000604482015290519081900360640190fd5b8060020154816005015410158015610d06575080600601548160050154115b15610d81576001818101805460ff1916821790556005820154600683015460028401546040805188815260208101959095528481019390935260608401919091526080830152517fee894caf226378836d9dc7b2254746d6e66a05ad334e0629fddcc788ae9147cd9181900360a00190a16001915050610660565b60018101805461ff00191661010017905560058101546006820154600283015460408051878152600060208201528082019490945260608401929092526080830152517fee894caf226378836d9dc7b2254746d6e66a05ad334e0629fddcc788ae9147cd9181900360a00190a16000915050610660565b60008281526007602090815260408083206001600160a01b038516845260080190915290205492915050565b610e2c611d88565b6001600160a01b0316816001600160a01b031614610e7b5760405162461bcd60e51b815260040180806020018281038252602f815260200180612459602f913960400191505060405180910390fd5b610bc882826120c1565b610e9f600080516020612439833981519152610b7e611d88565b610eda5760405162461bcd60e51b815260040180806020018281038252602381526020018061234d6023913960400191505060405180910390fd5b428211610f185760405162461bcd60e51b81526004018080602001828103825260218152602001806123706021913960400191505060405180910390fd5b818111610f565760405162461bcd60e51b81526004018080602001828103825260268152602001806123f26026913960400191505060405180910390fd5b600654610f64906001611ffe565b6006819055600081815260076020908152604091829020838155600281018790556003810186905560048101859055825193845290830186905282820185905260608301849052905190917fafbd5d299242bf861d198949ad835672e2e35b2e1838cee606a0b5aec2b4fa42919081900360800190a150505050565b600060045460001415610ff557506000610660565b60048054600254600354604080516370a0823160e01b81526001600160a01b0392831695810195909552516106199461076b936110fd9316916370a0823191602480820192602092909190829003018186803b15801561105457600080fd5b505afa158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b5051600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156110cb57600080fd5b505afa1580156110df573d6000803e3d6000fd5b505050506040513d60208110156110f557600080fd5b505190611ffe565b6001600160a01b03861660009081526005602052604090205490611d8c565b6000818152600760205260409020600381015415801590611141575042816003015411155b61118d576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481a185cc81b9bdd081e595d081cdd185c9d195960421b604482015290519081900360640190fd5b42816004015410156111d7576040805162461bcd60e51b815260206004820152600e60248201526d159bdd19481a185cc8195b99195960921b604482015290519081900360640190fd5b60006111e1611d88565b6001600160a01b038116600090815260088401602052604090205490915015611249576040805162461bcd60e51b81526020600482015260156024820152746e6f742079657420766f746564206f6e207468697360581b604482015290519081900360640190fd5b600061125482610fe0565b60068401549091506112669082611ffe565b60068401556001600160a01b0382166000908152600884016020908152604080832084905560078601909152902054156112e4576001600160a01b038216600090815260078401602052604090205460058401546112c391611e4c565b60058401556001600160a01b03821660009081526007840160205260408120555b6112ee8285611ea9565b6001600160a01b03821660008181526008850160209081526040808320546005880154600689015483519687529386018a9052858301949094526060850152608084019290925260a0830152516000805160206124888339815191529181900360c00190a150505050565b600061136b611366611d88565b610fe0565b905061137681610665565b50565b600081815260076020526040902060038101541580159061139e575042816003015411155b6113ea576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481a185cc81b9bdd081e595d081cdd185c9d195960421b604482015290519081900360640190fd5b4281600401541015611434576040805162461bcd60e51b815260206004820152600e60248201526d159bdd19481a185cc8195b99195960921b604482015290519081900360640190fd5b600061143e611d88565b6001600160a01b0381166000908152600784016020526040902054909150156114a6576040805162461bcd60e51b81526020600482015260156024820152746e6f742079657420766f746564206f6e207468697360581b604482015290519081900360640190fd5b60006114b182610fe0565b60058401549091506114c39082611ffe565b60058401556001600160a01b038216600090815260078401602090815260408083208490556008860190915290205415611541576001600160a01b0382166000908152600884016020526040902054600684015461152091611e4c565b60068401556001600160a01b03821660009081526008840160205260408120555b61154b8285611ea9565b6001600160a01b03821660008181526007850160209081526040808320546005880154600689015483519687529386018a9052858301919091526060850193909352608084019290925260a0830152516000805160206124888339815191529181900360c00190a150505050565b60008051602061243983398151915281565b60008281526020819052604081206115e3908361212a565b9392505050565b60008281526020819052604081206115e39083612136565b600081565b6002546001600160a01b031681565b61161e611c87565b6000611628611d88565b600254604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561167957600080fd5b505afa15801561168d573d6000803e3d6000fd5b505050506040513d60208110156116a357600080fd5b50516004549091506000906116e3576116bc8483611ffe565b6001600160a01b03841660009081526005602052604090208190556004819055905061174c565b6116fc8261076b60045487611d8c90919063ffffffff16565b6001600160a01b0384166000908152600560205260409020549091506117229082611ffe565b6001600160a01b0384166000908152600560205260409020556004546117489082611ffe565b6004555b611757836000611ea9565b6001600160a01b0383166000908152600860205260408120905b815481101561189a5760006007600084848154811061178c57fe5b6000918252602080832090910154835282810193909352604091820181206001600160a01b038a1682526008810190935220549091501561181c5760068101546117d69088611ffe565b60068201556001600160a01b03861660009081526008820160205260409020546118009088611ffe565b6001600160a01b03871660009081526008830160205260409020555b6001600160a01b03861660009081526007820160205260409020541561189157600581015461184b9088611ffe565b60058201556001600160a01b03861660009081526007820160205260409020546118759088611ffe565b6001600160a01b03871660009081526007830160205260409020555b50600101611771565b506002546040805163e4b797c160e01b81526001600160a01b038781166004830152306024830152604482018990529151919092169163e4b797c191606480830192600092919082900301818387803b1580156118f657600080fd5b505af115801561190a573d6000803e3d6000fd5b5050506001600160a01b0385166000818152600560209081526040918290205460045483519485529184015282820152517f37c6ed19ee3d6e6751900141d82396dacc73573ffc80353065d0cfce731864fc92509081900360600190a15050505050565b6000818152600760205260409020600381015415801590611993575042816003015411155b6119df576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481a185cc81b9bdd081e595d081cdd185c9d195960421b604482015290519081900360640190fd5b4281600401541015611a29576040805162461bcd60e51b815260206004820152600e60248201526d159bdd19481a185cc8195b99195960921b604482015290519081900360640190fd5b6000611a33611d88565b90506000611a4082610fe0565b6001600160a01b038316600090815260078501602052604090205490915015611aad576001600160a01b03821660009081526007840160205260409020546005840154611a8c91611e4c565b60058401556001600160a01b03821660009081526007840160205260408120555b6001600160a01b038216600090815260088401602052604090205415611b17576001600160a01b03821660009081526008840160205260409020546006840154611af691611e4c565b60068401556001600160a01b03821660009081526008840160205260408120555b611b22826000611ea9565b60058301546006840154604080516001600160a01b03861681526020810188905260008183018190526060820152608081019390935260a0830191909152516000805160206124888339815191529181900360c00190a150505050565b60008181526020819052604081206106199061214b565b600082815260208190526040902060020154611bb490610b7e611d88565b610e7b5760405162461bcd60e51b81526004018080602001828103825260308152602001806123916030913960400191505060405180910390fd5b6003546001600160a01b031681565b60065481565b60056020526000908152604090205481565b600a81565b611c286000610b7e611d88565b611c3157600080fd5b8015611c5457611c4f60008051602061243983398151915283610b60565b610bc8565b610bc860008051602061243983398151915283611b96565b60045481565b60006115e3836001600160a01b038416612156565b600254600354604080516370a0823160e01b81526001600160a01b039283166004820152905160009392909216916370a0823191602480820192602092909190829003018186803b158015611cdb57600080fd5b505afa158015611cef573d6000803e3d6000fd5b505050506040513d6020811015611d0557600080fd5b505190508015611376576002546003546040805163e4b797c160e01b81526001600160a01b039283166004820152306024820152604481018590529051919092169163e4b797c191606480830192600092919082900301818387803b158015611d6d57600080fd5b505af1158015611d81573d6000803e3d6000fd5b5050505050565b3390565b600082611d9b57506000610619565b82820282848281611da857fe5b04146115e35760405162461bcd60e51b81526004018080602001828103825260218152602001806124186021913960400191505060405180910390fd5b6000808211611e3b576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611e4457fe5b049392505050565b600082821115611ea3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b038216600090815260086020526040812090805b8254811015611f8e5783838281548110611eda57fe5b90600052602060002001541415611ef45760019150611f86565b4260076000858481548110611f0557fe5b90600052602060002001548152602001908152602001600020600401541015611f8657825483906000198101908110611f3a57fe5b9060005260206000200154838281548110611f5157fe5b906000526020600020018190555082805480611f6957fe5b600082815260208120820160001990810191909155908101909155015b600101611ec4565b50600083118015611f9d575080155b15611ff8578154600a11611fe25760405162461bcd60e51b81526004018080602001828103825260318152602001806123c16031913960400191505060405180910390fd5b8154600181018355600083815260209020018390555b50505050565b6000828201838110156115e3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008281526020819052604090206120709082611c72565b15610bc85761207d611d88565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206120d990826121a0565b15610bc8576120e6611d88565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60006115e383836121b5565b60006115e3836001600160a01b038416612219565b600061061982612231565b60006121628383612219565b61219857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610619565b506000610619565b60006115e3836001600160a01b038416612235565b815460009082106121f75760405162461bcd60e51b81526004018080602001828103825260228152602001806122fc6022913960400191505060405180910390fd5b82600001828154811061220657fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156122f1578354600019808301919081019060009087908390811061226857fe5b906000526020600020015490508087600001848154811061228557fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806122b557fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610619565b600091505061061956fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7473656e646572206d75737420626520616e20617070726f7665642070726f706f73657253746172742074696d65206d757374206265206c61746572207468616e206e6f77416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65796f752063616e206f6e6c7920686176652031302061637469766520766f74657320617420616e79206f6e652074696d65456e642074696d65206d757374206265206c61746572207468616e2073746172742074696d65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66b2446122d14dd123b9d55c7387bf74e9761a6f64b26a724c7f871ad74139c356a2646970667358221220c2b1ac17ab3f58539c0903bfd1bb991d3e745f8394757d8f6f73521f44026a4a64736f6c63430007030033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000051869836681bce74a514625c856afb697a01379700000000000000000000000050e42a476631172d1d8a8411a8cfa9c9cdc913b3
-----Decoded View---------------
Arg [0] : genesis_ (address): 0x51869836681BcE74a514625c856aFb697a013797
Arg [1] : oldGov_ (address): 0x50E42A476631172D1D8a8411A8cFa9C9CDC913b3
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000051869836681bce74a514625c856afb697a013797
Arg [1] : 00000000000000000000000050e42a476631172d1d8a8411a8cfa9c9cdc913b3
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.