RSC_AccessManager

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "src/RSC_AccessManager.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Ownable} from "./utils/Ownable.sol";

/// @title RSC_AccessManager
/// @notice Simple role registry for ADMIN, OPERATOR, RELAYER, WATCHER
contract RSC_AccessManager is Ownable {
    bytes32 public constant ROLE_ADMIN = keccak256("ADMIN");
    bytes32 public constant ROLE_OPERATOR = keccak256("OPERATOR");
    bytes32 public constant ROLE_RELAYER = keccak256("RELAYER");
    bytes32 public constant ROLE_WATCHER = keccak256("WATCHER");

    mapping(bytes32 => mapping(address => bool)) public hasRole;

    event RoleGranted(bytes32 indexed role, address indexed account);
    event RoleRevoked(bytes32 indexed role, address indexed account);

    function grant(bytes32 role, address account) external onlyOwner {
        require(account != address(0), "zero");
        hasRole[role][account] = true;
        emit RoleGranted(role, account);
    }

    function revoke(bytes32 role, address account) external onlyOwner {
        hasRole[role][account] = false;
        emit RoleRevoked(role, account);
    }

    function isAdmin(address a) external view returns (bool) { return hasRole[ROLE_ADMIN][a]; }
    function isOperator(address a) external view returns (bool) { return hasRole[ROLE_OPERATOR][a]; }
    function isRelayer(address a) external view returns (bool) { return hasRole[ROLE_RELAYER][a]; }
    function isWatcher(address a) external view returns (bool) { return hasRole[ROLE_WATCHER][a]; }
}


"
    },
    "src/utils/Ownable.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title Minimal Ownable utility
abstract contract Ownable {
    error NotOwner();

    address public owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor() {
        owner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
    }

    modifier onlyOwner() {
        if (msg.sender != owner) revert NotOwner();
        _;
    }

    function transferOwnership(address newOwner) external onlyOwner {
        require(newOwner != address(0), "Owner=zero");
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}


"
    }
  },
  "settings": {
    "remappings": [
      "forge-std/=lib/forge-std/src/",
      "reactive-lib/=lib/reactive-lib/src/"
    ],
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "metadata": {
      "useLiteralContent": false,
      "bytecodeHash": "ipfs",
      "appendCBOR": true
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "evmVersion": "cancun",
    "viaIR": true
  }
}}

Tags:
Factory|addr:0xe7ca11ae70519ea46a9c4b146b7e46c57ed4b127|verified:true|block:23452056|tx:0xf5328ea713d74f828fbd33656887e8527628a59467199fc3e80d3c898d3a5a73|first_check:1758966692

Submitted on: 2025-09-27 11:51:33

Comments

Log in to comment.

No comments yet.