Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ProtocolRegistry
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 1 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity "0.8.26";
import {FeeRegistry} from "./FeeRegistry.sol";
import {LogicRegistry} from "./LogicRegistry.sol";
/// @custom:contact [email protected]
/// @custom:oz-upgrades-from src/protocol-v1/FeeRegistry.sol:FeeRegistry
contract ProtocolRegistry is FeeRegistry, LogicRegistry {
/// @custom:oz-upgrades-unsafe-allow constructor
// solhint-disable-next-line ignoreConstructors
constructor(
bool disable
) {
if (disable) _disableInitializers();
}
function initialize(address initialOwner, address _protocolFeeReceiver) public initializer {
__Ownable_init(initialOwner);
__FeeRegistry_init(_protocolFeeReceiver);
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity "0.8.26";
import {CustomRateUpdated, DefaultRateUpdated, ProtocolFeeReceiverUpdated} from "./Events.sol";
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
/// @title FeeRegistry
/// @notice The FeeRegistry contract manages protocol fee rates for various vaults.
/// It allows the contract owner (the protocol) to set a default protocol fee rate, define custom fee rates
/// for specific vaults, and manage the address that receives these protocol fees.
/// Protocol fees represents a fraction (which is the rate) of the fees taken by the asset manager of the vault
/// @custom:contact [email protected]
abstract contract FeeRegistry is Ownable2StepUpgradeable {
struct CustomRate {
bool isActivated;
uint16 rate;
}
/// @custom:storage-location erc7201:hopper.storage.FeeRegistry
struct FeeRegistryStorage {
uint16 defaultRate;
address protocolFeeReceiver;
mapping(address => CustomRate) customRate;
}
// keccak256(abi.encode(uint256(keccak256("hopper.storage.FeeRegistry")) - 1)) & ~bytes32(uint256(0xff));
// solhint-disable-next-line const-name-snakecase
bytes32 private constant feeRegistryStorage = 0xfae567c932a2d69f96a50330b7967af6689561bf72e1f4ad815fc97800b3f300;
/// @notice Initializes the protocol fee receiver.
/// @param _protocolFeeReceiver The protocol fee receiver.
function __FeeRegistry_init(
address _protocolFeeReceiver
) public onlyInitializing {
FeeRegistryStorage storage $ = _getFeeRegistryStorage();
$.protocolFeeReceiver = _protocolFeeReceiver;
}
function _getFeeRegistryStorage() internal pure returns (FeeRegistryStorage storage $) {
// solhint-disable-next-line no-inline-assembly
assembly {
$.slot := feeRegistryStorage
}
}
/// @notice Updates the address of the protocol fee receiver.
/// @param _protocolFeeReceiver The new protocol fee receiver address.
function updateProtocolFeeReceiver(
address _protocolFeeReceiver
) external onlyOwner {
emit ProtocolFeeReceiverUpdated(_getFeeRegistryStorage().protocolFeeReceiver, _protocolFeeReceiver);
_getFeeRegistryStorage().protocolFeeReceiver = _protocolFeeReceiver;
}
/// @notice Sets the default protocol fee rate.
/// @param rate The new default protocol fee rate.
function updateDefaultRate(
uint16 rate
) external onlyOwner {
FeeRegistryStorage storage $ = _getFeeRegistryStorage();
emit DefaultRateUpdated($.defaultRate, rate);
$.defaultRate = rate;
}
/// @notice Sets a custom fee rate for a specific vault.
/// @param vault The address of the vault.
/// @param rate The custom fee rate for the vault.
/// @param isActivated A boolean indicating whether the custom rate is activated.
function updateCustomRate(address vault, uint16 rate, bool isActivated) external onlyOwner {
_getFeeRegistryStorage().customRate[vault] = CustomRate({isActivated: isActivated, rate: rate});
emit CustomRateUpdated(vault, rate, isActivated);
}
/// @notice Checks if a custom fee rate is activated for a specific vault.
/// @param vault The address of the vault.
/// @return True if the vault has a custom fee rate, false otherwise.
function isCustomRate(
address vault
) external view returns (bool) {
return _getFeeRegistryStorage().customRate[vault].isActivated;
}
/// @notice Returns the address of the protocol fee receiver.
/// @return The protocol fee receiver address.
function protocolFeeReceiver() external view returns (address) {
return _getFeeRegistryStorage().protocolFeeReceiver;
}
/// @notice Returns the protocol fee rate for a specific vault,
/// representing the percentage of the fees taken by the asset manager.
/// @param vault The address of the vault.
/// @return rate The protocol fee rate for the vault.
function protocolRate(
address vault
) external view returns (uint256 rate) {
return _protocolRate(vault);
}
/// @return rate The protocol fee rate for the caller,
/// representing the percentage of the fees taken by the asset manager.
function protocolRate() external view returns (uint256 rate) {
return _protocolRate(msg.sender);
}
/// @notice Returns the protocol fee rate for a specific vault.
/// @param vault The address of the vault.
/// @return rate The protocol fee rate for the vault, considering custom rates.
function _protocolRate(
address vault
) internal view returns (uint256 rate) {
FeeRegistryStorage storage $ = _getFeeRegistryStorage();
if ($.customRate[vault].isActivated) {
return $.customRate[vault].rate;
}
return $.defaultRate;
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity "0.8.26";
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
/// @title LogicRegistry
/// @notice Abstract contract for managing whitelisted logic implementations and default logic
/// @dev Inherits from Ownable2StepUpgradeable to provide ownership functionality with 2-step transfer
/// @dev Implements ILogicRegistry interface for standard registry functions
/// @custom:contact [email protected]
abstract contract LogicRegistry is Ownable2StepUpgradeable {
error LogicNotWhitelisted(address Logic);
error CantRemoveDefaultLogic();
event DefaultLogicUpdated(address previous, address newImpl);
event LogicAdded(address Logic);
event LogicRemoved(address Logic);
/// @custom:storage-location erc7201:hopper.storage.LogicRegistry
/// @notice Storage layout for the LogicRegistry contract
struct LogicRegistryStorage {
/// @notice Address of the default logic implementation
address defaultLogic;
/// @notice Mapping of logic addresses to their whitelist status
mapping(address logic => bool) whitelist;
}
// Storage slot for LogicRegistryStorage
// keccak256(abi.encode(uint256(keccak256("hopper.storage.LogicRegistry")) - 1)) & ~bytes32(uint256(0xff));
bytes32 private constant logicRegistryStorage = 0x1f7af4bd0bb99469a9721ca3a846842162947039ac74427c73a74c47aae0d400;
/// @notice Returns the storage struct at the predefined slot
/// @dev Uses assembly to access storage at a specific slot
/// @return $ The storage struct
function _getLogicRegistryStorage() internal pure returns (LogicRegistryStorage storage $) {
assembly {
$.slot := logicRegistryStorage
}
}
/// @notice Updates the default logic implementation
/// @dev Only callable by owner. Automatically adds new logic to whitelist if not already present
/// @param _newLogic Address of the new default logic implementation
function updateDefaultLogic(
address _newLogic
) public onlyOwner {
if (!_getLogicRegistryStorage().whitelist[_newLogic]) {
addLogic(_newLogic);
}
address previous = _getLogicRegistryStorage().defaultLogic;
_getLogicRegistryStorage().defaultLogic = _newLogic;
emit DefaultLogicUpdated(previous, _newLogic);
}
/// @notice Removes a logic implementation from the whitelist
/// @dev Only callable by owner. Does not affect default logic if removed.
/// @param _logic Address of the logic implementation to remove
function removeLogic(
address _logic
) public onlyOwner {
if (_logic == _getLogicRegistryStorage().defaultLogic) {
revert CantRemoveDefaultLogic();
}
_getLogicRegistryStorage().whitelist[_logic] = false;
emit LogicRemoved(_logic);
}
/// @notice Adds a logic implementation to the whitelist
/// @dev Only callable by owner
/// @param _newLogic Address of the logic implementation to add
function addLogic(
address _newLogic
) public onlyOwner {
_getLogicRegistryStorage().whitelist[_newLogic] = true;
emit LogicAdded(_newLogic);
}
/// @notice Checks if a logic implementation can be used
/// @dev Ignores the fromLogic parameter (present in interface) and only checks whitelist status for now
/// @param fromLogic Previous logic implementation (unused in this implementation)
/// @param logic Address of the logic implementation to check
/// @return True if the logic is whitelisted, false otherwise
function canUseLogic(address fromLogic, address logic) public view returns (bool) {
if (owner() == address(0)) return true; // logic can always be used if the protocol renounceOwnership()
return _getLogicRegistryStorage().whitelist[logic];
}
/// @notice Returns the current default logic implementation address
/// @return Address of the default logic implementation
function defaultLogic() external view returns (address) {
return _getLogicRegistryStorage().defaultLogic;
}
}// SPDX-License-Identifier: BUSL-1.1 pragma solidity "0.8.26"; /// @notice Emitted when the protocol fee receiver is updated. /// @param oldReceiver The old protocol fee receiver address. /// @param newReceiver The new protocol fee receiver address. event ProtocolFeeReceiverUpdated(address oldReceiver, address newReceiver); /// @notice Emitted when the default protocol fee rate is updated. /// @param oldRate The old default protocol fee rate. /// @param newRate The new default protocol fee rate. event DefaultRateUpdated(uint256 oldRate, uint256 newRate); /// @notice Emitted when a custom fee rate is updated for a specific vault. /// @param vault The address of the vault. /// @param rate The new custom fee rate for the vault. /// @param isActivated A boolean indicating whether the custom rate is activated. event CustomRateUpdated(address vault, uint16 rate, bool isActivated);
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {OwnableUpgradeable} from "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable2Step
struct Ownable2StepStorage {
address _pendingOwner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable2Step")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant Ownable2StepStorageLocation = 0x237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00;
function _getOwnable2StepStorage() private pure returns (Ownable2StepStorage storage $) {
assembly {
$.slot := Ownable2StepStorageLocation
}
}
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function __Ownable2Step_init() internal onlyInitializing {
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
return $._pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
$._pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
delete $._pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// 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: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}{
"remappings": [
"@openzeppelin-foundry-upgrades/=dependencies/openzeppelin-foundry-upgrades-0.4.0/src/",
"@openzeppelin/contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.0.0/",
"@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.0.0/",
"@src/=src/",
"@test/=test/",
"forge-safe/=dependencies/forge-safe/src/",
"forge-std/=dependencies/forge-std-1.9.7/src/",
"@openzeppelin-contracts-5.0.0/=dependencies/@openzeppelin-contracts-5.0.0/",
"@openzeppelin-contracts-upgradeable-5.0.0/=dependencies/@openzeppelin-contracts-upgradeable-5.0.0/",
"forge-std-1.9.7/=dependencies/forge-std-1.9.7/src/",
"openzeppelin-foundry-upgrades-0.4.0/=dependencies/openzeppelin-foundry-upgrades-0.4.0/src/",
"openzeppelin-foundry-upgrades/=dependencies/openzeppelin-foundry-upgrades-0.4.0/src/"
],
"optimizer": {
"enabled": true,
"runs": 1
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"bool","name":"disable","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CantRemoveDefaultLogic","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[{"internalType":"address","name":"Logic","type":"address"}],"name":"LogicNotWhitelisted","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint16","name":"rate","type":"uint16"},{"indexed":false,"internalType":"bool","name":"isActivated","type":"bool"}],"name":"CustomRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previous","type":"address"},{"indexed":false,"internalType":"address","name":"newImpl","type":"address"}],"name":"DefaultLogicUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"DefaultRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"Logic","type":"address"}],"name":"LogicAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"Logic","type":"address"}],"name":"LogicRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldReceiver","type":"address"},{"indexed":false,"internalType":"address","name":"newReceiver","type":"address"}],"name":"ProtocolFeeReceiverUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"_protocolFeeReceiver","type":"address"}],"name":"__FeeRegistry_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newLogic","type":"address"}],"name":"addLogic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromLogic","type":"address"},{"internalType":"address","name":"logic","type":"address"}],"name":"canUseLogic","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultLogic","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"},{"internalType":"address","name":"_protocolFeeReceiver","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"isCustomRate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolRate","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"protocolRate","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_logic","type":"address"}],"name":"removeLogic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint16","name":"rate","type":"uint16"},{"internalType":"bool","name":"isActivated","type":"bool"}],"name":"updateCustomRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newLogic","type":"address"}],"name":"updateDefaultLogic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"rate","type":"uint16"}],"name":"updateDefaultRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolFeeReceiver","type":"address"}],"name":"updateProtocolFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561000f575f80fd5b50604051610d71380380610d7183398101604081905261002e916100f4565b801561003c5761003c610042565b5061011a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100925760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100f15780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610104575f80fd5b81518015158114610113575f80fd5b9392505050565b610c4a806101275f395ff3fe608060405234801561000f575f80fd5b50600436106100ef575f3560e01c80632b10a2bd146100f35780632d9e72391461010857806334171bcc1461011b57806335451e9b1461012e57806339a51be51461014157806345f55b3c1461015f578063485cc955146101675780634ac797951461017a5780634caaea191461018d578063715018a6146101a057806379ba5097146101a857806379ef704e146101b05780638da5cb5b146101c357806399dd1566146101cb578063d6e81dd7146101e1578063e30c397814610204578063e37c04b71461020c578063f2fde38b1461021f578063f3c665f714610232575b5f80fd5b610106610101366004610b34565b610245565b005b610106610116366004610b7c565b6102fe565b610106610129366004610b9c565b610369565b61010661013c366004610b9c565b6103f4565b6101496104aa565b6040516101569190610bb5565b60405180910390f35b6101496104c8565b610106610175366004610bc9565b6104e0565b610106610188366004610b9c565b6105e0565b61010661019b366004610b9c565b61068c565b6101066106c7565b6101066106da565b6101066101be366004610b9c565b610722565b61014961078f565b6101d36107a9565b604051908152602001610156565b6101f46101ef366004610b9c565b6107b8565b6040519015158152602001610156565b6101496107e5565b6101d361021a366004610b9c565b6107ef565b61010661022d366004610b9c565b6107ff565b6101f4610240366004610bc9565b61086f565b61024d6108be565b604051806040016040528082151581526020018361ffff168152506102706108f0565b6001600160a01b0385165f8181526001929092016020908152604092839020845181549583015162ffffff1990961690151562ffff0019161761010061ffff96871602179055825191825292851692810192909252821515908201527fea02bc7486032318243b2c4fe47e7cb736ac0d1edc3ad9648bf846c3ffcd61379060600160405180910390a1505050565b6103066108be565b5f61030f6108f0565b80546040805161ffff928316815291851660208301529192507ff5a71b50122870af64c64adf8404af2029395e58592f1f97fd58da4dca004a04910160405180910390a1805461ffff191661ffff92909216919091179055565b6103716108be565b7ffb5b90d81126d568c8bdaa0398ba8a708fd01e26c7891e91fa88e96051985ce361039a6108f0565b546040516103b9916201000090046001600160a01b0316908490610bfa565b60405180910390a1806103ca6108f0565b80546001600160a01b0392909216620100000262010000600160b01b031990921691909117905550565b6103fc6108be565b610404610914565b6001600160a01b0382165f908152600191909101602052604090205460ff166104305761043081610722565b5f610439610914565b546001600160a01b031690508161044e610914565b80546001600160a01b0319166001600160a01b03929092169190911790556040517fdabd3378cc1c57088300aaf260b38f637d6dd2fc2edd54f5bf3f22ec7ab7f4ca9061049e9083908590610bfa565b60405180910390a15050565b5f6104b36108f0565b546201000090046001600160a01b0316919050565b5f6104d1610914565b546001600160a01b0316919050565b5f6104e9610938565b805490915060ff600160401b82041615906001600160401b03165f8115801561050f5750825b90505f826001600160401b0316600114801561052a5750303b155b905081158015610538575080155b156105565760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561057f57845460ff60401b1916600160401b1785555b6105888761095c565b6105918661068c565b83156105d757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b6105e86108be565b6105f0610914565b546001600160a01b039081169082160361061d57604051630f5600e760e31b815260040160405180910390fd5b5f610626610914565b6001600160a01b0383165f908152600191909101602052604090819020805460ff191692151592909217909155517f9f60fd9ac36634c8a086fb62b8d5f9b088ed08a56805bb49b467012264d1444c90610681908390610bb5565b60405180910390a150565b61069461096d565b5f61069d6108f0565b80546001600160a01b03909316620100000262010000600160b01b03199093169290921790915550565b6106cf6108be565b6106d85f610992565b565b33806106e46107e5565b6001600160a01b031614610716578060405163118cdaa760e01b815260040161070d9190610bb5565b60405180910390fd5b61071f81610992565b50565b61072a6108be565b6001610734610914565b6001600160a01b0383165f908152600191909101602052604090819020805460ff191692151592909217909155517fce0ca4df7a7ec71282174625246800d852b6926b9760ef984c9fa6611e71724a90610681908390610bb5565b5f806107996109b8565b546001600160a01b031692915050565b5f6107b3336109dc565b905090565b5f6107c16108f0565b6001600160a01b039092165f90815260019290920160205250604090205460ff1690565b5f80610799610a40565b5f6107f9826109dc565b92915050565b6108076108be565b5f610810610a40565b80546001600160a01b0319166001600160a01b038416908117825590915061083661078f565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f8061087961078f565b6001600160a01b03160361088f575060016107f9565b610897610914565b6001600160a01b0383165f908152600191909101602052604090205460ff16905092915050565b336108c761078f565b6001600160a01b0316146106d8573360405163118cdaa760e01b815260040161070d9190610bb5565b7ffae567c932a2d69f96a50330b7967af6689561bf72e1f4ad815fc97800b3f30090565b7f1f7af4bd0bb99469a9721ca3a846842162947039ac74427c73a74c47aae0d40090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0090565b61096461096d565b61071f81610a64565b610975610a95565b6106d857604051631afcd79f60e31b815260040160405180910390fd5b5f61099b610a40565b80546001600160a01b031916815590506109b482610aae565b5050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b5f806109e66108f0565b6001600160a01b0384165f90815260018201602052604090205490915060ff1615610a35576001600160a01b039092165f908152600190920160205250604090205461ffff6101009091041690565b5461ffff1692915050565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0090565b610a6c61096d565b6001600160a01b038116610716575f604051631e4fbdf760e01b815260040161070d9190610bb5565b5f610a9e610938565b54600160401b900460ff16919050565b5f610ab76109b8565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b80356001600160a01b0381168114610b1e575f80fd5b919050565b803561ffff81168114610b1e575f80fd5b5f805f60608486031215610b46575f80fd5b610b4f84610b08565b9250610b5d60208501610b23565b915060408401358015158114610b71575f80fd5b809150509250925092565b5f60208284031215610b8c575f80fd5b610b9582610b23565b9392505050565b5f60208284031215610bac575f80fd5b610b9582610b08565b6001600160a01b0391909116815260200190565b5f8060408385031215610bda575f80fd5b610be383610b08565b9150610bf160208401610b08565b90509250929050565b6001600160a01b039283168152911660208201526040019056fea2646970667358221220c3202e9dbd1531ff0955183820f61dfa6ae5bcda1b1f4b6a2afc5a8277beca2064736f6c634300081a00330000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106100ef575f3560e01c80632b10a2bd146100f35780632d9e72391461010857806334171bcc1461011b57806335451e9b1461012e57806339a51be51461014157806345f55b3c1461015f578063485cc955146101675780634ac797951461017a5780634caaea191461018d578063715018a6146101a057806379ba5097146101a857806379ef704e146101b05780638da5cb5b146101c357806399dd1566146101cb578063d6e81dd7146101e1578063e30c397814610204578063e37c04b71461020c578063f2fde38b1461021f578063f3c665f714610232575b5f80fd5b610106610101366004610b34565b610245565b005b610106610116366004610b7c565b6102fe565b610106610129366004610b9c565b610369565b61010661013c366004610b9c565b6103f4565b6101496104aa565b6040516101569190610bb5565b60405180910390f35b6101496104c8565b610106610175366004610bc9565b6104e0565b610106610188366004610b9c565b6105e0565b61010661019b366004610b9c565b61068c565b6101066106c7565b6101066106da565b6101066101be366004610b9c565b610722565b61014961078f565b6101d36107a9565b604051908152602001610156565b6101f46101ef366004610b9c565b6107b8565b6040519015158152602001610156565b6101496107e5565b6101d361021a366004610b9c565b6107ef565b61010661022d366004610b9c565b6107ff565b6101f4610240366004610bc9565b61086f565b61024d6108be565b604051806040016040528082151581526020018361ffff168152506102706108f0565b6001600160a01b0385165f8181526001929092016020908152604092839020845181549583015162ffffff1990961690151562ffff0019161761010061ffff96871602179055825191825292851692810192909252821515908201527fea02bc7486032318243b2c4fe47e7cb736ac0d1edc3ad9648bf846c3ffcd61379060600160405180910390a1505050565b6103066108be565b5f61030f6108f0565b80546040805161ffff928316815291851660208301529192507ff5a71b50122870af64c64adf8404af2029395e58592f1f97fd58da4dca004a04910160405180910390a1805461ffff191661ffff92909216919091179055565b6103716108be565b7ffb5b90d81126d568c8bdaa0398ba8a708fd01e26c7891e91fa88e96051985ce361039a6108f0565b546040516103b9916201000090046001600160a01b0316908490610bfa565b60405180910390a1806103ca6108f0565b80546001600160a01b0392909216620100000262010000600160b01b031990921691909117905550565b6103fc6108be565b610404610914565b6001600160a01b0382165f908152600191909101602052604090205460ff166104305761043081610722565b5f610439610914565b546001600160a01b031690508161044e610914565b80546001600160a01b0319166001600160a01b03929092169190911790556040517fdabd3378cc1c57088300aaf260b38f637d6dd2fc2edd54f5bf3f22ec7ab7f4ca9061049e9083908590610bfa565b60405180910390a15050565b5f6104b36108f0565b546201000090046001600160a01b0316919050565b5f6104d1610914565b546001600160a01b0316919050565b5f6104e9610938565b805490915060ff600160401b82041615906001600160401b03165f8115801561050f5750825b90505f826001600160401b0316600114801561052a5750303b155b905081158015610538575080155b156105565760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b0319166001178555831561057f57845460ff60401b1916600160401b1785555b6105888761095c565b6105918661068c565b83156105d757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b6105e86108be565b6105f0610914565b546001600160a01b039081169082160361061d57604051630f5600e760e31b815260040160405180910390fd5b5f610626610914565b6001600160a01b0383165f908152600191909101602052604090819020805460ff191692151592909217909155517f9f60fd9ac36634c8a086fb62b8d5f9b088ed08a56805bb49b467012264d1444c90610681908390610bb5565b60405180910390a150565b61069461096d565b5f61069d6108f0565b80546001600160a01b03909316620100000262010000600160b01b03199093169290921790915550565b6106cf6108be565b6106d85f610992565b565b33806106e46107e5565b6001600160a01b031614610716578060405163118cdaa760e01b815260040161070d9190610bb5565b60405180910390fd5b61071f81610992565b50565b61072a6108be565b6001610734610914565b6001600160a01b0383165f908152600191909101602052604090819020805460ff191692151592909217909155517fce0ca4df7a7ec71282174625246800d852b6926b9760ef984c9fa6611e71724a90610681908390610bb5565b5f806107996109b8565b546001600160a01b031692915050565b5f6107b3336109dc565b905090565b5f6107c16108f0565b6001600160a01b039092165f90815260019290920160205250604090205460ff1690565b5f80610799610a40565b5f6107f9826109dc565b92915050565b6108076108be565b5f610810610a40565b80546001600160a01b0319166001600160a01b038416908117825590915061083661078f565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f8061087961078f565b6001600160a01b03160361088f575060016107f9565b610897610914565b6001600160a01b0383165f908152600191909101602052604090205460ff16905092915050565b336108c761078f565b6001600160a01b0316146106d8573360405163118cdaa760e01b815260040161070d9190610bb5565b7ffae567c932a2d69f96a50330b7967af6689561bf72e1f4ad815fc97800b3f30090565b7f1f7af4bd0bb99469a9721ca3a846842162947039ac74427c73a74c47aae0d40090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0090565b61096461096d565b61071f81610a64565b610975610a95565b6106d857604051631afcd79f60e31b815260040160405180910390fd5b5f61099b610a40565b80546001600160a01b031916815590506109b482610aae565b5050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b5f806109e66108f0565b6001600160a01b0384165f90815260018201602052604090205490915060ff1615610a35576001600160a01b039092165f908152600190920160205250604090205461ffff6101009091041690565b5461ffff1692915050565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0090565b610a6c61096d565b6001600160a01b038116610716575f604051631e4fbdf760e01b815260040161070d9190610bb5565b5f610a9e610938565b54600160401b900460ff16919050565b5f610ab76109b8565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b80356001600160a01b0381168114610b1e575f80fd5b919050565b803561ffff81168114610b1e575f80fd5b5f805f60608486031215610b46575f80fd5b610b4f84610b08565b9250610b5d60208501610b23565b915060408401358015158114610b71575f80fd5b809150509250925092565b5f60208284031215610b8c575f80fd5b610b9582610b23565b9392505050565b5f60208284031215610bac575f80fd5b610b9582610b08565b6001600160a01b0391909116815260200190565b5f8060408385031215610bda575f80fd5b610be383610b08565b9150610bf160208401610b08565b90509250929050565b6001600160a01b039283168152911660208201526040019056fea2646970667358221220c3202e9dbd1531ff0955183820f61dfa6ae5bcda1b1f4b6a2afc5a8277beca2064736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : disable (bool): True
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.