Contract
0x12D82f38a038A71b0843BD3256CD1E0A1De74834
22
Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available, login to update
Latest 1 internal transaction
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0x0499abde3ba6e509594752ced8193d680920369d3af81e63e31b8473ad824f0c | 313 | 186 days 48 mins ago | 0x4e59b44847b379578588920ca78fbf26c0b4956c | Contract Creation | 0 ETH |
[ Download CSV Export ]
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
AccessControlRegistry
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * 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); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol) pragma solidity ^0.8.9; import "../utils/Context.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771Context is Context { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable _trustedForwarder; /// @custom:oz-upgrades-unsafe-allow constructor constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. /// @solidity memory-safe-assembly assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @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 // Deprecated in v4.8 } 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"); } } /** * @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) { 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); } } /** * @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 = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); 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. * * _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 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 Message, created from `s`. 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(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @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 // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol) 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; address private immutable _CACHED_THIS; 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); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && 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 // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "../utils/ExpiringMetaTxForwarder.sol"; import "../utils/SelfMulticall.sol"; import "./RoleDeriver.sol"; import "./interfaces/IAccessControlRegistry.sol"; /// @title Contract that allows users to manage independent, tree-shaped access /// control tables /// @notice Multiple contracts can refer to this contract to check if their /// users have granted accounts specific roles. Therefore, it aims to keep all /// access control roles of its users in this single contract. /// @dev Each user is called a "manager", and is the only member of their root /// role. Starting from this root role, they can create an arbitrary tree of /// roles and grant these to accounts. Each role has a description, and roles /// adminned by the same role cannot have the same description. contract AccessControlRegistry is ERC2771Context, AccessControl, ExpiringMetaTxForwarder, SelfMulticall, RoleDeriver, IAccessControlRegistry { /// @dev AccessControlRegistry is its own trusted meta-tx forwarder constructor() ERC2771Context(address(this)) {} /// @notice Initializes the manager by initializing its root role and /// granting it to them /// @dev Anyone can initialize a manager. An uninitialized manager /// attempting to initialize a role will be initialized automatically. /// Once a manager is initialized, subsequent initializations have no /// effect. /// @param manager Manager address to be initialized function initializeManager(address manager) public override { require(manager != address(0), "Manager address zero"); bytes32 rootRole = _deriveRootRole(manager); if (!hasRole(rootRole, manager)) { _grantRole(rootRole, manager); emit InitializedManager(rootRole, manager, _msgSender()); } } /// @notice Called by the account to renounce the role /// @dev Overriden to disallow managers from renouncing their root roles. /// `role` and `account` are not validated because /// `AccessControl.renounceRole` will revert if either of them is zero. /// @param role Role to be renounced /// @param account Account to renounce the role function renounceRole( bytes32 role, address account ) public override(AccessControl, IAccessControl) { require( role != _deriveRootRole(account), "role is root role of account" ); AccessControl.renounceRole(role, account); } /// @notice Initializes a role by setting its admin role and grants it to /// the sender /// @dev If the sender should not have the initialized role, they should /// explicitly renounce it after initializing it. /// Once a role is initialized, subsequent initializations have no effect /// other than granting the role to the sender. /// The sender must be a member of `adminRole`. `adminRole` value is not /// validated because the sender cannot have the `bytes32(0)` role. /// If the sender is an uninitialized manager that is initializing a role /// directly under their root role, manager initialization will happen /// automatically, which will grant the sender `adminRole` and allow them /// to initialize the role. /// @param adminRole Admin role to be assigned to the initialized role /// @param description Human-readable description of the initialized role /// @return role Initialized role function initializeRoleAndGrantToSender( bytes32 adminRole, string calldata description ) external override returns (bytes32 role) { require(bytes(description).length > 0, "Role description empty"); role = _deriveRole(adminRole, description); // AccessControl roles have `DEFAULT_ADMIN_ROLE` (i.e., `bytes32(0)`) // as their `adminRole` by default. No account in AccessControlRegistry // can possibly have that role, which means all initialized roles will // have non-default admin roles, and vice versa. if (getRoleAdmin(role) == DEFAULT_ADMIN_ROLE) { if (adminRole == _deriveRootRole(_msgSender())) { initializeManager(_msgSender()); } _setRoleAdmin(role, adminRole); emit InitializedRole(role, adminRole, description, _msgSender()); } grantRole(role, _msgSender()); } /// @dev See Context.sol function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address) { return ERC2771Context._msgSender(); } /// @dev See Context.sol function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) { return ERC2771Context._msgData(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/IAccessControl.sol"; import "../../utils/interfaces/IExpiringMetaTxForwarder.sol"; import "../../utils/interfaces/ISelfMulticall.sol"; interface IAccessControlRegistry is IAccessControl, IExpiringMetaTxForwarder, ISelfMulticall { event InitializedManager( bytes32 indexed rootRole, address indexed manager, address sender ); event InitializedRole( bytes32 indexed role, bytes32 indexed adminRole, string description, address sender ); function initializeManager(address manager) external; function initializeRoleAndGrantToSender( bytes32 adminRole, string calldata description ) external returns (bytes32 role); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title Contract to be inherited by contracts that will derive /// AccessControlRegistry roles /// @notice If a contract interfaces with AccessControlRegistry and needs to /// derive roles, it should inherit this contract instead of re-implementing /// the logic contract RoleDeriver { /// @notice Derives the root role of the manager /// @param manager Manager address /// @return rootRole Root role function _deriveRootRole( address manager ) internal pure returns (bytes32 rootRole) { rootRole = keccak256(abi.encodePacked(manager)); } /// @notice Derives the role using its admin role and description /// @dev This implies that roles adminned by the same role cannot have the /// same description /// @param adminRole Admin role /// @param description Human-readable description of the role /// @return role Role function _deriveRole( bytes32 adminRole, string memory description ) internal pure returns (bytes32 role) { role = _deriveRole(adminRole, keccak256(abi.encodePacked(description))); } /// @notice Derives the role using its admin role and description hash /// @dev This implies that roles adminned by the same role cannot have the /// same description /// @param adminRole Admin role /// @param descriptionHash Hash of the human-readable description of the /// role /// @return role Role function _deriveRole( bytes32 adminRole, bytes32 descriptionHash ) internal pure returns (bytes32 role) { role = keccak256(abi.encodePacked(adminRole, descriptionHash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./interfaces/IExpiringMetaTxForwarder.sol"; /// @title Contract that forwards expiring meta-txes to ERC2771 contracts that /// trust it /// @notice `msg.value` is not supported. Identical meta-txes are not /// supported. Target account must be a contract. Signer of the meta-tx is /// allowed to cancel it before execution, effectively rendering the signature /// useless. /// This implementation is not intended to be used with general-purpose relayer /// networks. Instead, it is meant for use-cases where the relayer wants the /// signer to send a tx, so they request a meta-tx and execute it themselves to /// cover the gas cost. /// @dev This implementation does not use signer-specific nonces for meta-txes /// to be executable in an arbitrary order. For example, one can sign two /// meta-txes that will whitelist an account each and deliver these to the /// respective owners of the accounts. This implementation allows the account /// owners to not care about if and when the other meta-tx is executed. The /// signer is responsible for not issuing signatures that may cause undesired /// race conditions. contract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder { using ECDSA for bytes32; using Address for address; /// @notice If the meta-tx with hash is executed or canceled /// @dev We track this on a meta-tx basis and not by using nonces to avoid /// requiring users keep track of nonces mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled; bytes32 private constant _TYPEHASH = keccak256( "ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)" ); constructor() EIP712("ExpiringMetaTxForwarder", "1.0.0") {} /// @notice Verifies the signature and executes the meta-tx /// @param metaTx Meta-tx /// @param signature Meta-tx hash signed by `from` /// @return returndata Returndata function execute( ExpiringMetaTx calldata metaTx, bytes calldata signature ) external override returns (bytes memory returndata) { bytes32 metaTxHash = processMetaTx(metaTx); require( metaTxHash.recover(signature) == metaTx.from, "Invalid signature" ); emit ExecutedMetaTx(metaTxHash); returndata = metaTx.to.functionCall( abi.encodePacked(metaTx.data, metaTx.from) ); } /// @notice Called by a meta-tx source to prevent it from being executed /// @dev This can be used to cancel meta-txes that were issued /// accidentally, e.g., with an unreasonably large expiration timestamp, /// which may create a dangling liability /// @param metaTx Meta-tx function cancel(ExpiringMetaTx calldata metaTx) external override { require(_msgSender() == metaTx.from, "Sender not meta-tx source"); emit CanceledMetaTx(processMetaTx(metaTx)); } /// @notice Checks if the meta-tx is valid, invalidates it for future /// execution or nullification, and returns the meta-tx hash /// @param metaTx Meta-tx /// @return metaTxHash Meta-tx hash function processMetaTx( ExpiringMetaTx calldata metaTx ) private returns (bytes32 metaTxHash) { metaTxHash = _hashTypedDataV4( keccak256( abi.encode( _TYPEHASH, metaTx.from, metaTx.to, keccak256(metaTx.data), metaTx.expirationTimestamp ) ) ); require( !metaTxWithHashIsExecutedOrCanceled[metaTxHash], "Meta-tx executed or canceled" ); require( metaTx.expirationTimestamp > block.timestamp, "Meta-tx expired" ); metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IExpiringMetaTxForwarder { event ExecutedMetaTx(bytes32 indexed metaTxHash); event CanceledMetaTx(bytes32 indexed metaTxHash); struct ExpiringMetaTx { address from; address to; bytes data; uint256 expirationTimestamp; } function execute( ExpiringMetaTx calldata metaTx, bytes calldata signature ) external returns (bytes memory returndata); function cancel(ExpiringMetaTx calldata metaTx) external; function metaTxWithHashIsExecutedOrCanceled( bytes32 metaTxHash ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ISelfMulticall { function multicall( bytes[] calldata data ) external returns (bytes[] memory returndata); function tryMulticall( bytes[] calldata data ) external returns (bool[] memory successes, bytes[] memory returndata); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/ISelfMulticall.sol"; /// @title Contract that enables calls to the inheriting contract to be batched /// @notice Implements two ways of batching, one requires none of the calls to /// revert and the other tolerates individual calls reverting /// @dev This implementation uses delegatecall for individual function calls. /// Since delegatecall is a message call, it can only be made to functions that /// are externally visible. This means that a contract cannot multicall its own /// functions that use internal/private visibility modifiers. /// Refer to OpenZeppelin's Multicall.sol for a similar implementation. contract SelfMulticall is ISelfMulticall { /// @notice Batches calls to the inheriting contract and reverts as soon as /// one of the batched calls reverts /// @param data Array of calldata of batched calls /// @return returndata Array of returndata of batched calls function multicall( bytes[] calldata data ) external override returns (bytes[] memory returndata) { uint256 callCount = data.length; returndata = new bytes[](callCount); for (uint256 ind = 0; ind < callCount; ) { bool success; // solhint-disable-next-line avoid-low-level-calls (success, returndata[ind]) = address(this).delegatecall(data[ind]); if (!success) { bytes memory returndataWithRevertData = returndata[ind]; if (returndataWithRevertData.length > 0) { // Adapted from OpenZeppelin's Address.sol // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndataWithRevertData) revert( add(32, returndataWithRevertData), returndata_size ) } } else { revert("Multicall: No revert string"); } } unchecked { ind++; } } } /// @notice Batches calls to the inheriting contract but does not revert if /// any of the batched calls reverts /// @param data Array of calldata of batched calls /// @return successes Array of success conditions of batched calls /// @return returndata Array of returndata of batched calls function tryMulticall( bytes[] calldata data ) external override returns (bool[] memory successes, bytes[] memory returndata) { uint256 callCount = data.length; successes = new bool[](callCount); returndata = new bytes[](callCount); for (uint256 ind = 0; ind < callCount; ) { // solhint-disable-next-line avoid-low-level-calls (successes[ind], returndata[ind]) = address(this).delegatecall( data[ind] ); unchecked { ind++; } } } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"metaTxHash","type":"bytes32"}],"name":"CanceledMetaTx","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"metaTxHash","type":"bytes32"}],"name":"ExecutedMetaTx","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"rootRole","type":"bytes32"},{"indexed":true,"internalType":"address","name":"manager","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"InitializedManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"adminRole","type":"bytes32"},{"indexed":false,"internalType":"string","name":"description","type":"string"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"InitializedRole","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":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"expirationTimestamp","type":"uint256"}],"internalType":"struct IExpiringMetaTxForwarder.ExpiringMetaTx","name":"metaTx","type":"tuple"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"expirationTimestamp","type":"uint256"}],"internalType":"struct IExpiringMetaTxForwarder.ExpiringMetaTx","name":"metaTx","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bytes","name":"returndata","type":"bytes"}],"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":"address","name":"manager","type":"address"}],"name":"initializeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"adminRole","type":"bytes32"},{"internalType":"string","name":"description","type":"string"}],"name":"initializeRoleAndGrantToSender","outputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"metaTxWithHashIsExecutedOrCanceled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"returndata","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","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":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"tryMulticall","outputs":[{"internalType":"bool[]","name":"successes","type":"bool[]"},{"internalType":"bytes[]","name":"returndata","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.