From 8206e85ed6c5f690081967a0ccab0a12ed860ced Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:57:37 +0100 Subject: [PATCH] Add a comment explaining the pop operation in the assembly code in SafeSignerLaunchpad --- modules/4337/contracts/experimental/SafeSignerLaunchpad.sol | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/4337/contracts/experimental/SafeSignerLaunchpad.sol b/modules/4337/contracts/experimental/SafeSignerLaunchpad.sol index a6685438b..edb337703 100644 --- a/modules/4337/contracts/experimental/SafeSignerLaunchpad.sol +++ b/modules/4337/contracts/experimental/SafeSignerLaunchpad.sol @@ -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" assembly 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)) } }