Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Executor
Compiler Version
v0.8.4+commit.c7e474f2
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import '@openzeppelin/contracts/governance/TimelockController.sol'; import '../auxiliaries/Policy.sol'; contract Executor is TimelockController, Policy { event ExecutorInitialized(); /// @param minDelay Minimum delay for propose execution /// @param proposers Governance core address /// @param executors Executors address /// @param token_ The address of the token representing voting rights /// @param minVotingPower Minimum voting power requirement /// @param quorumNumerator_ The quorum numerator constructor( uint256 minDelay, address[] memory proposers, address[] memory executors, address token_, uint256 minVotingPower, uint16 quorumNumerator_ ) TimelockController(minDelay, proposers, executors) Policy(token_, minVotingPower, quorumNumerator_) {} function init(address governanceCore) public { grantRole(POLICY_ADMIN_ROLE, governanceCore); grantRole(PROPOSER_ROLE, governanceCore); grantRole(EXECUTOR_ROLE, address(0)); emit ExecutorInitialized(); } }
// SPDX-License-Identifier: MIT 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: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, 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, _msgSender()); _; } /** * @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 override returns (bool) { return _roles[role].members[account]; } /** * @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 { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " 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 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. */ 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. */ 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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ 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. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; import "../access/AccessControl.sol"; /** * @dev Contract module which acts as a timelocked controller. When set as the * owner of an `Ownable` smart contract, it enforces a timelock on all * `onlyOwner` maintenance operations. This gives time for users of the * controlled contract to exit before a potentially dangerous maintenance * operation is applied. * * By default, this contract is self administered, meaning administration tasks * have to go through the timelock process. The proposer (resp executor) role * is in charge of proposing (resp executing) operations. A common use case is * to position this {TimelockController} as the owner of a smart contract, with * a multisig or a DAO as the sole proposer. * * _Available since v3.3._ */ contract TimelockController is AccessControl { bytes32 public constant TIMELOCK_ADMIN_ROLE = keccak256("TIMELOCK_ADMIN_ROLE"); bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); uint256 internal constant _DONE_TIMESTAMP = uint256(1); mapping(bytes32 => uint256) private _timestamps; uint256 private _minDelay; /** * @dev Emitted when a call is scheduled as part of operation `id`. */ event CallScheduled( bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data, bytes32 predecessor, uint256 delay ); /** * @dev Emitted when a call is performed as part of operation `id`. */ event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data); /** * @dev Emitted when operation `id` is cancelled. */ event Cancelled(bytes32 indexed id); /** * @dev Emitted when the minimum delay for future operations is modified. */ event MinDelayChange(uint256 oldDuration, uint256 newDuration); /** * @dev Initializes the contract with a given `minDelay`. */ constructor( uint256 minDelay, address[] memory proposers, address[] memory executors ) { _setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE); // deployer + self administration _setupRole(TIMELOCK_ADMIN_ROLE, _msgSender()); _setupRole(TIMELOCK_ADMIN_ROLE, address(this)); // register proposers for (uint256 i = 0; i < proposers.length; ++i) { _setupRole(PROPOSER_ROLE, proposers[i]); } // register executors for (uint256 i = 0; i < executors.length; ++i) { _setupRole(EXECUTOR_ROLE, executors[i]); } _minDelay = minDelay; emit MinDelayChange(0, minDelay); } /** * @dev Modifier to make a function callable only by a certain role. In * addition to checking the sender's role, `address(0)` 's role is also * considered. Granting a role to `address(0)` is equivalent to enabling * this role for everyone. */ modifier onlyRoleOrOpenRole(bytes32 role) { if (!hasRole(role, address(0))) { _checkRole(role, _msgSender()); } _; } /** * @dev Contract might receive/hold ETH as part of the maintenance process. */ receive() external payable {} /** * @dev Returns whether an id correspond to a registered operation. This * includes both Pending, Ready and Done operations. */ function isOperation(bytes32 id) public view virtual returns (bool pending) { return getTimestamp(id) > 0; } /** * @dev Returns whether an operation is pending or not. */ function isOperationPending(bytes32 id) public view virtual returns (bool pending) { return getTimestamp(id) > _DONE_TIMESTAMP; } /** * @dev Returns whether an operation is ready or not. */ function isOperationReady(bytes32 id) public view virtual returns (bool ready) { uint256 timestamp = getTimestamp(id); return timestamp > _DONE_TIMESTAMP && timestamp <= block.timestamp; } /** * @dev Returns whether an operation is done or not. */ function isOperationDone(bytes32 id) public view virtual returns (bool done) { return getTimestamp(id) == _DONE_TIMESTAMP; } /** * @dev Returns the timestamp at with an operation becomes ready (0 for * unset operations, 1 for done operations). */ function getTimestamp(bytes32 id) public view virtual returns (uint256 timestamp) { return _timestamps[id]; } /** * @dev Returns the minimum delay for an operation to become valid. * * This value can be changed by executing an operation that calls `updateDelay`. */ function getMinDelay() public view virtual returns (uint256 duration) { return _minDelay; } /** * @dev Returns the identifier of an operation containing a single * transaction. */ function hashOperation( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt ) public pure virtual returns (bytes32 hash) { return keccak256(abi.encode(target, value, data, predecessor, salt)); } /** * @dev Returns the identifier of an operation containing a batch of * transactions. */ function hashOperationBatch( address[] calldata targets, uint256[] calldata values, bytes[] calldata datas, bytes32 predecessor, bytes32 salt ) public pure virtual returns (bytes32 hash) { return keccak256(abi.encode(targets, values, datas, predecessor, salt)); } /** * @dev Schedule an operation containing a single transaction. * * Emits a {CallScheduled} event. * * Requirements: * * - the caller must have the 'proposer' role. */ function schedule( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt, uint256 delay ) public virtual onlyRole(PROPOSER_ROLE) { bytes32 id = hashOperation(target, value, data, predecessor, salt); _schedule(id, delay); emit CallScheduled(id, 0, target, value, data, predecessor, delay); } /** * @dev Schedule an operation containing a batch of transactions. * * Emits one {CallScheduled} event per transaction in the batch. * * Requirements: * * - the caller must have the 'proposer' role. */ function scheduleBatch( address[] calldata targets, uint256[] calldata values, bytes[] calldata datas, bytes32 predecessor, bytes32 salt, uint256 delay ) public virtual onlyRole(PROPOSER_ROLE) { require(targets.length == values.length, "TimelockController: length mismatch"); require(targets.length == datas.length, "TimelockController: length mismatch"); bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt); _schedule(id, delay); for (uint256 i = 0; i < targets.length; ++i) { emit CallScheduled(id, i, targets[i], values[i], datas[i], predecessor, delay); } } /** * @dev Schedule an operation that is to becomes valid after a given delay. */ function _schedule(bytes32 id, uint256 delay) private { require(!isOperation(id), "TimelockController: operation already scheduled"); require(delay >= getMinDelay(), "TimelockController: insufficient delay"); _timestamps[id] = block.timestamp + delay; } /** * @dev Cancel an operation. * * Requirements: * * - the caller must have the 'proposer' role. */ function cancel(bytes32 id) public virtual onlyRole(PROPOSER_ROLE) { require(isOperationPending(id), "TimelockController: operation cannot be cancelled"); delete _timestamps[id]; emit Cancelled(id); } /** * @dev Execute an (ready) operation containing a single transaction. * * Emits a {CallExecuted} event. * * Requirements: * * - the caller must have the 'executor' role. */ function execute( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { bytes32 id = hashOperation(target, value, data, predecessor, salt); _beforeCall(id, predecessor); _call(id, 0, target, value, data); _afterCall(id); } /** * @dev Execute an (ready) operation containing a batch of transactions. * * Emits one {CallExecuted} event per transaction in the batch. * * Requirements: * * - the caller must have the 'executor' role. */ function executeBatch( address[] calldata targets, uint256[] calldata values, bytes[] calldata datas, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { require(targets.length == values.length, "TimelockController: length mismatch"); require(targets.length == datas.length, "TimelockController: length mismatch"); bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt); _beforeCall(id, predecessor); for (uint256 i = 0; i < targets.length; ++i) { _call(id, i, targets[i], values[i], datas[i]); } _afterCall(id); } /** * @dev Checks before execution of an operation's calls. */ function _beforeCall(bytes32 id, bytes32 predecessor) private view { require(isOperationReady(id), "TimelockController: operation is not ready"); require(predecessor == bytes32(0) || isOperationDone(predecessor), "TimelockController: missing dependency"); } /** * @dev Checks after execution of an operation's calls. */ function _afterCall(bytes32 id) private { require(isOperationReady(id), "TimelockController: operation is not ready"); _timestamps[id] = _DONE_TIMESTAMP; } /** * @dev Execute an operation's call. * * Emits a {CallExecuted} event. */ function _call( bytes32 id, uint256 index, address target, uint256 value, bytes calldata data ) private { (bool success, ) = target.call{value: value}(data); require(success, "TimelockController: underlying transaction reverted"); emit CallExecuted(id, index, target, value, data); } /** * @dev Changes the minimum timelock duration for future operations. * * Emits a {MinDelayChange} event. * * Requirements: * * - the caller must be the timelock itself. This can only be achieved by scheduling and later executing * an operation where the timelock is the target and the data is the ABI-encoded call to this function. */ function updateDelay(uint256 newDelay) external virtual { require(msg.sender == address(this), "TimelockController: caller must be timelock"); emit MinDelayChange(_minDelay, newDelay); _minDelay = newDelay; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./draft-ERC20Permit.sol"; import "../../../utils/math/Math.sol"; import "../../../utils/math/SafeCast.sol"; import "../../../utils/cryptography/ECDSA.sol"; /** * @dev Extension of ERC20 to support Compound-like voting and delegation. This version is more generic than Compound's, * and supports token supply up to 2^224^ - 1, while COMP is limited to 2^96^ - 1. * * NOTE: If exact COMP compatibility is required, use the {ERC20VotesComp} variant of this module. * * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting * power can be queried through the public accessors {getVotes} and {getPastVotes}. * * By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it * requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked. * Enabling self-delegation can easily be done by overriding the {delegates} function. Keep in mind however that this * will significantly increase the base gas cost of transfers. * * _Available since v4.2._ */ abstract contract ERC20Votes is ERC20Permit { struct Checkpoint { uint32 fromBlock; uint224 votes; } bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); mapping(address => address) private _delegates; mapping(address => Checkpoint[]) private _checkpoints; Checkpoint[] private _totalSupplyCheckpoints; /** * @dev Emitted when an account changes their delegate. */ event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /** * @dev Emitted when a token transfer or delegate change results in changes to an account's voting power. */ event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /** * @dev Get the `pos`-th checkpoint for `account`. */ function checkpoints(address account, uint32 pos) public view virtual returns (Checkpoint memory) { return _checkpoints[account][pos]; } /** * @dev Get number of checkpoints for `account`. */ function numCheckpoints(address account) public view virtual returns (uint32) { return SafeCast.toUint32(_checkpoints[account].length); } /** * @dev Get the address `account` is currently delegating to. */ function delegates(address account) public view virtual returns (address) { return _delegates[account]; } /** * @dev Gets the current votes balance for `account` */ function getVotes(address account) public view returns (uint256) { uint256 pos = _checkpoints[account].length; return pos == 0 ? 0 : _checkpoints[account][pos - 1].votes; } /** * @dev Retrieve the number of votes for `account` at the end of `blockNumber`. * * Requirements: * * - `blockNumber` must have been already mined */ function getPastVotes(address account, uint256 blockNumber) public view returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_checkpoints[account], blockNumber); } /** * @dev Retrieve the `totalSupply` at the end of `blockNumber`. Note, this value is the sum of all balances. * It is but NOT the sum of all the delegated votes! * * Requirements: * * - `blockNumber` must have been already mined */ function getPastTotalSupply(uint256 blockNumber) public view returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_totalSupplyCheckpoints, blockNumber); } /** * @dev Lookup a value in a list of (sorted) checkpoints. */ function _checkpointsLookup(Checkpoint[] storage ckpts, uint256 blockNumber) private view returns (uint256) { // We run a binary search to look for the earliest checkpoint taken after `blockNumber`. // // During the loop, the index of the wanted checkpoint remains in the range [low-1, high). // With each iteration, either `low` or `high` is moved towards the middle of the range to maintain the invariant. // - If the middle checkpoint is after `blockNumber`, we look in [low, mid) // - If the middle checkpoint is before or equal to `blockNumber`, we look in [mid+1, high) // Once we reach a single value (when low == high), we've found the right checkpoint at the index high-1, if not // out of bounds (in which case we're looking too far in the past and the result is 0). // Note that if the latest checkpoint available is exactly for `blockNumber`, we end up with an index that is // past the end of the array, so we technically don't find a checkpoint after `blockNumber`, but it works out // the same. uint256 high = ckpts.length; uint256 low = 0; while (low < high) { uint256 mid = Math.average(low, high); if (ckpts[mid].fromBlock > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? 0 : ckpts[high - 1].votes; } /** * @dev Delegate votes from the sender to `delegatee`. */ function delegate(address delegatee) public virtual { return _delegate(_msgSender(), delegatee); } /** * @dev Delegates votes from signer to `delegatee` */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public virtual { require(block.timestamp <= expiry, "ERC20Votes: signature expired"); address signer = ECDSA.recover( _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))), v, r, s ); require(nonce == _useNonce(signer), "ERC20Votes: invalid nonce"); return _delegate(signer, delegatee); } /** * @dev Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1). */ function _maxSupply() internal view virtual returns (uint224) { return type(uint224).max; } /** * @dev Snapshots the totalSupply after it has been increased. */ function _mint(address account, uint256 amount) internal virtual override { super._mint(account, amount); require(totalSupply() <= _maxSupply(), "ERC20Votes: total supply risks overflowing votes"); _writeCheckpoint(_totalSupplyCheckpoints, _add, amount); } /** * @dev Snapshots the totalSupply after it has been decreased. */ function _burn(address account, uint256 amount) internal virtual override { super._burn(account, amount); _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount); } /** * @dev Move voting power when tokens are transferred. * * Emits a {DelegateVotesChanged} event. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual override { super._afterTokenTransfer(from, to, amount); _moveVotingPower(delegates(from), delegates(to), amount); } /** * @dev Change delegation for `delegator` to `delegatee`. * * Emits events {DelegateChanged} and {DelegateVotesChanged}. */ function _delegate(address delegator, address delegatee) internal virtual { address currentDelegate = delegates(delegator); uint256 delegatorBalance = balanceOf(delegator); _delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveVotingPower(currentDelegate, delegatee, delegatorBalance); } function _moveVotingPower( address src, address dst, uint256 amount ) private { if (src != dst && amount > 0) { if (src != address(0)) { (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[src], _subtract, amount); emit DelegateVotesChanged(src, oldWeight, newWeight); } if (dst != address(0)) { (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[dst], _add, amount); emit DelegateVotesChanged(dst, oldWeight, newWeight); } } } function _writeCheckpoint( Checkpoint[] storage ckpts, function(uint256, uint256) view returns (uint256) op, uint256 delta ) private returns (uint256 oldWeight, uint256 newWeight) { uint256 pos = ckpts.length; oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes; newWeight = op(oldWeight, delta); if (pos > 0 && ckpts[pos - 1].fromBlock == block.number) { ckpts[pos - 1].votes = SafeCast.toUint224(newWeight); } else { ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newWeight)})); } } function _add(uint256 a, uint256 b) private pure returns (uint256) { return a + b; } function _subtract(uint256 a, uint256 b) private pure returns (uint256) { return a - b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./draft-IERC20Permit.sol"; import "../ERC20.sol"; import "../../../utils/cryptography/draft-EIP712.sol"; import "../../../utils/cryptography/ECDSA.sol"; import "../../../utils/Counters.sol"; /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ */ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @dev See {IERC20Permit-permit}. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT 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 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 pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import '../interfaces/IPolicy.sol'; import '@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; contract Policy is IPolicy, AccessControl { bytes32 public constant LENDING_COMPANY_ROLE = keccak256('LENDING_COMPANY_ROLE'); bytes32 public constant POLICY_ADMIN_ROLE = keccak256('POLICY_ADMIN_ROLE'); ERC20Votes public immutable token; uint256 private _quorumNumerator; uint256 private _minVotingPower; event MinVotingPowerUpdated(uint256 oldMinVotingPower, uint256 newMinVotingPower); event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator); constructor( address token_, uint256 minVotingPower_, uint16 quorumNumerator_ ) { _setRoleAdmin(POLICY_ADMIN_ROLE, POLICY_ADMIN_ROLE); _setRoleAdmin(LENDING_COMPANY_ROLE, POLICY_ADMIN_ROLE); _setupRole(POLICY_ADMIN_ROLE, address(this)); _setupRole(POLICY_ADMIN_ROLE, _msgSender()); _minVotingPower = minVotingPower_; _quorumNumerator = quorumNumerator_; token = ERC20Votes(token_); emit MinVotingPowerUpdated(0, minVotingPower_); } ///////// Main Interfaces /// @notice Check whether the account can create the proposal at the end of the blockNumber /// @dev Proposer must be authorized in this version /// @param account The proposer address /// @param blockNumber The past blocknumber function validateProposer(address account, uint256 blockNumber) external view virtual override returns (bool) { blockNumber; return _validateProposer(account); } /// @notice Check whether the account can vote on the proposal at the end of the blockNumber /// @dev Voting power should be over the /// @param account The voter address /// @param blockNumber The past blocknumber function validateVoter(address account, uint256 blockNumber) external view virtual override returns (bool) { return token.getPastVotes(account, blockNumber) >= minVotingPower(); } /// @notice Check whether the proposal has been succeeded under the current governance policy /// @dev The propose should be ... TODO : set requirements for the success /// @param proposalVote The currnet proposal data function voteSucceeded(DataStruct.ProposalVote memory proposalVote) external view virtual override returns (bool) { return proposalVote.forVotes > proposalVote.againstVotes; } /// @notice Returns the voting power of an account at a specific blockNumber /// @dev The voting power is the amount of staked governance token /// @param account The address /// @param blockNumber The past blocknumber function getVotes(address account, uint256 blockNumber) external view override returns (uint256) { return token.getPastVotes(account, blockNumber); } /// @notice Returns whether the casted vote in the proposal exceeds quorum /// @dev The quorum can be updated /// @param proposalVote The proposal to check /// @param blockNumber The vote start blockNumber function quorumReached(DataStruct.ProposalVote memory proposalVote, uint256 blockNumber) external view override returns (bool) { return (quorum(blockNumber) <= proposalVote.forVotes + proposalVote.abstainVotes); } /// @notice Returns whether the casted vote in the proposal exceeds quorum /// @dev The quorum can be updated /// @param blockNumber The blockNumber for counting vote in the past function quorum(uint256 blockNumber) public view virtual override returns (uint256) { return (token.getPastTotalSupply(blockNumber) * quorumNumerator()) / quorumDenominator(); } //////////////////////// Quorum function quorumNumerator() public view virtual returns (uint256) { return _quorumNumerator; } function quorumDenominator() public view virtual returns (uint256) { return 100; } /// @notice Returns whether the casted vote in the proposal exceeds quorum /// @param newQuorumNumerator The new quorum numerator function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual { require(hasRole(POLICY_ADMIN_ROLE, msg.sender), 'Only Policy Admin'); _updateQuorumNumerator(newQuorumNumerator); } function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual { require(newQuorumNumerator <= quorumDenominator(), 'QuorumNumerator over QuorumDenominator'); uint256 oldQuorumNumerator = _quorumNumerator; _quorumNumerator = newQuorumNumerator; emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator); } //////////////////////// Propose /// @notice In the current elyfi, the lending company who has a collateral service provider role is allowed to create proposal. /// @param account The address of proposer function _validateProposer(address account) internal view returns (bool) { return hasRole(LENDING_COMPANY_ROLE, account); } /////////////////////// Voting power function minVotingPower() public view returns (uint256) { return _minVotingPower; } function updateMinVotingPower(uint256 newMinVotingPower) external { require(hasRole(POLICY_ADMIN_ROLE, msg.sender), 'Only Policy Admin'); _updateMinVotingPower(newMinVotingPower); } function _updateMinVotingPower(uint256 newMinVotingPower) internal { require(newMinVotingPower <= token.totalSupply(), 'VotingPower exceeds TotalSupply'); uint256 oldMinVotingPower = _minVotingPower; _minVotingPower = newMinVotingPower; emit MinVotingPowerUpdated(oldMinVotingPower, newMinVotingPower); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import '../libraries/DataStruct.sol'; /** * @dev Interface of Policy in Elyfi governance */ interface IPolicy { function validateProposer(address account, uint256 blockNumber) external view returns (bool); function validateVoter(address account, uint256 blockNumber) external view returns (bool); function getVotes(address account, uint256 blockNumber) external view returns (uint256); function voteSucceeded(DataStruct.ProposalVote memory proposal) external view returns (bool); function quorumReached(DataStruct.ProposalVote memory proposal, uint256 blockNumber) external view returns (bool); function quorum(uint256 blockNumber) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; library DataStruct { /** * @dev Supported vote types. Matches Governor Bravo ordering. */ enum VoteType { Against, For, Abstain } struct ProposalVote { uint256 againstVotes; uint256 forVotes; uint256 abstainVotes; } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"minDelay","type":"uint256"},{"internalType":"address[]","name":"proposers","type":"address[]"},{"internalType":"address[]","name":"executors","type":"address[]"},{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"minVotingPower","type":"uint256"},{"internalType":"uint16","name":"quorumNumerator_","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"CallExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"bytes32","name":"predecessor","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"delay","type":"uint256"}],"name":"CallScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"Cancelled","type":"event"},{"anonymous":false,"inputs":[],"name":"ExecutorInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"MinDelayChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldMinVotingPower","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMinVotingPower","type":"uint256"}],"name":"MinVotingPowerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldQuorumNumerator","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newQuorumNumerator","type":"uint256"}],"name":"QuorumNumeratorUpdated","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXECUTOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LENDING_COMPANY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POLICY_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROPOSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMELOCK_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"predecessor","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"execute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"},{"internalType":"bytes32","name":"predecessor","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"executeBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getMinDelay","outputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getTimestamp","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"predecessor","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"hashOperation","outputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"},{"internalType":"bytes32","name":"predecessor","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"hashOperationBatch","outputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"governanceCore","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"isOperation","outputs":[{"internalType":"bool","name":"pending","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"isOperationDone","outputs":[{"internalType":"bool","name":"done","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"isOperationPending","outputs":[{"internalType":"bool","name":"pending","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"isOperationReady","outputs":[{"internalType":"bool","name":"ready","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minVotingPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"quorum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quorumDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quorumNumerator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"againstVotes","type":"uint256"},{"internalType":"uint256","name":"forVotes","type":"uint256"},{"internalType":"uint256","name":"abstainVotes","type":"uint256"}],"internalType":"struct DataStruct.ProposalVote","name":"proposalVote","type":"tuple"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"quorumReached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"predecessor","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256","name":"delay","type":"uint256"}],"name":"schedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"},{"internalType":"bytes32","name":"predecessor","type":"bytes32"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256","name":"delay","type":"uint256"}],"name":"scheduleBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract ERC20Votes","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDelay","type":"uint256"}],"name":"updateDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinVotingPower","type":"uint256"}],"name":"updateMinVotingPower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newQuorumNumerator","type":"uint256"}],"name":"updateQuorumNumerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"validateProposer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"validateVoter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"againstVotes","type":"uint256"},{"internalType":"uint256","name":"forVotes","type":"uint256"},{"internalType":"uint256","name":"abstainVotes","type":"uint256"}],"internalType":"struct DataStruct.ProposalVote","name":"proposalVote","type":"tuple"}],"name":"voteSucceeded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a06040523480156200001157600080fd5b506040516200294e3803806200294e8339810160408190526200003491620004a3565b82828288888862000055600080516020620028ee83398151915280620002db565b6200007f6000805160206200290e833981519152600080516020620028ee833981519152620002db565b620000a96000805160206200292e833981519152600080516020620028ee833981519152620002db565b620000c4600080516020620028ee8339815191523362000326565b620000df600080516020620028ee8339815191523062000326565b60005b82518110156200014857620001356000805160206200290e8339815191528483815181106200012157634e487b7160e01b600052603260045260246000fd5b60200260200101516200032660201b60201c565b62000140816200054b565b9050620000e2565b5060005b81518110156200019e576200018b6000805160206200292e8339815191528383815181106200012157634e487b7160e01b600052603260045260246000fd5b62000196816200054b565b90506200014c565b5060028390556040805160008152602081018590527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a150505062000202600080516020620028ce83398151915280620002db60201b60201c565b6200023d7fa3e2c49fb410c51181698b9141f4d01ef283332011dad1851a8876104c08a9f7600080516020620028ce833981519152620002db565b62000258600080516020620028ce8339815191523062000326565b62000273600080516020620028ce8339815191523362000326565b600482905561ffff8116600355606083901b6001600160601b0319166080526040805160008152602081018490527fffa6924680a95f00a59e3a76b306ce0c90ee975b30a47720b08a85c7527a9d86910160405180910390a150505050505050505062000589565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b62000332828262000336565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000332576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620003923390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b0381168114620003ee57600080fd5b919050565b600082601f83011262000404578081fd5b815160206001600160401b038083111562000423576200042362000573565b8260051b604051601f19603f830116810181811084821117156200044b576200044b62000573565b604052848152838101925086840182880185018910156200046a578687fd5b8692505b8583101562000497576200048281620003d6565b8452928401926001929092019184016200046e565b50979650505050505050565b60008060008060008060c08789031215620004bc578182fd5b865160208801519096506001600160401b0380821115620004db578384fd5b620004e98a838b01620003f3565b96506040890151915080821115620004ff578384fd5b506200050e89828a01620003f3565b9450506200051f60608801620003d6565b92506080870151915060a087015161ffff811681146200053d578182fd5b809150509295509295509295565b60006000198214156200056c57634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b60805160601c61230a620005c46000396000818161074801528181610b7c015281816110e30152818161117c01526116df015261230a6000f3fe6080604052600436106102345760003560e01c8063756632991161012e578063b1c5f427116100ab578063e38335e51161006f578063e38335e5146106ce578063eb9019d4146106e1578063f27a0c9214610701578063f8ce560a14610716578063fc0c546a1461073657600080fd5b8063b1c5f42714610621578063bf1cb09214610641578063c4d252f514610661578063d45c443514610681578063d547741f146106ae57600080fd5b806391d14854116100f257806391d14854146105a157806397c3d334146105c1578063a17620c1146105d5578063a217fddf146105f7578063a7713a701461060c57600080fd5b806375663299146104ff5780638065657f1461051f5780638f2a0bb01461053f5780638f61f4f51461055f57806390bd89021461058157600080fd5b8063248a9ca3116101bc57806336fffde01161018057806336fffde01461046357806341e08d9314610478578063471ac16814610498578063584b153e146104bf57806364d62353146104df57600080fd5b8063248a9ca3146103a25780632ab0f529146103d25780632f2ff15d1461040357806331d507501461042357806336568abe1461044357600080fd5b806307eabd511161020357806307eabd51146102e75780630d3cf6fc1461031b578063134008d31461034f57806313bc9f201461036257806319ab453c1461038257600080fd5b806301d5062a1461024057806301ffc9a71461026257806306f3f9e61461029757806307bd0265146102b757600080fd5b3661023b57005b600080fd5b34801561024c57600080fd5b5061026061025b366004611bc3565b610782565b005b34801561026e57600080fd5b5061028261027d366004611dcc565b610806565b60405190151581526020015b60405180910390f35b3480156102a357600080fd5b506102606102b2366004611d89565b61083d565b3480156102c357600080fd5b506102d96000805160206122b583398151915281565b60405190815260200161028e565b3480156102f357600080fd5b506102d97fa3e2c49fb410c51181698b9141f4d01ef283332011dad1851a8876104c08a9f781565b34801561032757600080fd5b506102d97f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b61026061035d366004611b59565b6108a6565b34801561036e57600080fd5b5061028261037d366004611d89565b61090c565b34801561038e57600080fd5b5061026061039d366004611b16565b610932565b3480156103ae57600080fd5b506102d96103bd366004611d89565b60009081526020819052604090206001015490565b3480156103de57600080fd5b506102826103ed366004611d89565b6000908152600160208190526040909120541490565b34801561040f57600080fd5b5061026061041e366004611da1565b6109a7565b34801561042f57600080fd5b5061028261043e366004611d89565b6109d2565b34801561044f57600080fd5b5061026061045e366004611da1565b6109eb565b34801561046f57600080fd5b506004546102d9565b34801561048457600080fd5b50610282610493366004611e0f565b610a69565b3480156104a457600080fd5b506102826104b3366004611df4565b80516020909101511190565b3480156104cb57600080fd5b506102826104da366004611d89565b610a91565b3480156104eb57600080fd5b506102606104fa366004611d89565b610aa7565b34801561050b57600080fd5b5061028261051a366004611b30565b610b4b565b34801561052b57600080fd5b506102d961053a366004611b59565b610bff565b34801561054b57600080fd5b5061026061055a366004611cdb565b610c3e565b34801561056b57600080fd5b506102d960008051602061229583398151915281565b34801561058d57600080fd5b5061026061059c366004611d89565b610da9565b3480156105ad57600080fd5b506102826105bc366004611da1565b610e0a565b3480156105cd57600080fd5b5060646102d9565b3480156105e157600080fd5b506102d960008051602061227583398151915281565b34801561060357600080fd5b506102d9600081565b34801561061857600080fd5b506003546102d9565b34801561062d57600080fd5b506102d961063c366004611c36565b610e33565b34801561064d57600080fd5b5061028261065c366004611b30565b610e78565b34801561066d57600080fd5b5061026061067c366004611d89565b610e83565b34801561068d57600080fd5b506102d961069c366004611d89565b60009081526001602052604090205490565b3480156106ba57600080fd5b506102606106c9366004611da1565b610f47565b6102606106dc366004611c36565b610f6d565b3480156106ed57600080fd5b506102d96106fc366004611b30565b6110ba565b34801561070d57600080fd5b506002546102d9565b34801561072257600080fd5b506102d9610731366004611d89565b61115f565b34801561074257600080fd5b5061076a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161028e565b60008051602061229583398151915261079b8133611212565b60006107ab898989898989610bff565b90506107b78184611276565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a6040516107f396959493929190611fbe565b60405180910390a3505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061083757506301ffc9a760e01b6001600160e01b03198316145b92915050565b61085560008051602061227583398151915233610e0a565b61089a5760405162461bcd60e51b815260206004820152601160248201527027b7363c902837b634b1bc9020b236b4b760791b60448201526064015b60405180910390fd5b6108a381611365565b50565b6000805160206122b58339815191526108c0816000610e0a565b6108ce576108ce8133611212565b60006108de888888888888610bff565b90506108ea818561140b565b6108f98160008a8a8a8a6114a7565b610902816115bb565b5050505050505050565b60008181526001602052604081205460018111801561092b5750428111155b9392505050565b61094a600080516020612275833981519152826109a7565b610962600080516020612295833981519152826109a7565b61097b6000805160206122b583398151915260006109a7565b6040517fc6f55283c9efe1834fbca09fc3a5569f6538e98507ed05e21798b0678ce6bdd290600090a150565b6000828152602081905260409020600101546109c38133611212565b6109cd83836115f4565b505050565b60008181526001602052604081205481905b1192915050565b6001600160a01b0381163314610a5b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610891565b610a658282611678565b5050565b600082604001518360200151610a7f91906121a5565b610a888361115f565b11159392505050565b60008181526001602081905260408220546109e4565b333014610b0a5760405162461bcd60e51b815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201526a62652074696d656c6f636b60a81b6064820152608401610891565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b6000610b5660045490565b604051630748d63560e31b81526001600160a01b038581166004830152602482018590527f00000000000000000000000000000000000000000000000000000000000000001690633a46b1a89060440160206040518083038186803b158015610bbe57600080fd5b505afa158015610bd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf69190611e39565b10159392505050565b6000868686868686604051602001610c1c96959493929190611fbe565b6040516020818303038152906040528051906020012090509695505050505050565b600080516020612295833981519152610c578133611212565b888714610c765760405162461bcd60e51b8152600401610891906120d3565b888514610c955760405162461bcd60e51b8152600401610891906120d3565b6000610ca78b8b8b8b8b8b8b8b610e33565b9050610cb38184611276565b60005b8a811015610d9b5780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e85818110610d0157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610d169190611b16565b8d8d86818110610d3657634e487b7160e01b600052603260045260246000fd5b905060200201358c8c87818110610d5d57634e487b7160e01b600052603260045260246000fd5b9050602002810190610d6f9190612160565b8c8b604051610d8396959493929190611fbe565b60405180910390a3610d9481612243565b9050610cb6565b505050505050505050505050565b610dc160008051602061227583398151915233610e0a565b610e015760405162461bcd60e51b815260206004820152601160248201527027b7363c902837b634b1bc9020b236b4b760791b6044820152606401610891565b6108a3816116dd565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008888888888888888604051602001610e54989796959493929190611ffb565b60405160208183030381529060405280519060200120905098975050505050505050565b600061092b836117fb565b600080516020612295833981519152610e9c8133611212565b610ea582610a91565b610f0b5760405162461bcd60e51b815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e2063616044820152701b9b9bdd0818994818d85b98d95b1b1959607a1b6064820152608401610891565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610f638133611212565b6109cd8383611678565b6000805160206122b5833981519152610f87816000610e0a565b610f9557610f958133611212565b878614610fb45760405162461bcd60e51b8152600401610891906120d3565b878414610fd35760405162461bcd60e51b8152600401610891906120d3565b6000610fe58a8a8a8a8a8a8a8a610e33565b9050610ff1818561140b565b60005b898110156110a45761109482828d8d8581811061102157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906110369190611b16565b8c8c8681811061105657634e487b7160e01b600052603260045260246000fd5b905060200201358b8b8781811061107d57634e487b7160e01b600052603260045260246000fd5b905060200281019061108f9190612160565b6114a7565b61109d81612243565b9050610ff4565b506110ae816115bb565b50505050505050505050565b604051630748d63560e31b81526001600160a01b038381166004830152602482018390526000917f000000000000000000000000000000000000000000000000000000000000000090911690633a46b1a89060440160206040518083038186803b15801561112757600080fd5b505afa15801561113b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092b9190611e39565b60006064600354604051632394e7a360e21b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638e539e8c9060240160206040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111fe9190611e39565b61120891906121dd565b61083791906121bd565b61121c8282610e0a565b610a6557611234816001600160a01b03166014611827565b61123f836020611827565b604051602001611250929190611f17565b60408051601f198184030181529082905262461bcd60e51b8252610891916004016120a0565b61127f826109d2565b156112e45760405162461bcd60e51b815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201526e1c9958591e481cd8da19591d5b1959608a1b6064820152608401610891565b6002548110156113455760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e746044820152652064656c617960d01b6064820152608401610891565b61134f81426121a5565b6000928352600160205260409092209190915550565b60648111156113c55760405162461bcd60e51b815260206004820152602660248201527f51756f72756d4e756d657261746f72206f7665722051756f72756d44656e6f6d60448201526534b730ba37b960d11b6064820152608401610891565b600380549082905560408051828152602081018490527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b463399791015b60405180910390a15050565b6114148261090c565b6114305760405162461bcd60e51b815260040161089190612116565b80158061144c5750600081815260016020819052604090912054145b610a655760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e6720646570656044820152656e64656e637960d01b6064820152608401610891565b6000846001600160a01b03168484846040516114c4929190611f07565b60006040518083038185875af1925050503d8060008114611501576040519150601f19603f3d011682016040523d82523d6000602084013e611506565b606091505b50509050806115735760405162461bcd60e51b815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e6720746044820152721c985b9cd858dd1a5bdb881c995d995c9d1959606a1b6064820152608401610891565b85877fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b58878787876040516115aa9493929190611f8c565b60405180910390a350505050505050565b6115c48161090c565b6115e05760405162461bcd60e51b815260040161089190612116565b600090815260016020819052604090912055565b6115fe8282610e0a565b610a65576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116343390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6116828282610e0a565b15610a65576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561173657600080fd5b505afa15801561174a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176e9190611e39565b8111156117bd5760405162461bcd60e51b815260206004820152601f60248201527f566f74696e67506f776572206578636565647320546f74616c537570706c79006044820152606401610891565b600480549082905560408051828152602081018490527fffa6924680a95f00a59e3a76b306ce0c90ee975b30a47720b08a85c7527a9d8691016113ff565b60006108377fa3e2c49fb410c51181698b9141f4d01ef283332011dad1851a8876104c08a9f783610e0a565b606060006118368360026121dd565b6118419060026121a5565b67ffffffffffffffff81111561186757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611891576020820181803683370190505b509050600360fc1b816000815181106118ba57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106118f757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061191b8460026121dd565b6119269060016121a5565b90505b60018111156119ba576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061196857634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061198c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936119b38161222c565b9050611929565b50831561092b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610891565b80356001600160a01b0381168114611a2057600080fd5b919050565b60008083601f840112611a36578182fd5b50813567ffffffffffffffff811115611a4d578182fd5b6020830191508360208260051b8501011115611a6857600080fd5b9250929050565b60008083601f840112611a80578182fd5b50813567ffffffffffffffff811115611a97578182fd5b602083019150836020828501011115611a6857600080fd5b600060608284031215611ac0578081fd5b6040516060810181811067ffffffffffffffff82111715611aef57634e487b7160e01b83526041600452602483fd5b80604052508091508235815260208301356020820152604083013560408201525092915050565b600060208284031215611b27578081fd5b61092b82611a09565b60008060408385031215611b42578081fd5b611b4b83611a09565b946020939093013593505050565b60008060008060008060a08789031215611b71578182fd5b611b7a87611a09565b955060208701359450604087013567ffffffffffffffff811115611b9c578283fd5b611ba889828a01611a6f565b979a9699509760608101359660809091013595509350505050565b600080600080600080600060c0888a031215611bdd578081fd5b611be688611a09565b965060208801359550604088013567ffffffffffffffff811115611c08578182fd5b611c148a828b01611a6f565b989b979a50986060810135976080820135975060a09091013595509350505050565b60008060008060008060008060a0898b031215611c51578081fd5b883567ffffffffffffffff80821115611c68578283fd5b611c748c838d01611a25565b909a50985060208b0135915080821115611c8c578283fd5b611c988c838d01611a25565b909850965060408b0135915080821115611cb0578283fd5b50611cbd8b828c01611a25565b999c989b509699959896976060870135966080013595509350505050565b600080600080600080600080600060c08a8c031215611cf8578081fd5b893567ffffffffffffffff80821115611d0f578283fd5b611d1b8d838e01611a25565b909b50995060208c0135915080821115611d33578283fd5b611d3f8d838e01611a25565b909950975060408c0135915080821115611d57578283fd5b50611d648c828d01611a25565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b600060208284031215611d9a578081fd5b5035919050565b60008060408385031215611db3578182fd5b82359150611dc360208401611a09565b90509250929050565b600060208284031215611ddd578081fd5b81356001600160e01b03198116811461092b578182fd5b600060608284031215611e05578081fd5b61092b8383611aaf565b60008060808385031215611e21578182fd5b611e2b8484611aaf565b946060939093013593505050565b600060208284031215611e4a578081fd5b5051919050565b81835260006020808501808196508560051b8101915084845b87811015611ed15782840389528135601e19883603018112611e8a578687fd5b8701803567ffffffffffffffff811115611ea2578788fd5b803603891315611eb0578788fd5b611ebd8682898501611ede565b9a87019a9550505090840190600101611e6a565b5091979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611f4f8160178501602088016121fc565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611f808160288401602088016121fc565b01602801949350505050565b60018060a01b0385168152836020820152606060408201526000611fb4606083018486611ede565b9695505050505050565b60018060a01b038716815285602082015260a060408201526000611fe660a083018688611ede565b60608301949094525060800152949350505050565b60a0808252810188905260008960c08301825b8b81101561203c576001600160a01b0361202784611a09565b1682526020928301929091019060010161200e565b5083810360208501528881526001600160fb1b0389111561205b578283fd5b8860051b9150818a6020830137016020818101838152848303909101604085015261208781888a611e51565b6060850196909652505050608001529695505050505050565b60208152600082518060208401526120bf8160408501602087016121fc565b601f01601f19169190910160400192915050565b60208082526023908201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d616040820152620e8c6d60eb1b606082015260800190565b6020808252602a908201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e206973604082015269206e6f7420726561647960b01b606082015260800190565b6000808335601e19843603018112612176578283fd5b83018035915067ffffffffffffffff821115612190578283fd5b602001915036819003821315611a6857600080fd5b600082198211156121b8576121b861225e565b500190565b6000826121d857634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156121f7576121f761225e565b500290565b60005b838110156122175781810151838201526020016121ff565b83811115612226576000848401525b50505050565b60008161223b5761223b61225e565b506000190190565b60006000198214156122575761225761225e565b5060010190565b634e487b7160e01b600052601160045260246000fdfeace7350211ab645c1937904136ede4855ac3aa1eabb4970e1a51a335d2e19920b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1d8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63a26469706673582212208dd591afe29bd5a19c89942cc3665bf02100cb4e98a37c29aba694428cff910e64736f6c63430008040033ace7350211ab645c1937904136ede4855ac3aa1eabb4970e1a51a335d2e199205f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1d8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f275000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102345760003560e01c8063756632991161012e578063b1c5f427116100ab578063e38335e51161006f578063e38335e5146106ce578063eb9019d4146106e1578063f27a0c9214610701578063f8ce560a14610716578063fc0c546a1461073657600080fd5b8063b1c5f42714610621578063bf1cb09214610641578063c4d252f514610661578063d45c443514610681578063d547741f146106ae57600080fd5b806391d14854116100f257806391d14854146105a157806397c3d334146105c1578063a17620c1146105d5578063a217fddf146105f7578063a7713a701461060c57600080fd5b806375663299146104ff5780638065657f1461051f5780638f2a0bb01461053f5780638f61f4f51461055f57806390bd89021461058157600080fd5b8063248a9ca3116101bc57806336fffde01161018057806336fffde01461046357806341e08d9314610478578063471ac16814610498578063584b153e146104bf57806364d62353146104df57600080fd5b8063248a9ca3146103a25780632ab0f529146103d25780632f2ff15d1461040357806331d507501461042357806336568abe1461044357600080fd5b806307eabd511161020357806307eabd51146102e75780630d3cf6fc1461031b578063134008d31461034f57806313bc9f201461036257806319ab453c1461038257600080fd5b806301d5062a1461024057806301ffc9a71461026257806306f3f9e61461029757806307bd0265146102b757600080fd5b3661023b57005b600080fd5b34801561024c57600080fd5b5061026061025b366004611bc3565b610782565b005b34801561026e57600080fd5b5061028261027d366004611dcc565b610806565b60405190151581526020015b60405180910390f35b3480156102a357600080fd5b506102606102b2366004611d89565b61083d565b3480156102c357600080fd5b506102d96000805160206122b583398151915281565b60405190815260200161028e565b3480156102f357600080fd5b506102d97fa3e2c49fb410c51181698b9141f4d01ef283332011dad1851a8876104c08a9f781565b34801561032757600080fd5b506102d97f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b61026061035d366004611b59565b6108a6565b34801561036e57600080fd5b5061028261037d366004611d89565b61090c565b34801561038e57600080fd5b5061026061039d366004611b16565b610932565b3480156103ae57600080fd5b506102d96103bd366004611d89565b60009081526020819052604090206001015490565b3480156103de57600080fd5b506102826103ed366004611d89565b6000908152600160208190526040909120541490565b34801561040f57600080fd5b5061026061041e366004611da1565b6109a7565b34801561042f57600080fd5b5061028261043e366004611d89565b6109d2565b34801561044f57600080fd5b5061026061045e366004611da1565b6109eb565b34801561046f57600080fd5b506004546102d9565b34801561048457600080fd5b50610282610493366004611e0f565b610a69565b3480156104a457600080fd5b506102826104b3366004611df4565b80516020909101511190565b3480156104cb57600080fd5b506102826104da366004611d89565b610a91565b3480156104eb57600080fd5b506102606104fa366004611d89565b610aa7565b34801561050b57600080fd5b5061028261051a366004611b30565b610b4b565b34801561052b57600080fd5b506102d961053a366004611b59565b610bff565b34801561054b57600080fd5b5061026061055a366004611cdb565b610c3e565b34801561056b57600080fd5b506102d960008051602061229583398151915281565b34801561058d57600080fd5b5061026061059c366004611d89565b610da9565b3480156105ad57600080fd5b506102826105bc366004611da1565b610e0a565b3480156105cd57600080fd5b5060646102d9565b3480156105e157600080fd5b506102d960008051602061227583398151915281565b34801561060357600080fd5b506102d9600081565b34801561061857600080fd5b506003546102d9565b34801561062d57600080fd5b506102d961063c366004611c36565b610e33565b34801561064d57600080fd5b5061028261065c366004611b30565b610e78565b34801561066d57600080fd5b5061026061067c366004611d89565b610e83565b34801561068d57600080fd5b506102d961069c366004611d89565b60009081526001602052604090205490565b3480156106ba57600080fd5b506102606106c9366004611da1565b610f47565b6102606106dc366004611c36565b610f6d565b3480156106ed57600080fd5b506102d96106fc366004611b30565b6110ba565b34801561070d57600080fd5b506002546102d9565b34801561072257600080fd5b506102d9610731366004611d89565b61115f565b34801561074257600080fd5b5061076a7f000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f275081565b6040516001600160a01b03909116815260200161028e565b60008051602061229583398151915261079b8133611212565b60006107ab898989898989610bff565b90506107b78184611276565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a6040516107f396959493929190611fbe565b60405180910390a3505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061083757506301ffc9a760e01b6001600160e01b03198316145b92915050565b61085560008051602061227583398151915233610e0a565b61089a5760405162461bcd60e51b815260206004820152601160248201527027b7363c902837b634b1bc9020b236b4b760791b60448201526064015b60405180910390fd5b6108a381611365565b50565b6000805160206122b58339815191526108c0816000610e0a565b6108ce576108ce8133611212565b60006108de888888888888610bff565b90506108ea818561140b565b6108f98160008a8a8a8a6114a7565b610902816115bb565b5050505050505050565b60008181526001602052604081205460018111801561092b5750428111155b9392505050565b61094a600080516020612275833981519152826109a7565b610962600080516020612295833981519152826109a7565b61097b6000805160206122b583398151915260006109a7565b6040517fc6f55283c9efe1834fbca09fc3a5569f6538e98507ed05e21798b0678ce6bdd290600090a150565b6000828152602081905260409020600101546109c38133611212565b6109cd83836115f4565b505050565b60008181526001602052604081205481905b1192915050565b6001600160a01b0381163314610a5b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610891565b610a658282611678565b5050565b600082604001518360200151610a7f91906121a5565b610a888361115f565b11159392505050565b60008181526001602081905260408220546109e4565b333014610b0a5760405162461bcd60e51b815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201526a62652074696d656c6f636b60a81b6064820152608401610891565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b6000610b5660045490565b604051630748d63560e31b81526001600160a01b038581166004830152602482018590527f000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f27501690633a46b1a89060440160206040518083038186803b158015610bbe57600080fd5b505afa158015610bd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf69190611e39565b10159392505050565b6000868686868686604051602001610c1c96959493929190611fbe565b6040516020818303038152906040528051906020012090509695505050505050565b600080516020612295833981519152610c578133611212565b888714610c765760405162461bcd60e51b8152600401610891906120d3565b888514610c955760405162461bcd60e51b8152600401610891906120d3565b6000610ca78b8b8b8b8b8b8b8b610e33565b9050610cb38184611276565b60005b8a811015610d9b5780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e85818110610d0157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610d169190611b16565b8d8d86818110610d3657634e487b7160e01b600052603260045260246000fd5b905060200201358c8c87818110610d5d57634e487b7160e01b600052603260045260246000fd5b9050602002810190610d6f9190612160565b8c8b604051610d8396959493929190611fbe565b60405180910390a3610d9481612243565b9050610cb6565b505050505050505050505050565b610dc160008051602061227583398151915233610e0a565b610e015760405162461bcd60e51b815260206004820152601160248201527027b7363c902837b634b1bc9020b236b4b760791b6044820152606401610891565b6108a3816116dd565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008888888888888888604051602001610e54989796959493929190611ffb565b60405160208183030381529060405280519060200120905098975050505050505050565b600061092b836117fb565b600080516020612295833981519152610e9c8133611212565b610ea582610a91565b610f0b5760405162461bcd60e51b815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e2063616044820152701b9b9bdd0818994818d85b98d95b1b1959607a1b6064820152608401610891565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610f638133611212565b6109cd8383611678565b6000805160206122b5833981519152610f87816000610e0a565b610f9557610f958133611212565b878614610fb45760405162461bcd60e51b8152600401610891906120d3565b878414610fd35760405162461bcd60e51b8152600401610891906120d3565b6000610fe58a8a8a8a8a8a8a8a610e33565b9050610ff1818561140b565b60005b898110156110a45761109482828d8d8581811061102157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906110369190611b16565b8c8c8681811061105657634e487b7160e01b600052603260045260246000fd5b905060200201358b8b8781811061107d57634e487b7160e01b600052603260045260246000fd5b905060200281019061108f9190612160565b6114a7565b61109d81612243565b9050610ff4565b506110ae816115bb565b50505050505050505050565b604051630748d63560e31b81526001600160a01b038381166004830152602482018390526000917f000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f275090911690633a46b1a89060440160206040518083038186803b15801561112757600080fd5b505afa15801561113b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092b9190611e39565b60006064600354604051632394e7a360e21b8152600481018590527f000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f27506001600160a01b031690638e539e8c9060240160206040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111fe9190611e39565b61120891906121dd565b61083791906121bd565b61121c8282610e0a565b610a6557611234816001600160a01b03166014611827565b61123f836020611827565b604051602001611250929190611f17565b60408051601f198184030181529082905262461bcd60e51b8252610891916004016120a0565b61127f826109d2565b156112e45760405162461bcd60e51b815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201526e1c9958591e481cd8da19591d5b1959608a1b6064820152608401610891565b6002548110156113455760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e746044820152652064656c617960d01b6064820152608401610891565b61134f81426121a5565b6000928352600160205260409092209190915550565b60648111156113c55760405162461bcd60e51b815260206004820152602660248201527f51756f72756d4e756d657261746f72206f7665722051756f72756d44656e6f6d60448201526534b730ba37b960d11b6064820152608401610891565b600380549082905560408051828152602081018490527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b463399791015b60405180910390a15050565b6114148261090c565b6114305760405162461bcd60e51b815260040161089190612116565b80158061144c5750600081815260016020819052604090912054145b610a655760405162461bcd60e51b815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e6720646570656044820152656e64656e637960d01b6064820152608401610891565b6000846001600160a01b03168484846040516114c4929190611f07565b60006040518083038185875af1925050503d8060008114611501576040519150601f19603f3d011682016040523d82523d6000602084013e611506565b606091505b50509050806115735760405162461bcd60e51b815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e6720746044820152721c985b9cd858dd1a5bdb881c995d995c9d1959606a1b6064820152608401610891565b85877fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b58878787876040516115aa9493929190611f8c565b60405180910390a350505050505050565b6115c48161090c565b6115e05760405162461bcd60e51b815260040161089190612116565b600090815260016020819052604090912055565b6115fe8282610e0a565b610a65576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556116343390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6116828282610e0a565b15610a65576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f27506001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561173657600080fd5b505afa15801561174a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176e9190611e39565b8111156117bd5760405162461bcd60e51b815260206004820152601f60248201527f566f74696e67506f776572206578636565647320546f74616c537570706c79006044820152606401610891565b600480549082905560408051828152602081018490527fffa6924680a95f00a59e3a76b306ce0c90ee975b30a47720b08a85c7527a9d8691016113ff565b60006108377fa3e2c49fb410c51181698b9141f4d01ef283332011dad1851a8876104c08a9f783610e0a565b606060006118368360026121dd565b6118419060026121a5565b67ffffffffffffffff81111561186757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611891576020820181803683370190505b509050600360fc1b816000815181106118ba57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106118f757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061191b8460026121dd565b6119269060016121a5565b90505b60018111156119ba576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061196857634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061198c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936119b38161222c565b9050611929565b50831561092b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610891565b80356001600160a01b0381168114611a2057600080fd5b919050565b60008083601f840112611a36578182fd5b50813567ffffffffffffffff811115611a4d578182fd5b6020830191508360208260051b8501011115611a6857600080fd5b9250929050565b60008083601f840112611a80578182fd5b50813567ffffffffffffffff811115611a97578182fd5b602083019150836020828501011115611a6857600080fd5b600060608284031215611ac0578081fd5b6040516060810181811067ffffffffffffffff82111715611aef57634e487b7160e01b83526041600452602483fd5b80604052508091508235815260208301356020820152604083013560408201525092915050565b600060208284031215611b27578081fd5b61092b82611a09565b60008060408385031215611b42578081fd5b611b4b83611a09565b946020939093013593505050565b60008060008060008060a08789031215611b71578182fd5b611b7a87611a09565b955060208701359450604087013567ffffffffffffffff811115611b9c578283fd5b611ba889828a01611a6f565b979a9699509760608101359660809091013595509350505050565b600080600080600080600060c0888a031215611bdd578081fd5b611be688611a09565b965060208801359550604088013567ffffffffffffffff811115611c08578182fd5b611c148a828b01611a6f565b989b979a50986060810135976080820135975060a09091013595509350505050565b60008060008060008060008060a0898b031215611c51578081fd5b883567ffffffffffffffff80821115611c68578283fd5b611c748c838d01611a25565b909a50985060208b0135915080821115611c8c578283fd5b611c988c838d01611a25565b909850965060408b0135915080821115611cb0578283fd5b50611cbd8b828c01611a25565b999c989b509699959896976060870135966080013595509350505050565b600080600080600080600080600060c08a8c031215611cf8578081fd5b893567ffffffffffffffff80821115611d0f578283fd5b611d1b8d838e01611a25565b909b50995060208c0135915080821115611d33578283fd5b611d3f8d838e01611a25565b909950975060408c0135915080821115611d57578283fd5b50611d648c828d01611a25565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b600060208284031215611d9a578081fd5b5035919050565b60008060408385031215611db3578182fd5b82359150611dc360208401611a09565b90509250929050565b600060208284031215611ddd578081fd5b81356001600160e01b03198116811461092b578182fd5b600060608284031215611e05578081fd5b61092b8383611aaf565b60008060808385031215611e21578182fd5b611e2b8484611aaf565b946060939093013593505050565b600060208284031215611e4a578081fd5b5051919050565b81835260006020808501808196508560051b8101915084845b87811015611ed15782840389528135601e19883603018112611e8a578687fd5b8701803567ffffffffffffffff811115611ea2578788fd5b803603891315611eb0578788fd5b611ebd8682898501611ede565b9a87019a9550505090840190600101611e6a565b5091979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611f4f8160178501602088016121fc565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611f808160288401602088016121fc565b01602801949350505050565b60018060a01b0385168152836020820152606060408201526000611fb4606083018486611ede565b9695505050505050565b60018060a01b038716815285602082015260a060408201526000611fe660a083018688611ede565b60608301949094525060800152949350505050565b60a0808252810188905260008960c08301825b8b81101561203c576001600160a01b0361202784611a09565b1682526020928301929091019060010161200e565b5083810360208501528881526001600160fb1b0389111561205b578283fd5b8860051b9150818a6020830137016020818101838152848303909101604085015261208781888a611e51565b6060850196909652505050608001529695505050505050565b60208152600082518060208401526120bf8160408501602087016121fc565b601f01601f19169190910160400192915050565b60208082526023908201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d616040820152620e8c6d60eb1b606082015260800190565b6020808252602a908201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e206973604082015269206e6f7420726561647960b01b606082015260800190565b6000808335601e19843603018112612176578283fd5b83018035915067ffffffffffffffff821115612190578283fd5b602001915036819003821315611a6857600080fd5b600082198211156121b8576121b861225e565b500190565b6000826121d857634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156121f7576121f761225e565b500290565b60005b838110156122175781810151838201526020016121ff565b83811115612226576000848401525b50505050565b60008161223b5761223b61225e565b506000190190565b60006000198214156122575761225761225e565b5060010190565b634e487b7160e01b600052601160045260246000fdfeace7350211ab645c1937904136ede4855ac3aa1eabb4970e1a51a335d2e19920b09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1d8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63a26469706673582212208dd591afe29bd5a19c89942cc3665bf02100cb4e98a37c29aba694428cff910e64736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f275000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : minDelay (uint256): 6400
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000001900
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [3] : 000000000000000000000000cd668b44c7cf3b63722d5ce5f655de68dd8f2750
Arg [4] : 00000000000000000000000000000000000000000000021e19e0c9bab2400000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.