-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/arbSep-to-sep-testnet
- Loading branch information
Showing
9 changed files
with
1,247 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
contracts/src/test/ArbToGnosis/VeaInboxArbToGnosisMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// @custom:authors: [@madhurMongia] | ||
/// @custom:reviewers: [] | ||
/// @custom:auditors: [] | ||
/// @custom:bounties: [] | ||
/// @custom:deployments: [] | ||
|
||
pragma solidity 0.8.24; | ||
|
||
import "../../arbitrumToGnosis/VeaInboxArbToGnosis.sol"; | ||
import "../../canonical/arbitrum/IArbSys.sol"; | ||
import "../../interfaces/routers/IRouterToGnosis.sol"; | ||
|
||
contract VeaInboxArbToGnosisMock is VeaInboxArbToGnosis { | ||
IArbSys public immutable mockArbSys; | ||
|
||
constructor( | ||
uint256 _epochPeriod, | ||
address _routerArbToGnosis, | ||
IArbSys _mockArbSys | ||
) VeaInboxArbToGnosis(_epochPeriod, _routerArbToGnosis) { | ||
mockArbSys = _mockArbSys; | ||
} | ||
|
||
// Override sendSnapshot to use the mock ArbSys | ||
function sendSnapshot(uint256 _epoch, uint256 _gasLimit, Claim memory _claim) external override { | ||
unchecked { | ||
require(_epoch < block.timestamp / epochPeriod, "Can only send past epoch snapshot."); | ||
} | ||
|
||
bytes memory data = abi.encodeCall(IRouterToGnosis.route, (_epoch, snapshots[_epoch], _gasLimit, _claim)); | ||
|
||
// Use the mock ArbSys instead of the constant ARB_SYS | ||
bytes32 ticketID = bytes32(mockArbSys.sendTxToL1(routerArbToGnosis, data)); | ||
|
||
emit SnapshotSent(_epoch, ticketID); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
contracts/src/test/bridge-mocks/arbitrum/ArbSysMockWithBridge.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// @custom:authors: [@madhurMongia] | ||
/// @custom:reviewers: [] | ||
/// @custom:auditors: [] | ||
/// @custom:bounties: [] | ||
/// @custom:deployments: [] | ||
|
||
pragma solidity 0.8.24; | ||
|
||
import "../../../canonical/arbitrum/IArbSys.sol"; | ||
import "./BridgeMock.sol"; | ||
|
||
contract ArbSysMockWithBridge is IArbSys { | ||
BridgeMock public immutable bridge; | ||
|
||
constructor(BridgeMock _bridge) { | ||
bridge = _bridge; | ||
} | ||
|
||
function sendTxToL1( | ||
address destination, | ||
bytes calldata calldataForL1 | ||
) external payable returns (uint256 _withdrawal_ID) { | ||
return bridge.executeL1Message(destination, calldataForL1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.