Submitted by 0xdeadbeef0x, also found by romand
The protocol supports 2D nonces through a batchId mechanism.
Due to different ways to execute transaction on the wallet there could be a collision between batchIds being used.
This can result in unexpected failing of transactions
There are two main ways to execute transaction from the smart wallet
SmartAccount has locked the batchId #0  to be used by the EntryPoint.
When an EntryPoint calls validateUserOp before execution, the hardcoded nonce of batchId #0 will be incremented and validated, contracts/smart-contract-wallet/SmartAccount.sol#L501
Calls to execTransaction are more immediate and are likely to be executed before a UserOp through EntryPoint.
There is no limitation in execTransaction to use batchId #0 although it should be called only by EntryPoint.
If there is a call to execTransaction with batchId set to 0. It will increment the nonce and EntryPoint transactions will revert.
contracts/smart-contract-wallet/SmartAccount.sol#L216
VS Code
Add a requirement that batchId is not 0 in execTransaction:
require(batchId != 0, "batchId 0 is used only by EntryPoint")
livingrockrises (Biconomy) confirmed
For this contest, 46 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by 0xSmartContract received the top score from the judge.
The following wardens also submitted reports: adriro, giovannidisiena, lukris02, juancito, pauliax, 0x1f8b, joestakey, betweenETHlines, Udsen, Kalzak, Josiah, Viktor_Cortess, peanuts, gz627, IllIllI, cryptostellar5, Lirios, Diana, Atarpara, horsefacts, ast3ros, MyFDsYours, 0xAgro, 2997ms, SaharDevep, Rolezn, zaskoh, hl_, sorrynotsorry, MalfurionWhitehat, 0xdeadbeef0x, chrisdior4, ladboy233, chaduke, prady, Bnke0x0, btk, oyc_109, csanuragjain, nadin, Sathish9098, HE1M, Raiders, RaymondFam, and 0xhacksmithh.
