Address Contract Verified
Address
0xB97bB519743A5096505E4d3e6507a189Fa2B39f9
Balance
0 ETH
Nonce
1
Code Size
1613 bytes
Creator
0xEa7f5442...bB03 at tx 0xaf257180...374d58
Indexed Transactions
0
Contract Bytecode
1613 bytes
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80639e106dc7116100ad578063ce848e1311610071578063ce848e1314610354578063d71c72e01461037b578063e0482413146103a2578063ec3a4613146103c9578063f2fde38b146103dc57600080fd5b80639e106dc714610291578063a1bd302d146102b8578063a8720195146102df578063bffdc2a414610306578063ce2871601461032d57600080fd5b8063715018a6116100f4578063715018a6146101f757806375fd4ca9146102015780637f3c8ff5146102285780638da5cb5b1461024f5780639943ad671461026a57600080fd5b8063265cbca91461012657806338dd8c2c1461016057806347164d3b146101a957806348a166e6146101d0575b600080fd5b61014d7feefbfa32ce9dd99a431be27221a8732bc1e7b3d032ff4cbd56226b17783f741381565b6040519081526020015b60405180910390f35b61019961016e366004610586565b6001600160a01b03919091166000908152600160209081526040808320938352929052205460ff1690565b6040519015158152602001610157565b61014d7f4b1cf52f49d174a2779824195ac83ffb0173882d2de2b8017a7a2ad31efa9bac81565b61014d7f25472c26f712486e36393fa63e6b8c68e6b8766eb9afb8ed886cc3f05d53697681565b6101ff6103ef565b005b61014d7f627ab07b7d1e807a81e987070dfc0a2d891e418df2b352b2282d752b91f53b7181565b61014d7f46c2ab528350fb4f59e61eb6c0382446a3636f13f7846680a2734e5f829735a481565b6000546040516001600160a01b039091168152602001610157565b61014d7faa85d4d7655b58b3177edbbb41bc17f2e2ebffd26ace9d6b56244a5ee16c780681565b61014d7f3d37afab23e5cac313ed6bbbd4cc033efdc5d534544a422062560607f0a47c9181565b61014d7f79bb2eff4b96ce24cc809a1642a7365c4980ebeb15be2580a619e03726e41a9881565b61014d7fcf3889b3d647b5db8c87e0e05aca2acdd693a72c71726764f2198ee27a21c72881565b61014d7faeffe8a027d13ff1f9fbecaa8f7fc0ff2c5c5d71561a1a572f6bafeeba68abfd81565b61014d7f3e008573b76fa95febaab72c06ec152363f92f2b27dcaf00fbd0bb77a70593db81565b61014d7fd7f04f034163f8e54d3edad14592dc01fc248c04ff4006634300788f87b6946a81565b61014d7fb0487bdd3330b4d082e49dfc24e1aa23706abcc632f9215fee20a474a9a8845781565b61014d7fc8e17e1f507bc6ac21ffd444ba9d6c9d6ea2defdac21571990ea0eb8bcde3a2481565b6101ff6103d73660046105b0565b610403565b6101ff6103ea3660046105f5565b6104aa565b6103f76104ed565b610401600061051a565b565b61040b6104ed565b6001600160a01b0383161580159061042257508115155b61043f576040516354fae39d60e11b815260040160405180910390fd5b6001600160a01b0383166000818152600160209081526040808320868452825291829020805460ff191685151590811790915591519182528492917fbf768a8bd7016d5df999ce7e5dcbd90856578a89eb68c5a1d5fc1d4a3360107e910160405180910390a3505050565b6104b26104ed565b6001600160a01b0381166104e157604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104ea8161051a565b50565b6000546001600160a01b031633146104015760405163118cdaa760e01b81523360048201526024016104d8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461058157600080fd5b919050565b6000806040838503121561059957600080fd5b6105a28361056a565b946020939093013593505050565b6000806000606084860312156105c557600080fd5b6105ce8461056a565b925060208401359150604084013580151581146105ea57600080fd5b809150509250925092565b60006020828403121561060757600080fd5b6106108261056a565b939250505056fea2646970667358221220de97635ee1e5518e0dd6c6e57861f3c3f5a845480105fa4ba0e9e73ccb4cfdd164736f6c634300081c0033
Verified Source Code Full Match
Compiler: v0.8.28+commit.7893614a
EVM: london
Optimization: Yes (200 runs)
Roles.sol 74 lines
// Copyright (c) 2025 Merge Layers Inc.
//
// This source code is licensed under the Business Source License 1.1
// (the "License"); you may not use this file except in compliance with the
// License. You may obtain a copy of the License at
//
// https://github.com/malda-protocol/malda-lending/blob/main/LICENSE-BSL
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This file contains code derived from or inspired by Compound V2,
// originally licensed under the BSD 3-Clause License. See LICENSE-COMPOUND-V2
// for original license terms and attributions.
// SPDX-License-Identifier: BSL-1.1
pragma solidity =0.8.28;
/*
_____ _____ __ ____ _____
| | _ | | | \| _ |
| | | | | |__| | | |
|_|_|_|__|__|_____|____/|__|__|
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IRoles} from "./interfaces/IRoles.sol";
contract Roles is Ownable, IRoles {
// ----------- STORAGE ------------
mapping(address => mapping(bytes32 => bool)) private _roles;
bytes32 public constant REBALANCER = keccak256("REBALANCER");
bytes32 public constant PAUSE_MANAGER = keccak256("PAUSE_MANAGER");
bytes32 public constant REBALANCER_EOA = keccak256("REBALANCER_EOA");
bytes32 public constant GUARDIAN_PAUSE = keccak256("GUARDIAN_PAUSE");
bytes32 public constant CHAINS_MANAGER = keccak256("CHAINS_MANAGER");
bytes32 public constant PROOF_FORWARDER = keccak256("PROOF_FORWARDER");
bytes32 public constant PROOF_BATCH_FORWARDER = keccak256("PROOF_BATCH_FORWARDER");
bytes32 public constant SEQUENCER = keccak256("SEQUENCER");
bytes32 public constant GUARDIAN_BRIDGE = keccak256("GUARDIAN_BRIDGE");
bytes32 public constant GUARDIAN_ORACLE = keccak256("GUARDIAN_ORACLE");
bytes32 public constant GUARDIAN_RESERVE = keccak256("GUARDIAN_RESERVE");
bytes32 public constant GUARDIAN_BORROW_CAP = keccak256("GUARDIAN_BORROW_CAP");
bytes32 public constant GUARDIAN_SUPPLY_CAP = keccak256("GUARDIAN_SUPPLY_CAP");
bytes32 public constant GUARDIAN_BLACKLIST = keccak256("GUARDIAN_BLACKLIST");
/**
* @notice emitted when role is set
*/
event Allowed(address indexed _contract, bytes32 indexed _role, bool _allowed);
constructor(address _owner) Ownable(_owner) {}
// ----------- VIEW ------------
function isAllowedFor(address _contract, bytes32 _role) external view override returns (bool) {
return _roles[_contract][_role];
}
// ----------- OWNER ------------
/**
* @notice Abiltity to allow a contract for a role or not
* @param _contract the contract's address.
* @param _role the bytes32 role.
* @param _allowed the new status.
*/
function allowFor(address _contract, bytes32 _role, bool _allowed) external onlyOwner {
require(_contract != address(0) && _role != bytes32(0), Roles_InputNotValid());
_roles[_contract][_role] = _allowed;
emit Allowed(_contract, _role, _allowed);
}
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* 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 Ownable is Context {
address private _owner;
/**
* @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.
*/
constructor(address initialOwner) {
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) {
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 {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
IRoles.sol 105 lines
// Copyright (c) 2025 Merge Layers Inc.
//
// This source code is licensed under the Business Source License 1.1
// (the "License"); you may not use this file except in compliance with the
// License. You may obtain a copy of the License at
//
// https://github.com/malda-protocol/malda-lending/blob/main/LICENSE-BSL
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This file contains code derived from or inspired by Compound V2,
// originally licensed under the BSD 3-Clause License. See LICENSE-COMPOUND-V2
// for original license terms and attributions.
// SPDX-License-Identifier: BSL-1.1
pragma solidity =0.8.28;
/*
_____ _____ __ ____ _____
| | _ | | | \| _ |
| | | | | |__| | | |
|_|_|_|__|__|_____|____/|__|__|
*/
interface IRoles {
error Roles_InputNotValid();
/**
* @notice Returns REBALANCER role
*/
function REBALANCER() external view returns (bytes32);
/**
* @notice Returns REBALANCER_EOA role
*/
function REBALANCER_EOA() external view returns (bytes32);
/**
* @notice Returns GUARDIAN_PAUSE role
*/
function GUARDIAN_PAUSE() external view returns (bytes32);
/**
* @notice Returns GUARDIAN_BRIDGE role
*/
function GUARDIAN_BRIDGE() external view returns (bytes32);
/**
* @notice Returns GUARDIAN_BORROW_CAP role
*/
function GUARDIAN_BORROW_CAP() external view returns (bytes32);
/**
* @notice Returns GUARDIAN_SUPPLY_CAP role
*/
function GUARDIAN_SUPPLY_CAP() external view returns (bytes32);
/**
* @notice Returns GUARDIAN_RESERVE role
*/
function GUARDIAN_RESERVE() external view returns (bytes32);
/**
* @notice Returns PROOF_FORWARDER role
*/
function PROOF_FORWARDER() external view returns (bytes32);
/**
* @notice Returns PROOF_BATCH_FORWARDER role
*/
function PROOF_BATCH_FORWARDER() external view returns (bytes32);
/**
* @notice Returns SEQUENCER role
*/
function SEQUENCER() external view returns (bytes32);
/**
* @notice Returns PAUSE_MANAGER role
*/
function PAUSE_MANAGER() external view returns (bytes32);
/**
* @notice Returns CHAINS_MANAGER role
*/
function CHAINS_MANAGER() external view returns (bytes32);
/**
* @notice Returns GUARDIAN_ORACLE role
*/
function GUARDIAN_ORACLE() external view returns (bytes32);
/**
* @notice Returns GUARDIAN_BLACKLIST role
*/
function GUARDIAN_BLACKLIST() external view returns (bytes32);
/**
* @notice Returns allowance status for a contract and a role
* @param _contract the contract address
* @param _role the bytes32 role
*/
function isAllowedFor(address _contract, bytes32 _role) external view returns (bool);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
Read Contract
CHAINS_MANAGER 0xe0482413 → bytes32
GUARDIAN_BLACKLIST 0xce848e13 → bytes32
GUARDIAN_BORROW_CAP 0x265cbca9 → bytes32
GUARDIAN_BRIDGE 0xce287160 → bytes32
GUARDIAN_ORACLE 0x7f3c8ff5 → bytes32
GUARDIAN_PAUSE 0xbffdc2a4 → bytes32
GUARDIAN_RESERVE 0xd71c72e0 → bytes32
GUARDIAN_SUPPLY_CAP 0x9943ad67 → bytes32
PAUSE_MANAGER 0x47164d3b → bytes32
PROOF_BATCH_FORWARDER 0xa1bd302d → bytes32
PROOF_FORWARDER 0xa8720195 → bytes32
REBALANCER 0x9e106dc7 → bytes32
REBALANCER_EOA 0x48a166e6 → bytes32
SEQUENCER 0x75fd4ca9 → bytes32
isAllowedFor 0x38dd8c2c → bool
owner 0x8da5cb5b → address
Write Contract 3 functions
These functions modify contract state and require a wallet transaction to execute.
allowFor 0xec3a4613
address _contract
bytes32 _role
bool _allowed
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address