Skip to content

Commit 1045d34

Browse files
authored
refactor: Relocate message handler interface (#543)
The MulticallHandler contract currently imports the SpokePool contract and experienced a bytecode change after the following unrelated commit: 86593c6 This resulted in its CREATE2 deployment address changing. The MulticallHandler doesn't actually need any of the SpokePool implementation or its dependencies, and it seems like we'd like the MulticallHandler to be deployed to the same address on as many chains as possible, so factor out the interface to a separate file to insulate it from any unintended modifications
1 parent 3d9dbbb commit 1045d34

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

contracts/SpokePool.sol

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity ^0.8.0;
33

44
import "./MerkleLib.sol";
55
import "./external/interfaces/WETH9Interface.sol";
6+
import "./interfaces/SpokePoolMessageHandler.sol";
67
import "./interfaces/SpokePoolInterface.sol";
78
import "./interfaces/V3SpokePoolInterface.sol";
89
import "./upgradeable/MultiCallerUpgradeable.sol";
@@ -16,16 +17,6 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
1617
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
1718
import "@openzeppelin/contracts/utils/math/SignedMath.sol";
1819

19-
// This interface is expected to be implemented by any contract that expects to receive messages from the SpokePool.
20-
interface AcrossMessageHandler {
21-
function handleV3AcrossMessage(
22-
address tokenSent,
23-
uint256 amount,
24-
address relayer,
25-
bytes memory message
26-
) external;
27-
}
28-
2920
/**
3021
* @title SpokePool
3122
* @notice Base contract deployed on source and destination chains enabling depositors to transfer assets from source to

contracts/handlers/MulticallHandler.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-3.0-only
22
pragma solidity ^0.8.0;
33

4-
import "../SpokePool.sol";
4+
import "../interfaces/SpokePoolMessageHandler.sol";
55
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
66
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
77
import "@openzeppelin/contracts/utils/Address.sol";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
pragma solidity ^0.8.0;
3+
4+
// This interface is expected to be implemented by any contract that expects to receive messages from the SpokePool.
5+
interface AcrossMessageHandler {
6+
function handleV3AcrossMessage(
7+
address tokenSent,
8+
uint256 amount,
9+
address relayer,
10+
bytes memory message
11+
) external;
12+
}

0 commit comments

Comments
 (0)