Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 154,594 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Vote For App | 527882 | 5 secs ago | IN | 0 ETH | 0.00000456 | ||||
Vote For App | 527878 | 9 secs ago | IN | 0 ETH | 0.00000457 | ||||
Vote For App | 527878 | 9 secs ago | IN | 0 ETH | 0.00000515 | ||||
Vote For App | 527877 | 10 secs ago | IN | 0 ETH | 0.00000456 | ||||
Vote For App | 527875 | 12 secs ago | IN | 0 ETH | 0.00000515 | ||||
Vote For App | 527872 | 15 secs ago | IN | 0 ETH | 0.00000399 | ||||
Vote For App | 527870 | 17 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527866 | 21 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527865 | 22 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527863 | 24 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527859 | 28 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527859 | 28 secs ago | IN | 0 ETH | 0.00000545 | ||||
Vote For App | 527858 | 29 secs ago | IN | 0 ETH | 0.00000545 | ||||
Vote For App | 527857 | 30 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527857 | 30 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527852 | 35 secs ago | IN | 0 ETH | 0.00000708 | ||||
Vote For App | 527852 | 35 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527851 | 36 secs ago | IN | 0 ETH | 0.00000891 | ||||
Vote For App | 527849 | 38 secs ago | IN | 0 ETH | 0.00000457 | ||||
Vote For App | 527848 | 39 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527848 | 39 secs ago | IN | 0 ETH | 0.00000708 | ||||
Vote For App | 527847 | 40 secs ago | IN | 0 ETH | 0.00000789 | ||||
Vote For App | 527847 | 40 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527845 | 42 secs ago | IN | 0 ETH | 0.00000517 | ||||
Vote For App | 527844 | 43 secs ago | IN | 0 ETH | 0.00000456 |
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
203103 | 6 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
AbstractVoting
Compiler Version
v0.8.26+commit.8a97fa7a
ZkSolc Version
v1.5.7
Optimization Enabled:
Yes with Mode 3
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.26; import {IVoteGovernor} from "./interfaces/IVoteGovernor.sol"; import {IAppRegistry} from "./interfaces/IAppRegistry.sol"; import {OwnableRoles} from "@solady-0.0.232/src/auth/OwnableRoles.sol"; import {EnumerableSetLib} from "@solady-0.0.232/src/utils/EnumerableSetLib.sol"; contract AbstractVoting is OwnableRoles { using EnumerableSetLib for EnumerableSetLib.Uint256Set; struct Schedule { uint40 startTime; uint40 epochDuration; uint40 epochsCompleted; uint96 voteCost; } error InvalidValue(); error InvalidSchedule(); error VotingNotActive(); error AppNotActive(); error AlreadyVotedFor(uint256 appId); error UsedAllVotes(); error WithdrawFailed(); event ScheduleInitialized(uint256 startTime, uint256 epochDuration, uint256 epochsCompleted); event Voted(address indexed voter, uint256 indexed appId, uint256 indexed epoch); event VoteGovernorUpdated(address indexed newGovernor); event AppRegistryUpdated(address indexed newAppRegistry); uint256 public constant MANAGER_ROLE = _ROLE_0; IAppRegistry public appRegistry; IVoteGovernor public voteGovernor; Schedule public currentSchedule; Schedule public nextSchedule; mapping(uint256 epochId => mapping(uint256 appId => uint256 votes)) private appVotesByEpoch; mapping(address user => mapping(uint256 epochId => EnumerableSetLib.Uint256Set)) private userVotes; mapping(address user => uint256) public userVoteSpend; constructor(address owner, IAppRegistry _appRegistry, IVoteGovernor _voteGovernor) { _initializeOwner(owner); _grantRoles(owner, MANAGER_ROLE); appRegistry = _appRegistry; voteGovernor = _voteGovernor; emit VoteGovernorUpdated(address(_voteGovernor)); } function voteForApp(uint256 appId) external payable { Schedule memory schedule = _getActiveSchedule(); if (msg.value != schedule.voteCost) { revert InvalidValue(); } uint256 epoch = _getCurrentEpoch(schedule); if (epoch == 0) { revert VotingNotActive(); } if (!appRegistry.appEnabled(appId)) { revert AppNotActive(); } EnumerableSetLib.Uint256Set storage userVotedApps = userVotes[msg.sender][epoch]; if (_remainingVotes(msg.sender, epoch) == 0) { revert UsedAllVotes(); } if (userVotedApps.contains(appId)) { revert AlreadyVotedFor(appId); } unchecked { appVotesByEpoch[epoch][appId] += 1; userVoteSpend[msg.sender] += msg.value; } userVotedApps.add(appId); emit Voted(msg.sender, appId, epoch); } function initializeSchedule(uint40 _startTime, uint40 _epochDuration, uint96 _voteCost) external onlyRolesOrOwner(MANAGER_ROLE) { if (_startTime <= block.timestamp) { revert InvalidSchedule(); } if (_epochDuration == 0) { revert InvalidSchedule(); } // If the next schedule is set and has started, promote it to the current schedule if (nextSchedule.startTime > 0 && block.timestamp >= nextSchedule.startTime) { currentSchedule = nextSchedule; } if (currentSchedule.startTime == 0 || currentSchedule.startTime > block.timestamp) { // No current schedule exists or starts in future, so initialize as current schedule currentSchedule = Schedule(_startTime, _epochDuration, 0, _voteCost); emit ScheduleInitialized(_startTime, _epochDuration, 0); } else { // Get the total elapsed time since the current schedule started uint256 elapsedTime = _startTime - currentSchedule.startTime; // Ensure the new schedule starts at the end of an epoch from the existing schedule if (elapsedTime % currentSchedule.epochDuration != 0) { revert InvalidSchedule(); } // Calculate epochs completed in the current schedule up to the new schedule uint256 completedInCurrentSchedule = elapsedTime / currentSchedule.epochDuration; // Set the next schedule with the correct epochsCompleted carried over nextSchedule = Schedule( _startTime, _epochDuration, uint40(completedInCurrentSchedule + currentSchedule.epochsCompleted), _voteCost ); emit ScheduleInitialized( _startTime, _epochDuration, completedInCurrentSchedule + currentSchedule.epochsCompleted ); } } function setVoteGovernor(address newGovernor) external onlyOwner { voteGovernor = IVoteGovernor(newGovernor); emit VoteGovernorUpdated(newGovernor); } function setAppRegistry(address newAppRegistry) external onlyOwner { appRegistry = IAppRegistry(newAppRegistry); emit AppRegistryUpdated(newAppRegistry); } function withdraw() external onlyOwner { (bool success,) = payable(msg.sender).call{value: address(this).balance}(""); if (!success) { revert WithdrawFailed(); } } function userVotesRemaining(address user) external view returns (uint256) { uint256 epoch = currentEpoch(); if (epoch == 0) { return 0; } return _remainingVotes(user, epoch); } function getVotesForApp(uint256 appId, uint256 epoch) external view returns (uint256) { return appVotesByEpoch[epoch][appId]; } function getUserVotes(address user, uint256 epoch) external view returns (uint256[] memory) { EnumerableSetLib.Uint256Set storage userVotedApps = userVotes[user][epoch]; uint256[] memory votedApps = new uint256[](userVotedApps.length()); for (uint256 i = 0; i < userVotedApps.length(); i++) { votedApps[i] = userVotedApps.at(i); } return votedApps; } function currentEpoch() public view returns (uint256 epoch) { Schedule memory schedule = _getActiveSchedule(); return _getCurrentEpoch(schedule); } function voteCost() external view returns (uint96) { return _getActiveSchedule().voteCost; } function _getCurrentEpoch(Schedule memory schedule) private view returns (uint256) { if (schedule.startTime == 0) { return 0; } if (block.timestamp < schedule.startTime) { return 0; } uint256 epochsInCurrentSchedule = (block.timestamp - schedule.startTime) / schedule.epochDuration; return schedule.epochsCompleted + epochsInCurrentSchedule + 1; } function _getActiveSchedule() private view returns (Schedule memory schedule) { schedule = nextSchedule; if (schedule.startTime == 0 || block.timestamp < schedule.startTime) { return currentSchedule; } } function _remainingVotes(address user, uint256 epoch) private view returns (uint256) { uint256 votesForUser = voteGovernor.votesForUser(user, epoch); uint256 votesUsed = userVotes[user][epoch].length(); if (votesUsed >= votesForUser) { return 0; } else { unchecked { return votesForUser - votesUsed; } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IVoteGovernor { function votesForUser(address user, uint256 epochId) external view returns (uint256 votes); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IAppRegistry { error AppDoesNotExist(); event AppAdded(uint256 indexed appId, string name); event AppStatusUpdated(uint256 indexed appId, bool enabled); event AppRenamed(uint256 indexed appId, string newName); function appCount() external view returns (uint256); function appName(uint256 appId) external view returns (string memory); function appEnabled(uint256 appId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import {Ownable} from "./Ownable.sol"; /// @notice Simple single owner and multiroles authorization mixin. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/OwnableRoles.sol) /// /// @dev Note: /// This implementation does NOT auto-initialize the owner to `msg.sender`. /// You MUST call the `_initializeOwner` in the constructor / initializer. /// /// While the ownable portion follows /// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility, /// the nomenclature for the 2-step ownership handover may be unique to this codebase. abstract contract OwnableRoles is Ownable { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The `user`'s roles is updated to `roles`. /// Each bit of `roles` represents whether the role is set. event RolesUpdated(address indexed user, uint256 indexed roles); /// @dev `keccak256(bytes("RolesUpdated(address,uint256)"))`. uint256 private constant _ROLES_UPDATED_EVENT_SIGNATURE = 0x715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The role slot of `user` is given by: /// ``` /// mstore(0x00, or(shl(96, user), _ROLE_SLOT_SEED)) /// let roleSlot := keccak256(0x00, 0x20) /// ``` /// This automatically ignores the upper bits of the `user` in case /// they are not clean, as well as keep the `keccak256` under 32-bytes. /// /// Note: This is equivalent to `uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))`. uint256 private constant _ROLE_SLOT_SEED = 0x8b78c6d8; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Overwrite the roles directly without authorization guard. function _setRoles(address user, uint256 roles) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x0c, _ROLE_SLOT_SEED) mstore(0x00, user) // Store the new value. sstore(keccak256(0x0c, 0x20), roles) // Emit the {RolesUpdated} event. log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, mload(0x0c)), roles) } } /// @dev Updates the roles directly without authorization guard. /// If `on` is true, each set bit of `roles` will be turned on, /// otherwise, each set bit of `roles` will be turned off. function _updateRoles(address user, uint256 roles, bool on) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x0c, _ROLE_SLOT_SEED) mstore(0x00, user) let roleSlot := keccak256(0x0c, 0x20) // Load the current value. let current := sload(roleSlot) // Compute the updated roles if `on` is true. let updated := or(current, roles) // Compute the updated roles if `on` is false. // Use `and` to compute the intersection of `current` and `roles`, // `xor` it with `current` to flip the bits in the intersection. if iszero(on) { updated := xor(current, and(current, roles)) } // Then, store the new value. sstore(roleSlot, updated) // Emit the {RolesUpdated} event. log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, mload(0x0c)), updated) } } /// @dev Grants the roles directly without authorization guard. /// Each bit of `roles` represents the role to turn on. function _grantRoles(address user, uint256 roles) internal virtual { _updateRoles(user, roles, true); } /// @dev Removes the roles directly without authorization guard. /// Each bit of `roles` represents the role to turn off. function _removeRoles(address user, uint256 roles) internal virtual { _updateRoles(user, roles, false); } /// @dev Throws if the sender does not have any of the `roles`. function _checkRoles(uint256 roles) internal view virtual { /// @solidity memory-safe-assembly assembly { // Compute the role slot. mstore(0x0c, _ROLE_SLOT_SEED) mstore(0x00, caller()) // Load the stored value, and if the `and` intersection // of the value and `roles` is zero, revert. if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) { mstore(0x00, 0x82b42900) // `Unauthorized()`. revert(0x1c, 0x04) } } } /// @dev Throws if the sender is not the owner, /// and does not have any of the `roles`. /// Checks for ownership first, then lazily checks for roles. function _checkOwnerOrRoles(uint256 roles) internal view virtual { /// @solidity memory-safe-assembly assembly { // If the caller is not the stored owner. // Note: `_ROLE_SLOT_SEED` is equal to `_OWNER_SLOT_NOT`. if iszero(eq(caller(), sload(not(_ROLE_SLOT_SEED)))) { // Compute the role slot. mstore(0x0c, _ROLE_SLOT_SEED) mstore(0x00, caller()) // Load the stored value, and if the `and` intersection // of the value and `roles` is zero, revert. if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) { mstore(0x00, 0x82b42900) // `Unauthorized()`. revert(0x1c, 0x04) } } } } /// @dev Throws if the sender does not have any of the `roles`, /// and is not the owner. /// Checks for roles first, then lazily checks for ownership. function _checkRolesOrOwner(uint256 roles) internal view virtual { /// @solidity memory-safe-assembly assembly { // Compute the role slot. mstore(0x0c, _ROLE_SLOT_SEED) mstore(0x00, caller()) // Load the stored value, and if the `and` intersection // of the value and `roles` is zero, revert. if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) { // If the caller is not the stored owner. // Note: `_ROLE_SLOT_SEED` is equal to `_OWNER_SLOT_NOT`. if iszero(eq(caller(), sload(not(_ROLE_SLOT_SEED)))) { mstore(0x00, 0x82b42900) // `Unauthorized()`. revert(0x1c, 0x04) } } } } /// @dev Convenience function to return a `roles` bitmap from an array of `ordinals`. /// This is meant for frontends like Etherscan, and is therefore not fully optimized. /// Not recommended to be called on-chain. /// Made internal to conserve bytecode. Wrap it in a public function if needed. function _rolesFromOrdinals(uint8[] memory ordinals) internal pure returns (uint256 roles) { /// @solidity memory-safe-assembly assembly { for { let i := shl(5, mload(ordinals)) } i { i := sub(i, 0x20) } { // We don't need to mask the values of `ordinals`, as Solidity // cleans dirty upper bits when storing variables into memory. roles := or(shl(mload(add(ordinals, i)), 1), roles) } } } /// @dev Convenience function to return an array of `ordinals` from the `roles` bitmap. /// This is meant for frontends like Etherscan, and is therefore not fully optimized. /// Not recommended to be called on-chain. /// Made internal to conserve bytecode. Wrap it in a public function if needed. function _ordinalsFromRoles(uint256 roles) internal pure returns (uint8[] memory ordinals) { /// @solidity memory-safe-assembly assembly { // Grab the pointer to the free memory. ordinals := mload(0x40) let ptr := add(ordinals, 0x20) let o := 0 // The absence of lookup tables, De Bruijn, etc., here is intentional for // smaller bytecode, as this function is not meant to be called on-chain. for { let t := roles } 1 {} { mstore(ptr, o) // `shr` 5 is equivalent to multiplying by 0x20. // Push back into the ordinals array if the bit is set. ptr := add(ptr, shl(5, and(t, 1))) o := add(o, 1) t := shr(o, roles) if iszero(t) { break } } // Store the length of `ordinals`. mstore(ordinals, shr(5, sub(ptr, add(ordinals, 0x20)))) // Allocate the memory. mstore(0x40, ptr) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC UPDATE FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Allows the owner to grant `user` `roles`. /// If the `user` already has a role, then it will be an no-op for the role. function grantRoles(address user, uint256 roles) public payable virtual onlyOwner { _grantRoles(user, roles); } /// @dev Allows the owner to remove `user` `roles`. /// If the `user` does not have a role, then it will be an no-op for the role. function revokeRoles(address user, uint256 roles) public payable virtual onlyOwner { _removeRoles(user, roles); } /// @dev Allow the caller to remove their own roles. /// If the caller does not have a role, then it will be an no-op for the role. function renounceRoles(uint256 roles) public payable virtual { _removeRoles(msg.sender, roles); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC READ FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the roles of `user`. function rolesOf(address user) public view virtual returns (uint256 roles) { /// @solidity memory-safe-assembly assembly { // Compute the role slot. mstore(0x0c, _ROLE_SLOT_SEED) mstore(0x00, user) // Load the stored value. roles := sload(keccak256(0x0c, 0x20)) } } /// @dev Returns whether `user` has any of `roles`. function hasAnyRole(address user, uint256 roles) public view virtual returns (bool) { return rolesOf(user) & roles != 0; } /// @dev Returns whether `user` has all of `roles`. function hasAllRoles(address user, uint256 roles) public view virtual returns (bool) { return rolesOf(user) & roles == roles; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* MODIFIERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Marks a function as only callable by an account with `roles`. modifier onlyRoles(uint256 roles) virtual { _checkRoles(roles); _; } /// @dev Marks a function as only callable by the owner or by an account /// with `roles`. Checks for ownership first, then lazily checks for roles. modifier onlyOwnerOrRoles(uint256 roles) virtual { _checkOwnerOrRoles(roles); _; } /// @dev Marks a function as only callable by an account with `roles` /// or the owner. Checks for roles first, then lazily checks for ownership. modifier onlyRolesOrOwner(uint256 roles) virtual { _checkRolesOrOwner(roles); _; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ROLE CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // IYKYK uint256 internal constant _ROLE_0 = 1 << 0; uint256 internal constant _ROLE_1 = 1 << 1; uint256 internal constant _ROLE_2 = 1 << 2; uint256 internal constant _ROLE_3 = 1 << 3; uint256 internal constant _ROLE_4 = 1 << 4; uint256 internal constant _ROLE_5 = 1 << 5; uint256 internal constant _ROLE_6 = 1 << 6; uint256 internal constant _ROLE_7 = 1 << 7; uint256 internal constant _ROLE_8 = 1 << 8; uint256 internal constant _ROLE_9 = 1 << 9; uint256 internal constant _ROLE_10 = 1 << 10; uint256 internal constant _ROLE_11 = 1 << 11; uint256 internal constant _ROLE_12 = 1 << 12; uint256 internal constant _ROLE_13 = 1 << 13; uint256 internal constant _ROLE_14 = 1 << 14; uint256 internal constant _ROLE_15 = 1 << 15; uint256 internal constant _ROLE_16 = 1 << 16; uint256 internal constant _ROLE_17 = 1 << 17; uint256 internal constant _ROLE_18 = 1 << 18; uint256 internal constant _ROLE_19 = 1 << 19; uint256 internal constant _ROLE_20 = 1 << 20; uint256 internal constant _ROLE_21 = 1 << 21; uint256 internal constant _ROLE_22 = 1 << 22; uint256 internal constant _ROLE_23 = 1 << 23; uint256 internal constant _ROLE_24 = 1 << 24; uint256 internal constant _ROLE_25 = 1 << 25; uint256 internal constant _ROLE_26 = 1 << 26; uint256 internal constant _ROLE_27 = 1 << 27; uint256 internal constant _ROLE_28 = 1 << 28; uint256 internal constant _ROLE_29 = 1 << 29; uint256 internal constant _ROLE_30 = 1 << 30; uint256 internal constant _ROLE_31 = 1 << 31; uint256 internal constant _ROLE_32 = 1 << 32; uint256 internal constant _ROLE_33 = 1 << 33; uint256 internal constant _ROLE_34 = 1 << 34; uint256 internal constant _ROLE_35 = 1 << 35; uint256 internal constant _ROLE_36 = 1 << 36; uint256 internal constant _ROLE_37 = 1 << 37; uint256 internal constant _ROLE_38 = 1 << 38; uint256 internal constant _ROLE_39 = 1 << 39; uint256 internal constant _ROLE_40 = 1 << 40; uint256 internal constant _ROLE_41 = 1 << 41; uint256 internal constant _ROLE_42 = 1 << 42; uint256 internal constant _ROLE_43 = 1 << 43; uint256 internal constant _ROLE_44 = 1 << 44; uint256 internal constant _ROLE_45 = 1 << 45; uint256 internal constant _ROLE_46 = 1 << 46; uint256 internal constant _ROLE_47 = 1 << 47; uint256 internal constant _ROLE_48 = 1 << 48; uint256 internal constant _ROLE_49 = 1 << 49; uint256 internal constant _ROLE_50 = 1 << 50; uint256 internal constant _ROLE_51 = 1 << 51; uint256 internal constant _ROLE_52 = 1 << 52; uint256 internal constant _ROLE_53 = 1 << 53; uint256 internal constant _ROLE_54 = 1 << 54; uint256 internal constant _ROLE_55 = 1 << 55; uint256 internal constant _ROLE_56 = 1 << 56; uint256 internal constant _ROLE_57 = 1 << 57; uint256 internal constant _ROLE_58 = 1 << 58; uint256 internal constant _ROLE_59 = 1 << 59; uint256 internal constant _ROLE_60 = 1 << 60; uint256 internal constant _ROLE_61 = 1 << 61; uint256 internal constant _ROLE_62 = 1 << 62; uint256 internal constant _ROLE_63 = 1 << 63; uint256 internal constant _ROLE_64 = 1 << 64; uint256 internal constant _ROLE_65 = 1 << 65; uint256 internal constant _ROLE_66 = 1 << 66; uint256 internal constant _ROLE_67 = 1 << 67; uint256 internal constant _ROLE_68 = 1 << 68; uint256 internal constant _ROLE_69 = 1 << 69; uint256 internal constant _ROLE_70 = 1 << 70; uint256 internal constant _ROLE_71 = 1 << 71; uint256 internal constant _ROLE_72 = 1 << 72; uint256 internal constant _ROLE_73 = 1 << 73; uint256 internal constant _ROLE_74 = 1 << 74; uint256 internal constant _ROLE_75 = 1 << 75; uint256 internal constant _ROLE_76 = 1 << 76; uint256 internal constant _ROLE_77 = 1 << 77; uint256 internal constant _ROLE_78 = 1 << 78; uint256 internal constant _ROLE_79 = 1 << 79; uint256 internal constant _ROLE_80 = 1 << 80; uint256 internal constant _ROLE_81 = 1 << 81; uint256 internal constant _ROLE_82 = 1 << 82; uint256 internal constant _ROLE_83 = 1 << 83; uint256 internal constant _ROLE_84 = 1 << 84; uint256 internal constant _ROLE_85 = 1 << 85; uint256 internal constant _ROLE_86 = 1 << 86; uint256 internal constant _ROLE_87 = 1 << 87; uint256 internal constant _ROLE_88 = 1 << 88; uint256 internal constant _ROLE_89 = 1 << 89; uint256 internal constant _ROLE_90 = 1 << 90; uint256 internal constant _ROLE_91 = 1 << 91; uint256 internal constant _ROLE_92 = 1 << 92; uint256 internal constant _ROLE_93 = 1 << 93; uint256 internal constant _ROLE_94 = 1 << 94; uint256 internal constant _ROLE_95 = 1 << 95; uint256 internal constant _ROLE_96 = 1 << 96; uint256 internal constant _ROLE_97 = 1 << 97; uint256 internal constant _ROLE_98 = 1 << 98; uint256 internal constant _ROLE_99 = 1 << 99; uint256 internal constant _ROLE_100 = 1 << 100; uint256 internal constant _ROLE_101 = 1 << 101; uint256 internal constant _ROLE_102 = 1 << 102; uint256 internal constant _ROLE_103 = 1 << 103; uint256 internal constant _ROLE_104 = 1 << 104; uint256 internal constant _ROLE_105 = 1 << 105; uint256 internal constant _ROLE_106 = 1 << 106; uint256 internal constant _ROLE_107 = 1 << 107; uint256 internal constant _ROLE_108 = 1 << 108; uint256 internal constant _ROLE_109 = 1 << 109; uint256 internal constant _ROLE_110 = 1 << 110; uint256 internal constant _ROLE_111 = 1 << 111; uint256 internal constant _ROLE_112 = 1 << 112; uint256 internal constant _ROLE_113 = 1 << 113; uint256 internal constant _ROLE_114 = 1 << 114; uint256 internal constant _ROLE_115 = 1 << 115; uint256 internal constant _ROLE_116 = 1 << 116; uint256 internal constant _ROLE_117 = 1 << 117; uint256 internal constant _ROLE_118 = 1 << 118; uint256 internal constant _ROLE_119 = 1 << 119; uint256 internal constant _ROLE_120 = 1 << 120; uint256 internal constant _ROLE_121 = 1 << 121; uint256 internal constant _ROLE_122 = 1 << 122; uint256 internal constant _ROLE_123 = 1 << 123; uint256 internal constant _ROLE_124 = 1 << 124; uint256 internal constant _ROLE_125 = 1 << 125; uint256 internal constant _ROLE_126 = 1 << 126; uint256 internal constant _ROLE_127 = 1 << 127; uint256 internal constant _ROLE_128 = 1 << 128; uint256 internal constant _ROLE_129 = 1 << 129; uint256 internal constant _ROLE_130 = 1 << 130; uint256 internal constant _ROLE_131 = 1 << 131; uint256 internal constant _ROLE_132 = 1 << 132; uint256 internal constant _ROLE_133 = 1 << 133; uint256 internal constant _ROLE_134 = 1 << 134; uint256 internal constant _ROLE_135 = 1 << 135; uint256 internal constant _ROLE_136 = 1 << 136; uint256 internal constant _ROLE_137 = 1 << 137; uint256 internal constant _ROLE_138 = 1 << 138; uint256 internal constant _ROLE_139 = 1 << 139; uint256 internal constant _ROLE_140 = 1 << 140; uint256 internal constant _ROLE_141 = 1 << 141; uint256 internal constant _ROLE_142 = 1 << 142; uint256 internal constant _ROLE_143 = 1 << 143; uint256 internal constant _ROLE_144 = 1 << 144; uint256 internal constant _ROLE_145 = 1 << 145; uint256 internal constant _ROLE_146 = 1 << 146; uint256 internal constant _ROLE_147 = 1 << 147; uint256 internal constant _ROLE_148 = 1 << 148; uint256 internal constant _ROLE_149 = 1 << 149; uint256 internal constant _ROLE_150 = 1 << 150; uint256 internal constant _ROLE_151 = 1 << 151; uint256 internal constant _ROLE_152 = 1 << 152; uint256 internal constant _ROLE_153 = 1 << 153; uint256 internal constant _ROLE_154 = 1 << 154; uint256 internal constant _ROLE_155 = 1 << 155; uint256 internal constant _ROLE_156 = 1 << 156; uint256 internal constant _ROLE_157 = 1 << 157; uint256 internal constant _ROLE_158 = 1 << 158; uint256 internal constant _ROLE_159 = 1 << 159; uint256 internal constant _ROLE_160 = 1 << 160; uint256 internal constant _ROLE_161 = 1 << 161; uint256 internal constant _ROLE_162 = 1 << 162; uint256 internal constant _ROLE_163 = 1 << 163; uint256 internal constant _ROLE_164 = 1 << 164; uint256 internal constant _ROLE_165 = 1 << 165; uint256 internal constant _ROLE_166 = 1 << 166; uint256 internal constant _ROLE_167 = 1 << 167; uint256 internal constant _ROLE_168 = 1 << 168; uint256 internal constant _ROLE_169 = 1 << 169; uint256 internal constant _ROLE_170 = 1 << 170; uint256 internal constant _ROLE_171 = 1 << 171; uint256 internal constant _ROLE_172 = 1 << 172; uint256 internal constant _ROLE_173 = 1 << 173; uint256 internal constant _ROLE_174 = 1 << 174; uint256 internal constant _ROLE_175 = 1 << 175; uint256 internal constant _ROLE_176 = 1 << 176; uint256 internal constant _ROLE_177 = 1 << 177; uint256 internal constant _ROLE_178 = 1 << 178; uint256 internal constant _ROLE_179 = 1 << 179; uint256 internal constant _ROLE_180 = 1 << 180; uint256 internal constant _ROLE_181 = 1 << 181; uint256 internal constant _ROLE_182 = 1 << 182; uint256 internal constant _ROLE_183 = 1 << 183; uint256 internal constant _ROLE_184 = 1 << 184; uint256 internal constant _ROLE_185 = 1 << 185; uint256 internal constant _ROLE_186 = 1 << 186; uint256 internal constant _ROLE_187 = 1 << 187; uint256 internal constant _ROLE_188 = 1 << 188; uint256 internal constant _ROLE_189 = 1 << 189; uint256 internal constant _ROLE_190 = 1 << 190; uint256 internal constant _ROLE_191 = 1 << 191; uint256 internal constant _ROLE_192 = 1 << 192; uint256 internal constant _ROLE_193 = 1 << 193; uint256 internal constant _ROLE_194 = 1 << 194; uint256 internal constant _ROLE_195 = 1 << 195; uint256 internal constant _ROLE_196 = 1 << 196; uint256 internal constant _ROLE_197 = 1 << 197; uint256 internal constant _ROLE_198 = 1 << 198; uint256 internal constant _ROLE_199 = 1 << 199; uint256 internal constant _ROLE_200 = 1 << 200; uint256 internal constant _ROLE_201 = 1 << 201; uint256 internal constant _ROLE_202 = 1 << 202; uint256 internal constant _ROLE_203 = 1 << 203; uint256 internal constant _ROLE_204 = 1 << 204; uint256 internal constant _ROLE_205 = 1 << 205; uint256 internal constant _ROLE_206 = 1 << 206; uint256 internal constant _ROLE_207 = 1 << 207; uint256 internal constant _ROLE_208 = 1 << 208; uint256 internal constant _ROLE_209 = 1 << 209; uint256 internal constant _ROLE_210 = 1 << 210; uint256 internal constant _ROLE_211 = 1 << 211; uint256 internal constant _ROLE_212 = 1 << 212; uint256 internal constant _ROLE_213 = 1 << 213; uint256 internal constant _ROLE_214 = 1 << 214; uint256 internal constant _ROLE_215 = 1 << 215; uint256 internal constant _ROLE_216 = 1 << 216; uint256 internal constant _ROLE_217 = 1 << 217; uint256 internal constant _ROLE_218 = 1 << 218; uint256 internal constant _ROLE_219 = 1 << 219; uint256 internal constant _ROLE_220 = 1 << 220; uint256 internal constant _ROLE_221 = 1 << 221; uint256 internal constant _ROLE_222 = 1 << 222; uint256 internal constant _ROLE_223 = 1 << 223; uint256 internal constant _ROLE_224 = 1 << 224; uint256 internal constant _ROLE_225 = 1 << 225; uint256 internal constant _ROLE_226 = 1 << 226; uint256 internal constant _ROLE_227 = 1 << 227; uint256 internal constant _ROLE_228 = 1 << 228; uint256 internal constant _ROLE_229 = 1 << 229; uint256 internal constant _ROLE_230 = 1 << 230; uint256 internal constant _ROLE_231 = 1 << 231; uint256 internal constant _ROLE_232 = 1 << 232; uint256 internal constant _ROLE_233 = 1 << 233; uint256 internal constant _ROLE_234 = 1 << 234; uint256 internal constant _ROLE_235 = 1 << 235; uint256 internal constant _ROLE_236 = 1 << 236; uint256 internal constant _ROLE_237 = 1 << 237; uint256 internal constant _ROLE_238 = 1 << 238; uint256 internal constant _ROLE_239 = 1 << 239; uint256 internal constant _ROLE_240 = 1 << 240; uint256 internal constant _ROLE_241 = 1 << 241; uint256 internal constant _ROLE_242 = 1 << 242; uint256 internal constant _ROLE_243 = 1 << 243; uint256 internal constant _ROLE_244 = 1 << 244; uint256 internal constant _ROLE_245 = 1 << 245; uint256 internal constant _ROLE_246 = 1 << 246; uint256 internal constant _ROLE_247 = 1 << 247; uint256 internal constant _ROLE_248 = 1 << 248; uint256 internal constant _ROLE_249 = 1 << 249; uint256 internal constant _ROLE_250 = 1 << 250; uint256 internal constant _ROLE_251 = 1 << 251; uint256 internal constant _ROLE_252 = 1 << 252; uint256 internal constant _ROLE_253 = 1 << 253; uint256 internal constant _ROLE_254 = 1 << 254; uint256 internal constant _ROLE_255 = 1 << 255; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for managing enumerable sets in storage. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/EnumerableSetLib.sol) /// /// @dev Note: /// In many applications, the number of elements in an enumerable set is small. /// This enumerable set implementation avoids storing the length and indices /// for up to 3 elements. Once the length exceeds 3 for the first time, the length /// and indices will be initialized. The amortized cost of adding elements is O(1). /// /// The AddressSet implementation packs the length with the 0th entry. library EnumerableSetLib { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The index must be less than the length. error IndexOutOfBounds(); /// @dev The value cannot be the zero sentinel. error ValueIsZeroSentinel(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev A sentinel value to denote the zero value in storage. /// No elements can be equal to this value. /// `uint72(bytes9(keccak256(bytes("_ZERO_SENTINEL"))))`. uint256 private constant _ZERO_SENTINEL = 0xfbb67fda52d4bfb8bf; /// @dev The storage layout is given by: /// ``` /// mstore(0x04, _ENUMERABLE_ADDRESS_SET_SLOT_SEED) /// mstore(0x00, set.slot) /// let rootSlot := keccak256(0x00, 0x24) /// mstore(0x20, rootSlot) /// mstore(0x00, shr(96, shl(96, value))) /// let positionSlot := keccak256(0x00, 0x40) /// let valueSlot := add(rootSlot, sload(positionSlot)) /// let valueInStorage := shr(96, sload(valueSlot)) /// let lazyLength := shr(160, shl(160, sload(rootSlot))) /// ``` uint256 private constant _ENUMERABLE_ADDRESS_SET_SLOT_SEED = 0x978aab92; /// @dev The storage layout is given by: /// ``` /// mstore(0x04, _ENUMERABLE_WORD_SET_SLOT_SEED) /// mstore(0x00, set.slot) /// let rootSlot := keccak256(0x00, 0x24) /// mstore(0x20, rootSlot) /// mstore(0x00, value) /// let positionSlot := keccak256(0x00, 0x40) /// let valueSlot := add(rootSlot, sload(positionSlot)) /// let valueInStorage := sload(valueSlot) /// let lazyLength := sload(not(rootSlot)) /// ``` uint256 private constant _ENUMERABLE_WORD_SET_SLOT_SEED = 0x18fb5864; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STRUCTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev An enumerable address set in storage. struct AddressSet { uint256 _spacer; } /// @dev An enumerable bytes32 set in storage. struct Bytes32Set { uint256 _spacer; } /// @dev An enumerable uint256 set in storage. struct Uint256Set { uint256 _spacer; } /// @dev An enumerable int256 set in storage. struct Int256Set { uint256 _spacer; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* GETTERS / SETTERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the number of elements in the set. function length(AddressSet storage set) internal view returns (uint256 result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { let rootPacked := sload(rootSlot) let n := shr(160, shl(160, rootPacked)) result := shr(1, n) for {} iszero(or(iszero(shr(96, rootPacked)), n)) {} { result := 1 if iszero(sload(add(rootSlot, result))) { break } result := 2 if iszero(sload(add(rootSlot, result))) { break } result := 3 break } } } /// @dev Returns the number of elements in the set. function length(Bytes32Set storage set) internal view returns (uint256 result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { let n := sload(not(rootSlot)) result := shr(1, n) for {} iszero(n) {} { result := 0 if iszero(sload(add(rootSlot, result))) { break } result := 1 if iszero(sload(add(rootSlot, result))) { break } result := 2 if iszero(sload(add(rootSlot, result))) { break } result := 3 break } } } /// @dev Returns the number of elements in the set. function length(Uint256Set storage set) internal view returns (uint256 result) { result = length(_toBytes32Set(set)); } /// @dev Returns the number of elements in the set. function length(Int256Set storage set) internal view returns (uint256 result) { result = length(_toBytes32Set(set)); } /// @dev Returns whether `value` is in the set. function contains(AddressSet storage set, address value) internal view returns (bool result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { value := shr(96, shl(96, value)) if eq(value, _ZERO_SENTINEL) { mstore(0x00, 0xf5a267f1) // `ValueIsZeroSentinel()`. revert(0x1c, 0x04) } if iszero(value) { value := _ZERO_SENTINEL } let rootPacked := sload(rootSlot) for {} 1 {} { if iszero(shr(160, shl(160, rootPacked))) { result := 1 if eq(shr(96, rootPacked), value) { break } if eq(shr(96, sload(add(rootSlot, 1))), value) { break } if eq(shr(96, sload(add(rootSlot, 2))), value) { break } result := 0 break } mstore(0x20, rootSlot) mstore(0x00, value) result := iszero(iszero(sload(keccak256(0x00, 0x40)))) break } } } /// @dev Returns whether `value` is in the set. function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { if eq(value, _ZERO_SENTINEL) { mstore(0x00, 0xf5a267f1) // `ValueIsZeroSentinel()`. revert(0x1c, 0x04) } if iszero(value) { value := _ZERO_SENTINEL } for {} 1 {} { if iszero(sload(not(rootSlot))) { result := 1 if eq(sload(rootSlot), value) { break } if eq(sload(add(rootSlot, 1)), value) { break } if eq(sload(add(rootSlot, 2)), value) { break } result := 0 break } mstore(0x20, rootSlot) mstore(0x00, value) result := iszero(iszero(sload(keccak256(0x00, 0x40)))) break } } } /// @dev Returns whether `value` is in the set. function contains(Uint256Set storage set, uint256 value) internal view returns (bool result) { result = contains(_toBytes32Set(set), bytes32(value)); } /// @dev Returns whether `value` is in the set. function contains(Int256Set storage set, int256 value) internal view returns (bool result) { result = contains(_toBytes32Set(set), bytes32(uint256(value))); } /// @dev Adds `value` to the set. Returns whether `value` was not in the set. function add(AddressSet storage set, address value) internal returns (bool result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { value := shr(96, shl(96, value)) if eq(value, _ZERO_SENTINEL) { mstore(0x00, 0xf5a267f1) // `ValueIsZeroSentinel()`. revert(0x1c, 0x04) } if iszero(value) { value := _ZERO_SENTINEL } let rootPacked := sload(rootSlot) for { let n := shr(160, shl(160, rootPacked)) } 1 {} { mstore(0x20, rootSlot) if iszero(n) { let v0 := shr(96, rootPacked) if iszero(v0) { sstore(rootSlot, shl(96, value)) result := 1 break } if eq(v0, value) { break } let v1 := shr(96, sload(add(rootSlot, 1))) if iszero(v1) { sstore(add(rootSlot, 1), shl(96, value)) result := 1 break } if eq(v1, value) { break } let v2 := shr(96, sload(add(rootSlot, 2))) if iszero(v2) { sstore(add(rootSlot, 2), shl(96, value)) result := 1 break } if eq(v2, value) { break } mstore(0x00, v0) sstore(keccak256(0x00, 0x40), 1) mstore(0x00, v1) sstore(keccak256(0x00, 0x40), 2) mstore(0x00, v2) sstore(keccak256(0x00, 0x40), 3) rootPacked := or(rootPacked, 7) n := 7 } mstore(0x00, value) let p := keccak256(0x00, 0x40) if iszero(sload(p)) { n := shr(1, n) sstore(add(rootSlot, n), shl(96, value)) sstore(p, add(1, n)) sstore(rootSlot, add(2, rootPacked)) result := 1 break } break } } } /// @dev Adds `value` to the set. Returns whether `value` was not in the set. function add(Bytes32Set storage set, bytes32 value) internal returns (bool result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { if eq(value, _ZERO_SENTINEL) { mstore(0x00, 0xf5a267f1) // `ValueIsZeroSentinel()`. revert(0x1c, 0x04) } if iszero(value) { value := _ZERO_SENTINEL } for { let n := sload(not(rootSlot)) } 1 {} { mstore(0x20, rootSlot) if iszero(n) { let v0 := sload(rootSlot) if iszero(v0) { sstore(rootSlot, value) result := 1 break } if eq(v0, value) { break } let v1 := sload(add(rootSlot, 1)) if iszero(v1) { sstore(add(rootSlot, 1), value) result := 1 break } if eq(v1, value) { break } let v2 := sload(add(rootSlot, 2)) if iszero(v2) { sstore(add(rootSlot, 2), value) result := 1 break } if eq(v2, value) { break } mstore(0x00, v0) sstore(keccak256(0x00, 0x40), 1) mstore(0x00, v1) sstore(keccak256(0x00, 0x40), 2) mstore(0x00, v2) sstore(keccak256(0x00, 0x40), 3) n := 7 } mstore(0x00, value) let p := keccak256(0x00, 0x40) if iszero(sload(p)) { n := shr(1, n) sstore(add(rootSlot, n), value) sstore(p, add(1, n)) sstore(not(rootSlot), or(1, shl(1, add(1, n)))) result := 1 break } break } } } /// @dev Adds `value` to the set. Returns whether `value` was not in the set. function add(Uint256Set storage set, uint256 value) internal returns (bool result) { result = add(_toBytes32Set(set), bytes32(value)); } /// @dev Adds `value` to the set. Returns whether `value` was not in the set. function add(Int256Set storage set, int256 value) internal returns (bool result) { result = add(_toBytes32Set(set), bytes32(uint256(value))); } /// @dev Removes `value` from the set. Returns whether `value` was in the set. function remove(AddressSet storage set, address value) internal returns (bool result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { value := shr(96, shl(96, value)) if eq(value, _ZERO_SENTINEL) { mstore(0x00, 0xf5a267f1) // `ValueIsZeroSentinel()`. revert(0x1c, 0x04) } if iszero(value) { value := _ZERO_SENTINEL } let rootPacked := sload(rootSlot) for { let n := shr(160, shl(160, rootPacked)) } 1 {} { if iszero(n) { result := 1 if eq(shr(96, rootPacked), value) { sstore(rootSlot, sload(add(rootSlot, 1))) sstore(add(rootSlot, 1), sload(add(rootSlot, 2))) sstore(add(rootSlot, 2), 0) break } if eq(shr(96, sload(add(rootSlot, 1))), value) { sstore(add(rootSlot, 1), sload(add(rootSlot, 2))) sstore(add(rootSlot, 2), 0) break } if eq(shr(96, sload(add(rootSlot, 2))), value) { sstore(add(rootSlot, 2), 0) break } result := 0 break } mstore(0x20, rootSlot) mstore(0x00, value) let p := keccak256(0x00, 0x40) let position := sload(p) if iszero(position) { break } n := sub(shr(1, n), 1) if iszero(eq(sub(position, 1), n)) { let lastValue := shr(96, sload(add(rootSlot, n))) sstore(add(rootSlot, sub(position, 1)), shl(96, lastValue)) sstore(add(rootSlot, n), 0) mstore(0x00, lastValue) sstore(keccak256(0x00, 0x40), position) } sstore(rootSlot, or(shl(96, shr(96, sload(rootSlot))), or(shl(1, n), 1))) sstore(p, 0) result := 1 break } } } /// @dev Removes `value` from the set. Returns whether `value` was in the set. function remove(Bytes32Set storage set, bytes32 value) internal returns (bool result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { if eq(value, _ZERO_SENTINEL) { mstore(0x00, 0xf5a267f1) // `ValueIsZeroSentinel()`. revert(0x1c, 0x04) } if iszero(value) { value := _ZERO_SENTINEL } for { let n := sload(not(rootSlot)) } 1 {} { if iszero(n) { result := 1 if eq(sload(rootSlot), value) { sstore(rootSlot, sload(add(rootSlot, 1))) sstore(add(rootSlot, 1), sload(add(rootSlot, 2))) sstore(add(rootSlot, 2), 0) break } if eq(sload(add(rootSlot, 1)), value) { sstore(add(rootSlot, 1), sload(add(rootSlot, 2))) sstore(add(rootSlot, 2), 0) break } if eq(sload(add(rootSlot, 2)), value) { sstore(add(rootSlot, 2), 0) break } result := 0 break } mstore(0x20, rootSlot) mstore(0x00, value) let p := keccak256(0x00, 0x40) let position := sload(p) if iszero(position) { break } n := sub(shr(1, n), 1) if iszero(eq(sub(position, 1), n)) { let lastValue := sload(add(rootSlot, n)) sstore(add(rootSlot, sub(position, 1)), lastValue) sstore(add(rootSlot, n), 0) mstore(0x00, lastValue) sstore(keccak256(0x00, 0x40), position) } sstore(not(rootSlot), or(shl(1, n), 1)) sstore(p, 0) result := 1 break } } } /// @dev Removes `value` from the set. Returns whether `value` was in the set. function remove(Uint256Set storage set, uint256 value) internal returns (bool result) { result = remove(_toBytes32Set(set), bytes32(value)); } /// @dev Removes `value` from the set. Returns whether `value` was in the set. function remove(Int256Set storage set, int256 value) internal returns (bool result) { result = remove(_toBytes32Set(set), bytes32(uint256(value))); } /// @dev Returns all of the values in the set. /// Note: This can consume more gas than the block gas limit for large sets. function values(AddressSet storage set) internal view returns (address[] memory result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { let zs := _ZERO_SENTINEL let rootPacked := sload(rootSlot) let n := shr(160, shl(160, rootPacked)) result := mload(0x40) let o := add(0x20, result) let v := shr(96, rootPacked) mstore(o, mul(v, iszero(eq(v, zs)))) for {} 1 {} { if iszero(n) { if v { n := 1 v := shr(96, sload(add(rootSlot, n))) if v { n := 2 mstore(add(o, 0x20), mul(v, iszero(eq(v, zs)))) v := shr(96, sload(add(rootSlot, n))) if v { n := 3 mstore(add(o, 0x40), mul(v, iszero(eq(v, zs)))) } } } break } n := shr(1, n) for { let i := 1 } lt(i, n) { i := add(i, 1) } { v := shr(96, sload(add(rootSlot, i))) mstore(add(o, shl(5, i)), mul(v, iszero(eq(v, zs)))) } break } mstore(result, n) mstore(0x40, add(o, shl(5, n))) } } /// @dev Returns all of the values in the set. /// Note: This can consume more gas than the block gas limit for large sets. function values(Bytes32Set storage set) internal view returns (bytes32[] memory result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { let zs := _ZERO_SENTINEL let n := sload(not(rootSlot)) result := mload(0x40) let o := add(0x20, result) for {} 1 {} { if iszero(n) { let v := sload(rootSlot) if v { n := 1 mstore(o, mul(v, iszero(eq(v, zs)))) v := sload(add(rootSlot, n)) if v { n := 2 mstore(add(o, 0x20), mul(v, iszero(eq(v, zs)))) v := sload(add(rootSlot, n)) if v { n := 3 mstore(add(o, 0x40), mul(v, iszero(eq(v, zs)))) } } } break } n := shr(1, n) for { let i := 0 } lt(i, n) { i := add(i, 1) } { let v := sload(add(rootSlot, i)) mstore(add(o, shl(5, i)), mul(v, iszero(eq(v, zs)))) } break } mstore(result, n) mstore(0x40, add(o, shl(5, n))) } } /// @dev Returns all of the values in the set. /// Note: This can consume more gas than the block gas limit for large sets. function values(Uint256Set storage set) internal view returns (uint256[] memory result) { result = _toUints(values(_toBytes32Set(set))); } /// @dev Returns all of the values in the set. /// Note: This can consume more gas than the block gas limit for large sets. function values(Int256Set storage set) internal view returns (int256[] memory result) { result = _toInts(values(_toBytes32Set(set))); } /// @dev Returns the element at index `i` in the set. function at(AddressSet storage set, uint256 i) internal view returns (address result) { bytes32 rootSlot = _rootSlot(set); /// @solidity memory-safe-assembly assembly { result := shr(96, sload(add(rootSlot, i))) result := mul(result, iszero(eq(result, _ZERO_SENTINEL))) } if (i >= length(set)) revert IndexOutOfBounds(); } /// @dev Returns the element at index `i` in the set. function at(Bytes32Set storage set, uint256 i) internal view returns (bytes32 result) { result = _rootSlot(set); /// @solidity memory-safe-assembly assembly { result := sload(add(result, i)) result := mul(result, iszero(eq(result, _ZERO_SENTINEL))) } if (i >= length(set)) revert IndexOutOfBounds(); } /// @dev Returns the element at index `i` in the set. function at(Uint256Set storage set, uint256 i) internal view returns (uint256 result) { result = uint256(at(_toBytes32Set(set), i)); } /// @dev Returns the element at index `i` in the set. function at(Int256Set storage set, uint256 i) internal view returns (int256 result) { result = int256(uint256(at(_toBytes32Set(set), i))); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PRIVATE HELPERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the root slot. function _rootSlot(AddressSet storage s) private pure returns (bytes32 r) { /// @solidity memory-safe-assembly assembly { mstore(0x04, _ENUMERABLE_ADDRESS_SET_SLOT_SEED) mstore(0x00, s.slot) r := keccak256(0x00, 0x24) } } /// @dev Returns the root slot. function _rootSlot(Bytes32Set storage s) private pure returns (bytes32 r) { /// @solidity memory-safe-assembly assembly { mstore(0x04, _ENUMERABLE_WORD_SET_SLOT_SEED) mstore(0x00, s.slot) r := keccak256(0x00, 0x24) } } /// @dev Casts to a Bytes32Set. function _toBytes32Set(Uint256Set storage s) private pure returns (Bytes32Set storage c) { /// @solidity memory-safe-assembly assembly { c.slot := s.slot } } /// @dev Casts to a Bytes32Set. function _toBytes32Set(Int256Set storage s) private pure returns (Bytes32Set storage c) { /// @solidity memory-safe-assembly assembly { c.slot := s.slot } } /// @dev Casts to a uint256 array. function _toUints(bytes32[] memory a) private pure returns (uint256[] memory c) { /// @solidity memory-safe-assembly assembly { c := a } } /// @dev Casts to a int256 array. function _toInts(bytes32[] memory a) private pure returns (int256[] memory c) { /// @solidity memory-safe-assembly assembly { c := a } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Simple single owner authorization mixin. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol) /// /// @dev Note: /// This implementation does NOT auto-initialize the owner to `msg.sender`. /// You MUST call the `_initializeOwner` in the constructor / initializer. /// /// While the ownable portion follows /// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility, /// the nomenclature for the 2-step ownership handover may be unique to this codebase. abstract contract Ownable { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The caller is not authorized to call the function. error Unauthorized(); /// @dev The `newOwner` cannot be the zero address. error NewOwnerIsZeroAddress(); /// @dev The `pendingOwner` does not have a valid handover request. error NoHandoverRequest(); /// @dev Cannot double-initialize. error AlreadyInitialized(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ownership is transferred from `oldOwner` to `newOwner`. /// This event is intentionally kept the same as OpenZeppelin's Ownable to be /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173), /// despite it not being as lightweight as a single argument event. event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); /// @dev An ownership handover to `pendingOwner` has been requested. event OwnershipHandoverRequested(address indexed pendingOwner); /// @dev The ownership handover to `pendingOwner` has been canceled. event OwnershipHandoverCanceled(address indexed pendingOwner); /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`. uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE = 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0; /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE = 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d; /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE = 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The owner slot is given by: /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`. /// It is intentionally chosen to be a high value /// to avoid collision with lower slots. /// The choice of manual storage layout is to enable compatibility /// with both regular and upgradeable contracts. bytes32 internal constant _OWNER_SLOT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927; /// The ownership handover slot of `newOwner` is given by: /// ``` /// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED)) /// let handoverSlot := keccak256(0x00, 0x20) /// ``` /// It stores the expiry timestamp of the two-step ownership handover. uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Override to return true to make `_initializeOwner` prevent double-initialization. function _guardInitializeOwner() internal pure virtual returns (bool guard) {} /// @dev Initializes the owner directly without authorization guard. /// This function must be called upon initialization, /// regardless of whether the contract is upgradeable or not. /// This is to enable generalization to both regular and upgradeable contracts, /// and to save gas in case the initial owner is not the caller. /// For performance reasons, this function will not check if there /// is an existing owner. function _initializeOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT if sload(ownerSlot) { mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`. revert(0x1c, 0x04) } // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } else { /// @solidity memory-safe-assembly assembly { // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(_OWNER_SLOT, newOwner) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } } /// @dev Sets the owner directly without authorization guard. function _setOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) } } else { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, newOwner) } } } /// @dev Throws if the sender is not the owner. function _checkOwner() internal view virtual { /// @solidity memory-safe-assembly assembly { // If the caller is not the stored owner, revert. if iszero(eq(caller(), sload(_OWNER_SLOT))) { mstore(0x00, 0x82b42900) // `Unauthorized()`. revert(0x1c, 0x04) } } } /// @dev Returns how long a two-step ownership handover is valid for in seconds. /// Override to return a different value if needed. /// Made internal to conserve bytecode. Wrap it in a public function if needed. function _ownershipHandoverValidFor() internal view virtual returns (uint64) { return 48 * 3600; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC UPDATE FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Allows the owner to transfer the ownership to `newOwner`. function transferOwnership(address newOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { if iszero(shl(96, newOwner)) { mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`. revert(0x1c, 0x04) } } _setOwner(newOwner); } /// @dev Allows the owner to renounce their ownership. function renounceOwnership() public payable virtual onlyOwner { _setOwner(address(0)); } /// @dev Request a two-step ownership handover to the caller. /// The request will automatically expire in 48 hours (172800 seconds) by default. function requestOwnershipHandover() public payable virtual { unchecked { uint256 expires = block.timestamp + _ownershipHandoverValidFor(); /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to `expires`. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), expires) // Emit the {OwnershipHandoverRequested} event. log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller()) } } } /// @dev Cancels the two-step ownership handover to the caller, if any. function cancelOwnershipHandover() public payable virtual { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), 0) // Emit the {OwnershipHandoverCanceled} event. log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller()) } } /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`. /// Reverts if there is no existing ownership handover requested by `pendingOwner`. function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) let handoverSlot := keccak256(0x0c, 0x20) // If the handover does not exist, or has expired. if gt(timestamp(), sload(handoverSlot)) { mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`. revert(0x1c, 0x04) } // Set the handover slot to 0. sstore(handoverSlot, 0) } _setOwner(pendingOwner); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC READ FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the owner of the contract. function owner() public view virtual returns (address result) { /// @solidity memory-safe-assembly assembly { result := sload(_OWNER_SLOT) } } /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`. function ownershipHandoverExpiresAt(address pendingOwner) public view virtual returns (uint256 result) { /// @solidity memory-safe-assembly assembly { // Compute the handover slot. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) // Load the handover slot. result := sload(keccak256(0x0c, 0x20)) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* MODIFIERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Marks a function as only callable by the owner. modifier onlyOwner() virtual { _checkOwner(); _; } }
{ "viaIR": false, "codegen": "yul", "remappings": [ "@solady-0.0.232/=dependencies/solady-0.0.232/", "forge-std/=lib/forge-std/src/" ], "evmVersion": "cancun", "outputSelection": { "*": { "*": [ "abi", "metadata" ], "": [ "ast" ] } }, "optimizer": { "enabled": true, "mode": "3", "fallback_to_optimizing_for_size": false, "disable_system_request_memoization": true }, "metadata": {}, "libraries": {}, "enableEraVMExtensions": false, "forceEVMLA": false }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"contract IAppRegistry","name":"_appRegistry","type":"address"},{"internalType":"contract IVoteGovernor","name":"_voteGovernor","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[{"internalType":"uint256","name":"appId","type":"uint256"}],"name":"AlreadyVotedFor","type":"error"},{"inputs":[],"name":"AppNotActive","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[],"name":"InvalidSchedule","type":"error"},{"inputs":[],"name":"InvalidValue","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UsedAllVotes","type":"error"},{"inputs":[],"name":"VotingNotActive","type":"error"},{"inputs":[],"name":"WithdrawFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAppRegistry","type":"address"}],"name":"AppRegistryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"roles","type":"uint256"}],"name":"RolesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"epochDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"epochsCompleted","type":"uint256"}],"name":"ScheduleInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newGovernor","type":"address"}],"name":"VoteGovernorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":true,"internalType":"uint256","name":"appId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"Voted","type":"event"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"appRegistry","outputs":[{"internalType":"contract IAppRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentSchedule","outputs":[{"internalType":"uint40","name":"startTime","type":"uint40"},{"internalType":"uint40","name":"epochDuration","type":"uint40"},{"internalType":"uint40","name":"epochsCompleted","type":"uint40"},{"internalType":"uint96","name":"voteCost","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getUserVotes","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"appId","type":"uint256"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getVotesForApp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"grantRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAllRoles","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAnyRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint40","name":"_startTime","type":"uint40"},{"internalType":"uint40","name":"_epochDuration","type":"uint40"},{"internalType":"uint96","name":"_voteCost","type":"uint96"}],"name":"initializeSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextSchedule","outputs":[{"internalType":"uint40","name":"startTime","type":"uint40"},{"internalType":"uint40","name":"epochDuration","type":"uint40"},{"internalType":"uint40","name":"epochsCompleted","type":"uint40"},{"internalType":"uint96","name":"voteCost","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"renounceRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"revokeRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"rolesOf","outputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAppRegistry","type":"address"}],"name":"setAppRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGovernor","type":"address"}],"name":"setVoteGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userVoteSpend","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userVotesRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voteCost","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"appId","type":"uint256"}],"name":"voteForApp","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"voteGovernor","outputs":[{"internalType":"contract IVoteGovernor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
3cda33510000000000000000000000000000000000000000000000000000000000000000010002c70c13b2f3811d37437a6378d6d12b346ff9822c40c9ef711595380693000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000006f6426a9b93a7567fcccbfe5d0d6f26c1085999b000000000000000000000000659701b6be5c83aaffc5ce229679e7d53903b32e000000000000000000000000a80ec2a60fb41ae9b1bbf914e75b0d464b95709c
Deployed Bytecode
0x00040000000000020007000000000002000000000801034f00000060031002700000025b01300197000300000018035500020000000803550000025b0030019d0000000100200190000000a10000c13d0000008002000039000000400020043f000000040010008c000004200000413d000000000208043b000000e002200270000002680020009c000001170000a13d000002690020009c0000019b0000a13d0000026a0020009c000001a80000213d000002700020009c0000026d0000213d000002730020009c000003f80000613d000002740020009c000004200000c13d000000640010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b000700000001001d000002980010009c000004200000213d0000002401800370000000000101043b000600000001001d000002980010009c000004200000213d0000004401800370000000000101043b000500000001001d000002990010009c000004200000213d00000262010000410000000c0010043f0000000001000411000000000010043f00000000010004140000025b0010009c0000025b01008041000000c00110021000000263011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000000000101041a0000000100100190000000460000c13d0000025f01000041000000000101041a0000000002000411000000000012004b000004400000c13d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000004770000613d00000006020000290000029802200198000000000801043b000005750000613d00000007010000290000029801100197000000000081004b000005750000a13d0000000207000039000000000407041a0000000303000039000000000503041a0000029806500197000000010660008a000000000086004b000000650000813d0000029a065001970000029b04400197000000000464019f000000000047041b000000050600002900000299066001970000029809400197000000010a90008a00000000008a004b000005790000813d0000000007910049000002980070009c0000056f0000213d00000028084002700000029809800198000004710000613d0000029f0870019700000000089800d900000000099800a900000000079700490000029f00700198000005750000c13d000000400700043d0000029c0070009c000006580000213d0000008009700039000000400090043f000000600970003900000000006904350000029f0680019700000050044002700000029804400197000000000464001900000298064001970000004008700039000000000068043500000020067000390000000000260435000000000017043500000005060000290000007806600210000002a00660019700000006070000290000002807700210000002a107700197000000000667019f0000029b05500197000000000556019f0000005006400210000002a206600197000000000565019f000000000515019f000000000053041b000000400300043d000000400530003900000000004504350000002004300039000000000024043500000000001304350000025b0030009c0000025b0300804100000040013002100000000002000414000005960000013d0000000002000416000000000002004b000004200000c13d0000001f021000390000025c022001970000008002200039000000400020043f0000001f0310018f0000025d041001980000008002400039000000b20000613d0000008005000039000000000608034f000000006706043c0000000005750436000000000025004b000000ae0000c13d000000000003004b000000bf0000613d000000000448034f0000000303300210000000000502043300000000053501cf000000000535022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000353019f0000000000320435000000600010008c000004200000413d000000800200043d0000025e0020009c000004200000213d000000a00100043d000700000001001d0000025e0010009c000004200000213d000000c00100043d000600000001001d0000025e0010009c000004200000213d0000025e062001970000025f01000041000000000061041b00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c7000500000002001d0000800d020000390000000303000039000002610400004100000000050000190969095f0000040f00000001002001900000000502000029000004200000613d00000262010000410000000c0010043f000000000020043f00000000010004140000025b0010009c0000025b01008041000000c00110021000000263011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000000000201041a00000001062001bf000000000061041b0000000c0100043d000000000200041400000060051002700000025b0020009c0000025b02008041000000c00120021000000260011001c70000800d02000039000000030300003900000264040000410969095f0000040f0000000100200190000004200000613d00000007010000290000025e0110019700000006020000290000025e05200197000000000200041a0000026502200197000000000112019f000000000010041b0000000101000039000000000201041a0000026502200197000000000252019f000000000021041b00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c70000800d02000039000000020300003900000266040000410969095f0000040f0000000100200190000004200000613d00000020010000390000010000100443000001200000044300000267010000410000096a0001042e0000027e0020009c0000012c0000213d000002880020009c000001dd0000a13d000002890020009c000002380000213d0000028c0020009c000002a00000613d0000028d0020009c000004200000c13d000000240010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b0000025e0010009c000004200000213d00000262020000410000029b0000013d0000027f0020009c000001fd0000a13d000002800020009c0000024b0000213d000002830020009c000002c70000613d000002840020009c000004200000c13d000000240010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b000700000001001d0000025e0010009c000004200000213d000000800000043f000000a00000043f000000c00000043f000000e00000043f0000018001000039000000400010043f0000000302000039000000000202041a0000029804200198000001000040043f00000028032002700000029803300197000001200030043f00000050032002700000029803300197000001400030043f00000078022002700000029902200197000001600020043f000004480000c13d0000008002100039000000400020043f0000000202000039000000000202041a0000007803200270000002990330019700000060041000390000000000340435000000500320027000000298033001970000004004100039000000000034043500000298052001970000000003510436000000280120027000000298011001970000000000130435000000000005004b0000000001000019000003f10000613d000400000005001d000500000003001d000600000004001d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000004770000613d000000000101043b000000040210006c000000000100001900000006030000290000000504000029000003f10000413d00000000010404330000029801100198000004710000613d00000000011200d900000000020304330000029802200197000000000012001a0000056f0000413d0000000001120019000002c20010009c0000056f0000613d0000000102000039000000000202041a000000400500043d000002b90300004100000000003504350000000403500039000000070400002900000000004304350000000103100039000600000005001d0000002401500039000500000003001d000000000031043500000000010004140000025e02200197000000040020008c0000059f0000c13d0000000103000031000000200030008c00000020040000390000000004034019000005c90000013d000002750020009c0000021c0000a13d000002760020009c000002640000213d000002790020009c000003370000613d0000027a0020009c000004200000c13d0000000001000416000000000001004b000004200000c13d0000000101000039000003560000013d0000026b0020009c0000028d0000213d0000026e0020009c000004000000613d0000026f0020009c000004200000c13d000000240010008c000004200000413d0000000401800370000000000101043b000700000001001d0000025e0010009c000004200000213d0000025f01000041000000000101041a0000000002000411000000000012004b000004400000c13d00000291010000410000000c0010043f0000000701000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c00110021000000263011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000500000001001d000000000101041a000600000001001d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000004770000613d000000000101043b000000060010006c0000054f0000a13d0000029701000041000000000010043f00000294010000410000096b000104300000028e0020009c000003dc0000613d0000028f0020009c000003580000613d000002900020009c000004200000c13d000000440010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b0000025e0010009c000004200000213d0000002402800370000000000202043b000700000002001d00000262020000410000000c0020043f000000000010043f0000000c0100003900000020020000390969094a0000040f000000000101041a000000070110017f000000070010006c00000000010000390000000101006039000000800010043f00000292010000410000096a0001042e000002850020009c000003e40000613d000002860020009c000003810000613d000002870020009c000004200000c13d000000440010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b0000025e0010009c000004200000213d00000262020000410000000c0020043f000000000010043f0000002401800370000000000101043b000700000001001d0000000c0100003900000020020000390969094a0000040f000000000101041a00000007001001800000000001000039000000010100c039000000800010043f00000292010000410000096a0001042e0000027b0020009c000003ec0000613d0000027c0020009c000003930000613d0000027d0020009c000004200000c13d000000440010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000002401800370000000000101043b000000000010043f0000000401000039000000200010043f0000004002000039000000000100001900070000000803530969094a0000040f000000070200035f0000000402200370000000000202043b000000000020043f000000200010043f00000000010000190000004002000039000004150000013d0000028a0020009c000002e40000613d0000028b0020009c000004200000c13d000000440010008c000004200000413d0000000401800370000000000101043b000700000001001d0000025e0010009c000004200000213d096907ca0000040f00000024010000390000000201100367000000000201043b0000000701000029096909250000040f00000000010000190000096a0001042e000002810020009c000003020000613d000002820020009c000004200000c13d0000025f01000041000000000501041a0000000001000411000000000051004b000004400000c13d00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c70000800d020000390000000303000039000002610400004100000000060000190969095f0000040f0000000100200190000004200000613d0000025f01000041000000000001041b00000000010000190000096a0001042e000002770020009c000003520000613d000002780020009c000004200000c13d0000000001000416000000000001004b000004200000c13d0000000201000039000003850000013d000002710020009c000004070000613d000002720020009c000004200000c13d000000240010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000501043b0000025e0050009c000004200000213d0000025f01000041000000000101041a0000000002000411000000000012004b000004400000c13d0000000101000039000000000201041a0000026502200197000000000252019f000000000021041b00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c70000800d0200003900000002030000390000026604000041000002df0000013d0000026c0020009c0000041a0000613d0000026d0020009c000004200000c13d000000240010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b0000025e0010009c000004200000213d00000291020000410000000c0020043f000000000010043f0000000c010000390000002002000039000004150000013d00000291010000410000000c0010043f0000000001000411000000000010043f0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000004770000613d000000000101043b000700000001001d00000000010004140000025b0010009c0000025b01008041000000c00110021000000263011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000702000029000002bf0220009a000000000021041b00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c70000800d020000390000000203000039000002c004000041000002de0000013d00000291010000410000000c0010043f0000000001000411000000000010043f00000000010004140000025b0010009c0000025b01008041000000c00110021000000263011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000000000001041b00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c70000800d020000390000000203000039000002bb0400004100000000050004110969095f0000040f0000000100200190000004200000613d00000000010000190000096a0001042e0000000001000416000000000001004b000004200000c13d0000025f01000041000000000201041a0000000001000411000000000021004b000004400000c13d000700000002001d000002bc0100004100000000001004430000000001000410000000040010044300000000010004140000025b0010009c0000025b01008041000000c001100210000002bd011001c70000800a02000039096909640000040f0000000100200190000004770000613d000000000301043b00000000010004140000000704000029000000040040008c000004780000c13d000000010200003900000001010000310000048c0000013d000000240010008c000004200000413d0000000401800370000000000101043b000700000001001d000000800000043f000000a00000043f000000c00000043f000000e00000043f0000018001000039000000400010043f0000000302000039000000000202041a0000029804200198000001000040043f00000028032002700000029803300197000001200030043f00000050032002700000029803300197000001400030043f00000078022002700000029902200197000001600020043f000004220000c13d0000008002100039000000400020043f0000000202000039000000000302041a000002980230019700000000052104360000007802300270000002990220019700000060041000390000000000240435000000500430027000000298044001970000004006100039000000000046043500000028033002700000029803300197000000000035043500000299022001970000000003000416000000000023004b000004440000c13d000000000101043300000298011001980000045b0000c13d000002b801000041000000000010043f000002a4010000410000096b00010430000000240010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000501043b0000025e0050009c000004200000213d0000025f01000041000000000101041a0000000002000411000000000012004b000004400000c13d000000000100041a0000026501100197000000000151019f000000000010041b00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c70000800d020000390000000203000039000002a604000041000002df0000013d0000000001000416000000000001004b000004200000c13d0000025f01000041000000000101041a000003fc0000013d000000440010008c000004200000413d0000000401800370000000000101043b0000025e0010009c000004200000213d0000025f02000041000000000202041a0000000003000411000000000023004b000004400000c13d00000262020000410000000c0020043f000000000010043f00000000010004140000025b0010009c0000025b01008041000000c00110021000000263011001c70000801002000039096909640000040f0000000100200190000004200000613d00000024020000390000000202200367000000000202043b000000000101043b000000000301041a000000000623019f000000000061041b0000000c0100043d000000000200041400000060051002700000025b0020009c0000025b02008041000000c00120021000000260011001c70000800d0200003900000003030000390000026404000041000002df0000013d0000000001000416000000000001004b000004200000c13d0000000301000039000000000101041a0000029802100197000000800020043f00000028021002700000029802200197000000a00020043f00000050021002700000029802200197000000c00020043f00000078011002700000029901100197000000e00010043f000002a5010000410000096a0001042e000000440010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b0000025e0010009c000004200000213d000000000010043f0000000501000039000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b00000024020000390000000202200367000000000202043b000000000020043f000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000201043b000002a801000041000000040010043f000600000002001d000000000020043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000201043b000002c201200167000000000101041a000000000001004b000004c30000c13d0000000101200039000000000101041a000000000001004b00000000030000390000000103006039000000000102041a000000000001004b00000001033061bf0000000001000039000000010100c0390000000202200039000000000202041a000000000002004b00000003020000390000000202006039000000000003004b0000000001026019000004c60000013d000000240010008c000004200000413d0000000401800370000000000201043b0000000001000411096909250000040f00000000010000190000096a0001042e0000000001000416000000000001004b000004200000c13d096907d40000040f000000600110003900000000010104330000029901100197000003f10000013d0000000001000416000000000001004b000004200000c13d096907d40000040f096908da0000040f000000400200043d00000000001204350000025b0020009c0000025b020080410000004001200210000002b0011001c70000096a0001042e0000000001000416000000000001004b000004200000c13d000000000100041a0000025e01100197000000800010043f00000292010000410000096a0001042e0000000001000416000000000001004b000004200000c13d0000000101000039000000800010043f00000292010000410000096a0001042e000000240010008c000004200000413d0000000001000416000000000001004b000004200000c13d0000000401800370000000000101043b0000025e0010009c000004200000213d000000000010043f0000000601000039000000200010043f000000400200003900000000010000190969094a0000040f000000000101041a000000800010043f00000292010000410000096a0001042e000000240010008c000004200000413d0000000401800370000000000101043b0000025e0010009c000004350000a13d00000000010000190000096b00010430000600000004001d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000004770000613d000000000101043b000000060010006c0000047f0000813d000000400100043d0000029c0010009c0000031b0000a13d000006580000013d0000025f02000041000000000202041a0000000003000411000000000023004b000004400000c13d000000000001004b000005520000c13d0000029301000041000000000010043f00000294010000410000096b00010430000002c101000041000000000010043f00000294010000410000096b00010430000002b101000041000000000010043f000002a4010000410000096b00010430000600000004001d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000004770000613d000000000101043b000000060010006c000004bb0000813d000000400100043d0000029c0010009c000001520000a13d000006580000013d000400000001001d000500000006001d000600000005001d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000004770000613d000000000101043b000000040110006c00000006020000290000000503000029000003330000413d00000000020204330000029802200198000005550000c13d000002ad01000041000000000010043f0000001201000039000000040010043f000002ae010000410000096b00010430000000000001042f0000025b0010009c0000025b01008041000000c001100210000000000003004b000004840000c13d0000000002040019000004870000013d000001000100003900000140060000390000012005000039000001600200043d0000032c0000013d00000260011001c7000080090200003900000000050000190969095f0000040f000300000001035500000060011002700001025b0010019d0000025b01100197000000000001004b000004940000c13d0000000100200190000002e20000c13d000002be01000041000000000010043f000002a4010000410000096b000104300000001f04100039000002c3044001970000003f04400039000002c305400197000000400400043d0000000005540019000000000045004b000000000600003900000001060040390000029f0050009c000006580000213d0000000100600190000006580000c13d000000400050043f0000000006140436000002c3031001980000001f0410018f00000000013600190000000305000367000004ad0000613d000000000705034f000000007807043c0000000006860436000000000016004b000004a90000c13d000000000004004b0000048e0000613d000000000335034f0000000304400210000000000501043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f00000000003104350000048e0000013d00000140040000390000012003000039000001000100043d0000029805100197000000000005004b0000000001000019000001660000c13d000003f10000013d000002aa0010009c000006580000213d000000010110027000000005021002100000003f03200039000002ab04300197000000400300043d000400000003001d0000000003340019000000000043004b000000000400003900000001040040390000029f0030009c000006580000213d0000000100400190000006580000c13d000000400030043f000000040300002900000000061304360000001f0120018f000000000002004b000004e10000613d0000000002260019000000000300003100000002033003670000000004060019000000003503043c0000000004540436000000000024004b000004dd0000c13d000300000006001d000000000001004b000700000000001d000002a801000041000000040010043f0000000601000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000201043b000002c201200167000000000101041a000000000001004b000004f90000613d00000001011002700000000704000029000005080000013d000000000102041a000000000001004b0000000001000039000000010100c0390000000704000029000005080000613d0000000103200039000000000303041a000000000003004b000005080000613d0000000201200039000000000101041a000000000001004b00000003010000390000000201006039000000000014004b0000065e0000813d000002a801000041000000040010043f0000000601000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000701100029000000000101041a000500000001001d000002a801000041000000040010043f0000000601000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000201043b000002c201200167000000000101041a000000000001004b000005310000613d000000010110027000000003040000290000000705000029000005410000013d000000000102041a000000000001004b0000000001000039000000010100c03900000003040000290000000705000029000005410000613d0000000103200039000000000303041a000000000003004b000005410000613d0000000201200039000000000101041a000000000001004b00000003010000390000000201006039000000000015004b000006770000813d00000004010000290000000001010433000000000015004b0000067b0000813d000000050150021000000000014100190000000502000029000002af0020009c00000000020060190000000000210435000700010050003d000004e40000013d0000000501000029000000000001041b00000007010000290969090f0000040f00000000010000190000096a0001042e00000000012100d900000000020304330000029802200197000000000012001a0000056f0000413d000500000012001d000000010100008a000000050010006b0000056f0000613d000000000200041a000000400300043d000002b2010000410000000000130435000600000003001d00000004013000390000000703000029000000000031043500000000010004140000025e02200197000000040020008c000006140000c13d0000000103000031000000200030008c000000200400003900000000040340190000063e0000013d000002ad01000041000000000010043f0000001101000039000000040010043f000002ae010000410000096b00010430000002a301000041000000000010043f000002a4010000410000096b00010430000000400300043d0000029c0030009c000006580000213d0000008005300039000000400050043f00000060053000390000000000650435000000200530003900000000002504350000000000130435000000400330003900000000000304350000029b034001970000002804200210000000000343019f0000007804600210000000000343019f000000000313019f000000000037041b000000400300043d000000200430003900000000002404350000000000130435000000400130003900000000000104350000025b0030009c0000025b03008041000000400130021000000000020004140000025b0020009c0000025b02008041000000c002200210000000000112019f0000029d011001c70000800d0200003900000001030000390000029e04000041000002df0000013d00000006030000290000025b0030009c0000025b0300804100000040033002100000025b0010009c0000025b01008041000000c001100210000000000131019f000002ba011001c7096909640000040f00000060031002700000025b03300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000605700029000005b80000613d000000000801034f0000000609000029000000008a08043c0000000009a90436000000000059004b000005b40000c13d000000000006004b000005c50000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f00030000000103550000000100200190000006810000613d0000001f01400039000000600210018f0000000601200029000000000021004b000000000200003900000001020040390000029f0010009c000006580000213d0000000100200190000006580000c13d000000400010043f000000200030008c000004200000413d00000006010000290000000001010433000600000001001d0000000701000029000000000010043f0000000501000039000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000502000029000000000020043f000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000002a802000041000000040020043f000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000201043b000002c201200167000000000101041a000000000001004b000006d20000c13d000000000102041a000000000001004b0000000001000039000000010100c039000006d30000613d0000000103200039000000000303041a000000000003004b000006d30000613d0000000201200039000000000101041a000000000001004b00000003010000390000000201006039000006d30000013d00000006030000290000025b0030009c0000025b0300804100000040033002100000025b0010009c0000025b01008041000000c001100210000000000131019f000002ae011001c7096909640000040f00000060031002700000025b03300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000006057000290000062d0000613d000000000801034f0000000609000029000000008a08043c0000000009a90436000000000059004b000006290000c13d000000000006004b0000063a0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f000300000001035500000001002001900000068d0000613d0000001f01400039000000600210018f0000000601200029000000000021004b000000000200003900000001020040390000029f0010009c000006580000213d0000000100200190000006580000c13d000000400010043f000000200030008c000004200000413d00000006010000290000000001010433000000000001004b0000000002000039000000010200c039000000000021004b000004200000c13d000000000001004b000006ab0000c13d000002b701000041000000000010043f000002a4010000410000096b00010430000002ad01000041000000000010043f0000004101000039000000040010043f000002ae010000410000096b00010430000000400100043d000000200200003900000000022104360000000403000029000000000303043300000000003204350000004002100039000000000003004b0000066e0000613d00000000040000190000000306000029000000006506043400000000025204360000000104400039000000000034004b000006690000413d00000000021200490000025b0020009c0000025b0200804100000060022002100000025b0010009c0000025b010080410000004001100210000000000112019f0000096a0001042e000002ac01000041000000000010043f000002a4010000410000096b00010430000002ad01000041000000000010043f0000003201000039000000040010043f000002ae010000410000096b000104300000001f0530018f0000025d06300198000000400200043d0000000004620019000006980000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000006880000c13d000006980000013d0000001f0530018f0000025d06300198000000400200043d0000000004620019000006980000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000006940000c13d000000000005004b000006a50000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000025b0020009c0000025b020080410000004002200210000000000112019f0000096b000104300000000001000411000000000010043f0000000501000039000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d00000005020000290000000102200039000000000101043b000600000002001d000000000020043f000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000500000001001d00000000010004110000000602000029096908240000040f000000000001004b000006d60000c13d000002b601000041000000000010043f000002a4010000410000096b000104300000000101100270000000060110006b0000000001004019000003f10000013d000002a801000041000000040010043f0000000501000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000702000029000002af0020009c000006eb0000c13d000002b501000041000000000010043f00000294010000410000096b00010430000002c202100167000000070000006b0000000703000029000002af03006041000400000003001d000000000202041a000000000002004b0000074b0000c13d000000000201041a000000040020006c0000075b0000613d0000000102100039000000000202041a000000040020006c0000075b0000613d0000000201100039000000000101041a000000040010006c0000075b0000613d0000000601000029000000000010043f0000000401000039000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000702000029000000000020043f000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000000000201041a0000000102200039000000000021041b0000000001000411000000000010043f0000000601000039000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000000000201041a00000000030004160000000002320019000000000021041b000002a801000041000000040010043f0000000501000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000201043b000002c201200167000200000001001d000000000101041a000500000002001d000000200020043f000300000001001d000000000001004b000007a10000c13d0000000501000029000000000101041a000000000001004b000007610000c13d00000004010000290000000502000029000007ba0000013d000000200010043f0000000401000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000000000101041a000000000001004b000006fe0000613d000002b401000041000000000010043f0000000701000029000000040010043f000002ae010000410000096b00010430000000040010006c000007bb0000613d00000005020000290000000102200039000000000302041a000300000003001d000000000003004b0000076b0000c13d0000000401000029000007ba0000013d0000000303000029000000040030006c000007bb0000613d00000005020000290000000202200039000000000302041a000100000003001d000000000003004b000007690000613d0000000103000029000000040030006c000007bb0000613d000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000102000039000000000021041b0000000301000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000202000039000000000021041b0000000101000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b0000000302000039000000000021041b000300070000003d0000000401000029000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000004200000613d000000000101043b000000000201041a000000000002004b000007bb0000c13d0000000302000029000000010220027000000005032000290000000404000029000000000043041b0000000102200039000000000021041b000000010120021000000001011001bf0000000202000029000000000012041b00000000010004140000025b0010009c0000025b01008041000000c00110021000000260011001c70000800d020000390000000403000039000002b3040000410000000005000411000000070600002900000006070000290969095f0000040f0000000100200190000004200000613d000002e20000013d0000025f01000041000000000101041a0000000002000411000000000012004b000007d00000c13d000000000001042d000002c101000041000000000010043f00000294010000410000096b000104300002000000000002000000400100043d000002c40010009c0000081d0000813d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000400400043d0000029c0040009c0000081d0000213d0000008001400039000000400010043f0000000301000039000000000101041a00000078021002700000029902200197000000600340003900000000002304350000005002100270000002980220019700000040034000390000000000230435000000280210027000000298022001970000002003400039000000000023043500000298011001980000000000140435000008080000613d000100000001001d000200000004001d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000008230000613d000000000101043b000000010010006c00000002010000290000081c0000813d000000400100043d0000029c0010009c0000081d0000213d0000008002100039000000400020043f0000000202000039000000000402041a0000007802400270000002990220019700000060031000390000000000230435000000500240027000000298022001970000004003100039000000000023043500000298024001970000000002210436000000280340027000000298033001970000000000320435000000000001042d000002ad01000041000000000010043f0000004101000039000000040010043f000002ae010000410000096b00010430000000000001042f00030000000000020000000103000039000000000403041a000000400b00043d0000002403b00039000300000002001d0000000000230435000002b90300004100000000003b04350000025e051001970000000401b00039000000000051043500000000010004140000025e02400197000000040020008c000008390000c13d0000000103000031000000200030008c00000020040000390000000004034019000008670000013d000100000005001d0000025b00b0009c0000025b0300004100000000030b401900000040033002100000025b0010009c0000025b01008041000000c001100210000000000131019f000002ba011001c700020000000b001d096909640000040f000000020b00002900000060031002700000025b03300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b0019000008550000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b000008510000c13d000000000006004b000008620000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f00030000000103550000000100200190000008bc0000613d00000001050000290000001f01400039000000600210018f0000000001b20019000000000021004b000000000200003900000001020040390000029f0010009c000008b60000213d0000000100200190000008b60000c13d000000400010043f0000001f0030008c000008b40000a13d00000000010b0433000200000001001d000000000050043f0000000501000039000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000008b40000613d000000000101043b0000000302000029000000000020043f000000200010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a7011001c70000801002000039096909640000040f0000000100200190000008b40000613d000000000101043b000002a802000041000000040020043f000000000010043f00000000010004140000025b0010009c0000025b01008041000000c001100210000002a9011001c70000801002000039096909640000040f0000000100200190000008b40000613d000000000101043b000002c202100167000000000202041a000000000002004b000008a30000613d0000000102200270000008b10000013d000000000201041a000000000002004b0000000002000039000000010200c039000008b10000613d0000000103100039000000000303041a000000000003004b000008b10000613d0000000201100039000000000101041a000000000001004b00000003020000390000000202006039000000020120006b0000000001004019000000000001042d00000000010000190000096b00010430000002ad01000041000000000010043f0000004101000039000000040010043f000002ae010000410000096b000104300000001f0530018f0000025d06300198000000400200043d0000000004620019000008c70000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000008c30000c13d000000000005004b000008d40000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000025b0020009c0000025b020080410000004002200210000000000112019f0000096b00010430000300000000000200000000320104340000029802200198000009000000613d000200000002001d000300000003001d000100000001001d0000029501000041000000000010044300000000010004140000025b0010009c0000025b01008041000000c00110021000000296011001c70000800b02000039096909640000040f0000000100200190000009020000613d000000000101043b000000020210006c00000000010000190000000303000029000009010000413d00000000010304330000029801100198000009030000613d00000000011200d90000000102000029000000400220003900000000020204330000029802200197000000000012001a000009090000413d0000000001120019000002c20010009c000009090000613d0000000101100039000000000001042d0000000001000019000000000001042d000000000001042f000002ad01000041000000000010043f0000001201000039000000040010043f000002ae010000410000096b00010430000002ad01000041000000000010043f0000001101000039000000040010043f000002ae010000410000096b0001043000010000000000020000025f02000041000000000502041a00000000020004140000025e061001970000025b0020009c0000025b02008041000000c00120021000000260011001c70000800d0200003900000003030000390000026104000041000100000006001d0969095f0000040f0000000100200190000009230000613d0000025f010000410000000102000029000000000021041b000000000001042d00000000010000190000096b000104300001000000000002000100000002001d00000262020000410000000c0020043f000000000010043f00000000010004140000025b0010009c0000025b01008041000000c00110021000000263011001c70000801002000039096909640000040f0000000100200190000009470000613d000000010200008a000000010220014f000000000101043b000000000301041a000000000623016f000000000061041b0000000c0100043d000000000200041400000060051002700000025b0020009c0000025b02008041000000c00120021000000260011001c70000800d02000039000000030300003900000264040000410969095f0000040f0000000100200190000009470000613d000000000001042d00000000010000190000096b00010430000000000001042f0000025b0010009c0000025b0100804100000040011002100000025b0020009c0000025b020080410000006002200210000000000112019f00000000020004140000025b0020009c0000025b02008041000000c002200210000000000112019f00000260011001c70000801002000039096909640000040f00000001002001900000095d0000613d000000000101043b000000000001042d00000000010000190000096b0001043000000962002104210000000102000039000000000001042d0000000002000019000000000001042d00000967002104230000000102000039000000000001042d0000000002000019000000000001042d00000969000004320000096a0001042e0000096b0001043000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392702000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0000000000000000000000000000000000000000000000000000000008b78c6d802000000000000000000000000000000000000200000000c0000000000000000715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26ffffffffffffffffffffffff0000000000000000000000000000000000000000d4fa96e66957e7fa081abac03d339088a2e967438e311b713ab2e34c3fe1ec7d0000000200000000000000000000000000000040000001000000000000000000000000000000000000000000000000000000000000000000000000007667180700000000000000000000000000000000000000000000000000000000bb4fceb800000000000000000000000000000000000000000000000000000000ec87621b00000000000000000000000000000000000000000000000000000000f2fde38a00000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000fee81cf400000000000000000000000000000000000000000000000000000000ec87621c00000000000000000000000000000000000000000000000000000000f04e283e00000000000000000000000000000000000000000000000000000000c11cb21900000000000000000000000000000000000000000000000000000000c11cb21a00000000000000000000000000000000000000000000000000000000dc9d130f00000000000000000000000000000000000000000000000000000000bb4fceb900000000000000000000000000000000000000000000000000000000bc89891200000000000000000000000000000000000000000000000000000000802bfd1a000000000000000000000000000000000000000000000000000000008da5cb5a000000000000000000000000000000000000000000000000000000008da5cb5b00000000000000000000000000000000000000000000000000000000a88ea61600000000000000000000000000000000000000000000000000000000802bfd1b00000000000000000000000000000000000000000000000000000000874b0b4900000000000000000000000000000000000000000000000000000000766718080000000000000000000000000000000000000000000000000000000077166067000000000000000000000000000000000000000000000000000000007c7f9449000000000000000000000000000000000000000000000000000000004c1b8ffc0000000000000000000000000000000000000000000000000000000054d1f13c000000000000000000000000000000000000000000000000000000007060a226000000000000000000000000000000000000000000000000000000007060a22700000000000000000000000000000000000000000000000000000000715018a60000000000000000000000000000000000000000000000000000000054d1f13d0000000000000000000000000000000000000000000000000000000058fcf577000000000000000000000000000000000000000000000000000000004c1b8ffd00000000000000000000000000000000000000000000000000000000504fd0ab00000000000000000000000000000000000000000000000000000000514e62fc0000000000000000000000000000000000000000000000000000000025692961000000000000000000000000000000000000000000000000000000003ccfd60a000000000000000000000000000000000000000000000000000000003ccfd60b000000000000000000000000000000000000000000000000000000004a4ee7b10000000000000000000000000000000000000000000000000000000025692962000000000000000000000000000000000000000000000000000000002de9480700000000000000000000000000000000000000000000000000000000183a4f6e000000000000000000000000000000000000000000000000000000001c10893f000000000000000000000000000000000000000000000000000000001cd64df400000000000000000000000000000000000000000000000000000000389a75e10000000000000000000000000000000000000020000000800000000000000000000000000000000000000000000000000000000000000000000000007448fbae00000000000000000000000000000000000000040000001c0000000000000000796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d955391320200000200000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000006f5e8818000000000000000000000000000000000000000000000000000000ffffffffff0000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff7f020000000000000000000000000000000000006000000000000000000000000050fa6c258ed0d426d18a4bd47c5a4d5daf1f3b3fa33aefbc41c4f28ccdae2ccc000000000000000000000000000000000000000000000000ffffffffffffffff0000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000ffffffffff00000000000000000000000000000000000000000000ffffffffff00000000000000000000dba16ce80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000800000000000000000700f0e7ca61201d6ee6388b8ea55056c47f2472fd7f3320171d54260c6008eff02000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000018fb58640200000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000001ffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe04e23d035000000000000000000000000000000000000000000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000000000000fbb67fda52d4bfb8bf0000000000000000000000000000000000000020000000000000000000000000aa7feadc000000000000000000000000000000000000000000000000000000005004ffde00000000000000000000000000000000000000000000000000000000ea66f58e474bc09f580000e81f31b334d171db387d0c6098ba47bd897741679bda1a7ce40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f5a267f15a6eec7c00000000000000000000000000000000000000000000000000000000653a11c6000000000000000000000000000000000000000000000000000000009b8cc475000000000000000000000000000000000000000000000000000000008ed7ee04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000fa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c929cc7f708afc65944829bd487b90b72536b1951864fbfc14e125fc972a6507f390200000200000000000000000000000000000024000000000000000000000000750b219c00000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd5d00dbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d0000000000000000000000000000000000000000000000000000000082b42900ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffff80000000000000000000000000000000000000000000000000000000000000000057d23d6223388d70daeb901ca9a27526992eddda9f7066e522082b4de9db7567
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ 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.