Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 5 from a total of 5 transactions
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ConfigurationManager
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.17; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { IConfigurationManager } from "../interfaces/IConfigurationManager.sol"; /** * @title ConfigurationManager * @author Pods Finance * @notice Allows contracts to read protocol-wide settings */ contract ConfigurationManager is IConfigurationManager, Ownable { mapping(address => mapping(bytes32 => uint256)) private _parameters; mapping(address => uint256) private _caps; mapping(address => address) private _allowedVaults; address private immutable _global = address(0); /** * @inheritdoc IConfigurationManager */ function setParameter( address target, bytes32 name, uint256 value ) public override onlyOwner { _parameters[target][name] = value; emit ParameterSet(target, name, value); } /** * @inheritdoc IConfigurationManager */ function getParameter(address target, bytes32 name) external view override returns (uint256) { return _parameters[target][name]; } /** * @inheritdoc IConfigurationManager */ function getGlobalParameter(bytes32 name) external view override returns (uint256) { return _parameters[_global][name]; } /** * @inheritdoc IConfigurationManager */ function setCap(address target, uint256 value) external override onlyOwner { if (target == address(0)) revert ConfigurationManager__TargetCannotBeTheZeroAddress(); _caps[target] = value; emit SetCap(target, value); } /** * @inheritdoc IConfigurationManager */ function getCap(address target) external view override returns (uint256) { return _caps[target]; } /** * @inheritdoc IConfigurationManager */ function setVaultMigration(address oldVault, address newVault) external override onlyOwner { if (newVault == address(0)) revert ConfigurationManager__NewVaultCannotBeTheZeroAddress(); _allowedVaults[oldVault] = newVault; emit VaultAllowanceSet(oldVault, newVault); } /** * @inheritdoc IConfigurationManager */ function getVaultMigration(address oldVault) external view override returns (address) { return _allowedVaults[oldVault]; } }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.17; /** * @title IConfigurationManager * @notice Allows contracts to read protocol-wide configuration modules * @author Pods Finance */ interface IConfigurationManager { event SetCap(address indexed target, uint256 value); event ParameterSet(address indexed target, bytes32 indexed name, uint256 value); event VaultAllowanceSet(address indexed oldVault, address indexed newVault); error ConfigurationManager__TargetCannotBeTheZeroAddress(); error ConfigurationManager__NewVaultCannotBeTheZeroAddress(); /** * @notice Set specific parameters to a contract or globally across multiple contracts. * @dev Use `address(0)` to set a global parameter. * @param target The contract address * @param name The parameter name * @param value The parameter value */ function setParameter( address target, bytes32 name, uint256 value ) external; /** * @notice Retrieves the value of a parameter set to contract. * @param target The contract address * @param name The parameter name */ function getParameter(address target, bytes32 name) external view returns (uint256); /** * @notice Retrieves the value of a parameter shared between multiple contracts. * @param name The parameter name */ function getGlobalParameter(bytes32 name) external view returns (uint256); /** * @notice Defines a cap value to a contract. * @param target The contract address * @param value Cap amount */ function setCap(address target, uint256 value) external; /** * @notice Get the value of a defined cap. * @dev Note that 0 cap means that the contract is not capped * @param target The contract address */ function getCap(address target) external view returns (uint256); /** * @notice Sets the allowance to migrate to a `vault` address. * @param oldVault The current vault address * @param newVault The vault where assets are going to be migrated to */ function setVaultMigration(address oldVault, address newVault) external; /** * @notice Returns the new Vault address. * @param oldVault The current vault address */ function getVaultMigration(address oldVault) external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.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. * * By default, the owner account will be the one that deploys the contract. 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 Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @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) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"ConfigurationManager__NewVaultCannotBeTheZeroAddress","type":"error"},{"inputs":[],"name":"ConfigurationManager__TargetCannotBeTheZeroAddress","type":"error"},{"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":true,"internalType":"address","name":"target","type":"address"},{"indexed":true,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"ParameterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"SetCap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldVault","type":"address"},{"indexed":true,"internalType":"address","name":"newVault","type":"address"}],"name":"VaultAllowanceSet","type":"event"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"getCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"getGlobalParameter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"getParameter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oldVault","type":"address"}],"name":"getVaultMigration","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setParameter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oldVault","type":"address"},{"internalType":"address","name":"newVault","type":"address"}],"name":"setVaultMigration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052600060805234801561001557600080fd5b5061001f33610024565b610074565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6080516105e261008f600039600061019c01526105e26000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c806380ad2cf31161006657806380ad2cf3146101605780638da5cb5b14610173578063b1b2afbe14610184578063b3aefb75146101d8578063f2fde38b1461020157600080fd5b806301b8c204146100a357806310c4cca3146100b8578063367165d7146101015780635bd79ddc14610145578063715018a614610158575b600080fd5b6100b66100b13660046104e1565b610214565b005b6100e46100c6366004610514565b6001600160a01b039081166000908152600360205260409020541690565b6040516001600160a01b0390911681526020015b60405180910390f35b61013761010f366004610536565b6001600160a01b03919091166000908152600160209081526040808320938352929052205490565b6040519081526020016100f8565b6100b6610153366004610560565b61027b565b6100b6610301565b6100b661016e366004610536565b610315565b6000546001600160a01b03166100e4565b610137610192366004610593565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600160209081526040808320938352929052205490565b6101376101e6366004610514565b6001600160a01b031660009081526002602052604090205490565b6100b661020f366004610514565b61039d565b61021c61041b565b6001600160a01b038316600081815260016020908152604080832086845282529182902084905590518381528492917fa8271224d6df8230b065d65f71a191365281005b6a894349a63f535d9a5329ae910160405180910390a3505050565b61028361041b565b6001600160a01b0381166102aa57604051631b086ed960e31b815260040160405180910390fd5b6001600160a01b0382811660008181526003602052604080822080546001600160a01b0319169486169485179055517f76e0cd68acc3969f006d263e59be91177d4fb9bd809f09e08cbf6c9ca97a15829190a35050565b61030961041b565b6103136000610475565b565b61031d61041b565b6001600160a01b03821661034457604051631b8a5e1960e11b815260040160405180910390fd5b6001600160a01b03821660008181526002602052604090819020839055517f1154f8925f238c6dc2fb9f2cc4d4d1bf6dc6621d248d6b237eb9a7495139b556906103919084815260200190565b60405180910390a25050565b6103a561041b565b6001600160a01b03811661040f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61041881610475565b50565b6000546001600160a01b031633146103135760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610406565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146104dc57600080fd5b919050565b6000806000606084860312156104f657600080fd5b6104ff846104c5565b95602085013595506040909401359392505050565b60006020828403121561052657600080fd5b61052f826104c5565b9392505050565b6000806040838503121561054957600080fd5b610552836104c5565b946020939093013593505050565b6000806040838503121561057357600080fd5b61057c836104c5565b915061058a602084016104c5565b90509250929050565b6000602082840312156105a557600080fd5b503591905056fea2646970667358221220d89c12aece62ea365574af80639fc8f8c4dcfc3c2c669c492e47d4c5e9db3a9564736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c806380ad2cf31161006657806380ad2cf3146101605780638da5cb5b14610173578063b1b2afbe14610184578063b3aefb75146101d8578063f2fde38b1461020157600080fd5b806301b8c204146100a357806310c4cca3146100b8578063367165d7146101015780635bd79ddc14610145578063715018a614610158575b600080fd5b6100b66100b13660046104e1565b610214565b005b6100e46100c6366004610514565b6001600160a01b039081166000908152600360205260409020541690565b6040516001600160a01b0390911681526020015b60405180910390f35b61013761010f366004610536565b6001600160a01b03919091166000908152600160209081526040808320938352929052205490565b6040519081526020016100f8565b6100b6610153366004610560565b61027b565b6100b6610301565b6100b661016e366004610536565b610315565b6000546001600160a01b03166100e4565b610137610192366004610593565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600160209081526040808320938352929052205490565b6101376101e6366004610514565b6001600160a01b031660009081526002602052604090205490565b6100b661020f366004610514565b61039d565b61021c61041b565b6001600160a01b038316600081815260016020908152604080832086845282529182902084905590518381528492917fa8271224d6df8230b065d65f71a191365281005b6a894349a63f535d9a5329ae910160405180910390a3505050565b61028361041b565b6001600160a01b0381166102aa57604051631b086ed960e31b815260040160405180910390fd5b6001600160a01b0382811660008181526003602052604080822080546001600160a01b0319169486169485179055517f76e0cd68acc3969f006d263e59be91177d4fb9bd809f09e08cbf6c9ca97a15829190a35050565b61030961041b565b6103136000610475565b565b61031d61041b565b6001600160a01b03821661034457604051631b8a5e1960e11b815260040160405180910390fd5b6001600160a01b03821660008181526002602052604090819020839055517f1154f8925f238c6dc2fb9f2cc4d4d1bf6dc6621d248d6b237eb9a7495139b556906103919084815260200190565b60405180910390a25050565b6103a561041b565b6001600160a01b03811661040f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61041881610475565b50565b6000546001600160a01b031633146103135760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610406565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146104dc57600080fd5b919050565b6000806000606084860312156104f657600080fd5b6104ff846104c5565b95602085013595506040909401359392505050565b60006020828403121561052657600080fd5b61052f826104c5565b9392505050565b6000806040838503121561054957600080fd5b610552836104c5565b946020939093013593505050565b6000806040838503121561057357600080fd5b61057c836104c5565b915061058a602084016104c5565b90509250929050565b6000602082840312156105a557600080fd5b503591905056fea2646970667358221220d89c12aece62ea365574af80639fc8f8c4dcfc3c2c669c492e47d4c5e9db3a9564736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.