Skip to content

Commit

Permalink
Add a comment explaining the pop operation in the assembly code in Sa…
Browse files Browse the repository at this point in the history
…feSignerLaunchpad
  • Loading branch information
mmv08 committed Jan 15, 2024
1 parent e7e9d0d commit a1cea45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/4337/contracts/experimental/SafeSignerLaunchpad.sol
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ contract SafeSignerLaunchpad is IAccount, SafeStorage, SignatureValidatorConstan
if (missingAccountFunds > 0) {
// solhint-disable-next-line no-inline-assembly
assembly ("memory-safe") {
// The `pop` is necessary here because solidity 0.5.0
// enforces "strict" assemblo blocks and "statements (elements of a block) are disallowed if they return something onto the stack at the end."
// This is not well documented, the quote is taken from here:
// https://github.com/ethereum/solidity/issues/1820
// The compiler will throw an error if we keep the success value on the stack
pop(call(gas(), caller(), missingAccountFunds, 0, 0, 0, 0))
}
}
Expand Down

0 comments on commit a1cea45

Please sign in to comment.