Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate GPv2Signing calldata manipulation tests to Foundry #206

Merged
merged 22 commits into from
Aug 15, 2024

Conversation

fedgiac
Copy link
Contributor

@fedgiac fedgiac commented Aug 14, 2024

Description

There is only one test involved, and the logic of it has changed in the upgrade process.
The key difference is that we use Solidity version 0.8 in the tests, while the previous test used Solidity 0.7. The relevant part here is that contract calls now validate the padding in the calldata, making it impossible to successfully call recoverOrderFromTrade with manipulated calldata. Curiously, this should have been the case since Solidity ~0.5, however it wasn't properly enforced until Solidity 0.8 (see ethereum/solidity repo here and discussion in the PR where this was introduced).

Test Plan

CI.

Related Issues

#120

@fedgiac fedgiac requested a review from a team as a code owner August 14, 2024 09:43
@fedgiac fedgiac force-pushed the migrate-test-signing-calldata-manipulation branch from 70df7eb to 483e8f2 Compare August 14, 2024 12:40
Copy link
Contributor

@mfw78 mfw78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice use of fuzz tests!

Base automatically changed from migrate-test-signing-recover-order-from-trade to main August 15, 2024 13:48
@fedgiac fedgiac enabled auto-merge (squash) August 15, 2024 13:50
@fedgiac fedgiac merged commit 2536fa3 into main Aug 15, 2024
7 checks passed
@fedgiac fedgiac deleted the migrate-test-signing-calldata-manipulation branch August 15, 2024 13:51
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants