@@ -21,6 +21,9 @@ import {ScrollChain} from "../../src/L1/rollup/ScrollChain.sol";
21
21
import {ScrollOwner} from "../../src/misc/ScrollOwner.sol " ;
22
22
import {Whitelist} from "../../src/L2/predeploys/Whitelist.sol " ;
23
23
24
+ import {SystemSignerRegistry} from "../../src/L1/system-contract/SystemSignerRegistry.sol " ;
25
+
26
+
24
27
// solhint-disable max-states-count
25
28
// solhint-disable state-visibility
26
29
// solhint-disable var-name-mixedcase
@@ -63,6 +66,9 @@ contract InitializeL1ScrollOwner is Script {
63
66
address L1_ENFORCED_TX_GATEWAY_PROXY_ADDR = vm.envAddress ("L1_ENFORCED_TX_GATEWAY_PROXY_ADDR " );
64
67
address L1_WHITELIST_ADDR = vm.envAddress ("L1_WHITELIST_ADDR " );
65
68
69
+ address SYSTEM_CONTRACT_ADDR = vm.envAddress ("SYSTEM_CONTRACT_ADDR " );
70
+
71
+
66
72
ScrollOwner owner;
67
73
68
74
function run () external {
@@ -81,7 +87,8 @@ contract InitializeL1ScrollOwner is Script {
81
87
configL1GatewayRouter ();
82
88
configL1CustomERC20Gateway ();
83
89
configL1ERC721Gateway ();
84
- configL1ERC1155Gateway ();
90
+ configL1ERC1155Gateway ();
91
+ configSystemContract ();
85
92
86
93
configL1USDCGateway ();
87
94
configEnforcedTxGateway ();
@@ -272,4 +279,21 @@ contract InitializeL1ScrollOwner is Script {
272
279
owner.updateAccess (L1_ENFORCED_TX_GATEWAY_PROXY_ADDR, _selectors, SCROLL_MULTISIG_NO_DELAY_ROLE, true );
273
280
owner.updateAccess (L1_ENFORCED_TX_GATEWAY_PROXY_ADDR, _selectors, EMERGENCY_MULTISIG_NO_DELAY_ROLE, true );
274
281
}
282
+
283
+ function configSystemContract () internal {
284
+ // If we already have deployed it, just do:
285
+ SystemSignerRegistry sys = SystemSignerRegistry (SYSTEM_CONTRACT_ADDR);
286
+
287
+ // sys has a normal constructor that set the "owner" to `ScrollOwner`.
288
+ // Now we want to let the Security Council call `addSigner(...)` with no delay.
289
+ bytes4 [] memory selectors = new bytes4 [](1 );
290
+ selectors[0 ] = sys.addSigner.selector ;
291
+
292
+ owner.updateAccess (
293
+ SYSTEM_CONTRACT_ADDR, // the system contract
294
+ selectors, // array of function selectors (onlyOwner)
295
+ SECURITY_COUNCIL_NO_DELAY_ROLE,
296
+ true
297
+ );
298
+ }
275
299
}
0 commit comments