Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix arbitrum L1 to L2 crosschain call detection #3578

Merged
merged 3 commits into from Jul 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions contracts/crosschain/arbitrum/LibArbitrumL2.sol
Expand Up @@ -21,7 +21,7 @@ library LibArbitrumL2 {
address public constant ARBSYS = 0x0000000000000000000000000000000000000064;

function isCrossChain(address arbsys) internal view returns (bool) {
return ArbitrumL2_Bridge(arbsys).isTopLevelCall();
return ArbitrumL2_Bridge(arbsys).wasMyCallersAddressAliased();
}

/**
Expand All @@ -35,9 +35,6 @@ library LibArbitrumL2 {
function crossChainSender(address arbsys) internal view returns (address) {
if (!isCrossChain(arbsys)) revert NotCrossChainCall();

return
ArbitrumL2_Bridge(arbsys).wasMyCallersAddressAliased()
? ArbitrumL2_Bridge(arbsys).myCallersAddressWithoutAliasing()
: msg.sender;
return ArbitrumL2_Bridge(arbsys).myCallersAddressWithoutAliasing();
}
}