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

Support updated Milkman contract with pinned calldata #5

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

fedgiac
Copy link

@fedgiac fedgiac commented Oct 9, 2024

These change update the Milkman bot contract so that it supports the latest changes to the Milkman contracts, namely enforcing that a Milkman order is valid only if the app data is the same that was specified on order creation (see cowdao-grants/milkman#1 ).

Since the code doesn't work with the old contract, I also replaced references to the old Milkman address with a deployment of the new contract. The code matches the contract changes and the code can be verified here. This contract will be added to the corresponding contract repo once that PR is merged.

The ABI has been manually built by using the repo above (forge build, find the Milkman contract in the out folder, and copying the ABI part, that is jq .abi out/Milkman.sol/Milkman.json).

How to test

Test coverage is lacking, so the changes can be considered in large part untested.
The existing test that interacts with the contract has been modified to show that there is basic Milkman support for the new contract. All other tests are still working.
I also deployed a few contracts on Sepolia, created an order, and seen that the integration test works as I think is expected. I also documented what I think should be expected.

Notably, we send a request to the quote/create_order endpoints, which now includes the appdata. I manually verified that the format of the app data that's sent out is as expected (e.g., 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee).

@fedgiac fedgiac requested a review from MartinquaXD October 10, 2024 07:57
@fedgiac fedgiac removed the request for review from MartinquaXD October 10, 2024 10:01
@fedgiac fedgiac requested a review from MartinquaXD October 10, 2024 10:27
@MartinquaXD MartinquaXD merged commit 5ed4731 into main Oct 11, 2024
1 check passed
@MartinquaXD MartinquaXD deleted the support-constant-appdata branch October 11, 2024 07:22
cowmarketing pushed a commit to cowprotocol/docs that referenced this pull request Dec 10, 2024
# Description

Adds a new vulnerability disclosure for ERC-1271 orders.

This used to affect Milkman orders but has been fixed in
cowdao-grants/milkman#1 and related
infrastructure in cowprotocol/milkman-bot#5.
No "official"  contracts are affected by this issue anymore.

## Credits

This issue was brought to our attention thanks to the report by Quantura
Tech with their analysis of the negative effects on the solver
competition when order fees can be manipulated.

## Reference

Internal discussion about the disclosure
[here](https://cowservices.slack.com/archives/C03JTHY9CUU/p1727861224310599).
harisang pushed a commit to cowprotocol/docs that referenced this pull request Jan 16, 2025
# Description

Adds a new vulnerability disclosure for ERC-1271 orders.

This used to affect Milkman orders but has been fixed in
cowdao-grants/milkman#1 and related
infrastructure in cowprotocol/milkman-bot#5.
No "official"  contracts are affected by this issue anymore.

## Credits

This issue was brought to our attention thanks to the report by Quantura
Tech with their analysis of the negative effects on the solver
competition when order fees can be manipulated.

## Reference

Internal discussion about the disclosure
[here](https://cowservices.slack.com/archives/C03JTHY9CUU/p1727861224310599).
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.

2 participants