Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion contracts/crosschain/CrosschainLinked.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,17 @@ abstract contract CrosschainLinked is ERC7786Recipient {
address instance,
bytes calldata sender
) internal view virtual override returns (bool) {
(address gateway, bytes memory router) = getLink(_extractChain(sender));
(address gateway, bytes memory router) = getLink(_extractChainCalldata(sender));
return instance == gateway && sender.equal(router);
}

function _extractChain(bytes memory self) private pure returns (bytes memory) {
(bytes2 chainType, bytes memory chainReference, ) = self.parseV1();
return InteroperableAddress.formatV1(chainType, chainReference, hex"");
}

function _extractChainCalldata(bytes calldata self) private pure returns (bytes memory) {
(bytes2 chainType, bytes calldata chainReference, ) = self.parseV1Calldata();
return InteroperableAddress.formatV1(chainType, chainReference, hex"");
}
}