Grant Proposal – Milkman

Hi @charlesndalton, thank you for putting together this grant proposal.

As a member of the grants committee, I just wanted to inform you that we are finalizing a document with the final structure of the grant, and will share with you for comments early next week.

Thank you for your patience and support :cow:

2 Likes

Hi @charlesndalton,

After some discussions, the grants committee feels comfortable with the following grant structure: CoW GRANT 2 - HackMD.

Let us know what you think of it, and we move forward with the next steps.

1 Like

Hi @Master_CoW,

At a high level, this works.

One question: I see a reference to a typescript SDK: “Test suite for the smart contracts as well as for the SDK around it (typescript components etc).” This hasn’t been discussed thus far (at least with me). Perhaps someone from the committee could expand?

1 Like

Hey @charlesndalton

Let me try to clarify what we mean by this sentence:

  • Test suite for the smart contracts as well as for the SDK around it (typescript components etc).

In regards to test suit for the smart contracts, it expected to have such contracts unit tested. From what we have been able to see in your github (milkman/test_cancel.py at main · charlesndalton/milkman · GitHub for example) you have already performed some of these tests. To mark this deliverable as completed, the grants committee expects to have at least >95% of the smart contract unit tested.

In regards to the Test suit for the SDK, it expected to have some python code that demonstrates using the contract for an actual trade. In other words, an end-to-end test that showcases how the system is supposed to be used & work. This test should be through enough to demonstrate that the systems works as expected.If this is not clear, happy to set up a call to discuss further.

Let us know if this is clear enough.

1 Like

Yep, makes sense!

I will add some code examples on how someone using ape-safe could create swaps with the different price checkers :+1:

2 Likes

Awesome, looking forward to this.

Then the next steps would be to sign the CoW Grants DAO Agreement and we kick off this endeavor :slight_smile:

I will reach out to you once I have it.

1 Like

This is a test of something we need to do to move the grant forward, but I want to make sure that only the relevant parties can vote.

Like milk?
  • Yes
  • No

0 voters

1 Like

This is a great idea to test sentiment. Well done

Hi,

After all the comments back and forth, its finally the time to signal if the grant moves forward. For this, I would ask both the @cowgrantscommittee and @charlesndalton to read the final text of the grant here.

Additionally, it is needed the grants committee and charles signal that the proposal is moving forward via the following poll.

Should CoW Grants fund CoW Grant Proposal 2 - Milkman Smart Contracts?
  • Yes
  • No

0 voters

The first payment of this grant (10k xDAI) was processed on October 18th: Transaction 0xb1dfba9f777c7cbec5713a6d1326f949a5e30967ca11c3f11fabd05c323dcd9f - Gnosis Chain Explorer

@charlesndalton it would be greatly appreciated if some progress updates are posted to this thread, especially if there’s any significant progress achieved, or delays hit. (But any update is good)

1 Like

Yep, sounds good :+1:

Here’s current status:

  • Core Milkman contract is done and milkman bot is in workable state. Both have been integration tested on Goerli.
  • The core Milkman contract is pending audit by Nicholas, and then hopefully Frederico once Nicholas is done.
  • G0 audit is scheduled for November 14th.
  • Unit tests are passing for the UniV2 price checker, the Curve price checker, the Chainlink price checker, and the UniV3 price checker. A meta price checker that uses multiple price checkers still to be done.
2 Likes

Another community update (I figure every ~2 weeks is a good rhythm, someone can tell me otherwise if not):

  • Docs are there now for both Milkman (how to use it) and the Milkman bot (how to run it)
  • Meta price checker is done, and all price checkers have been refactored to make them more modular. 72/72 tests currently passing
  • Milkman bot is pretty close to done. All of the logic is there, just tests need to be added
  • Unfortunately, it looks like we might not be able to have a Balancer price checker, at least for initial launch. The problem here is that to be EIP-1271-compatible, we need isValidSignature to be view, but Balancer’s queryBatchSwap is non-view. UniswapV3 has a similar problem but I was able to find a ‘static quoter’ which returns prices from a view function; I’m engaged with Balancer, and it looks like this doesn’t exist here. If it were ever added though, it should be easy to add the Balancer price checker.
3 Likes

Another update:

  • Audit by g0 complete
    • Some changes to core Milkman contract, such as requiring that requestSwapExactTokensToTokens is only called on the ‘root’ Milkman and cancelSwap and isValidSignature are only called on ‘order contracts’ (EIP-1167 clones)
    • No major security issues found
    • I expect Adam from g0 to publish a report
  • Some changes were made to the cow.fi endpoints, Milkman and the bot have been adapted to these changes and are passing integration tests
    • Logic to estimate fees in python integration tests
    • Logic to estimate fees in Milkman bot
  • Going to prod is dependent on the EIP-1271 changes in cow.fi being pushed out of barn and into prod – I expect that Milkman can go to prod within 1-2 weeks of this

TL;DR: the light at the end of the tunnel is near :slightly_smiling_face:

2 Likes

Hey @charlesndalton, would love to get another update!
Excited to see this fully shipped
Also would like to know if when should we start evaluation before completing the second payment?

1 Like

Sure thing!

Yesterday was go-to-prod day :partying_face:

Everything should be ready for review / evaluation. For completeness, here’s a more in-depth status on each of the parts:

  • Milkman contract: 100% final, etched into Ethereum stone @ 0x11C76AD590ABDFFCD980afEC9ad951B160F02797
  • Price checkers: done and deployed. This includes price checking for Uniswap V2, SushiSwap, Uniswap V3, Curve, Chainlink, and multiple of those at the same time. Deployment addresses are listed here: milkman/DEPLOYMENTS.md at main · charlesndalton/milkman · GitHub.
  • Milkman bot: stable and working in production, so far hasn’t encountered any issues with the swaps that I’ve thrown at it
  • Python SDK: deployed to PyPi @ milkman_py 0.1.1

So we’re in a good spot. Given that price checker, the bot, and the SDK aren’t as unchangeable as the core Milkman contract, I expect future improvements and additions.

2 Likes

Confirming publicly here that the grant has been accepted as completed.

2 Likes

Final payment of the grant has been processed