Skip to content

extract unauthorized-from FlowTransferV1 helpers#459

Open
thedavidmeister wants to merge 2 commits into
mainfrom
2026-05-07-issue-421-unauthorized-transfer-helpers
Open

extract unauthorized-from FlowTransferV1 helpers#459
thedavidmeister wants to merge 2 commits into
mainfrom
2026-05-07-issue-421-unauthorized-transfer-helpers

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Summary

Three negative-path tests in Flow.transfer.t.sol built two-element FlowTransferV1 structs inline with the same shape (one transfer unauthorized + one self-flow) repeated per token type.

Adds three helpers in FlowTransferOperation.sol:

  • unauthorizedERC20Flow
  • unauthorizedERC721Flow
  • unauthorizedERC1155Flow

Each takes the unauthorized address, the authorized actor, the flow, and per-type ids/amounts, and returns the full FlowTransferV1.

The matching inline blocks in the three negative-path tests are replaced. The second block in the ERC20 test (unauthorized at slot 1, not 0) keeps its inline construction since it exercises a different shape.

Closes #421.

Test plan

  • all 3 negative-path tests still pass — 100 fuzz runs each

🤖 Generated with Claude Code

Three negative-path tests in Flow.transfer.t.sol built two-element
FlowTransferV1 structs inline, with the same shape (one transfer
unauthorized + one self-flow) repeated per token type.

Adds three helpers in FlowTransferOperation.sol:
- unauthorizedERC20Flow
- unauthorizedERC721Flow
- unauthorizedERC1155Flow

Each takes the unauthorized address, the authorized actor, the flow,
and per-type ids/amounts, and returns the full FlowTransferV1.

The matching inline blocks in the three negative-path tests are
replaced. The second block in the ERC20 test (where the unauthorized
address is at slot 1, not 0) keeps its inline construction since it
exercises a different shape.

Closes #421.

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

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 36 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9c30ecd4-e0c8-4b1d-9c24-7fde4f305a9b

📥 Commits

Reviewing files that changed from the base of the PR and between 772e568 and 662cb14.

📒 Files selected for processing (2)
  • test/abstract/FlowTransferOperation.sol
  • 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-07-issue-421-unauthorized-transfer-helpers

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.

@thedavidmeister thedavidmeister self-assigned this May 9, 2026
@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Reviewed 9e0082c: reviewed and approved. LGTM.

…unauthorized-transfer-helpers

# Conflicts:
#	test/src/concrete/Flow.transfer.t.sol
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.

[TEST-3] [LOW] Negative-path FlowTransferV1 construction duplicated in Flow.transfer.t.sol

1 participant