Overview
ETH Balance
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Multichain Info
No addresses found
Loading...
Loading
Contract Name:
DelegationsHoster
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./SignatureUtils.sol"; interface IGovernorContract { function castVote(uint256 proposalId, uint8 support) external; function castVoteWithReason(uint256 proposalId, uint8 support, string calldata reason) external; function castVoteWithReasonAndParams(uint256 proposalId, uint8 support, string calldata reason, bytes memory params) external; } interface IERC1271 { function isValidSignature(bytes32 _hash, bytes memory _signature) external view returns (bytes4); } contract DelegationsHoster is AccessControl, IERC1271 { bytes32 public constant ONCHAIN_VOTER_ROLE = keccak256("ONCHAIN_VOTER_ROLE"); address public offchainVoter; event OffchainVoterChanged(address indexed previousVoter, address indexed newVoter); event VoteCastByLobbyFi(uint256 proposalId, uint8 support, string reason, bytes params, address governorContractAddress); constructor() { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } /// Role management for off-chain voters function setOffchainVoter(address _offchainVoter) external onlyRole(DEFAULT_ADMIN_ROLE) { address previousVoter = offchainVoter; offchainVoter = _offchainVoter; emit OffchainVoterChanged(previousVoter, offchainVoter); } /// On-chain voting function castVote(uint256 proposalId, uint8 support, address governorContractAddress) external onlyRole(ONCHAIN_VOTER_ROLE) { IGovernorContract governorContract = IGovernorContract(governorContractAddress); governorContract.castVote(proposalId, support); emit VoteCastByLobbyFi(proposalId, support, "", "", governorContractAddress); } function castVoteWithReason(uint256 proposalId, uint8 support, string calldata reason, address governorContractAddress) external onlyRole(ONCHAIN_VOTER_ROLE) { IGovernorContract governorContract = IGovernorContract(governorContractAddress); governorContract.castVoteWithReason(proposalId, support, reason); emit VoteCastByLobbyFi(proposalId, support, reason, "", governorContractAddress); } function castVoteWithReasonAndParams(uint256 proposalId, uint8 support, string calldata reason, bytes memory params, address governorContractAddress) external onlyRole(ONCHAIN_VOTER_ROLE) { IGovernorContract governorContract = IGovernorContract(governorContractAddress); governorContract.castVoteWithReasonAndParams(proposalId, support, reason, params); emit VoteCastByLobbyFi(proposalId, support, reason, params, governorContractAddress); } // ERC-1271 signature validation for off-chain voting function isValidSignature(bytes32 _hash, bytes memory _signature) external view override returns (bytes4) { if (SignatureUtils.recoverSigner(_hash, _signature) == offchainVoter) { return this.isValidSignature.selector; } else { return bytes4(0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @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. */ 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 `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.20; /** * @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 } /** * @dev The signature derives the `address(0)`. */ error ECDSAInvalidSignature(); /** * @dev The signature has an invalid length. */ error ECDSAInvalidSignatureLength(uint256 length); /** * @dev The signature has an S value that is in the upper half order. */ error ECDSAInvalidSignatureS(bytes32 s); /** * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not * return address(0) without also returning an error description. Errors are documented using an enum (error type) * and a bytes32 providing additional information about the error. * * If no error is returned, then the address can be used for verification purposes. * * The `ecrecover` EVM precompile 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 {MessageHashUtils-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] */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length)); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature); _throwError(error, errorArg); 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] */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { unchecked { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); // We do not check for an overflow here since the shift operation results in 0 or 1. uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError, bytes32) { // 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, s); } // 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, bytes32(0)); } return (signer, RecoverError.NoError, bytes32(0)); } /** * @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, bytes32 errorArg) = tryRecover(hash, v, r, s); _throwError(error, errorArg); return recovered; } /** * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. */ function _throwError(RecoverError error, bytes32 errorArg) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert ECDSAInvalidSignature(); } else if (error == RecoverError.InvalidSignatureLength) { revert ECDSAInvalidSignatureLength(uint256(errorArg)); } else if (error == RecoverError.InvalidSignatureS) { revert ECDSAInvalidSignatureS(errorArg); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./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); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @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.20; library SignatureUtils { function readBytes32(bytes memory data, uint256 index) internal pure returns (bytes32 o) { require(data.length / 32 > index, "Reading bytes out of bounds"); assembly { o := mload(add(data, add(32, mul(32, index)))) } } function recoverSigner(bytes32 _hash, bytes memory _signature) internal pure returns (address signer) { require(_signature.length == 65, "SignatureValidator#recoverSigner: invalid signature length"); // Variables are not scoped in Solidity. uint8 v = uint8(_signature[64]); bytes32 r = readBytes32(_signature, 0); bytes32 s = readBytes32(_signature, 1); if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { revert("SignatureValidator#recoverSigner: invalid signature 's' value"); } if (v != 27 && v != 28) { revert("SignatureValidator#recoverSigner: invalid signature 'v' value"); } // Recover ECDSA signer signer = ecrecover(_hash, v, r, s); // Prevent signer from being 0x0 require( signer != address(0x0), "SignatureValidator#recoverSigner: INVALID_SIGNER" ); return signer; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousVoter","type":"address"},{"indexed":true,"internalType":"address","name":"newVoter","type":"address"}],"name":"OffchainVoterChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"support","type":"uint8"},{"indexed":false,"internalType":"string","name":"reason","type":"string"},{"indexed":false,"internalType":"bytes","name":"params","type":"bytes"},{"indexed":false,"internalType":"address","name":"governorContractAddress","type":"address"}],"name":"VoteCastByLobbyFi","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONCHAIN_VOTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"},{"internalType":"uint8","name":"support","type":"uint8"},{"internalType":"address","name":"governorContractAddress","type":"address"}],"name":"castVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"},{"internalType":"uint8","name":"support","type":"uint8"},{"internalType":"string","name":"reason","type":"string"},{"internalType":"address","name":"governorContractAddress","type":"address"}],"name":"castVoteWithReason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"},{"internalType":"uint8","name":"support","type":"uint8"},{"internalType":"string","name":"reason","type":"string"},{"internalType":"bytes","name":"params","type":"bytes"},{"internalType":"address","name":"governorContractAddress","type":"address"}],"name":"castVoteWithReasonAndParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"offchainVoter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","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":"_offchainVoter","type":"address"}],"name":"setOffchainVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001c600033610022565b506100ce565b6000828152602081815260408083206001600160a01b038516845290915281205460ff166100c4576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561007c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016100c8565b5060005b92915050565b610fd1806100dd6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806336568abe1161008c578063a217fddf11610066578063a217fddf146101fd578063cb1d159114610205578063d547741f14610218578063e31096c81461022b57600080fd5b806336568abe146101c2578063406946c1146101d557806391d14854146101ea57600080fd5b806324524c6c116100c857806324524c6c14610158578063248a9ca31461016b5780632f2ff15d1461019c57806331faf94d146101af57600080fd5b806301ffc9a7146100ef5780631626ba7e14610117578063234ce04214610143575b600080fd5b6101026100fd366004610a76565b610256565b60405190151581526020015b60405180910390f35b61012a610125366004610b4a565b61028d565b6040516001600160e01b0319909116815260200161010e565b610156610151366004610c07565b6102cb565b005b610156610166366004610c9a565b610396565b61018e610179366004610cd6565b60009081526020819052604090206001015490565b60405190815260200161010e565b6101566101aa366004610cef565b610482565b6101566101bd366004610d1b565b6104ad565b6101566101d0366004610cef565b61050b565b61018e600080516020610f5c83398151915281565b6101026101f8366004610cef565b610543565b61018e600081565b610156610213366004610d36565b61056c565b610156610226366004610cef565b610632565b60015461023e906001600160a01b031681565b6040516001600160a01b03909116815260200161010e565b60006001600160e01b03198216637965db0b60e01b148061028757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001546000906001600160a01b03166102a68484610657565b6001600160a01b0316036102c25750630b135d3f60e11b610287565b50600092915050565b600080516020610f5c8339815191526102e3816108c2565b6040516317ce628560e21b815282906001600160a01b03821690635f398a1490610319908b908b908b908b908b90600401610e14565b600060405180830381600087803b15801561033357600080fd5b505af1158015610347573d6000803e3d6000fd5b505050507ff95488e54d4c28096bbac3d4f3bb9f686dd7d504a631f172a26f49cc0537bd3588888888888860405161038496959493929190610e55565b60405180910390a15050505050505050565b600080516020610f5c8339815191526103ae816108c2565b604051630acf027160e31b81526004810185905260ff8416602482015282906001600160a01b03821690635678138890604401600060405180830381600087803b1580156103fb57600080fd5b505af115801561040f573d6000803e3d6000fd5b50506040805188815260ff8816602082015260a0818301819052600090820181905260c0606083018190528201526001600160a01b038716608082015290517ff95488e54d4c28096bbac3d4f3bb9f686dd7d504a631f172a26f49cc0537bd3593509081900360e0019150a15050505050565b60008281526020819052604090206001015461049d816108c2565b6104a783836108cf565b50505050565b60006104b8816108c2565b600180546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f23fa0e4d6c87dff62fb0ffb6d8c55c7965b6ade23c35df17c51035f7163d2a9790600090a3505050565b6001600160a01b03811633146105345760405163334bd91960e11b815260040160405180910390fd5b61053e8282610961565b505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020610f5c833981519152610584816108c2565b604051637b3c71d360e01b815282906001600160a01b03821690637b3c71d3906105b8908a908a908a908a90600401610ea6565b600060405180830381600087803b1580156105d257600080fd5b505af11580156105e6573d6000803e3d6000fd5b505050507ff95488e54d4c28096bbac3d4f3bb9f686dd7d504a631f172a26f49cc0537bd358787878787604051610621959493929190610ed3565b60405180910390a150505050505050565b60008281526020819052604090206001015461064d816108c2565b6104a78383610961565b600081516041146106c35760405162461bcd60e51b815260206004820152603a6024820152600080516020610f7c83398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e67746800000000000060648201526084015b60405180910390fd5b6000826040815181106106d8576106d8610f23565b016020015160f81c905060006106ee84826109cc565b905060006106fd8560016109cc565b90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08111156107835760405162461bcd60e51b815260206004820152603d6024820152600080516020610f7c83398151915260448201527f3a20696e76616c6964207369676e6174757265202773272076616c756500000060648201526084016106ba565b8260ff16601b1415801561079b57508260ff16601c14155b156107fc5760405162461bcd60e51b815260206004820152603d6024820152600080516020610f7c83398151915260448201527f3a20696e76616c6964207369676e6174757265202776272076616c756500000060648201526084016106ba565b60408051600081526020810180835288905260ff851691810191909152606081018390526080810182905260019060a0016020604051602081039080840390855afa15801561084f573d6000803e3d6000fd5b5050604051601f1901519450506001600160a01b0384166108b95760405162461bcd60e51b81526020600482015260306024820152600080516020610f7c83398151915260448201526f1d1024a72b20a624a22fa9a4a3a722a960811b60648201526084016106ba565b50505092915050565b6108cc8133610a39565b50565b60006108db8383610543565b610959576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556109113390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610287565b506000610287565b600061096d8383610543565b15610959576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610287565b600081602084516109dd9190610f39565b11610a2a5760405162461bcd60e51b815260206004820152601b60248201527f52656164696e67206279746573206f7574206f6620626f756e6473000000000060448201526064016106ba565b50602090810291909101015190565b610a438282610543565b610a725760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016106ba565b5050565b600060208284031215610a8857600080fd5b81356001600160e01b031981168114610aa057600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610ace57600080fd5b813567ffffffffffffffff80821115610ae957610ae9610aa7565b604051601f8301601f19908116603f01168101908282118183101715610b1157610b11610aa7565b81604052838152866020858801011115610b2a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215610b5d57600080fd5b82359150602083013567ffffffffffffffff811115610b7b57600080fd5b610b8785828601610abd565b9150509250929050565b803560ff81168114610ba257600080fd5b919050565b60008083601f840112610bb957600080fd5b50813567ffffffffffffffff811115610bd157600080fd5b602083019150836020828501011115610be957600080fd5b9250929050565b80356001600160a01b0381168114610ba257600080fd5b60008060008060008060a08789031215610c2057600080fd5b86359550610c3060208801610b91565b9450604087013567ffffffffffffffff80821115610c4d57600080fd5b610c598a838b01610ba7565b90965094506060890135915080821115610c7257600080fd5b50610c7f89828a01610abd565b925050610c8e60808801610bf0565b90509295509295509295565b600080600060608486031215610caf57600080fd5b83359250610cbf60208501610b91565b9150610ccd60408501610bf0565b90509250925092565b600060208284031215610ce857600080fd5b5035919050565b60008060408385031215610d0257600080fd5b82359150610d1260208401610bf0565b90509250929050565b600060208284031215610d2d57600080fd5b610aa082610bf0565b600080600080600060808688031215610d4e57600080fd5b85359450610d5e60208701610b91565b9350604086013567ffffffffffffffff811115610d7a57600080fd5b610d8688828901610ba7565b9094509250610d99905060608701610bf0565b90509295509295909350565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b81811015610df457602081850181015186830182015201610dd8565b506000602082860101526020601f19601f83011685010191505092915050565b85815260ff85166020820152608060408201526000610e37608083018587610da5565b8281036060840152610e498185610dce565b98975050505050505050565b86815260ff8616602082015260a060408201526000610e7860a083018688610da5565b8281036060840152610e8a8186610dce565b91505060018060a01b0383166080830152979650505050505050565b84815260ff84166020820152606060408201526000610ec9606083018486610da5565b9695505050505050565b85815260ff8516602082015260a060408201526000610ef660a083018587610da5565b8281036060840152600081526001600160a01b039390931660809092019190915250602001949350505050565b634e487b7160e01b600052603260045260246000fd5b600082610f5657634e487b7160e01b600052601260045260246000fd5b50049056fe62415835e27bb62ff0af7b4b1d968ce69661c45aef8a294659488c61049da2425369676e617475726556616c696461746f72237265636f7665725369676e6572a2646970667358221220b81b6d2ad8df6e096ceccdd70424368c7dc06f5651362bfd33315357e662591a64736f6c63430008140033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806336568abe1161008c578063a217fddf11610066578063a217fddf146101fd578063cb1d159114610205578063d547741f14610218578063e31096c81461022b57600080fd5b806336568abe146101c2578063406946c1146101d557806391d14854146101ea57600080fd5b806324524c6c116100c857806324524c6c14610158578063248a9ca31461016b5780632f2ff15d1461019c57806331faf94d146101af57600080fd5b806301ffc9a7146100ef5780631626ba7e14610117578063234ce04214610143575b600080fd5b6101026100fd366004610a76565b610256565b60405190151581526020015b60405180910390f35b61012a610125366004610b4a565b61028d565b6040516001600160e01b0319909116815260200161010e565b610156610151366004610c07565b6102cb565b005b610156610166366004610c9a565b610396565b61018e610179366004610cd6565b60009081526020819052604090206001015490565b60405190815260200161010e565b6101566101aa366004610cef565b610482565b6101566101bd366004610d1b565b6104ad565b6101566101d0366004610cef565b61050b565b61018e600080516020610f5c83398151915281565b6101026101f8366004610cef565b610543565b61018e600081565b610156610213366004610d36565b61056c565b610156610226366004610cef565b610632565b60015461023e906001600160a01b031681565b6040516001600160a01b03909116815260200161010e565b60006001600160e01b03198216637965db0b60e01b148061028757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001546000906001600160a01b03166102a68484610657565b6001600160a01b0316036102c25750630b135d3f60e11b610287565b50600092915050565b600080516020610f5c8339815191526102e3816108c2565b6040516317ce628560e21b815282906001600160a01b03821690635f398a1490610319908b908b908b908b908b90600401610e14565b600060405180830381600087803b15801561033357600080fd5b505af1158015610347573d6000803e3d6000fd5b505050507ff95488e54d4c28096bbac3d4f3bb9f686dd7d504a631f172a26f49cc0537bd3588888888888860405161038496959493929190610e55565b60405180910390a15050505050505050565b600080516020610f5c8339815191526103ae816108c2565b604051630acf027160e31b81526004810185905260ff8416602482015282906001600160a01b03821690635678138890604401600060405180830381600087803b1580156103fb57600080fd5b505af115801561040f573d6000803e3d6000fd5b50506040805188815260ff8816602082015260a0818301819052600090820181905260c0606083018190528201526001600160a01b038716608082015290517ff95488e54d4c28096bbac3d4f3bb9f686dd7d504a631f172a26f49cc0537bd3593509081900360e0019150a15050505050565b60008281526020819052604090206001015461049d816108c2565b6104a783836108cf565b50505050565b60006104b8816108c2565b600180546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f23fa0e4d6c87dff62fb0ffb6d8c55c7965b6ade23c35df17c51035f7163d2a9790600090a3505050565b6001600160a01b03811633146105345760405163334bd91960e11b815260040160405180910390fd5b61053e8282610961565b505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020610f5c833981519152610584816108c2565b604051637b3c71d360e01b815282906001600160a01b03821690637b3c71d3906105b8908a908a908a908a90600401610ea6565b600060405180830381600087803b1580156105d257600080fd5b505af11580156105e6573d6000803e3d6000fd5b505050507ff95488e54d4c28096bbac3d4f3bb9f686dd7d504a631f172a26f49cc0537bd358787878787604051610621959493929190610ed3565b60405180910390a150505050505050565b60008281526020819052604090206001015461064d816108c2565b6104a78383610961565b600081516041146106c35760405162461bcd60e51b815260206004820152603a6024820152600080516020610f7c83398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e67746800000000000060648201526084015b60405180910390fd5b6000826040815181106106d8576106d8610f23565b016020015160f81c905060006106ee84826109cc565b905060006106fd8560016109cc565b90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08111156107835760405162461bcd60e51b815260206004820152603d6024820152600080516020610f7c83398151915260448201527f3a20696e76616c6964207369676e6174757265202773272076616c756500000060648201526084016106ba565b8260ff16601b1415801561079b57508260ff16601c14155b156107fc5760405162461bcd60e51b815260206004820152603d6024820152600080516020610f7c83398151915260448201527f3a20696e76616c6964207369676e6174757265202776272076616c756500000060648201526084016106ba565b60408051600081526020810180835288905260ff851691810191909152606081018390526080810182905260019060a0016020604051602081039080840390855afa15801561084f573d6000803e3d6000fd5b5050604051601f1901519450506001600160a01b0384166108b95760405162461bcd60e51b81526020600482015260306024820152600080516020610f7c83398151915260448201526f1d1024a72b20a624a22fa9a4a3a722a960811b60648201526084016106ba565b50505092915050565b6108cc8133610a39565b50565b60006108db8383610543565b610959576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556109113390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610287565b506000610287565b600061096d8383610543565b15610959576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610287565b600081602084516109dd9190610f39565b11610a2a5760405162461bcd60e51b815260206004820152601b60248201527f52656164696e67206279746573206f7574206f6620626f756e6473000000000060448201526064016106ba565b50602090810291909101015190565b610a438282610543565b610a725760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016106ba565b5050565b600060208284031215610a8857600080fd5b81356001600160e01b031981168114610aa057600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610ace57600080fd5b813567ffffffffffffffff80821115610ae957610ae9610aa7565b604051601f8301601f19908116603f01168101908282118183101715610b1157610b11610aa7565b81604052838152866020858801011115610b2a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215610b5d57600080fd5b82359150602083013567ffffffffffffffff811115610b7b57600080fd5b610b8785828601610abd565b9150509250929050565b803560ff81168114610ba257600080fd5b919050565b60008083601f840112610bb957600080fd5b50813567ffffffffffffffff811115610bd157600080fd5b602083019150836020828501011115610be957600080fd5b9250929050565b80356001600160a01b0381168114610ba257600080fd5b60008060008060008060a08789031215610c2057600080fd5b86359550610c3060208801610b91565b9450604087013567ffffffffffffffff80821115610c4d57600080fd5b610c598a838b01610ba7565b90965094506060890135915080821115610c7257600080fd5b50610c7f89828a01610abd565b925050610c8e60808801610bf0565b90509295509295509295565b600080600060608486031215610caf57600080fd5b83359250610cbf60208501610b91565b9150610ccd60408501610bf0565b90509250925092565b600060208284031215610ce857600080fd5b5035919050565b60008060408385031215610d0257600080fd5b82359150610d1260208401610bf0565b90509250929050565b600060208284031215610d2d57600080fd5b610aa082610bf0565b600080600080600060808688031215610d4e57600080fd5b85359450610d5e60208701610b91565b9350604086013567ffffffffffffffff811115610d7a57600080fd5b610d8688828901610ba7565b9094509250610d99905060608701610bf0565b90509295509295909350565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b81811015610df457602081850181015186830182015201610dd8565b506000602082860101526020601f19601f83011685010191505092915050565b85815260ff85166020820152608060408201526000610e37608083018587610da5565b8281036060840152610e498185610dce565b98975050505050505050565b86815260ff8616602082015260a060408201526000610e7860a083018688610da5565b8281036060840152610e8a8186610dce565b91505060018060a01b0383166080830152979650505050505050565b84815260ff84166020820152606060408201526000610ec9606083018486610da5565b9695505050505050565b85815260ff8516602082015260a060408201526000610ef660a083018587610da5565b8281036060840152600081526001600160a01b039390931660809092019190915250602001949350505050565b634e487b7160e01b600052603260045260246000fd5b600082610f5657634e487b7160e01b600052601260045260246000fd5b50049056fe62415835e27bb62ff0af7b4b1d968ce69661c45aef8a294659488c61049da2425369676e617475726556616c696461746f72237265636f7665725369676e6572a2646970667358221220b81b6d2ad8df6e096ceccdd70424368c7dc06f5651362bfd33315357e662591a64736f6c63430008140033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.