Skip to content

Commit

Permalink
chore: better docs for _getOriginSender
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Jul 29, 2024
1 parent ca314f7 commit 112873d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/rfq/FastBridgeRouterV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ contract FastBridgeRouterV2 is DefaultRouter, Ownable, IFastBridgeRouter {
// The easiest way to read from memory is to use assembly
// solhint-disable-next-line no-inline-assembly
assembly {
// We need to skip the rawParams.length (32 bytes) and the rebate flag (1 byte)
// Skip the rawParams.length (32 bytes) and the rebate flag (1 byte)
originSender := mload(add(rawParams, 33))
// Now We have the address in the highest 160 bits. Shift right by 96 to get it in the lowest 160 bits
// The address is in the highest 160 bits. Shift right by 96 to get it in the lowest 160 bits
originSender := shr(96, originSender)
}
}
if (originSender == address(0) && msg.sender.code.length == 0) {
// We fallback to msg.sender if that is EOA. This establishes backwards compatibility
// Fall back to msg.sender if it is an EOA. This maintains backward compatibility
// for cases where we can safely assume that the origin sender is the same as msg.sender.
originSender = msg.sender;
}
Expand Down

0 comments on commit 112873d

Please sign in to comment.