Skip to content

Commit

Permalink
refactor: EOA fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Jul 26, 2024
1 parent cce2d13 commit ca314f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/rfq/FastBridgeRouterV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ contract FastBridgeRouterV2 is DefaultRouter, Ownable, IFastBridgeRouter {
originSender := shr(96, originSender)
}
}
if (originSender == address(0)) {
if (originSender == address(0) && msg.sender.code.length == 0) {
// We fallback to msg.sender if that is EOA. This establishes backwards compatibility
// for cases where we can safely assume that the origin sender is the same as msg.sender.
return msg.sender.code.length == 0 ? msg.sender : address(0);
originSender = msg.sender;
}
}

Expand Down

0 comments on commit ca314f7

Please sign in to comment.