You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(Memo): incorrect comment claims post-increment is pre-increment #483
uint256 currentMemoIndex = memoIndex++;
The comment above says "Pre-increment ensures unique indices under reentrancy", but the code uses post-increment (memoIndex++). Pre-increment would be ++memoIndex.
The behaviour is correct (the index is already incremented before the subcall), but the comment is misleading and could cause future developers to misunderstand the reentrancy guarantee.
Suggested fix
Change the comment to accurately describe post-increment semantics.
Hi, could I take this one? I'd reword the comment above uint256 currentMemoIndex = memoIndex++; in contracts/src/memo/Memo.sol: the index is incremented in storage before the subcall, so each call (including a reentrant one) keeps the previous value as its own unique index. No code change, comment only.
Happy to take a one-line docs fix here if assigned — update the Memo.sol comment so it matches post-increment (memoIndex++) instead of claiming pre-increment. Will wait for assignment before opening a PR.
Activity
A5Infinity commentedon Oct 9, 2026
Hi, could I take this one? I'd reword the comment above
uint256 currentMemoIndex = memoIndex++;incontracts/src/memo/Memo.sol: the index is incremented in storage before the subcall, so each call (including a reentrant one) keeps the previous value as its own unique index. No code change, comment only.kutluhaneth46 commentedon Oct 26, 2026
Happy to take a one-line docs fix here if assigned — update the Memo.sol comment so it matches post-increment (
memoIndex++) instead of claiming pre-increment. Will wait for assignment before opening a PR.