Skip to content

Commit

Permalink
add world chain support
Browse files Browse the repository at this point in the history
  • Loading branch information
hexonaut committed Aug 26, 2024
1 parent 95edd63 commit 008ffe0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/forwarders/OptimismForwarder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ interface ICrossDomainOptimism {

library OptimismForwarder {

address constant internal L1_CROSS_DOMAIN_OPTIMISM = 0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1;
address constant internal L1_CROSS_DOMAIN_BASE = 0x866E82a600A1414e583f7F13623F1aC5d58b0Afa;
address constant internal L2_CROSS_DOMAIN = 0x4200000000000000000000000000000000000007;
address constant internal L1_CROSS_DOMAIN_OPTIMISM = 0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1;
address constant internal L1_CROSS_DOMAIN_BASE = 0x866E82a600A1414e583f7F13623F1aC5d58b0Afa;
address constant internal L1_CROSS_DOMAIN_WORLD_CHAIN = 0xf931a81D18B1766d15695ffc7c1920a62b7e710a;
address constant internal L2_CROSS_DOMAIN = 0x4200000000000000000000000000000000000007;

function sendMessageL1toL2(
address l1CrossDomain,
Expand Down
2 changes: 2 additions & 0 deletions src/testing/bridges/OptimismBridgeTesting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ library OptimismBridgeTesting {
sourceCrossChainMessenger = 0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1;
} else if (name == keccak256("base")) {
sourceCrossChainMessenger = 0x866E82a600A1414e583f7F13623F1aC5d58b0Afa;
} else if (name == keccak256("world_chain")) {
sourceCrossChainMessenger = 0xf931a81D18B1766d15695ffc7c1920a62b7e710a;
} else {
revert("Unsupported destination chain");
}
Expand Down
9 changes: 9 additions & 0 deletions test/OptimismIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ contract OptimismIntegrationTest is IntegrationBaseTest {
runCrossChainTests(getChain("base").createFork());
}

function test_world_chain() public {
setChain("world_chain", ChainData({
name: "World Chain",
rpcUrl: vm.envString("WORLD_CHAIN_RPC_URL"),
chainId: 480
}));
runCrossChainTests(getChain("world_chain").createFork());
}

function initSourceReceiver() internal override pure returns (address) {
return address(0);
}
Expand Down

0 comments on commit 008ffe0

Please sign in to comment.