Skip to content

test flow() atomicity on later-transfer failure#445

Open
thedavidmeister wants to merge 1 commit intomainfrom
2026-05-05-issue-318-flow-atomicity-test
Open

test flow() atomicity on later-transfer failure#445
thedavidmeister wants to merge 1 commit intomainfrom
2026-05-05-issue-318-flow-atomicity-test

Conversation

@thedavidmeister
Copy link
Copy Markdown
Contributor

Summary

Pins the documented atomicity invariant on IFlowV5.flow(): when a later transfer in the same flow reverts, the entire flow reverts and no earlier transfer's effects persist.

The test mixes a valid ERC20 transfer with an ERC1155 transfer that fails the from-allowed check. The outer revert reason MUST be the inner failure's selector — that proves the inner revert was not caught and squashed by a wrapper.

EVM transaction-level rollback handles the actual state revert; this test exists to lock the revert-propagation invariant against a future change that wraps inner calls in try/catch.

Closes #318.

Test plan

  • testFlowAtomicRollbackOnLaterTransferFailure — 100 fuzz runs

🤖 Generated with Claude Code

Pins the documented atomicity invariant on `IFlowV5.flow()`: when a
later transfer in the same flow reverts, the entire flow reverts and
no earlier transfer's effects persist. The test mixes a valid ERC20
transfer with an ERC1155 transfer that fails the from-allowed check;
the outer revert reason MUST be the inner failure's selector, which
proves the inner revert was not caught and squashed.

EVM transaction-level rollback handles the actual state revert; the
test exists to lock the revert-propagation invariant against a future
change that wraps inner calls in try/catch.

Closes #318.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@thedavidmeister has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 30 minutes and 18 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 36d3ae89-a36f-4383-8308-c98376586fa6

📥 Commits

Reviewing files that changed from the base of the PR and between ceaea3c and a8c6330.

📒 Files selected for processing (1)
  • test/src/concrete/Flow.transfer.t.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-05-issue-318-flow-atomicity-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[A22-3] [LOW] IFlowV5.flow() atomicity invariant has no dedicated test

1 participant