Skip to content

Commit 7b853a2

Browse files
committed
🔨 contracts: hardcode exa bridge role proposal salt
1 parent 634d690 commit 7b853a2

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎contracts/.gas-snapshot‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,19 @@ ExaPreviewerTest:test_collect_reverts_whenProposalsLeaveNoLiquidity() (gas: 1437
202202
ExaPreviewerTest:test_markets_returnsMarkets() (gas: 150447)
203203
ExaPreviewerTest:test_pendingProposals_returnsPendingProposals() (gas: 1983943)
204204
ExaPreviewerTest:test_utilizations_returns() (gas: 134922)
205-
HypEXATest:test_deployRouter_enrollsBase_whenNoRemotesOnOptimism() (gas: 30706283)
206-
HypEXATest:test_deployRouter_enrollsOptimism_whenNoRemotesOnBase() (gas: 30811917)
207-
HypEXATest:test_deployRouter_reverts_whenNoRemotesOnUnsupportedChain() (gas: 20627783)
205+
HypEXATest:test_deployRouter_enrollsBase_whenNoRemotesOnOptimism() (gas: 30706715)
206+
HypEXATest:test_deployRouter_enrollsOptimism_whenNoRemotesOnBase() (gas: 30812349)
207+
HypEXATest:test_deployRouter_reverts_whenNoRemotesOnUnsupportedChain() (gas: 20628215)
208208
HypEXATest:test_deployRouter_setsHookAndIsm() (gas: 270936)
209209
HypEXATest:test_handle_reverts_withoutBridgeRole() (gas: 578581)
210210
HypEXATest:test_hookAndIsm_trackMailboxDefaults_withoutRedeploy() (gas: 154299)
211211
HypEXATest:test_pause_pausesHookAndIsmViaPauser() (gas: 144877)
212212
HypEXATest:test_process_reverts_whenIsmPaused() (gas: 712859)
213-
HypEXATest:test_proposeBridgeRole_reverts_whenAlreadyGranted() (gas: 273918)
214-
HypEXATest:test_proposeBridgeRole_reverts_whenRouterNotDeployed() (gas: 20387421)
215-
HypEXATest:test_proposeBridgeRole_schedulesGrantOnTimelock() (gas: 2303697)
216-
HypEXATest:test_rotateRouterPausable_restoresProcessAfterPauserIsmPaused() (gas: 22139948)
217-
HypEXATest:test_rotateRouterPausable_restoresTransferRemoteAfterPauserHookPaused() (gas: 2126569)
213+
HypEXATest:test_proposeBridgeRole_reverts_whenAlreadyGranted() (gas: 273332)
214+
HypEXATest:test_proposeBridgeRole_reverts_whenRouterNotDeployed() (gas: 20387237)
215+
HypEXATest:test_proposeBridgeRole_schedulesGrantOnTimelock() (gas: 2303104)
216+
HypEXATest:test_rotateRouterPausable_restoresProcessAfterPauserIsmPaused() (gas: 22140415)
217+
HypEXATest:test_rotateRouterPausable_restoresTransferRemoteAfterPauserHookPaused() (gas: 2126591)
218218
HypEXATest:test_roundTrip_opToBaseToOp() (gas: 1312360)
219219
HypEXATest:test_roundTrip_opToPolygonToBaseToOp() (gas: 1960009)
220220
HypEXATest:test_transferRemote_reverts_whenHookPaused() (gas: 1106969)
@@ -255,4 +255,4 @@ RefunderTest:test_refund_reverts_whenTimelocked() (gas: 77924)
255255
RefunderTest:test_refund_reverts_whenWrongSignature() (gas: 109942)
256256
RefunderTest:test_refund_toleratesTimeDrift() (gas: 263419)
257257
RefunderTest:test_withdraw_reverts_whenNotAdmin() (gas: 35779)
258-
RefunderTest:test_withdraw_withdraws() (gas: 67492)
258+
RefunderTest:test_withdraw_withdraws() (gas: 67492)

‎contracts/script/HypEXA.s.sol‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ contract HypEXA is BaseScript {
7474
vm.stopBroadcast();
7575
}
7676

77-
function proposeBridgeRole(bytes32 salt) external {
77+
function proposeBridgeRole() external {
78+
bytes32 salt = keccak256("propose-exa-bridge-role");
7879
address router = CREATE3_FACTORY.getDeployed(acct("admin"), keccak256(abi.encode("HypEXA")));
7980
if (router.code.length == 0) revert RouterNotDeployed();
8081
address exa = protocol("EXA", true, getChain("optimism").chainId);

‎contracts/test/HypEXA.t.sol‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,16 @@ contract HypEXATest is ForkTest {
234234
HypEXA hypEXA = new HypEXA();
235235

236236
vm.expectRevert(RouterNotDeployed.selector);
237-
hypEXA.proposeBridgeRole(keccak256("HypEXA.BRIDGE_ROLE"));
237+
hypEXA.proposeBridgeRole();
238238
}
239239

240240
function test_proposeBridgeRole_schedulesGrantOnTimelock() external {
241241
vm.selectFork(opFork);
242242
vm.prank(protocol("TimelockController"));
243243
exa.revokeRole(keccak256("BRIDGE_ROLE"), address(opRouter));
244244

245-
bytes32 salt = keccak256("HypEXA.BRIDGE_ROLE");
246-
opHypEXA.proposeBridgeRole(salt);
245+
bytes32 salt = keccak256("propose-exa-bridge-role");
246+
opHypEXA.proposeBridgeRole();
247247

248248
TimelockController timelock = TimelockController(payable(protocol("TimelockController")));
249249
bytes32 id = timelock.hashOperation(
@@ -259,7 +259,7 @@ contract HypEXATest is ForkTest {
259259
function test_proposeBridgeRole_reverts_whenAlreadyGranted() external {
260260
vm.selectFork(opFork);
261261
vm.expectRevert(AlreadyGranted.selector);
262-
opHypEXA.proposeBridgeRole(keccak256("HypEXA.BRIDGE_ROLE"));
262+
opHypEXA.proposeBridgeRole();
263263
}
264264

265265
function test_deployRouter_setsHookAndIsm() external {

0 commit comments

Comments
 (0)