Skip to content

Commit

Permalink
Create RollupManager.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Oct 20, 2024
1 parent 3e34545 commit a524f65
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract RollupManager {
mapping(address => bool) public operators;
address public owner;

event OperatorAdded(address indexed operator);
event OperatorRemoved(address indexed operator);

modifier onlyOwner() {
require(msg.sender == owner, "Not the owner");
_;
}

constructor() {
owner = msg.sender;
}

function addOperator(address _operator) external onlyOwner {
require(!operators[_operator], "Already an operator");
operators[_operator] = true;
emit OperatorAdded(_operator);
}

function removeOperator(address _operator) external onlyOwner {
require(operators[_operator], "Not an operator");
operators[_operator] = false;
emit OperatorRemoved(_operator);
}

function isOperator(address _address) external view returns (bool) {
return operators[_address];
}
}

0 comments on commit a524f65

Please sign in to comment.