openzeppelin-contracts icon indicating copy to clipboard operation
openzeppelin-contracts copied to clipboard

Fuzz tampered tests for `ERC2771Forwarder`

Open cairoeth opened this issue 1 year ago • 4 comments

Fixes #4896 and helps #4894

PR Checklist

  • [ ] Tests
  • [ ] Documentation
  • [ ] Changeset entry (run npx changeset add)

cairoeth avatar Oct 15 '24 01:10 cairoeth

⚠️ No Changeset found

Latest commit: 1e2b9ce45c64f375e68f00cc8ac75d47ef2dd0f5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Oct 15 '24 01:10 changeset-bot[bot]

@Amxx those two functions are a bit different as they test for two different cases:

  • testExecuteBatchTamperedValuesZeroReceiver: if the receiver is the zero address, then the call will revert if any of the meta transactions are invalid/tampered
  • testExecuteBatchTamperedValues: if the receiver is not the zero address, then the call will not revert but the tampered meta transaction will simply just be skipped.

To get the latest version and be able to run the tests, do foundryup on terminal.

cairoeth avatar Oct 18 '24 16:10 cairoeth

@cairoeth I rewrote the test quite heavily. IMO that is more readable. Let me know what you think.

Amxx avatar Oct 18 '24 19:10 Amxx

looks great, thanks!

cairoeth avatar Oct 18 '24 20:10 cairoeth