@mantleio/contracts
Version:
[Mantle] L1 and L2 smart contracts for Mantle
151 lines • 18.8 kB
JSON
{
"address": "0x31aBe1c466C2A8b95fd84258dD1471472979B650",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_libAddressManager",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "_who",
"type": "address"
}
],
"name": "isCollateralized",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "libAddressManager",
"outputs": [
{
"internalType": "contract Lib_AddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0xd9c76c95d0d603a4b85b87eeb9c49f6bf5fcee25f13e7869ed1c7eec655ed8a4",
"receipt": {
"to": null,
"from": "0x2A2954F3989a83Cc43DD58B0f038D5F276f21333",
"contractAddress": "0x31aBe1c466C2A8b95fd84258dD1471472979B650",
"transactionIndex": 3,
"gasUsed": "252183",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xfba5fee17c1d6f733e1e9026ff0a35d3bffab0fd6a9ec0d5efe4d6dbe7420973",
"transactionHash": "0xd9c76c95d0d603a4b85b87eeb9c49f6bf5fcee25f13e7869ed1c7eec655ed8a4",
"logs": [],
"blockNumber": 17577610,
"cumulativeGasUsed": "482421",
"status": 1,
"byzantium": true
},
"args": [
"0x6968f3F16C3e64003F02E121cf0D5CCBf5625a42"
],
"numDeployments": 1,
"solcInputHash": "160c63563c1dac66876269cff72cea71",
"metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_who\",\"type\":\"address\"}],\"name\":\"isCollateralized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract is, for now, a stub of the \\\"real\\\" BondManager that does nothing but allow the \\\"BVM_Proposer\\\" to submit state root batches.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_libAddressManager\":\"Address of the Address Manager.\"}},\"isCollateralized(address)\":{\"params\":{\"_who\":\"Address to check.\"},\"returns\":{\"_0\":\"true if the address is properly collateralized, false otherwise.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"BondManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"isCollateralized(address)\":{\"notice\":\"Checks whether a given address is properly collateralized and can perform actions within the system.\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L1/verification/BondManager.sol\":\"BondManager\"},\"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/L1/verification/BondManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* Interface Imports */\\nimport { IBondManager } from \\\"./IBondManager.sol\\\";\\n\\n/* Contract Imports */\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/**\\n * @title BondManager\\n * @dev This contract is, for now, a stub of the \\\"real\\\" BondManager that does nothing but\\n * allow the \\\"BVM_Proposer\\\" to submit state root batches.\\n *\\n */\\ncontract BondManager is IBondManager, Lib_AddressResolver {\\n /**\\n * @param _libAddressManager Address of the Address Manager.\\n */\\n constructor(address _libAddressManager) Lib_AddressResolver(_libAddressManager) {}\\n\\n /**\\n * Checks whether a given address is properly collateralized and can perform actions within\\n * the system.\\n * @param _who Address to check.\\n * @return true if the address is properly collateralized, false otherwise.\\n */\\n // slither-disable-next-line external-function\\n function isCollateralized(address _who) public view returns (bool) {\\n // Only authenticate sequencer to submit state root batches.\\n return _who == resolve(\\\"BVM_Proposer\\\");\\n }\\n}\\n\",\"keccak256\":\"0xd04ea84a397e4d6eb93506046203aa595078d2bbbfa50e47212bb9a8f55bf268\",\"license\":\"MIT\"},\"contracts/L1/verification/IBondManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/**\\n * @title IBondManager\\n */\\ninterface IBondManager {\\n /********************\\n * Public Functions *\\n ********************/\\n\\n function isCollateralized(address _who) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x4ae2dc7bf175626d2930299e73d50a7ba936171d07810497ef71fa38a4e246a7\",\"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\"},\"contracts/libraries/resolver/Lib_AddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* Library Imports */\\nimport { Lib_AddressManager } from \\\"./Lib_AddressManager.sol\\\";\\n\\n/**\\n * @title Lib_AddressResolver\\n */\\nabstract contract Lib_AddressResolver {\\n /*************\\n * Variables *\\n *************/\\n\\n Lib_AddressManager public libAddressManager;\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n /**\\n * @param _libAddressManager Address of the Lib_AddressManager.\\n */\\n constructor(address _libAddressManager) {\\n libAddressManager = Lib_AddressManager(_libAddressManager);\\n }\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Resolves the address associated with a given name.\\n * @param _name Name to resolve an address for.\\n * @return Address associated with the given name.\\n */\\n function resolve(string memory _name) public view returns (address) {\\n return libAddressManager.getAddress(_name);\\n }\\n}\\n\",\"keccak256\":\"0x515c4db671a28e2fe180201f6d11c0208c05f582ca3489fb6b8e81c27659bc62\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516103bb3803806103bb83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b610328806100936000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806302ad4d2a14610046578063299ca4781461006e578063461a447814610099575b600080fd5b610059610054366004610195565b6100ac565b60405190151581526020015b60405180910390f35b600054610081906001600160a01b031681565b6040516001600160a01b039091168152602001610065565b6100816100a73660046101cf565b6100f6565b60006100db6040518060400160405280600c81526020016b212b26afa83937b837b9b2b960a11b8152506100f6565b6001600160a01b0316826001600160a01b0316149050919050565b6000805460405163bf40fac160e01b81526001600160a01b039091169063bf40fac190610127908590600401610280565b60206040518083038186803b15801561013f57600080fd5b505afa158015610153573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017791906102d5565b92915050565b6001600160a01b038116811461019257600080fd5b50565b6000602082840312156101a757600080fd5b81356101b28161017d565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101e157600080fd5b813567ffffffffffffffff808211156101f957600080fd5b818401915084601f83011261020d57600080fd5b81358181111561021f5761021f6101b9565b604051601f8201601f19908116603f01168101908382118183101715610247576102476101b9565b8160405282815287602084870101111561026057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102ad57858101830151858201604001528201610291565b818111156102bf576000604083870101525b50601f01601f1916929092016040019392505050565b6000602082840312156102e757600080fd5b81516101b28161017d56fea264697066735822122001b0fcd2fe35ea1c8769d40c0a1fbdfe16bff1d476980df598e6a0ccdf55e89564736f6c63430008090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806302ad4d2a14610046578063299ca4781461006e578063461a447814610099575b600080fd5b610059610054366004610195565b6100ac565b60405190151581526020015b60405180910390f35b600054610081906001600160a01b031681565b6040516001600160a01b039091168152602001610065565b6100816100a73660046101cf565b6100f6565b60006100db6040518060400160405280600c81526020016b212b26afa83937b837b9b2b960a11b8152506100f6565b6001600160a01b0316826001600160a01b0316149050919050565b6000805460405163bf40fac160e01b81526001600160a01b039091169063bf40fac190610127908590600401610280565b60206040518083038186803b15801561013f57600080fd5b505afa158015610153573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017791906102d5565b92915050565b6001600160a01b038116811461019257600080fd5b50565b6000602082840312156101a757600080fd5b81356101b28161017d565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101e157600080fd5b813567ffffffffffffffff808211156101f957600080fd5b818401915084601f83011261020d57600080fd5b81358181111561021f5761021f6101b9565b604051601f8201601f19908116603f01168101908382118183101715610247576102476101b9565b8160405282815287602084870101111561026057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102ad57858101830151858201604001528201610291565b818111156102bf576000604083870101525b50601f01601f1916929092016040019392505050565b6000602082840312156102e757600080fd5b81516101b28161017d56fea264697066735822122001b0fcd2fe35ea1c8769d40c0a1fbdfe16bff1d476980df598e6a0ccdf55e89564736f6c63430008090033",
"devdoc": {
"details": "This contract is, for now, a stub of the \"real\" BondManager that does nothing but allow the \"BVM_Proposer\" to submit state root batches.",
"kind": "dev",
"methods": {
"constructor": {
"params": {
"_libAddressManager": "Address of the Address Manager."
}
},
"isCollateralized(address)": {
"params": {
"_who": "Address to check."
},
"returns": {
"_0": "true if the address is properly collateralized, false otherwise."
}
},
"resolve(string)": {
"params": {
"_name": "Name to resolve an address for."
},
"returns": {
"_0": "Address associated with the given name."
}
}
},
"title": "BondManager",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"isCollateralized(address)": {
"notice": "Checks whether a given address is properly collateralized and can perform actions within the system."
},
"resolve(string)": {
"notice": "Resolves the address associated with a given name."
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 52622,
"contract": "contracts/L1/verification/BondManager.sol:BondManager",
"label": "libAddressManager",
"offset": 0,
"slot": "0",
"type": "t_contract(Lib_AddressManager)52614"
}
],
"types": {
"t_contract(Lib_AddressManager)52614": {
"encoding": "inplace",
"label": "contract Lib_AddressManager",
"numberOfBytes": "20"
}
}
}
}