UNPKG

@mantleio/contracts

Version:
237 lines 21.2 kB
{ "address": "0x6968f3F16C3e64003F02E121cf0D5CCBf5625a42", "abi": [ { "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" } ], "transactionHash": "0xe727ac72f50d7b4356b6cae14fbd4d1383ff39ff8b3cbff6804c90316c1dc877", "receipt": { "to": null, "from": "0x2A2954F3989a83Cc43DD58B0f038D5F276f21333", "contractAddress": "0x6968f3F16C3e64003F02E121cf0D5CCBf5625a42", "transactionIndex": 11, "gasUsed": "363063", "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000020000000000000000400000000000000000000000000000000000000000000000000000000000000000000020000010000000000000000000080040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", "blockHash": "0x0fe37464c162d91fdafa82f5c4dd7e8d9b00ed009de66f376d600069ca353a56", "transactionHash": "0xe727ac72f50d7b4356b6cae14fbd4d1383ff39ff8b3cbff6804c90316c1dc877", "logs": [ { "transactionIndex": 11, "blockNumber": 17577535, "transactionHash": "0xe727ac72f50d7b4356b6cae14fbd4d1383ff39ff8b3cbff6804c90316c1dc877", "address": "0x6968f3F16C3e64003F02E121cf0D5CCBf5625a42", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000002a2954f3989a83cc43dd58b0f038d5f276f21333" ], "data": "0x", "logIndex": 44, "blockHash": "0x0fe37464c162d91fdafa82f5c4dd7e8d9b00ed009de66f376d600069ca353a56" } ], "blockNumber": 17577535, "cumulativeGasUsed": "1692770", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, "solcInputHash": "923d5e84c7bdb96db63ac12abfc0bbb6", "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"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\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getAddress(string)\":{\"params\":{\"_name\":\"Name to retrieve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"setAddress(string,address)\":{\"params\":{\"_address\":\"Address to associate with the name.\",\"_name\":\"String name to associate an address with.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Lib_AddressManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getAddress(string)\":{\"notice\":\"Retrieves the address associated with a given name.\"},\"setAddress(string,address)\":{\"notice\":\"Changes the address associated with a particular name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/libraries/resolver/Lib_AddressManager.sol\":\"Lib_AddressManager\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _setOwner(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _setOwner(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _setOwner(newOwner);\\n }\\n\\n function _setOwner(address newOwner) private {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x6bb804a310218875e89d12c053e94a13a4607cdf7cc2052f3e52bd32a0dc50a1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f\",\"license\":\"MIT\"},\"contracts/libraries/resolver/Lib_AddressManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* External Imports */\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/**\\n * @title Lib_AddressManager\\n */\\ncontract Lib_AddressManager is Ownable {\\n /**********\\n * Events *\\n **********/\\n\\n event AddressSet(string indexed _name, address _newAddress, address _oldAddress);\\n\\n /*************\\n * Variables *\\n *************/\\n\\n mapping(bytes32 => address) private addresses;\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Changes the address associated with a particular name.\\n * @param _name String name to associate an address with.\\n * @param _address Address to associate with the name.\\n */\\n function setAddress(string memory _name, address _address) external onlyOwner {\\n bytes32 nameHash = _getNameHash(_name);\\n address oldAddress = addresses[nameHash];\\n addresses[nameHash] = _address;\\n\\n emit AddressSet(_name, _address, oldAddress);\\n }\\n\\n /**\\n * Retrieves the address associated with a given name.\\n * @param _name Name to retrieve an address for.\\n * @return Address associated with the given name.\\n */\\n function getAddress(string memory _name) external view returns (address) {\\n return addresses[_getNameHash(_name)];\\n }\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Computes the hash of a name.\\n * @param _name Name to compute a hash for.\\n * @return Hash of the given name.\\n */\\n function _getNameHash(string memory _name) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(_name));\\n }\\n}\\n\",\"keccak256\":\"0xcde9b29429d512c549f7c1b8a033f161fa71c18cda08b241748663854196ae14\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105268061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008f578063bf40fac1146100a2578063f2fde38b146100b5575b600080fd5b6100646100c8565b005b6000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006461009d3660046103d3565b610107565b6100736100b0366004610421565b6101ca565b6100646100c336600461045e565b6101f9565b6000546001600160a01b031633146100fb5760405162461bcd60e51b81526004016100f290610480565b60405180910390fd5b6101056000610294565b565b6000546001600160a01b031633146101315760405162461bcd60e51b81526004016100f290610480565b600061013c836102e4565b6000818152600160205260409081902080546001600160a01b038681166001600160a01b03198316179092559151929350169061017a9085906104b5565b604080519182900382206001600160a01b03808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b6000600160006101d9846102e4565b81526020810191909152604001600020546001600160a01b031692915050565b6000546001600160a01b031633146102235760405162461bcd60e51b81526004016100f290610480565b6001600160a01b0381166102885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f2565b61029181610294565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016102f791906104b5565b604051602081830303815290604052805190602001209050919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261033b57600080fd5b813567ffffffffffffffff8082111561035657610356610314565b604051601f8301601f19908116603f0116810190828211818310171561037e5761037e610314565b8160405283815286602085880101111561039757600080fd5b836020870160208301376000602085830101528094505050505092915050565b80356001600160a01b03811681146103ce57600080fd5b919050565b600080604083850312156103e657600080fd5b823567ffffffffffffffff8111156103fd57600080fd5b6104098582860161032a565b925050610418602084016103b7565b90509250929050565b60006020828403121561043357600080fd5b813567ffffffffffffffff81111561044a57600080fd5b6104568482850161032a565b949350505050565b60006020828403121561047057600080fd5b610479826103b7565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000825160005b818110156104d657602081860181015185830152016104bc565b818111156104e5576000828501525b50919091019291505056fea2646970667358221220303bbeaf3d63537991209d0df6db34ba752b1152b02fc0b5442784b442d936eb64736f6c63430008090033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008f578063bf40fac1146100a2578063f2fde38b146100b5575b600080fd5b6100646100c8565b005b6000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006461009d3660046103d3565b610107565b6100736100b0366004610421565b6101ca565b6100646100c336600461045e565b6101f9565b6000546001600160a01b031633146100fb5760405162461bcd60e51b81526004016100f290610480565b60405180910390fd5b6101056000610294565b565b6000546001600160a01b031633146101315760405162461bcd60e51b81526004016100f290610480565b600061013c836102e4565b6000818152600160205260409081902080546001600160a01b038681166001600160a01b03198316179092559151929350169061017a9085906104b5565b604080519182900382206001600160a01b03808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b6000600160006101d9846102e4565b81526020810191909152604001600020546001600160a01b031692915050565b6000546001600160a01b031633146102235760405162461bcd60e51b81526004016100f290610480565b6001600160a01b0381166102885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f2565b61029181610294565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016102f791906104b5565b604051602081830303815290604052805190602001209050919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261033b57600080fd5b813567ffffffffffffffff8082111561035657610356610314565b604051601f8301601f19908116603f0116810190828211818310171561037e5761037e610314565b8160405283815286602085880101111561039757600080fd5b836020870160208301376000602085830101528094505050505092915050565b80356001600160a01b03811681146103ce57600080fd5b919050565b600080604083850312156103e657600080fd5b823567ffffffffffffffff8111156103fd57600080fd5b6104098582860161032a565b925050610418602084016103b7565b90509250929050565b60006020828403121561043357600080fd5b813567ffffffffffffffff81111561044a57600080fd5b6104568482850161032a565b949350505050565b60006020828403121561047057600080fd5b610479826103b7565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000825160005b818110156104d657602081860181015185830152016104bc565b818111156104e5576000828501525b50919091019291505056fea2646970667358221220303bbeaf3d63537991209d0df6db34ba752b1152b02fc0b5442784b442d936eb64736f6c63430008090033", "devdoc": { "kind": "dev", "methods": { "getAddress(string)": { "params": { "_name": "Name to retrieve an address for." }, "returns": { "_0": "Address associated with the given name." } }, "owner()": { "details": "Returns the address of the current owner." }, "renounceOwnership()": { "details": "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." }, "setAddress(string,address)": { "params": { "_address": "Address to associate with the name.", "_name": "String name to associate an address with." } }, "transferOwnership(address)": { "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." } }, "title": "Lib_AddressManager", "version": 1 }, "userdoc": { "kind": "user", "methods": { "getAddress(string)": { "notice": "Retrieves the address associated with a given name." }, "setAddress(string,address)": { "notice": "Changes the address associated with a particular name." } }, "version": 1 }, "storageLayout": { "storage": [ { "astId": 6025, "contract": "contracts/libraries/resolver/Lib_AddressManager.sol:Lib_AddressManager", "label": "_owner", "offset": 0, "slot": "0", "type": "t_address" }, { "astId": 52547, "contract": "contracts/libraries/resolver/Lib_AddressManager.sol:Lib_AddressManager", "label": "addresses", "offset": 0, "slot": "1", "type": "t_mapping(t_bytes32,t_address)" } ], "types": { "t_address": { "encoding": "inplace", "label": "address", "numberOfBytes": "20" }, "t_bytes32": { "encoding": "inplace", "label": "bytes32", "numberOfBytes": "32" }, "t_mapping(t_bytes32,t_address)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => address)", "numberOfBytes": "32", "value": "t_address" } } } }