diff --git a/src/bridge/Bridge.sol b/src/bridge/Bridge.sol index 31b415540..e0b3b3f1c 100644 --- a/src/bridge/Bridge.sol +++ b/src/bridge/Bridge.sol @@ -63,6 +63,11 @@ contract Bridge is Initializable, DelegateCallAware, IBridge { rollup = rollup_; } + /// @notice Allows the proxy owner to set the rollup address + function updateRollupAddress(IOwnable _rollup) external onlyDelegated onlyRollupOrOwner { + rollup = _rollup; + } + modifier onlyRollupOrOwner() { if (msg.sender != address(rollup)) { address rollupOwner = rollup.owner(); diff --git a/src/bridge/IBridge.sol b/src/bridge/IBridge.sol index f1fff13c0..b174d57ee 100644 --- a/src/bridge/IBridge.sol +++ b/src/bridge/IBridge.sol @@ -112,4 +112,6 @@ interface IBridge { // ---------- initializer ---------- function initialize(IOwnable rollup_) external; + + function updateRollupAddress(IOwnable _rollup) external; } diff --git a/src/mocks/BridgeStub.sol b/src/mocks/BridgeStub.sol index d0f9e8cca..bfd3d4610 100644 --- a/src/mocks/BridgeStub.sol +++ b/src/mocks/BridgeStub.sol @@ -179,4 +179,8 @@ contract BridgeStub is IBridge { function initialize(IOwnable) external pure { revert("NOT_IMPLEMENTED"); } + + function updateRollupAddress(IOwnable) external pure { + revert("NOT_IMPLEMENTED"); + } } diff --git a/src/test-helpers/BridgeTester.sol b/src/test-helpers/BridgeTester.sol index b355c51c8..02ca13f5d 100644 --- a/src/test-helpers/BridgeTester.sol +++ b/src/test-helpers/BridgeTester.sol @@ -73,6 +73,10 @@ contract BridgeTester is Initializable, DelegateCallAware, IBridge { rollup = rollup_; } + function updateRollupAddress(IOwnable _rollup) external onlyDelegated onlyRollupOrOwner { + rollup = _rollup; + } + function activeOutbox() public view returns (address) { if (_activeOutbox == EMPTY_ACTIVEOUTBOX) return address(uint160(0)); return _activeOutbox;