Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
RegistryContract
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; import {IRegistryAccess} from "../interfaces/registry/IRegistryAccess.sol"; import {IRegistryContract} from "../interfaces/registry/IRegistryContract.sol"; import {Initializable} from "openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol"; import {DEFAULT_ADMIN_ROLE} from "src/constants.sol"; import {NotAuthorized, NullAddress, InvalidName} from "src/errors.sol"; /// @notice This contract is used to store all the address of the contracts /// @title RegistryContract contract /// @dev This contract is used to store all the address of the contracts /// @author Usual Tech team contract RegistryContract is IRegistryContract, Initializable { /*////////////////////////////////////////////////////////////// Upgradability //////////////////////////////////////////////////////////////*/ struct RegistryContractStorageV0 { mapping(bytes32 => address) _contracts; address _registryAccess; } /// @notice The position of the storage structure. // keccak256(abi.encode(uint256(keccak256("registrycontract.storage.v0")) - 1)) & ~bytes32(uint256(0xff)) // solhint-disable-next-line bytes32 public constant RegistryContractStorageV0Location = 0xcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c446700; /// @notice Returns the storage struct of the contract. /// @return $ . function _registryContractStorageV0() internal pure returns (RegistryContractStorageV0 storage $) { bytes32 position = RegistryContractStorageV0Location; // solhint-disable-next-line no-inline-assembly assembly { $.slot := position } } /*////////////////////////////////////////////////////////////// Event //////////////////////////////////////////////////////////////*/ /// @notice This event is emitted when the address of the contract is set /// @param name The name of the contract in bytes32 /// @param contractAddress The address of the contract event SetContract(bytes32 indexed name, address indexed contractAddress); /*////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////*/ /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } /// @notice Function for initializing the contract. /// @dev This function is used to set the initial state of the contract. /// @param registryAccess_ The address of the registry access contract. function initialize(address registryAccess_) public initializer { if (registryAccess_ == address(0)) { revert NullAddress(); } RegistryContractStorageV0 storage $ = _registryContractStorageV0(); $._registryAccess = registryAccess_; } /*////////////////////////////////////////////////////////////// External //////////////////////////////////////////////////////////////*/ /// @notice Set the address of the contract /// @param name name of the contract /// @param contractAddress address of the contract function setContract(bytes32 name, address contractAddress) external { // if address is null reverts if (contractAddress == address(0)) { revert NullAddress(); } // if name is null reverts if (name == bytes32(0)) { revert InvalidName(); } RegistryContractStorageV0 storage $ = _registryContractStorageV0(); // only admin can set the contract if (!IRegistryAccess($._registryAccess).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) { revert NotAuthorized(); } $._contracts[name] = contractAddress; emit SetContract(name, contractAddress); } /// @notice Get the address of the contract /// @param name name of the contract /// @return address address of the contract function getContract(bytes32 name) external view returns (address) { RegistryContractStorageV0 storage $ = _registryContractStorageV0(); address _contract = $._contracts[name]; // if address is null reverts if (_contract == address(0)) { revert NullAddress(); } return _contract; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; import {IAccessControlDefaultAdminRules} from "openzeppelin-contracts/access/extensions/IAccessControlDefaultAdminRules.sol"; // solhint-disable-next-line no-empty-blocks interface IRegistryAccess is IAccessControlDefaultAdminRules {}
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; interface IRegistryContract { function setContract(bytes32 name, address contractAddress) external; function getContract(bytes32 name) external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; bytes32 constant ADMIN = keccak256("ADMIN"); bytes32 constant DEFAULT_ADMIN_ROLE = 0x00; bytes32 constant DAO_COLLATERAL = keccak256("DAO_COLLATERAL_CONTRACT"); bytes32 constant USD0_MINT = keccak256("USD0_MINT"); bytes32 constant USD0_BURN = keccak256("USD0_BURN"); bytes32 constant INTENT_MATCHING_ROLE = keccak256("INTENT_MATCHING_ROLE"); bytes32 constant SWAPPER_ENGINE = keccak256("SWAPPER_ENGINE"); bytes32 constant INTENT_TYPE_HASH = keccak256( "SwapIntent(address recipient,address rwaToken,uint256 amountInTokenDecimals,uint256 nonce,uint256 deadline)" ); /* Contracts */ bytes32 constant CONTRACT_REGISTRY_ACCESS = keccak256("CONTRACT_REGISTRY_ACCESS"); bytes32 constant CONTRACT_DAO_COLLATERAL = keccak256("CONTRACT_DAO_COLLATERAL"); bytes32 constant CONTRACT_USD0PP = keccak256("CONTRACT_USD0PP"); bytes32 constant CONTRACT_TOKEN_MAPPING = keccak256("CONTRACT_TOKEN_MAPPING"); bytes32 constant CONTRACT_ORACLE = keccak256("CONTRACT_ORACLE"); bytes32 constant CONTRACT_ORACLE_USUAL = keccak256("CONTRACT_ORACLE_USUAL"); bytes32 constant CONTRACT_DATA_PUBLISHER = keccak256("CONTRACT_DATA_PUBLISHER"); bytes32 constant CONTRACT_TREASURY = keccak256("CONTRACT_TREASURY"); bytes32 constant CONTRACT_SWAPPER_ENGINE = keccak256("CONTRACT_SWAPPER_ENGINE"); /* Contract tokens */ bytes32 constant CONTRACT_USD0 = keccak256("CONTRACT_USD0"); bytes32 constant CONTRACT_USDC = keccak256("CONTRACT_USDC"); /* Constants */ uint256 constant SCALAR_ONE = 1e18; uint256 constant SCALAR_TEN_KWEI = 10_000; uint256 constant MAX_REDEEM_FEE = 2500; uint256 constant MINIMUM_USDC_PROVIDED = 100e6; //minimum of 100 USDC deposit; // we take 12sec as the average block time // 1 year = 3600sec * 24 hours * 365 days * 4 years = 126144000 + 1 day // adding a leap day uint256 constant BOND_DURATION_FOUR_YEAR = 126_230_400; //including a leap day; uint256 constant BOND_START_DATE = 1_719_489_600; // Thu Jun 27 2024 12:00:00 GMT+0000 uint256 constant BASIS_POINT_BASE = 10_000; uint64 constant ONE_WEEK = 604_800; uint256 constant ONE_USDC = 1e6; /* * The maximum relative price difference between two oracle responses allowed in order for the PriceFeed * to return to using the Oracle oracle. 18-digit precision. */ uint256 constant INITIAL_MAX_DEPEG_THRESHOLD = 100; /* Maximum number of RWA tokens that can be associated with USD0 */ uint256 constant MAX_RWA_COUNT = 10;
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.20; error AlreadyClaimed(); error AlreadyWhitelisted(); error AmountTooBig(); error AmountTooLow(); error AmountIsZero(); error Blacklisted(); error Empty(); error ExpiredSignature(uint256 deadline); error SameValue(); error Invalid(); error InvalidToken(); error InvalidName(); error InvalidSigner(address owner); error InvalidDeadline(uint256 approvalDeadline, uint256 intentDeadline); error NoOrdersIdsProvided(); error InvalidSymbol(); error LockedOffer(); error NotAuthorized(); error NotClaimableYet(); error NullAddress(); error NullContract(); error OracleNotWorkingNotCurrent(); error OracleNotInitialized(); error OutOfBounds(); error InvalidTimeout(); error RedeemMustNotBePaused(); error RedeemMustBePaused(); error SwapMustNotBePaused(); error SwapMustBePaused(); error StablecoinDepeg(); error DepegThresholdTooHigh(); error TokenNotWhitelist(); error BondNotStarted(); error BondFinished(); error BondNotFinished(); error BeginInPast(); error CBRIsTooHigh(); error CBRIsNull(); error RedeemFeeTooBig(); error CancelFeeTooBig(); error MinterRewardTooBig(); error CollateralProviderRewardTooBig(); error DistributionRatioInvalid(); error TooManyRWA(); error FailingTransfer(); error InsufficientUSD0Balance(); error USDCAmountNotFullyMatched(); error OrderNotActive(); error NotRequester(); error InsufficientUSD0Allowance(); error ApprovalFailed();
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlDefaultAdminRules.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection. */ interface IAccessControlDefaultAdminRules is IAccessControl { /** * @dev The new default admin is not a valid default admin. */ error AccessControlInvalidDefaultAdmin(address defaultAdmin); /** * @dev At least one of the following rules was violated: * * - The `DEFAULT_ADMIN_ROLE` must only be managed by itself. * - The `DEFAULT_ADMIN_ROLE` must only be held by one account at the time. * - Any `DEFAULT_ADMIN_ROLE` transfer must be in two delayed steps. */ error AccessControlEnforcedDefaultAdminRules(); /** * @dev The delay for transferring the default admin delay is enforced and * the operation must wait until `schedule`. * * NOTE: `schedule` can be 0 indicating there's no transfer scheduled. */ error AccessControlEnforcedDefaultAdminDelay(uint48 schedule); /** * @dev Emitted when a {defaultAdmin} transfer is started, setting `newAdmin` as the next * address to become the {defaultAdmin} by calling {acceptDefaultAdminTransfer} only after `acceptSchedule` * passes. */ event DefaultAdminTransferScheduled(address indexed newAdmin, uint48 acceptSchedule); /** * @dev Emitted when a {pendingDefaultAdmin} is reset if it was never accepted, regardless of its schedule. */ event DefaultAdminTransferCanceled(); /** * @dev Emitted when a {defaultAdminDelay} change is started, setting `newDelay` as the next * delay to be applied between default admin transfer after `effectSchedule` has passed. */ event DefaultAdminDelayChangeScheduled(uint48 newDelay, uint48 effectSchedule); /** * @dev Emitted when a {pendingDefaultAdminDelay} is reset if its schedule didn't pass. */ event DefaultAdminDelayChangeCanceled(); /** * @dev Returns the address of the current `DEFAULT_ADMIN_ROLE` holder. */ function defaultAdmin() external view returns (address); /** * @dev Returns a tuple of a `newAdmin` and an accept schedule. * * After the `schedule` passes, the `newAdmin` will be able to accept the {defaultAdmin} role * by calling {acceptDefaultAdminTransfer}, completing the role transfer. * * A zero value only in `acceptSchedule` indicates no pending admin transfer. * * NOTE: A zero address `newAdmin` means that {defaultAdmin} is being renounced. */ function pendingDefaultAdmin() external view returns (address newAdmin, uint48 acceptSchedule); /** * @dev Returns the delay required to schedule the acceptance of a {defaultAdmin} transfer started. * * This delay will be added to the current timestamp when calling {beginDefaultAdminTransfer} to set * the acceptance schedule. * * NOTE: If a delay change has been scheduled, it will take effect as soon as the schedule passes, making this * function returns the new delay. See {changeDefaultAdminDelay}. */ function defaultAdminDelay() external view returns (uint48); /** * @dev Returns a tuple of `newDelay` and an effect schedule. * * After the `schedule` passes, the `newDelay` will get into effect immediately for every * new {defaultAdmin} transfer started with {beginDefaultAdminTransfer}. * * A zero value only in `effectSchedule` indicates no pending delay change. * * NOTE: A zero value only for `newDelay` means that the next {defaultAdminDelay} * will be zero after the effect schedule. */ function pendingDefaultAdminDelay() external view returns (uint48 newDelay, uint48 effectSchedule); /** * @dev Starts a {defaultAdmin} transfer by setting a {pendingDefaultAdmin} scheduled for acceptance * after the current timestamp plus a {defaultAdminDelay}. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * Emits a DefaultAdminRoleChangeStarted event. */ function beginDefaultAdminTransfer(address newAdmin) external; /** * @dev Cancels a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}. * * A {pendingDefaultAdmin} not yet accepted can also be cancelled with this function. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * May emit a DefaultAdminTransferCanceled event. */ function cancelDefaultAdminTransfer() external; /** * @dev Completes a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}. * * After calling the function: * * - `DEFAULT_ADMIN_ROLE` should be granted to the caller. * - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder. * - {pendingDefaultAdmin} should be reset to zero values. * * Requirements: * * - Only can be called by the {pendingDefaultAdmin}'s `newAdmin`. * - The {pendingDefaultAdmin}'s `acceptSchedule` should've passed. */ function acceptDefaultAdminTransfer() external; /** * @dev Initiates a {defaultAdminDelay} update by setting a {pendingDefaultAdminDelay} scheduled for getting * into effect after the current timestamp plus a {defaultAdminDelay}. * * This function guarantees that any call to {beginDefaultAdminTransfer} done between the timestamp this * method is called and the {pendingDefaultAdminDelay} effect schedule will use the current {defaultAdminDelay} * set before calling. * * The {pendingDefaultAdminDelay}'s effect schedule is defined in a way that waiting until the schedule and then * calling {beginDefaultAdminTransfer} with the new delay will take at least the same as another {defaultAdmin} * complete transfer (including acceptance). * * The schedule is designed for two scenarios: * * - When the delay is changed for a larger one the schedule is `block.timestamp + newDelay` capped by * {defaultAdminDelayIncreaseWait}. * - When the delay is changed for a shorter one, the schedule is `block.timestamp + (current delay - new delay)`. * * A {pendingDefaultAdminDelay} that never got into effect will be canceled in favor of a new scheduled change. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * Emits a DefaultAdminDelayChangeScheduled event and may emit a DefaultAdminDelayChangeCanceled event. */ function changeDefaultAdminDelay(uint48 newDelay) external; /** * @dev Cancels a scheduled {defaultAdminDelay} change. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * May emit a DefaultAdminDelayChangeCanceled event. */ function rollbackDefaultAdminDelay() external; /** * @dev Maximum time in seconds for an increase to {defaultAdminDelay} (that is scheduled using {changeDefaultAdminDelay}) * to take effect. Default to 5 days. * * When the {defaultAdminDelay} is scheduled to be increased, it goes into effect after the new delay has passed with * the purpose of giving enough time for reverting any accidental change (i.e. using milliseconds instead of seconds) * that may lock the contract. However, to avoid excessive schedules, the wait is capped by this function and it can * be overrode for a custom {defaultAdminDelay} increase scheduling. * * IMPORTANT: Make sure to add a reasonable amount of time while overriding this value, otherwise, * there's a risk of setting a high new delay that goes into effect almost immediately without the * possibility of human intervention in the case of an input error (eg. set milliseconds instead of seconds). */ function defaultAdminDelayIncreaseWait() external view returns (uint48); }
// 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; }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "utils/=lib/utils/", "@openzeppelin/=lib/openzeppelin-contracts/", "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/", "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/", "src/=src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": false, "libraries": { "scripts/deployment/utils/DeploymentHelpers.sol": { "DeploymentHelpers": "0x758888Dd8Cc9C654519413E3Da099c3FF618CE84" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidName","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"NullAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"}],"name":"SetContract","type":"event"},{"inputs":[],"name":"RegistryContractStorageV0Location","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"getContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"registryAccess_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setContract","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b5061001861001d565b6100cf565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006d5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cc5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6104b8806100dc5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80637ed77c9c1461004e578063a127ed6214610063578063c4d66de81461009d578063e16c7d98146100b0575b5f80fd5b61006161005c366004610409565b6100db565b005b61008a7fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c44670081565b6040519081526020015b60405180910390f35b6100616100ab366004610433565b61022b565b6100c36100be36600461044c565b610391565b6040516001600160a01b039091168152602001610094565b6001600160a01b0381166101025760405163e99d5ac560e01b815260040160405180910390fd5b816101205760405163430f13b360e01b815260040160405180910390fd5b5f7fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c4467006001810154604051632474521560e21b81525f60048201523360248201529192506001600160a01b0316906391d1485490604401602060405180830381865afa158015610191573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101b59190610463565b6101d25760405163ea8e4eb560e01b815260040160405180910390fd5b5f8381526020829052604080822080546001600160a01b0319166001600160a01b0386169081179091559051909185917f5de40a806536a2029221dac2c8887ac9f11952fcc1ed3d7cfb4476dd5259b7409190a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f811580156102705750825b90505f8267ffffffffffffffff16600114801561028c5750303b155b90508115801561029a575080155b156102b85760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156102e257845460ff60401b1916600160401b1785555b6001600160a01b0386166103095760405163e99d5ac560e01b815260040160405180910390fd5b7fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c44670180546001600160a01b0319166001600160a01b038816179055831561038957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f8181527fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c446700602081905260408220546001600160a01b0316806103e75760405163e99d5ac560e01b815260040160405180910390fd5b9392505050565b80356001600160a01b0381168114610404575f80fd5b919050565b5f806040838503121561041a575f80fd5b8235915061042a602084016103ee565b90509250929050565b5f60208284031215610443575f80fd5b6103e7826103ee565b5f6020828403121561045c575f80fd5b5035919050565b5f60208284031215610473575f80fd5b815180151581146103e7575f80fdfea26469706673582212203e9f19702aff9560306f2a3c540508883759adc26de2f321e6dec30b8ad0d14964736f6c63430008140033
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c80637ed77c9c1461004e578063a127ed6214610063578063c4d66de81461009d578063e16c7d98146100b0575b5f80fd5b61006161005c366004610409565b6100db565b005b61008a7fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c44670081565b6040519081526020015b60405180910390f35b6100616100ab366004610433565b61022b565b6100c36100be36600461044c565b610391565b6040516001600160a01b039091168152602001610094565b6001600160a01b0381166101025760405163e99d5ac560e01b815260040160405180910390fd5b816101205760405163430f13b360e01b815260040160405180910390fd5b5f7fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c4467006001810154604051632474521560e21b81525f60048201523360248201529192506001600160a01b0316906391d1485490604401602060405180830381865afa158015610191573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101b59190610463565b6101d25760405163ea8e4eb560e01b815260040160405180910390fd5b5f8381526020829052604080822080546001600160a01b0319166001600160a01b0386169081179091559051909185917f5de40a806536a2029221dac2c8887ac9f11952fcc1ed3d7cfb4476dd5259b7409190a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff165f811580156102705750825b90505f8267ffffffffffffffff16600114801561028c5750303b155b90508115801561029a575080155b156102b85760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156102e257845460ff60401b1916600160401b1785555b6001600160a01b0386166103095760405163e99d5ac560e01b815260040160405180910390fd5b7fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c44670180546001600160a01b0319166001600160a01b038816179055831561038957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f8181527fcf38fe916ff40451cdf6ceadfcd63ce28eb30d22d6d6be79c57435301c446700602081905260408220546001600160a01b0316806103e75760405163e99d5ac560e01b815260040160405180910390fd5b9392505050565b80356001600160a01b0381168114610404575f80fd5b919050565b5f806040838503121561041a575f80fd5b8235915061042a602084016103ee565b90509250929050565b5f60208284031215610443575f80fd5b6103e7826103ee565b5f6020828403121561045c575f80fd5b5035919050565b5f60208284031215610473575f80fd5b815180151581146103e7575f80fdfea26469706673582212203e9f19702aff9560306f2a3c540508883759adc26de2f321e6dec30b8ad0d14964736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.