Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
VotingSlot
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./helpers/TransferHelper.sol"; import "./libraries/DateTimeHelpers.sol"; import "./interfaces/IVotingSlot.sol"; import "./interfaces/IStakingPool.sol"; contract VotingSlot is Ownable, AccessControl, Pausable, ReentrancyGuard, IVotingSlot { string public name; string public description; string public image; uint256 public voteStartDate; uint256 public voteEndDate; mapping(address => uint256) public votes; mapping(address => bool) private _blocked; mapping(address => mapping(bytes32 => uint256)) private _votesPerDay; uint256 public positiveVoteWeight; uint256 public negativeVoteWeight; uint256 maxVoteWeightPerUser; bool private isAlreadyInitialized; bytes32 public constant MOD_ROLE = keccak256(abi.encodePacked("MODERATOR")); IStakingPool public stakingPool; uint16 public maxFreeVotesPerDay; constructor(address _newOwner) { _transferOwnership(_newOwner); } modifier mustBeModeratorOrOwner() { address sender = _msgSender(); require(hasRole(MOD_ROLE, sender) || sender == owner(), "OnlyModeratorOrOwner"); _; } modifier mustNotBeBlocked() { address sender = _msgSender(); if (blocked(sender)) revert Blocked(); _; } modifier onlyDuringVotingPeriod() { require(block.timestamp >= voteStartDate && block.timestamp <= voteEndDate, "VotingPeriodNotActive"); _; } function initialize( string memory _name, string memory _description, string memory _image, address newOwner, IStakingPool _stakingPool, uint16 _maxFreeVotesPerDay, uint256 _voteStartDate, uint256 _voteEndDate, uint256 _maxVoteWeightPerUser ) external { if (isAlreadyInitialized) revert AlreadyInitialized(); _grantRole(MOD_ROLE, _msgSender()); setName(_name); setDescription(_description); setImage(_image); setStakingPool(_stakingPool); setMaxFreeVotesPerDay(_maxFreeVotesPerDay); setVoteStartDate(_voteStartDate); setVoteEndDate(_voteEndDate); setMaxVoteWeightPerUser(_maxVoteWeightPerUser); _grantRole(MOD_ROLE, newOwner); _transferOwnership(newOwner); isAlreadyInitialized = true; emit Initialized(_name, _description, _image, newOwner, address(_stakingPool), _maxFreeVotesPerDay, _voteStartDate, _voteEndDate, _maxVoteWeightPerUser); } function voteYes() external mustNotBeBlocked whenNotPaused nonReentrant onlyDuringVotingPeriod { address account = _msgSender(); uint256 accountStaked = stakingPool.amountStaked(account); bytes32 currentDayBytes32 = currentDayToBytes32(); uint256 todaysVotes = _votesPerDay[account][currentDayBytes32]; // Check for free vote eligibility if (accountStaked == 0) { if (todaysVotes >= maxFreeVotesPerDay) { revert ReachedMaximumFreeVotesPerDay(); } } votes[account] += 1; positiveVoteWeight += 1; // Update the daily vote counter _votesPerDay[account][currentDayBytes32] += 1; // Emit events for tracking emit UpdateNoOfYesVotes(positiveVoteWeight); } function voteNo() external mustNotBeBlocked whenNotPaused nonReentrant onlyDuringVotingPeriod { address account = _msgSender(); uint256 accountStaked = stakingPool.amountStaked(account); bytes32 currentDayBytes32 = currentDayToBytes32(); uint256 todaysVotes = _votesPerDay[account][currentDayBytes32]; // Check for free vote eligibility if (accountStaked == 0) { if (todaysVotes >= maxFreeVotesPerDay) { revert ReachedMaximumFreeVotesPerDay(); } } // Record Vote votes[account] += 1; negativeVoteWeight += 1; // Update the daily vote counter _votesPerDay[account][currentDayBytes32] += 1; // Emit events for tracking emit UpdateNoOfNoVotes(negativeVoteWeight); } function setName(string memory _name) public mustBeModeratorOrOwner { name = _name; emit UpdatedName(_name); } function setDescription(string memory _description) public mustBeModeratorOrOwner { description = _description; emit UpdatedDescription(_description); } function setImage(string memory _image) public mustBeModeratorOrOwner { image = _image; emit UpdatedImage(_image); } function setStakingPool(IStakingPool _stakingPool) public mustBeModeratorOrOwner { stakingPool = _stakingPool; emit UpdatedStakingPool(address(_stakingPool)); } function setMaxFreeVotesPerDay(uint16 _maxFreeVotesPerDay) public mustBeModeratorOrOwner { maxFreeVotesPerDay = _maxFreeVotesPerDay; } function setVoteStartDate(uint256 _voteStartDate) public mustBeModeratorOrOwner { voteStartDate = _voteStartDate; emit UpdatedVoteStartDate(_voteStartDate); } function setVoteEndDate(uint256 _voteEndDate) public mustBeModeratorOrOwner { voteEndDate = _voteEndDate; emit UpdatedVoteEndDate(_voteEndDate); } function setMaxVoteWeightPerUser(uint256 _maxVoteWeightPerUser) public mustBeModeratorOrOwner { maxVoteWeightPerUser = _maxVoteWeightPerUser; } function blocked(address _account) public view returns (bool) { return _blocked[_account]; } function switchBlockStatus(address _account) external mustBeModeratorOrOwner { _blocked[_account] = !_blocked[_account]; } function currentDayToBytes32() public view returns (bytes32) { (uint256 year, uint256 month, uint256 day) = DateTimeHelpers.timestampToDate(block.timestamp); return keccak256(abi.encodePacked(year, month, day)); } function grantModRole(address _account) public onlyOwner whenNotPaused { if (hasRole(MOD_ROLE, _account)) revert AlreadyModerator(); _grantRole(MOD_ROLE, _account); } function removeModRole(address _account) public onlyOwner whenNotPaused { if (!hasRole(MOD_ROLE, _account)) revert NotModerator(); _revokeRole(MOD_ROLE, _account); } function grantModRoleToMany(address[] memory _accounts) external onlyOwner whenNotPaused { for (uint i = 0; i < _accounts.length; i++) { grantModRole(_accounts[i]); } } function revokeModRoleFromMany(address[] memory _accounts) external onlyOwner whenNotPaused { for (uint i = 0; i < _accounts.length; i++) { removeModRole(_accounts[i]); } } function retrieveERC20(address _token, uint256 _amount, address _to) public mustBeModeratorOrOwner { uint256 retrievableBalance = IERC20(_token).balanceOf(address(this)); require(_amount <= retrievableBalance, "ABV: amount_greater_than_retrievable_balance"); TransferHelpers.safeTransferERC20(_token, _to, _amount); } function changePauseState() external mustBeModeratorOrOwner { if (paused()) _unpause(); else _pause(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; library TransferHelpers { using Address for address; function safeTransferERC20(address token, address to, uint256 amount) internal { bytes4 encodedFunc = bytes4(keccak256(bytes("transfer(address,uint256)"))); token.functionCall(abi.encodeWithSelector(encodedFunc, to, amount)); } function safeTransferFromERC20(address token, address from, address to, uint256 amount) internal { bytes4 encodedFunc = bytes4(keccak256(bytes("transferFrom(address,address,uint256)"))); token.functionCall(abi.encodeWithSelector(encodedFunc, from, to, amount)); } function safeTransferEther(address to, uint256 amount) internal returns (bool success) { (success, ) = to.call{value: amount}(new bytes(0)); } }
pragma solidity ^0.8.0; interface IStakingPool { event Stake(address indexed account, uint256 amount, uint256 timestamp); event Unstake(address indexed account, uint256 amount); event Withdrawal(address indexed account, uint amount0, uint256 amount1); event StakeFeePercentageChange(uint16 stakeFeePercentageChange); event WithdrawalFeePercentageChange(uint16 withdrawalFeePercentageChange); event APYRateChange(uint24 apyRate); error ZeroAddressForFeesSet(); error Blocked(); error OnlyModeratorOrOwner(); error RewardIsZero(); error NoStake(); error AlreadyModerator(); error NotModerator(); error AlreadyInitialized(); event RewardsAdded(uint256 reward); event RewardDrained(uint256 amount); function blockedAddresses(address) external view returns (bool); function stakeFeePercentage() external view returns (uint16); function token0() external view returns (address); function token1() external view returns (address); function apyRate() external view returns (uint24); function withdrawalIntervals() external view returns (uint256); function feeReceiver() external view returns (address); function amountStaked(address) external view returns (uint256); function lastStakeTime(address) external view returns (uint256); function nextWithdrawalTime(address) external view returns (uint256); function blocked(address _account) external view returns (bool); event Initialized( address newOwner, address token0, address token1, uint24 apyRate, uint16 stakeFeePercentage, uint16 withdrawalFeePercentage, address feeReceiver, uint256 intervals ); function initialize( address _newOwner, address _token0, address _token1, uint24 _apyRate, uint16 _stakeFeePercentage, uint16 _withdrawalFeePercentage, address _feeReceiver, uint256 _intervals ) external; }
pragma solidity ^0.8.0; import {IStakingPool} from "./IStakingPool.sol"; interface IVotingSlot { error AlreadyModerator(); error NotModerator(); error AlreadyInitialized(); error Blocked(); error OnlyModeratorOrOwner(); error ReachedMaximumFreeVotesPerDay(); event Initialized( string name, string description, string image, address newOwner, address stakingPool, uint16 maxFreeVotesPerDay, uint256 voteStartDate, uint256 voteEndDate, uint256 maxVoteWeightPerUser ); event UpdatedName(string name); event UpdatedDescription(string description); event UpdatedImage(string image); event UpdatedStakingPool(address stakingPool); event UpdatedVoteWeight(uint256 voteWeight); event UpdatedVoteStartDate(uint256 voteStartDate); event UpdatedVoteEndDate(uint256 voteEndDate); event UpdateNoOfYesVotes(uint256 amount); event UpdateNoOfNoVotes(uint256 amount); function positiveVoteWeight() external view returns (uint256); function negativeVoteWeight() external view returns (uint256); function name() external view returns (string memory); function description() external view returns (string memory); function votes(address) external view returns (uint256); function blocked(address _account) external view returns (bool); function initialize( string memory name, string memory description, string memory image, address newOwner, IStakingPool stakingPool, uint16 maxFreeVotesPerDay, uint256 voteStartDate, uint256 voteEndDate, uint256 maxVoteWeightPerUser ) external; function stakingPool() external view returns (IStakingPool); function image() external view returns (string memory); function maxFreeVotesPerDay() external view returns (uint16); }
pragma solidity ^0.8.0; // ---------------------------------------------------------------------------- // BokkyPooBah's DateTime Library v1.00 // // A gas-efficient Solidity date and time library // // https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary // // Tested date range 1970/01/01 to 2345/12/31 // // Conventions: // Unit | Range | Notes // :-------- |:-------------:|:----- // timestamp | >= 0 | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC // year | 1970 ... 2345 | // month | 1 ... 12 | // day | 1 ... 31 | // hour | 0 ... 23 | // minute | 0 ... 59 | // second | 0 ... 59 | // dayOfWeek | 1 ... 7 | 1 = Monday, ..., 7 = Sunday // // // Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018. // // GNU Lesser General Public License 3.0 // https://www.gnu.org/licenses/lgpl-3.0.en.html // ---------------------------------------------------------------------------- library DateTimeHelpers { uint constant SECONDS_PER_DAY = 24 * 60 * 60; uint constant SECONDS_PER_HOUR = 60 * 60; uint constant SECONDS_PER_MINUTE = 60; int constant OFFSET19700101 = 2440588; uint constant DOW_MON = 1; uint constant DOW_TUE = 2; uint constant DOW_WED = 3; uint constant DOW_THU = 4; uint constant DOW_FRI = 5; uint constant DOW_SAT = 6; uint constant DOW_SUN = 7; // ------------------------------------------------------------------------ // Calculate the number of days from 1970/01/01 to year/month/day using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and subtracting the offset 2440588 so that 1970/01/01 is day 0 // // days = day // - 32075 // + 1461 * (year + 4800 + (month - 14) / 12) / 4 // + 367 * (month - 2 - (month - 14) / 12 * 12) / 12 // - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4 // - offset // ------------------------------------------------------------------------ function _daysFromDate(uint year, uint month, uint day) internal pure returns (uint _days) { require(year >= 1970); int _year = int(year); int _month = int(month); int _day = int(day); int __days = _day - 32075 + (1461 * (_year + 4800 + (_month - 14) / 12)) / 4 + (367 * (_month - 2 - ((_month - 14) / 12) * 12)) / 12 - (3 * ((_year + 4900 + (_month - 14) / 12) / 100)) / 4 - OFFSET19700101; _days = uint(__days); } // ------------------------------------------------------------------------ // Calculate year/month/day from the number of days since 1970/01/01 using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and adding the offset 2440588 so that 1970/01/01 is day 0 // // int L = days + 68569 + offset // int N = 4 * L / 146097 // L = L - (146097 * N + 3) / 4 // year = 4000 * (L + 1) / 1461001 // L = L - 1461 * year / 4 + 31 // month = 80 * L / 2447 // dd = L - 2447 * month / 80 // L = month / 11 // month = month + 2 - 12 * L // year = 100 * (N - 49) + year + L // ------------------------------------------------------------------------ function _daysToDate(uint _days) internal pure returns (uint year, uint month, uint day) { int __days = int(_days); int L = __days + 68569 + OFFSET19700101; int N = (4 * L) / 146097; L = L - (146097 * N + 3) / 4; int _year = (4000 * (L + 1)) / 1461001; L = L - (1461 * _year) / 4 + 31; int _month = (80 * L) / 2447; int _day = L - (2447 * _month) / 80; L = _month / 11; _month = _month + 2 - 12 * L; _year = 100 * (N - 49) + _year + L; year = uint(_year); month = uint(_month); day = uint(_day); } function timestampFromDate(uint year, uint month, uint day) internal pure returns (uint timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY; } function timestampFromDateTime(uint year, uint month, uint day, uint hour, uint minute, uint second) internal pure returns (uint timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + hour * SECONDS_PER_HOUR + minute * SECONDS_PER_MINUTE + second; } function timestampToDate(uint timestamp) internal pure returns (uint year, uint month, uint day) { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function timestampToDateTime(uint timestamp) internal pure returns (uint year, uint month, uint day, uint hour, uint minute, uint second) { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; secs = secs % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; second = secs % SECONDS_PER_MINUTE; } function isValidDate(uint year, uint month, uint day) internal pure returns (bool valid) { if (year >= 1970 && month > 0 && month <= 12) { uint daysInMonth = _getDaysInMonth(year, month); if (day > 0 && day <= daysInMonth) { valid = true; } } } function isValidDateTime(uint year, uint month, uint day, uint hour, uint minute, uint second) internal pure returns (bool valid) { if (isValidDate(year, month, day)) { if (hour < 24 && minute < 60 && second < 60) { valid = true; } } } function isLeapYear(uint timestamp) internal pure returns (bool leapYear) { uint year; uint month; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); leapYear = _isLeapYear(year); } function _isLeapYear(uint year) internal pure returns (bool leapYear) { leapYear = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); } function isWeekDay(uint timestamp) internal pure returns (bool weekDay) { weekDay = getDayOfWeek(timestamp) <= DOW_FRI; } function isWeekEnd(uint timestamp) internal pure returns (bool weekEnd) { weekEnd = getDayOfWeek(timestamp) >= DOW_SAT; } function getDaysInMonth(uint timestamp) internal pure returns (uint daysInMonth) { uint year; uint month; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); daysInMonth = _getDaysInMonth(year, month); } function _getDaysInMonth(uint year, uint month) internal pure returns (uint daysInMonth) { if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { daysInMonth = 31; } else if (month != 2) { daysInMonth = 30; } else { daysInMonth = _isLeapYear(year) ? 29 : 28; } } // 1 = Monday, 7 = Sunday function getDayOfWeek(uint timestamp) internal pure returns (uint dayOfWeek) { uint _days = timestamp / SECONDS_PER_DAY; dayOfWeek = ((_days + 3) % 7) + 1; } function getYear(uint timestamp) internal pure returns (uint year) { uint month; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getMonth(uint timestamp) internal pure returns (uint month) { uint year; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getDay(uint timestamp) internal pure returns (uint day) { uint year; uint month; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getHour(uint timestamp) internal pure returns (uint hour) { uint secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; } function getMinute(uint timestamp) internal pure returns (uint minute) { uint secs = timestamp % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; } function getSecond(uint timestamp) internal pure returns (uint second) { second = timestamp % SECONDS_PER_MINUTE; } function addYears(uint timestamp, uint _years) internal pure returns (uint newTimestamp) { uint year; uint month; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); year += _years; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp >= timestamp); } function addMonths(uint timestamp, uint _months) internal pure returns (uint newTimestamp) { uint year; uint month; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); month += _months; year += (month - 1) / 12; month = ((month - 1) % 12) + 1; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp >= timestamp); } function addDays(uint timestamp, uint _days) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _days * SECONDS_PER_DAY; require(newTimestamp >= timestamp); } function addHours(uint timestamp, uint _hours) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _hours * SECONDS_PER_HOUR; require(newTimestamp >= timestamp); } function addMinutes(uint timestamp, uint _minutes) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _minutes * SECONDS_PER_MINUTE; require(newTimestamp >= timestamp); } function addSeconds(uint timestamp, uint _seconds) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _seconds; require(newTimestamp >= timestamp); } function subYears(uint timestamp, uint _years) internal pure returns (uint newTimestamp) { uint year; uint month; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); year -= _years; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp <= timestamp); } function subMonths(uint timestamp, uint _months) internal pure returns (uint newTimestamp) { uint year; uint month; uint day; (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint yearMonth = year * 12 + (month - 1) - _months; year = yearMonth / 12; month = (yearMonth % 12) + 1; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp <= timestamp); } function subDays(uint timestamp, uint _days) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _days * SECONDS_PER_DAY; require(newTimestamp <= timestamp); } function subHours(uint timestamp, uint _hours) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _hours * SECONDS_PER_HOUR; require(newTimestamp <= timestamp); } function subMinutes(uint timestamp, uint _minutes) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _minutes * SECONDS_PER_MINUTE; require(newTimestamp <= timestamp); } function subSeconds(uint timestamp, uint _seconds) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _seconds; require(newTimestamp <= timestamp); } function diffYears(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _years) { require(fromTimestamp <= toTimestamp); uint fromYear; uint fromMonth; uint fromDay; uint toYear; uint toMonth; uint toDay; (fromYear, fromMonth, fromDay) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (toYear, toMonth, toDay) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _years = toYear - fromYear; } function diffMonths(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _months) { require(fromTimestamp <= toTimestamp); uint fromYear; uint fromMonth; uint fromDay; uint toYear; uint toMonth; uint toDay; (fromYear, fromMonth, fromDay) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (toYear, toMonth, toDay) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _months = toYear * 12 + toMonth - fromYear * 12 - fromMonth; } function diffDays(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _days) { require(fromTimestamp <= toTimestamp); _days = (toTimestamp - fromTimestamp) / SECONDS_PER_DAY; } function diffHours(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _hours) { require(fromTimestamp <= toTimestamp); _hours = (toTimestamp - fromTimestamp) / SECONDS_PER_HOUR; } function diffMinutes(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _minutes) { require(fromTimestamp <= toTimestamp); _minutes = (toTimestamp - fromTimestamp) / SECONDS_PER_MINUTE; } function diffSeconds(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _seconds) { require(fromTimestamp <= toTimestamp); _seconds = toTimestamp - fromTimestamp; } }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"AlreadyModerator","type":"error"},{"inputs":[],"name":"Blocked","type":"error"},{"inputs":[],"name":"NotModerator","type":"error"},{"inputs":[],"name":"OnlyModeratorOrOwner","type":"error"},{"inputs":[],"name":"ReachedMaximumFreeVotesPerDay","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"description","type":"string"},{"indexed":false,"internalType":"string","name":"image","type":"string"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"},{"indexed":false,"internalType":"address","name":"stakingPool","type":"address"},{"indexed":false,"internalType":"uint16","name":"maxFreeVotesPerDay","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"voteStartDate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"voteEndDate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxVoteWeightPerUser","type":"uint256"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UpdateNoOfNoVotes","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UpdateNoOfYesVotes","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"description","type":"string"}],"name":"UpdatedDescription","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"image","type":"string"}],"name":"UpdatedImage","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"UpdatedName","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"stakingPool","type":"address"}],"name":"UpdatedStakingPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voteEndDate","type":"uint256"}],"name":"UpdatedVoteEndDate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voteStartDate","type":"uint256"}],"name":"UpdatedVoteStartDate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voteWeight","type":"uint256"}],"name":"UpdatedVoteWeight","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MOD_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"blocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changePauseState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentDayToBytes32","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"grantModRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"}],"name":"grantModRoleToMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"image","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"string","name":"_image","type":"string"},{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"contract IStakingPool","name":"_stakingPool","type":"address"},{"internalType":"uint16","name":"_maxFreeVotesPerDay","type":"uint16"},{"internalType":"uint256","name":"_voteStartDate","type":"uint256"},{"internalType":"uint256","name":"_voteEndDate","type":"uint256"},{"internalType":"uint256","name":"_maxVoteWeightPerUser","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxFreeVotesPerDay","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"negativeVoteWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"positiveVoteWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removeModRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"retrieveERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"}],"name":"revokeModRoleFromMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_image","type":"string"}],"name":"setImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_maxFreeVotesPerDay","type":"uint16"}],"name":"setMaxFreeVotesPerDay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxVoteWeightPerUser","type":"uint256"}],"name":"setMaxVoteWeightPerUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"setName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStakingPool","name":"_stakingPool","type":"address"}],"name":"setStakingPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_voteEndDate","type":"uint256"}],"name":"setVoteEndDate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_voteStartDate","type":"uint256"}],"name":"setVoteStartDate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingPool","outputs":[{"internalType":"contract IStakingPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"switchBlockStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voteEndDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voteNo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voteStartDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voteYes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"votes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080346200008957601f62002e2938819003918201601f19168301916001600160401b038311848410176200008e578084926020946040528339810103126200008957516001600160a01b0381168103620000895762000079906200006433620000a4565b60ff19600254166002556001600355620000a4565b604051612d3d9081620000ec8239f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146121285750806306fdde03146120945780630c56ae3b146120675780630e8fe6ed14611ff35780631985276b14611faa57806322e6541614611f64578063248a9ca314611f355780632f2ff15d14611efb5780633028f63a14611e5b57806335d9e40914611e3d57806336568abe14611dab57806341c12a7014611c2457806346e79ffc14611b1c578063475dfdc814611aa85780635c975abb14611a8557806368e1b43114611a67578063703c6d16146119f7578063715018a61461199e57806371adb5e6146117ce5780637284e4161461173a5780637c41370f146115495780638085ceaa146114d5578063877816391461144f5780638d7e0acb146114315780638da5cb5b146114085780638dcbc1821461139057806390c3f38f146111c557806390cf581c14610ff857806391d1485414610fab578063a217fddf14610f8f578063be489f9f14610f71578063c47f002714610d9b578063d547741f14610d5c578063d8bff5a514610d22578063dfaea7e614610cfd578063e135abe414610ce2578063e596219514610ca3578063e8dd67d4146103fc578063e932406f146103d9578063f2fde38b1461034c578063f3ccaac0146102785763f96c678c146101ed57600080fd5b3461027357602036600319011261027357610206612254565b61020e61278b565b610216612895565b61024a81610222612372565b600052600160205260406000209060018060a01b031660005260205260ff6040600020541690565b6102615761025f9061025a612372565b61269b565b005b60405163979119d560e01b8152600490fd5b600080fd5b3461027357600036600319011261027357604051600060065461029a8161217b565b8084529060019081811690811561032557506001146102dc575b6102d8846102c4818603826121eb565b60405191829160208352602083019061222f565b0390f35b600660009081529250600080516020612cc88339815191525b82841061030d5750505081016020016102c4826102b4565b805460208587018101919091529093019281016102f5565b60ff191660208087019190915292151560051b850190920192506102c491508390506102b4565b3461027357602036600319011261027357610365612254565b61036d61278b565b6001600160a01b038116156103855761025f906127e3565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346102735760003660031901126102735760206103f4612372565b604051908152f35b3461027357610120366003190112610273576004356001600160401b0381116102735761042d90369060040161229b565b6024356001600160401b0381116102735761044c90369060040161229b565b906044356001600160401b0381116102735761046c90369060040161229b565b906064356001600160a01b0381169003610273576084356001600160a01b03811690036102735761ffff60a4351660a435036102735760ff600f5416610c92576104be6104b7612372565b339061269b565b6104ca33610222612372565b8015610c7e575b6104da9061292f565b8051926001600160401b038411610a72576104f660045461217b565b601f8111610c15575b50602093601f8111600114610ba2578091929394600091610b97575b508160011b916000199060031b1c1916176004555b7f2319d1693ced5c256216527c7586842758cea48e90a4d4f69304f768834137986040516020815280610566602082018661222f565b0390a161057533610222612372565b8015610b83575b6105859061292f565b8051926001600160401b038411610a72576105a160055461217b565b601f8111610b1a575b50602093601f8111600114610aa7578091929394600091610a9c575b508160011b916000199060031b1c1916176005555b7f8e7ee28d3d3b0dd81239d1c0e48b77da9bfa4f63eb4db88c5789bd289d1ec4626040516020815280610611602082018661222f565b0390a161062033610222612372565b8015610a88575b6106309061292f565b80516001600160401b038111610a725761064b60065461217b565b601f8111610a09575b506020601f821160011461096c577f192cc1322b8fe74e0f381eb2f0e119dcbe941446a1a7ba28e170751db2c334fc94928261089c95936108b893600091610961575b508160011b916000199060031b1c1916176006555b7ff82c617ae111c7dc97cff5fbdc800e6de1cc79d739ef5a400a7c6746fa7a611a60405160208152806106e2602082018561222f565b0390a16106f133610222612372565b801561094d575b6107019061292f565b600f8054610100600160a81b03198116608435600881901b610100600160a81b03169182179093556040516001600160a01b03909316835290917f513ee920caa09c71ce9ebfe8d94110ab1ed6bb1870fd87cce129a2c8e8979ed490602090a161076d33610222612372565b8015610939575b61077d9061292f565b610100600160b81b03199091161760a43560a81b61ffff60a81b1617600f556107a833610222612372565b8015610925575b6107b89061292f565b60c4356007557f8f6e626fd72fbc5be13797576edf29d80e31d6b396fc85190028e1e19c455fa9602060405160c4358152a16107f633610222612372565b8015610911575b6108069061292f565b60e4356008557fde6c59c355067bf24092d3ed8616e15f3741ec2ce12f7cb2d817c7523ef6b4ce602060405160e4358152a161084433610222612372565b80156108fd575b6108549061292f565b6108aa610104359384600e5561086e60643561025a612372565b6108796064356127e3565b600160ff19600f541617600f55604051968796610120885261012088019061222f565b90868203602088015261222f565b90848203604086015261222f565b6001600160a01b036064358116606085015260843516608084015261ffff60a4351660a084015260c43560c084015260e43560e08401526101008301919091520390a1005b506000546001600160a01b0316331461084b565b506000546001600160a01b031633146107fd565b506000546001600160a01b031633146107af565b506000546001600160a01b03163314610774565b506000546001600160a01b031633146106f8565b905082015188610697565b6006600052600080516020612cc88339815191529060005b601f19841681106109f15750926001836108b8937f192cc1322b8fe74e0f381eb2f0e119dcbe941446a1a7ba28e170751db2c334fc989661089c9896601f198116106109d8575b5050811b016006556106ac565b84015160001960f88460031b161c1916905588806109cb565b90916020600181928588015181550193019101610984565b6006600052601f820160051c600080516020612cc88339815191520160208310610a5d575b601f820160051c600080516020612cc8833981519152018110610a515750610654565b60008155600101610a2e565b50600080516020612cc8833981519152610a2e565b634e487b7160e01b600052604160045260246000fd5b506000546001600160a01b03163314610627565b9050830151856105c6565b6005600052600080516020612ca883398151915260005b601f1983168110610b02575060019293949582601f19811610610ae9575b5050811b016005556105db565b85015160001960f88460031b161c191690558580610adc565b84870151825560209687019660019092019101610abe565b6005600052601f850160051c600080516020612ca88339815191520160208610610b6e575b601f820160051c600080516020612ca8833981519152018110610b6257506105aa565b60008155600101610b3f565b50600080516020612ca8833981519152610b3f565b506000546001600160a01b0316331461057c565b90508301518561051b565b6004600052600080516020612ce883398151915260005b601f1983168110610bfd575060019293949582601f19811610610be4575b5050811b01600455610530565b85015160001960f88460031b161c191690558580610bd7565b84870151825560209687019660019092019101610bb9565b6004600052601f850160051c600080516020612ce88339815191520160208610610c69575b601f820160051c600080516020612ce8833981519152018110610c5d57506104ff565b60008155600101610c3a565b50600080516020612ce8833981519152610c3a565b506000546001600160a01b031633146104d1565b60405162dc149f60e41b8152600490fd5b34610273576020366003190112610273576001600160a01b03610cc4612254565b16600052600a602052602060ff604060002054166040519015158152f35b346102735760003660031901126102735760206103f4612972565b3461027357600036600319011261027357602061ffff600f5460a81c16604051908152f35b34610273576020366003190112610273576001600160a01b03610d43612254565b1660005260096020526020604060002054604051908152f35b346102735760403660031901126102735761025f600435610d7b61226a565b90806000526001602052610d9660016040600020015461239c565b612715565b3461027357602080600319360112610273576001600160401b039060043582811161027357610dce90369060040161229b565b90610ddb33610222612372565b8015610f5d575b610deb9061292f565b8151928311610a7257610dff60045461217b565b601f8111610f0b575b508092601f8111600114610e7a57807f2319d1693ced5c256216527c7586842758cea48e90a4d4f69304f7688341379894600091610e6f575b508160011b916000199060031b1c1916176004555b610e6a60405192828493845283019061222f565b0390a1005b905083015185610e41565b601f198116936004600052600080516020612ce88339815191529460005b818110610ef457509482916001937f2319d1693ced5c256216527c7586842758cea48e90a4d4f69304f768834137989710610edb575b5050811b01600455610e56565b85015160001960f88460031b161c191690558580610ece565b858301518755600190960195918401918401610e98565b6004600052600080516020612ce8833981519152601f850160051c810191838610610f53575b601f0160051c01905b818110610f475750610e08565b60008155600101610f3a565b9091508190610f31565b506000546001600160a01b03163314610de2565b34610273576000366003190112610273576020600c54604051908152f35b3461027357600036600319011261027357602060405160008152f35b3461027357604036600319011261027357610fc461226a565b600435600052600160205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b3461027357600036600319011261027357336000526020600a815260ff604060002054166111b357611028612895565b6110306128d9565b600754421015806111a7575b61104590612851565b600f54604051630ef40a6760e41b81523360048201528281602481600886901c6001600160a01b03165afa90811561119b5760009161116e575b50611088612972565b9133600052600b845260406000208360005284526040600020549115611148575b505033600052600982526040600020805490600182018092116111325755600c546001810180911161113257600c5533600052600b82526040600020906000528152604060002090815460018101809111611132577f05c702aa5f2f6a0bfc010218e724344d9a31301bdf6db75f7e9e28c4ef8844ec9255600c54604051908152a16001600355005b634e487b7160e01b600052601160045260246000fd5b60a81c61ffff16111561115c5782806110a9565b60405163042248ef60e51b8152600490fd5b90508281813d8311611194575b61118581836121eb565b8101031261027357518361107f565b503d61117b565b6040513d6000823e3d90fd5b5060085442111561103c565b60405163a5baf15160e01b8152600490fd5b3461027357602080600319360112610273576001600160401b0390600435828111610273576111f890369060040161229b565b9061120533610222612372565b801561137c575b6112159061292f565b8151928311610a7257600561122a815461217b565b601f811161132d575b508193601f811160011461129e57807f8e7ee28d3d3b0dd81239d1c0e48b77da9bfa4f63eb4db88c5789bd289d1ec46295600091611293575b508160011b916000199060031b1c1916179055610e6a60405192828493845283019061222f565b90508401518661126c565b601f1981169482600052600080516020612ca88339815191529560005b81811061131657509582916001937f8e7ee28d3d3b0dd81239d1c0e48b77da9bfa4f63eb4db88c5789bd289d1ec46298106112fd575b5050811b019055610e56565b86015160001960f88460031b161c1916905586806112f1565b8683015188556001909701969185019185016112bb565b81600052600080516020612ca8833981519152601f8601831c810191848710611372575b601f01831c01905b8181106113665750611233565b60008155600101611359565b9091508190611351565b506000546001600160a01b0316331461120c565b346102735761139e366122e2565b6113a661278b565b6113ae612895565b60005b815181101561025f576001600160a01b036113cc8284612bc5565b5116906113d761278b565b6113df612895565b6113eb82610222612372565b610261576113fe6114039261025a612372565b612bb6565b6113b1565b34610273576000366003190112610273576000546040516001600160a01b039091168152602090f35b34610273576000366003190112610273576020600d54604051908152f35b346102735761145d366122e2565b61146561278b565b61146d612895565b60005b815181101561025f576001600160a01b0361148b8284612bc5565b51169061149661278b565b61149e612895565b6114aa82610222612372565b156114c3576113fe6114be92610d96612372565b611470565b6040516375522eb560e11b8152600490fd5b34610273576020366003190112610273577fde6c59c355067bf24092d3ed8616e15f3741ec2ce12f7cb2d817c7523ef6b4ce602060043561151833610222612372565b8015611535575b6115289061292f565b80600855604051908152a1005b506000546001600160a01b0316331461151f565b3461027357606036600319011261027357611562612254565b6044356001600160a01b0381811692602435928490036102735761158833610222612372565b801561172d575b6115989061292f565b60405180926370a0823160e01b8252306004830152816024602095869386165afa90811561119b57600091611700575b5083116116a65760008061025f957f7472616e7366657228616464726573732c75696e74323536290000000000000085604051611604816121b5565b601981520152604051958587019163a9059cbb60e01b83526024880152604487015260448652611633866121d0565b60405195611640876121b5565b601e87527f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000086880152519082855af1903d1561169d573d61168081612280565b9061168e60405192836121eb565b8152600081943d92013e612bd9565b60609250612bd9565b60405162461bcd60e51b815260048101839052602c60248201527f4142563a20616d6f756e745f677265617465725f7468616e5f7265747269657660448201526b61626c655f62616c616e636560a01b6064820152608490fd5b90508281813d8311611726575b61171781836121eb565b810103126102735751856115c8565b503d61170d565b506000548216331461158f565b3461027357600036600319011261027357604051600060055461175c8161217b565b808452906001908181169081156103255750600114611785576102d8846102c4818603826121eb565b600560009081529250600080516020612ca88339815191525b8284106117b65750505081016020016102c4826102b4565b8054602085870181019190915290930192810161179e565b3461027357602080600319360112610273576001600160401b03906004358281116102735761180190369060040161229b565b9061180e33610222612372565b801561198a575b61181e9061292f565b8151928311610a725761183260065461217b565b601f8111611938575b508092601f81116001146118a757807ff82c617ae111c7dc97cff5fbdc800e6de1cc79d739ef5a400a7c6746fa7a611a9460009161189c575b508160011b916000199060031b1c191617600655610e6a60405192828493845283019061222f565b905083015185611874565b601f198116936006600052600080516020612cc88339815191529460005b81811061192157509482916001937ff82c617ae111c7dc97cff5fbdc800e6de1cc79d739ef5a400a7c6746fa7a611a9710611908575b5050811b01600655610e56565b85015160001960f88460031b161c1916905585806118fb565b8583015187556001909601959184019184016118c5565b6006600052600080516020612cc8833981519152601f850160051c810191838610611980575b601f0160051c01905b818110611974575061183b565b60008155600101611967565b909150819061195e565b506000546001600160a01b03163314611815565b34610273576000366003190112610273576119b761278b565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346102735760203660031901126102735760043561ffff8116810361027357611a2233610222612372565b8015611a53575b611a329061292f565b600f805461ffff60a81b191660a89290921b61ffff60a81b16919091179055005b506000546001600160a01b03163314611a29565b34610273576000366003190112610273576020600754604051908152f35b3461027357600036600319011261027357602060ff600254166040519015158152f35b34610273576020366003190112610273577f8f6e626fd72fbc5be13797576edf29d80e31d6b396fc85190028e1e19c455fa96020600435611aeb33610222612372565b8015611b08575b611afb9061292f565b80600755604051908152a1005b506000546001600160a01b03163314611af2565b3461027357600036600319011261027357611b3933610222612372565b8015611c10575b611b499061292f565b60025460ff811615611bd1575060025460ff811615611b955760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b600190611bdc612895565b60ff1916176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b506000546001600160a01b03163314611b40565b3461027357600036600319011261027357336000526020600a815260ff604060002054166111b357611c54612895565b611c5c6128d9565b60075442101580611d9f575b611c7190612851565b600f54604051630ef40a6760e41b81523360048201528281602481600886901c6001600160a01b03165afa90811561119b57600091611d72575b50611cb4612972565b9133600052600b845260406000208360005284526040600020549115611d5e575b505033600052600982526040600020805490600182018092116111325755600d546001810180911161113257600d5533600052600b82526040600020906000528152604060002090815460018101809111611132577fbfb7f61d27ed48256e28b360d14577d3231eb3c8e8d5b97b12d2d0eeb7c125a59255600d54604051908152a16001600355005b60a81c61ffff16111561115c578280611cd5565b90508281813d8311611d98575b611d8981836121eb565b81010312610273575183611cab565b503d611d7f565b50600854421115611c68565b3461027357604036600319011261027357611dc461226a565b336001600160a01b03821603611de05761025f90600435612715565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b34610273576000366003190112610273576020600854604051908152f35b34610273576020366003190112610273577f513ee920caa09c71ce9ebfe8d94110ab1ed6bb1870fd87cce129a2c8e8979ed46020611e97612254565b611ea333610222612372565b8015611ee7575b611eb39061292f565b600f8054610100600160a81b031916600883901b610100600160a81b03161790556040516001600160a01b039091168152a1005b506000546001600160a01b03163314611eaa565b346102735760403660031901126102735761025f600435611f1a61226a565b9080600052600160205261025a60016040600020015461239c565b346102735760203660031901126102735760043560005260016020526020600160406000200154604051908152f35b3461027357602036600319011261027357611f7d612254565b611f8561278b565b611f8d612895565b611f9981610222612372565b156114c35761025f90610d96612372565b3461027357602036600319011261027357611fc733610222612372565b8015611fdf575b611fd79061292f565b600435600e55005b506000546001600160a01b03163314611fce565b346102735760203660031901126102735761200c612254565b61201833610222612372565b8015612053575b6120289061292f565b6001600160a01b03166000908152600a60205260409020805460ff818116151660ff19909116179055005b506000546001600160a01b0316331461201f565b3461027357600036600319011261027357600f5460405160089190911c6001600160a01b03168152602090f35b346102735760003660031901126102735760405160006004546120b68161217b565b8084529060019081811690811561032557506001146120df576102d8846102c4818603826121eb565b600460009081529250600080516020612ce88339815191525b8284106121105750505081016020016102c4826102b4565b805460208587018101919091529093019281016120f8565b34610273576020366003190112610273576004359063ffffffff60e01b821680920361027357602091637965db0b60e01b811490811561216a575b5015158152f35b6301ffc9a760e01b14905083612163565b90600182811c921680156121ab575b602083101461219557565b634e487b7160e01b600052602260045260246000fd5b91607f169161218a565b604081019081106001600160401b03821117610a7257604052565b608081019081106001600160401b03821117610a7257604052565b90601f801991011681019081106001600160401b03821117610a7257604052565b60005b83811061221f5750506000910152565b818101518382015260200161220f565b906020916122488151809281855285808601910161220c565b601f01601f1916010190565b600435906001600160a01b038216820361027357565b602435906001600160a01b038216820361027357565b6001600160401b038111610a7257601f01601f191660200190565b81601f82011215610273578035906122b282612280565b926122c060405194856121eb565b8284526020838301011161027357816000926020809301838601378301015290565b602080600319830112610273576001600160401b03916004358381116102735781602382011215610273578060040135938411610a72578360051b906040519461232e858401876121eb565b855260248486019282010192831161027357602401905b828210612353575050505090565b81356001600160a01b0381168103610273578152908301908301612345565b60405160208101906826a7a222a920aa27a960b91b825260098152612396816121b5565b51902090565b6000818152600191602091838352604093848220338352845260ff8583205416156123c8575050505050565b33855193606085018581106001600160401b03821117612687578752602a8552858501918736843785511561267357603083538551841015612673576078602187015360295b84811161260957506125c757865192612426846121d0565b604284528684019460603687378451156125b3576030865384518210156125b35790607860218601536041915b81831161254557505050612503576124ff9386936124e3936124d46048946124ab9a519a8b957f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008c880152518092603788019061220c565b8401917001034b99036b4b9b9b4b733903937b6329607d1b60378401525180938684019061220c565b010360288101875201856121eb565b5192839262461bcd60e51b84526004840152602483019061222f565b0390fd5b60648587519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f8116601081101561259f576f181899199a1a9b1b9c1cb0b131b232b360811b901a612575858861282a565b5360041c92801561258b57600019019190612453565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b60648688519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b90600f8116601081101561265f576f181899199a1a9b1b9c1cb0b131b232b360811b901a612637838961282a565b5360041c90801561264b576000190161240e565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b85526032600452602485fd5b634e487b7160e01b85526041600452602485fd5b906000918083526001602052604083209160018060a01b03169182845260205260ff604084205416156126cd57505050565b80835260016020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4565b906000918083526001602052604083209160018060a01b03169182845260205260ff60408420541661274657505050565b8083526001602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4565b6000546001600160a01b0316330361279f57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b90815181101561283b570160200190565b634e487b7160e01b600052603260045260246000fd5b1561285857565b60405162461bcd60e51b8152602060048201526015602482015274566f74696e67506572696f644e6f7441637469766560581b6044820152606490fd5b60ff600254166128a157565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b6002600354146128ea576002600355565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b1561293657565b60405162461bcd60e51b815260206004820152601460248201527327b7363ca6b7b232b930ba37b927b927bbb732b960611b6044820152606490fd5b600062010bd962015180420481810191838212801591841291821691151617612ba2576226496501908262253d8c8312911290801582169115161761258b578060021b6004918282058103612b8f5762023ab1809205918281029081058303612b7c57600381019085600383129112908015821691151617612b7c5790836129fb920590612c8e565b6001810160018112858312908015821691151617612b7c57610fa09080820291820503612b7c5762164b099005906105b58281029081058303612b69579084612a45920590612c8e565b91601f83019285601f85129112908015821691151617612b7c578260500292605084058103612b695761098f809405938481029081058503612b5657906050612a8f920590612c8e565b94600b840593600281019082600283129112908015821691151617612b435784600c0290600c82058603612b305790612ac791612c8e565b946030198301928313600116612b1d5782606402926064840503612b1d575050612afa9291612af591612c72565b612c72565b9160405191602083019384526040830152606082015260608152612396816121d0565b634e487b7160e01b825260119052602490fd5b634e487b7160e01b835260118752602483fd5b634e487b7160e01b825260118652602482fd5b634e487b7160e01b875260118652602487fd5b634e487b7160e01b865260118552602486fd5b634e487b7160e01b855260118452602485fd5b634e487b7160e01b845260118352602484fd5b634e487b7160e01b83526011600452602483fd5b60001981146111325760010190565b805182101561283b5760209160051b010190565b91929015612c3b5750815115612bed575090565b3b15612bf65790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612c4e5750805190602001fd5b60405162461bcd60e51b8152602060048201529081906124ff90602483019061222f565b9190916000838201938412911290801582169115161761113257565b818103929160001380158285131691841216176111325756fe036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19ba2646970667358221220433dc2059d914e21a45eb037209078611885e6200b454a1c16d350b7c6b9b7f964736f6c63430008110033000000000000000000000000f2255c5f4dd0a2dfc4b65bab08ee27ca58333362
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146121285750806306fdde03146120945780630c56ae3b146120675780630e8fe6ed14611ff35780631985276b14611faa57806322e6541614611f64578063248a9ca314611f355780632f2ff15d14611efb5780633028f63a14611e5b57806335d9e40914611e3d57806336568abe14611dab57806341c12a7014611c2457806346e79ffc14611b1c578063475dfdc814611aa85780635c975abb14611a8557806368e1b43114611a67578063703c6d16146119f7578063715018a61461199e57806371adb5e6146117ce5780637284e4161461173a5780637c41370f146115495780638085ceaa146114d5578063877816391461144f5780638d7e0acb146114315780638da5cb5b146114085780638dcbc1821461139057806390c3f38f146111c557806390cf581c14610ff857806391d1485414610fab578063a217fddf14610f8f578063be489f9f14610f71578063c47f002714610d9b578063d547741f14610d5c578063d8bff5a514610d22578063dfaea7e614610cfd578063e135abe414610ce2578063e596219514610ca3578063e8dd67d4146103fc578063e932406f146103d9578063f2fde38b1461034c578063f3ccaac0146102785763f96c678c146101ed57600080fd5b3461027357602036600319011261027357610206612254565b61020e61278b565b610216612895565b61024a81610222612372565b600052600160205260406000209060018060a01b031660005260205260ff6040600020541690565b6102615761025f9061025a612372565b61269b565b005b60405163979119d560e01b8152600490fd5b600080fd5b3461027357600036600319011261027357604051600060065461029a8161217b565b8084529060019081811690811561032557506001146102dc575b6102d8846102c4818603826121eb565b60405191829160208352602083019061222f565b0390f35b600660009081529250600080516020612cc88339815191525b82841061030d5750505081016020016102c4826102b4565b805460208587018101919091529093019281016102f5565b60ff191660208087019190915292151560051b850190920192506102c491508390506102b4565b3461027357602036600319011261027357610365612254565b61036d61278b565b6001600160a01b038116156103855761025f906127e3565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346102735760003660031901126102735760206103f4612372565b604051908152f35b3461027357610120366003190112610273576004356001600160401b0381116102735761042d90369060040161229b565b6024356001600160401b0381116102735761044c90369060040161229b565b906044356001600160401b0381116102735761046c90369060040161229b565b906064356001600160a01b0381169003610273576084356001600160a01b03811690036102735761ffff60a4351660a435036102735760ff600f5416610c92576104be6104b7612372565b339061269b565b6104ca33610222612372565b8015610c7e575b6104da9061292f565b8051926001600160401b038411610a72576104f660045461217b565b601f8111610c15575b50602093601f8111600114610ba2578091929394600091610b97575b508160011b916000199060031b1c1916176004555b7f2319d1693ced5c256216527c7586842758cea48e90a4d4f69304f768834137986040516020815280610566602082018661222f565b0390a161057533610222612372565b8015610b83575b6105859061292f565b8051926001600160401b038411610a72576105a160055461217b565b601f8111610b1a575b50602093601f8111600114610aa7578091929394600091610a9c575b508160011b916000199060031b1c1916176005555b7f8e7ee28d3d3b0dd81239d1c0e48b77da9bfa4f63eb4db88c5789bd289d1ec4626040516020815280610611602082018661222f565b0390a161062033610222612372565b8015610a88575b6106309061292f565b80516001600160401b038111610a725761064b60065461217b565b601f8111610a09575b506020601f821160011461096c577f192cc1322b8fe74e0f381eb2f0e119dcbe941446a1a7ba28e170751db2c334fc94928261089c95936108b893600091610961575b508160011b916000199060031b1c1916176006555b7ff82c617ae111c7dc97cff5fbdc800e6de1cc79d739ef5a400a7c6746fa7a611a60405160208152806106e2602082018561222f565b0390a16106f133610222612372565b801561094d575b6107019061292f565b600f8054610100600160a81b03198116608435600881901b610100600160a81b03169182179093556040516001600160a01b03909316835290917f513ee920caa09c71ce9ebfe8d94110ab1ed6bb1870fd87cce129a2c8e8979ed490602090a161076d33610222612372565b8015610939575b61077d9061292f565b610100600160b81b03199091161760a43560a81b61ffff60a81b1617600f556107a833610222612372565b8015610925575b6107b89061292f565b60c4356007557f8f6e626fd72fbc5be13797576edf29d80e31d6b396fc85190028e1e19c455fa9602060405160c4358152a16107f633610222612372565b8015610911575b6108069061292f565b60e4356008557fde6c59c355067bf24092d3ed8616e15f3741ec2ce12f7cb2d817c7523ef6b4ce602060405160e4358152a161084433610222612372565b80156108fd575b6108549061292f565b6108aa610104359384600e5561086e60643561025a612372565b6108796064356127e3565b600160ff19600f541617600f55604051968796610120885261012088019061222f565b90868203602088015261222f565b90848203604086015261222f565b6001600160a01b036064358116606085015260843516608084015261ffff60a4351660a084015260c43560c084015260e43560e08401526101008301919091520390a1005b506000546001600160a01b0316331461084b565b506000546001600160a01b031633146107fd565b506000546001600160a01b031633146107af565b506000546001600160a01b03163314610774565b506000546001600160a01b031633146106f8565b905082015188610697565b6006600052600080516020612cc88339815191529060005b601f19841681106109f15750926001836108b8937f192cc1322b8fe74e0f381eb2f0e119dcbe941446a1a7ba28e170751db2c334fc989661089c9896601f198116106109d8575b5050811b016006556106ac565b84015160001960f88460031b161c1916905588806109cb565b90916020600181928588015181550193019101610984565b6006600052601f820160051c600080516020612cc88339815191520160208310610a5d575b601f820160051c600080516020612cc8833981519152018110610a515750610654565b60008155600101610a2e565b50600080516020612cc8833981519152610a2e565b634e487b7160e01b600052604160045260246000fd5b506000546001600160a01b03163314610627565b9050830151856105c6565b6005600052600080516020612ca883398151915260005b601f1983168110610b02575060019293949582601f19811610610ae9575b5050811b016005556105db565b85015160001960f88460031b161c191690558580610adc565b84870151825560209687019660019092019101610abe565b6005600052601f850160051c600080516020612ca88339815191520160208610610b6e575b601f820160051c600080516020612ca8833981519152018110610b6257506105aa565b60008155600101610b3f565b50600080516020612ca8833981519152610b3f565b506000546001600160a01b0316331461057c565b90508301518561051b565b6004600052600080516020612ce883398151915260005b601f1983168110610bfd575060019293949582601f19811610610be4575b5050811b01600455610530565b85015160001960f88460031b161c191690558580610bd7565b84870151825560209687019660019092019101610bb9565b6004600052601f850160051c600080516020612ce88339815191520160208610610c69575b601f820160051c600080516020612ce8833981519152018110610c5d57506104ff565b60008155600101610c3a565b50600080516020612ce8833981519152610c3a565b506000546001600160a01b031633146104d1565b60405162dc149f60e41b8152600490fd5b34610273576020366003190112610273576001600160a01b03610cc4612254565b16600052600a602052602060ff604060002054166040519015158152f35b346102735760003660031901126102735760206103f4612972565b3461027357600036600319011261027357602061ffff600f5460a81c16604051908152f35b34610273576020366003190112610273576001600160a01b03610d43612254565b1660005260096020526020604060002054604051908152f35b346102735760403660031901126102735761025f600435610d7b61226a565b90806000526001602052610d9660016040600020015461239c565b612715565b3461027357602080600319360112610273576001600160401b039060043582811161027357610dce90369060040161229b565b90610ddb33610222612372565b8015610f5d575b610deb9061292f565b8151928311610a7257610dff60045461217b565b601f8111610f0b575b508092601f8111600114610e7a57807f2319d1693ced5c256216527c7586842758cea48e90a4d4f69304f7688341379894600091610e6f575b508160011b916000199060031b1c1916176004555b610e6a60405192828493845283019061222f565b0390a1005b905083015185610e41565b601f198116936004600052600080516020612ce88339815191529460005b818110610ef457509482916001937f2319d1693ced5c256216527c7586842758cea48e90a4d4f69304f768834137989710610edb575b5050811b01600455610e56565b85015160001960f88460031b161c191690558580610ece565b858301518755600190960195918401918401610e98565b6004600052600080516020612ce8833981519152601f850160051c810191838610610f53575b601f0160051c01905b818110610f475750610e08565b60008155600101610f3a565b9091508190610f31565b506000546001600160a01b03163314610de2565b34610273576000366003190112610273576020600c54604051908152f35b3461027357600036600319011261027357602060405160008152f35b3461027357604036600319011261027357610fc461226a565b600435600052600160205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b3461027357600036600319011261027357336000526020600a815260ff604060002054166111b357611028612895565b6110306128d9565b600754421015806111a7575b61104590612851565b600f54604051630ef40a6760e41b81523360048201528281602481600886901c6001600160a01b03165afa90811561119b5760009161116e575b50611088612972565b9133600052600b845260406000208360005284526040600020549115611148575b505033600052600982526040600020805490600182018092116111325755600c546001810180911161113257600c5533600052600b82526040600020906000528152604060002090815460018101809111611132577f05c702aa5f2f6a0bfc010218e724344d9a31301bdf6db75f7e9e28c4ef8844ec9255600c54604051908152a16001600355005b634e487b7160e01b600052601160045260246000fd5b60a81c61ffff16111561115c5782806110a9565b60405163042248ef60e51b8152600490fd5b90508281813d8311611194575b61118581836121eb565b8101031261027357518361107f565b503d61117b565b6040513d6000823e3d90fd5b5060085442111561103c565b60405163a5baf15160e01b8152600490fd5b3461027357602080600319360112610273576001600160401b0390600435828111610273576111f890369060040161229b565b9061120533610222612372565b801561137c575b6112159061292f565b8151928311610a7257600561122a815461217b565b601f811161132d575b508193601f811160011461129e57807f8e7ee28d3d3b0dd81239d1c0e48b77da9bfa4f63eb4db88c5789bd289d1ec46295600091611293575b508160011b916000199060031b1c1916179055610e6a60405192828493845283019061222f565b90508401518661126c565b601f1981169482600052600080516020612ca88339815191529560005b81811061131657509582916001937f8e7ee28d3d3b0dd81239d1c0e48b77da9bfa4f63eb4db88c5789bd289d1ec46298106112fd575b5050811b019055610e56565b86015160001960f88460031b161c1916905586806112f1565b8683015188556001909701969185019185016112bb565b81600052600080516020612ca8833981519152601f8601831c810191848710611372575b601f01831c01905b8181106113665750611233565b60008155600101611359565b9091508190611351565b506000546001600160a01b0316331461120c565b346102735761139e366122e2565b6113a661278b565b6113ae612895565b60005b815181101561025f576001600160a01b036113cc8284612bc5565b5116906113d761278b565b6113df612895565b6113eb82610222612372565b610261576113fe6114039261025a612372565b612bb6565b6113b1565b34610273576000366003190112610273576000546040516001600160a01b039091168152602090f35b34610273576000366003190112610273576020600d54604051908152f35b346102735761145d366122e2565b61146561278b565b61146d612895565b60005b815181101561025f576001600160a01b0361148b8284612bc5565b51169061149661278b565b61149e612895565b6114aa82610222612372565b156114c3576113fe6114be92610d96612372565b611470565b6040516375522eb560e11b8152600490fd5b34610273576020366003190112610273577fde6c59c355067bf24092d3ed8616e15f3741ec2ce12f7cb2d817c7523ef6b4ce602060043561151833610222612372565b8015611535575b6115289061292f565b80600855604051908152a1005b506000546001600160a01b0316331461151f565b3461027357606036600319011261027357611562612254565b6044356001600160a01b0381811692602435928490036102735761158833610222612372565b801561172d575b6115989061292f565b60405180926370a0823160e01b8252306004830152816024602095869386165afa90811561119b57600091611700575b5083116116a65760008061025f957f7472616e7366657228616464726573732c75696e74323536290000000000000085604051611604816121b5565b601981520152604051958587019163a9059cbb60e01b83526024880152604487015260448652611633866121d0565b60405195611640876121b5565b601e87527f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000086880152519082855af1903d1561169d573d61168081612280565b9061168e60405192836121eb565b8152600081943d92013e612bd9565b60609250612bd9565b60405162461bcd60e51b815260048101839052602c60248201527f4142563a20616d6f756e745f677265617465725f7468616e5f7265747269657660448201526b61626c655f62616c616e636560a01b6064820152608490fd5b90508281813d8311611726575b61171781836121eb565b810103126102735751856115c8565b503d61170d565b506000548216331461158f565b3461027357600036600319011261027357604051600060055461175c8161217b565b808452906001908181169081156103255750600114611785576102d8846102c4818603826121eb565b600560009081529250600080516020612ca88339815191525b8284106117b65750505081016020016102c4826102b4565b8054602085870181019190915290930192810161179e565b3461027357602080600319360112610273576001600160401b03906004358281116102735761180190369060040161229b565b9061180e33610222612372565b801561198a575b61181e9061292f565b8151928311610a725761183260065461217b565b601f8111611938575b508092601f81116001146118a757807ff82c617ae111c7dc97cff5fbdc800e6de1cc79d739ef5a400a7c6746fa7a611a9460009161189c575b508160011b916000199060031b1c191617600655610e6a60405192828493845283019061222f565b905083015185611874565b601f198116936006600052600080516020612cc88339815191529460005b81811061192157509482916001937ff82c617ae111c7dc97cff5fbdc800e6de1cc79d739ef5a400a7c6746fa7a611a9710611908575b5050811b01600655610e56565b85015160001960f88460031b161c1916905585806118fb565b8583015187556001909601959184019184016118c5565b6006600052600080516020612cc8833981519152601f850160051c810191838610611980575b601f0160051c01905b818110611974575061183b565b60008155600101611967565b909150819061195e565b506000546001600160a01b03163314611815565b34610273576000366003190112610273576119b761278b565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346102735760203660031901126102735760043561ffff8116810361027357611a2233610222612372565b8015611a53575b611a329061292f565b600f805461ffff60a81b191660a89290921b61ffff60a81b16919091179055005b506000546001600160a01b03163314611a29565b34610273576000366003190112610273576020600754604051908152f35b3461027357600036600319011261027357602060ff600254166040519015158152f35b34610273576020366003190112610273577f8f6e626fd72fbc5be13797576edf29d80e31d6b396fc85190028e1e19c455fa96020600435611aeb33610222612372565b8015611b08575b611afb9061292f565b80600755604051908152a1005b506000546001600160a01b03163314611af2565b3461027357600036600319011261027357611b3933610222612372565b8015611c10575b611b499061292f565b60025460ff811615611bd1575060025460ff811615611b955760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b600190611bdc612895565b60ff1916176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b506000546001600160a01b03163314611b40565b3461027357600036600319011261027357336000526020600a815260ff604060002054166111b357611c54612895565b611c5c6128d9565b60075442101580611d9f575b611c7190612851565b600f54604051630ef40a6760e41b81523360048201528281602481600886901c6001600160a01b03165afa90811561119b57600091611d72575b50611cb4612972565b9133600052600b845260406000208360005284526040600020549115611d5e575b505033600052600982526040600020805490600182018092116111325755600d546001810180911161113257600d5533600052600b82526040600020906000528152604060002090815460018101809111611132577fbfb7f61d27ed48256e28b360d14577d3231eb3c8e8d5b97b12d2d0eeb7c125a59255600d54604051908152a16001600355005b60a81c61ffff16111561115c578280611cd5565b90508281813d8311611d98575b611d8981836121eb565b81010312610273575183611cab565b503d611d7f565b50600854421115611c68565b3461027357604036600319011261027357611dc461226a565b336001600160a01b03821603611de05761025f90600435612715565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b34610273576000366003190112610273576020600854604051908152f35b34610273576020366003190112610273577f513ee920caa09c71ce9ebfe8d94110ab1ed6bb1870fd87cce129a2c8e8979ed46020611e97612254565b611ea333610222612372565b8015611ee7575b611eb39061292f565b600f8054610100600160a81b031916600883901b610100600160a81b03161790556040516001600160a01b039091168152a1005b506000546001600160a01b03163314611eaa565b346102735760403660031901126102735761025f600435611f1a61226a565b9080600052600160205261025a60016040600020015461239c565b346102735760203660031901126102735760043560005260016020526020600160406000200154604051908152f35b3461027357602036600319011261027357611f7d612254565b611f8561278b565b611f8d612895565b611f9981610222612372565b156114c35761025f90610d96612372565b3461027357602036600319011261027357611fc733610222612372565b8015611fdf575b611fd79061292f565b600435600e55005b506000546001600160a01b03163314611fce565b346102735760203660031901126102735761200c612254565b61201833610222612372565b8015612053575b6120289061292f565b6001600160a01b03166000908152600a60205260409020805460ff818116151660ff19909116179055005b506000546001600160a01b0316331461201f565b3461027357600036600319011261027357600f5460405160089190911c6001600160a01b03168152602090f35b346102735760003660031901126102735760405160006004546120b68161217b565b8084529060019081811690811561032557506001146120df576102d8846102c4818603826121eb565b600460009081529250600080516020612ce88339815191525b8284106121105750505081016020016102c4826102b4565b805460208587018101919091529093019281016120f8565b34610273576020366003190112610273576004359063ffffffff60e01b821680920361027357602091637965db0b60e01b811490811561216a575b5015158152f35b6301ffc9a760e01b14905083612163565b90600182811c921680156121ab575b602083101461219557565b634e487b7160e01b600052602260045260246000fd5b91607f169161218a565b604081019081106001600160401b03821117610a7257604052565b608081019081106001600160401b03821117610a7257604052565b90601f801991011681019081106001600160401b03821117610a7257604052565b60005b83811061221f5750506000910152565b818101518382015260200161220f565b906020916122488151809281855285808601910161220c565b601f01601f1916010190565b600435906001600160a01b038216820361027357565b602435906001600160a01b038216820361027357565b6001600160401b038111610a7257601f01601f191660200190565b81601f82011215610273578035906122b282612280565b926122c060405194856121eb565b8284526020838301011161027357816000926020809301838601378301015290565b602080600319830112610273576001600160401b03916004358381116102735781602382011215610273578060040135938411610a72578360051b906040519461232e858401876121eb565b855260248486019282010192831161027357602401905b828210612353575050505090565b81356001600160a01b0381168103610273578152908301908301612345565b60405160208101906826a7a222a920aa27a960b91b825260098152612396816121b5565b51902090565b6000818152600191602091838352604093848220338352845260ff8583205416156123c8575050505050565b33855193606085018581106001600160401b03821117612687578752602a8552858501918736843785511561267357603083538551841015612673576078602187015360295b84811161260957506125c757865192612426846121d0565b604284528684019460603687378451156125b3576030865384518210156125b35790607860218601536041915b81831161254557505050612503576124ff9386936124e3936124d46048946124ab9a519a8b957f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008c880152518092603788019061220c565b8401917001034b99036b4b9b9b4b733903937b6329607d1b60378401525180938684019061220c565b010360288101875201856121eb565b5192839262461bcd60e51b84526004840152602483019061222f565b0390fd5b60648587519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f8116601081101561259f576f181899199a1a9b1b9c1cb0b131b232b360811b901a612575858861282a565b5360041c92801561258b57600019019190612453565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b60648688519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b90600f8116601081101561265f576f181899199a1a9b1b9c1cb0b131b232b360811b901a612637838961282a565b5360041c90801561264b576000190161240e565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b85526032600452602485fd5b634e487b7160e01b85526041600452602485fd5b906000918083526001602052604083209160018060a01b03169182845260205260ff604084205416156126cd57505050565b80835260016020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4565b906000918083526001602052604083209160018060a01b03169182845260205260ff60408420541661274657505050565b8083526001602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4565b6000546001600160a01b0316330361279f57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3565b90815181101561283b570160200190565b634e487b7160e01b600052603260045260246000fd5b1561285857565b60405162461bcd60e51b8152602060048201526015602482015274566f74696e67506572696f644e6f7441637469766560581b6044820152606490fd5b60ff600254166128a157565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b6002600354146128ea576002600355565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b1561293657565b60405162461bcd60e51b815260206004820152601460248201527327b7363ca6b7b232b930ba37b927b927bbb732b960611b6044820152606490fd5b600062010bd962015180420481810191838212801591841291821691151617612ba2576226496501908262253d8c8312911290801582169115161761258b578060021b6004918282058103612b8f5762023ab1809205918281029081058303612b7c57600381019085600383129112908015821691151617612b7c5790836129fb920590612c8e565b6001810160018112858312908015821691151617612b7c57610fa09080820291820503612b7c5762164b099005906105b58281029081058303612b69579084612a45920590612c8e565b91601f83019285601f85129112908015821691151617612b7c578260500292605084058103612b695761098f809405938481029081058503612b5657906050612a8f920590612c8e565b94600b840593600281019082600283129112908015821691151617612b435784600c0290600c82058603612b305790612ac791612c8e565b946030198301928313600116612b1d5782606402926064840503612b1d575050612afa9291612af591612c72565b612c72565b9160405191602083019384526040830152606082015260608152612396816121d0565b634e487b7160e01b825260119052602490fd5b634e487b7160e01b835260118752602483fd5b634e487b7160e01b825260118652602482fd5b634e487b7160e01b875260118652602487fd5b634e487b7160e01b865260118552602486fd5b634e487b7160e01b855260118452602485fd5b634e487b7160e01b845260118352602484fd5b634e487b7160e01b83526011600452602483fd5b60001981146111325760010190565b805182101561283b5760209160051b010190565b91929015612c3b5750815115612bed575090565b3b15612bf65790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612c4e5750805190602001fd5b60405162461bcd60e51b8152602060048201529081906124ff90602483019061222f565b9190916000838201938412911290801582169115161761113257565b818103929160001380158285131691841216176111325756fe036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19ba2646970667358221220433dc2059d914e21a45eb037209078611885e6200b454a1c16d350b7c6b9b7f964736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f2255c5f4dd0a2dfc4b65bab08ee27ca58333362
-----Decoded View---------------
Arg [0] : _newOwner (address): 0xF2255c5F4dd0a2dfC4B65bab08EE27CA58333362
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000f2255c5f4dd0a2dfc4b65bab08ee27ca58333362
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.