Skip to content

Commit

Permalink
Keep only curent signer
Browse files Browse the repository at this point in the history
  • Loading branch information
ranchalp committed Jan 16, 2025
1 parent 9cfaad5 commit 03dc404
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 68 deletions.
6 changes: 3 additions & 3 deletions scripts/foundry/InitializeL1ScrollOwner.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {ScrollChain} from "../../src/L1/rollup/ScrollChain.sol";
import {ScrollOwner} from "../../src/misc/ScrollOwner.sol";
import {Whitelist} from "../../src/L2/predeploys/Whitelist.sol";

import {SystemSignerRegistry} from "../../src/L1/system-contract/SystemSignerRegistry.sol";
import {SystemConfig} from "../../src/L1/system-contract/SystemConfig.sol";


// solhint-disable max-states-count
Expand Down Expand Up @@ -282,12 +282,12 @@ contract InitializeL1ScrollOwner is Script {

function configSystemContract() internal {
// If we already have deployed it, just do:
SystemSignerRegistry sys = SystemSignerRegistry(SYSTEM_CONTRACT_ADDR);
SystemConfig sys = SystemConfig(SYSTEM_CONTRACT_ADDR);

// sys has a normal constructor that set the "owner" to `ScrollOwner`.
// Now we want to let the Security Council call `addSigner(...)` with no delay.
bytes4[] memory selectors = new bytes4[](1);
selectors[0] = sys.addSigner.selector;
selectors[0] = sys.updateSigner.selector;

owner.updateAccess(
SYSTEM_CONTRACT_ADDR, // the system contract
Expand Down
30 changes: 30 additions & 0 deletions src/L1/system-contract/SystemConfig.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import "@openzeppelin/contracts/access/Ownable.sol";

contract SystemConfig is Ownable {

address public currentSigner;

constructor(address _owner) {
_transferOwnership(_owner);
}

/**
* @dev Update the current signer.
* Only the owner can call this function.
* @param _newSigner The address of the new authorized signer.
*/
function updateSigner(address _newSigner) external onlyOwner {
currentSigner = _newSigner;
}

/**
* @dev Return the current authorized signer.
* @return The authorized signer address.
*/
function getSigner() external view returns (address) {
return currentSigner;
}
}
65 changes: 0 additions & 65 deletions src/L1/system-contract/SystemSignerRegistry.sol

This file was deleted.

0 comments on commit 03dc404

Please sign in to comment.