@@ -7,8 +7,7 @@ import {Script, console2 as console} from "forge-std/Script.sol";
7
7
import {Vm} from "forge-std/Vm.sol " ;
8
8
import {stdToml} from "forge-std/StdToml.sol " ;
9
9
10
- import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol " ;
11
- import {IBridgehub} from "contracts/bridgehub/IBridgehub.sol " ;
10
+ import {Bridgehub} from "contracts/bridgehub/Bridgehub.sol " ;
12
11
import {IZkSyncHyperchain} from "contracts/state-transition/chain-interfaces/IZkSyncHyperchain.sol " ;
13
12
import {ValidatorTimelock} from "contracts/state-transition/ValidatorTimelock.sol " ;
14
13
import {Governance} from "contracts/governance/Governance.sol " ;
@@ -118,20 +117,17 @@ contract RegisterHyperchainScript is Script {
118
117
}
119
118
120
119
function registerTokenOnBridgehub () internal {
121
- IBridgehub bridgehub = IBridgehub (config.bridgehub);
122
- Ownable ownable = Ownable (config.bridgehub);
120
+ Bridgehub bridgehub = Bridgehub (config.bridgehub);
123
121
124
122
if (bridgehub.tokenIsRegistered (config.baseToken)) {
125
123
console.log ("Token already registered on Bridgehub " );
126
124
} else {
127
125
bytes memory data = abi.encodeCall (bridgehub.addToken, (config.baseToken));
128
- Utils.executeUpgrade ({
129
- _governor: ownable.owner (),
130
- _salt: bytes32 (config.bridgehubCreateNewChainSalt),
126
+ Utils.chainAdminMulticall ({
127
+ _chainAdmin: bridgehub.admin (),
131
128
_target: config.bridgehub,
132
129
_data: data,
133
- _value: 0 ,
134
- _delay: 0
130
+ _value: 0
135
131
});
136
132
console.log ("Token registered on Bridgehub " );
137
133
}
@@ -156,8 +152,7 @@ contract RegisterHyperchainScript is Script {
156
152
}
157
153
158
154
function registerHyperchain () internal {
159
- IBridgehub bridgehub = IBridgehub (config.bridgehub);
160
- Ownable ownable = Ownable (config.bridgehub);
155
+ Bridgehub bridgehub = Bridgehub (config.bridgehub);
161
156
162
157
vm.recordLogs ();
163
158
bytes memory data = abi.encodeCall (
@@ -172,14 +167,7 @@ contract RegisterHyperchainScript is Script {
172
167
)
173
168
);
174
169
175
- Utils.executeUpgrade ({
176
- _governor: ownable.owner (),
177
- _salt: bytes32 (config.bridgehubCreateNewChainSalt),
178
- _target: config.bridgehub,
179
- _data: data,
180
- _value: 0 ,
181
- _delay: 0
182
- });
170
+ Utils.chainAdminMulticall ({_chainAdmin: bridgehub.admin (), _target: config.bridgehub, _data: data, _value: 0 });
183
171
console.log ("Hyperchain registered " );
184
172
185
173
// Get new diamond proxy address from emitted events
0 commit comments