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:
AddressManager
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BSL 1.1 - Copyright 2024 MetaLayer Labs Ltd. pragma solidity 0.8.15; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; /// @custom:legacy /// @title AddressManager /// @notice AddressManager is a legacy contract that was used in the old version of the Optimism /// system to manage a registry of string names to addresses. We now use a more standard /// proxy system instead, but this contract is still necessary for backwards compatibility /// with several older contracts. contract AddressManager is Ownable { /// @notice Mapping of the hashes of string names to addresses. mapping(bytes32 => address) private addresses; /// @notice Emitted when an address is modified in the registry. /// @param name String name being set in the registry. /// @param newAddress Address set for the given name. /// @param oldAddress Address that was previously set for the given name. event AddressSet(string indexed name, address newAddress, address oldAddress); /// @notice Changes the address associated with a particular name. /// @param _name String name to associate an address with. /// @param _address Address to associate with the name. function setAddress(string memory _name, address _address) external onlyOwner { bytes32 nameHash = _getNameHash(_name); address oldAddress = addresses[nameHash]; addresses[nameHash] = _address; emit AddressSet(_name, _address, oldAddress); } /// @notice Retrieves the address associated with a given name. /// @param _name Name to retrieve an address for. /// @return Address associated with the given name. function getAddress(string memory _name) external view returns (address) { return addresses[_getNameHash(_name)]; } /// @notice Computes the hash of a name. /// @param _name Name to compute a hash for. /// @return Hash of the given name. function _getNameHash(string memory _name) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_name)); } }
// 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; } }
{ "remappings": [ "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@rari-capital/solmate/=lib/solmate/", "@cwia/=lib/clones-with-immutable-args/src/", "forge-std/=lib/forge-std/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "safe-contracts/=lib/safe-contracts/contracts/", "clones-with-immutable-args/=lib/clones-with-immutable-args/src/", "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"},{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"}],"name":"AddressSet","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"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getAddress","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":"string","name":"_name","type":"string"},{"internalType":"address","name":"_address","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6104b88061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008f578063bf40fac1146100a2578063f2fde38b146100b5575b600080fd5b6100646100c8565b005b6000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006461009d3660046103c3565b6100dc565b6100736100b0366004610411565b61017d565b6100646100c336600461044e565b6101ac565b6100d061022a565b6100da6000610284565b565b6100e461022a565b60006100ef836102d4565b6000818152600160205260409081902080546001600160a01b038681166001600160a01b03198316179092559151929350169061012d908590610470565b604080519182900382206001600160a01b03808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b60006001600061018c846102d4565b81526020810191909152604001600020546001600160a01b031692915050565b6101b461022a565b6001600160a01b03811661021e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61022781610284565b50565b6000546001600160a01b031633146100da5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610215565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016102e79190610470565b604051602081830303815290604052805190602001209050919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261032b57600080fd5b813567ffffffffffffffff8082111561034657610346610304565b604051601f8301601f19908116603f0116810190828211818310171561036e5761036e610304565b8160405283815286602085880101111561038757600080fd5b836020870160208301376000602085830101528094505050505092915050565b80356001600160a01b03811681146103be57600080fd5b919050565b600080604083850312156103d657600080fd5b823567ffffffffffffffff8111156103ed57600080fd5b6103f98582860161031a565b925050610408602084016103a7565b90509250929050565b60006020828403121561042357600080fd5b813567ffffffffffffffff81111561043a57600080fd5b6104468482850161031a565b949350505050565b60006020828403121561046057600080fd5b610469826103a7565b9392505050565b6000825160005b818110156104915760208186018101518583015201610477565b818111156104a0576000828501525b50919091019291505056fea164736f6c634300080f000a
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008f578063bf40fac1146100a2578063f2fde38b146100b5575b600080fd5b6100646100c8565b005b6000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006461009d3660046103c3565b6100dc565b6100736100b0366004610411565b61017d565b6100646100c336600461044e565b6101ac565b6100d061022a565b6100da6000610284565b565b6100e461022a565b60006100ef836102d4565b6000818152600160205260409081902080546001600160a01b038681166001600160a01b03198316179092559151929350169061012d908590610470565b604080519182900382206001600160a01b03808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b60006001600061018c846102d4565b81526020810191909152604001600020546001600160a01b031692915050565b6101b461022a565b6001600160a01b03811661021e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61022781610284565b50565b6000546001600160a01b031633146100da5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610215565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016102e79190610470565b604051602081830303815290604052805190602001209050919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261032b57600080fd5b813567ffffffffffffffff8082111561034657610346610304565b604051601f8301601f19908116603f0116810190828211818310171561036e5761036e610304565b8160405283815286602085880101111561038757600080fd5b836020870160208301376000602085830101528094505050505092915050565b80356001600160a01b03811681146103be57600080fd5b919050565b600080604083850312156103d657600080fd5b823567ffffffffffffffff8111156103ed57600080fd5b6103f98582860161031a565b925050610408602084016103a7565b90509250929050565b60006020828403121561042357600080fd5b813567ffffffffffffffff81111561043a57600080fd5b6104468482850161031a565b949350505050565b60006020828403121561046057600080fd5b610469826103a7565b9392505050565b6000825160005b818110156104915760208186018101518583015201610477565b818111156104a0576000828501525b50919091019291505056fea164736f6c634300080f000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.