Grant Application: Cow protocol — upgrade to Ethers V6


Grant Title:

Ethers.js v5 to v6 Upgrade and SDK Agnosticism for Cow Protocol


Author:

This implementation of the project will be carried out by: @AbhishekKochar


About You:

I’m a blockchain engineer with over 4 years of experience, specialising in working with multiple DeFi protocols. My expertise primarily lies in developer tools and smart contract development.


Additional Links:

Github: Abhishekkochar (Abhishek kochar) · GitHub


Grant Category:

Developer tools


Grant Description:

In response to this RFG, I aim to upgrade the @cowprotocol/cow-sdk & cowswap from ether-V5 to ether-V6.

This will also require me to do the following:

  • Remove dependency on @cowprotocol/contractspackage. Import all the necessary function to @cowprotocol/cow-sdk .
  • Refractor Cowswap dependency from @cowprotocol/contracts to @cowprotocol/cow-sdk .
  • Investigating 3rd-party packages dependency on ether.js. Updating packages to appropriate version accordingly,
  • Similar changes will be made on related sub-projects like explorer.
  • Thorough testing of updated projects in staging environments.
  • Finalize documentation and migration guides.
  • Deploy and monitor updated versions.

Note: Github repository will be public. Changes will be made to the existing repository.

  • ether-v6 will serve as a main branch. All changes related to this upgrade will be made to this branch.
  • Upon successful completion of the migration to Ether-V6, a PR will be created to push the changes to main branch.

RFP: Ethers.js v5 to v6 Upgrade and SDK Agnosticism for Cow Protocol

Funding Request:

A total of 15,000 EURO denominated in xDAI token (Gnosis Chain).


Milestones

Milestone Task Due Date Payment
Milestone 1 Remove dependency @cowprotocol/contracts package on both @cowprotocol/cow-sdk and Cowswap along with passing affected tests. Migration to ether-v6 on both @cowprotocol/cow-sdk and Cowswap , along with existing passing and additional tests if required. 2 weeks 6000 EURO
Milestone 2 Changes to all sub-projects like explorer. Update documents and examples 1 week 2000 EURO
Milestone 3 Modular adapters for blockchain interactions, utilising both Ether.js and Viem, along with documentation. 3 weeks 7000 EURO
NOTE: Payment denominated in xDAI.

Gnosis Chain Address (to receive the grant):

gno:0xa87a0BE15A8507e0e652f80B0f898301c9a7906D


Terms and Conditions:

By submitting this grant application, I acknowledge and agree to be bound by the CoW DAO Participation Agreement and the CoW Grant Terms and Conditions.

2 Likes

Hi,
Thanks for your application. Given the comprehensive and technical nature of this grant, can you please identify links to projects (specific repositories), where you have contributed developer related tooling / SDKs?

Additionally, given the size of this, I would suggest breaking things down into specific milestones and payment to be made upon milestone completion. For example, a refactor extracting the @cowprotocol/contracts dependency with tests migration, ethers-v6 migration with tests, followed by documentation / example updates etc.

Would be nice for feedback as well from @shoom3301 and/or @anxolin.

mfw78.

2 Likes

Hi,

Thanks for the quick message.
Following are some of the open source projects I developed with ether.js and other libraries.

Liquidity mining: GitHub - BirthdayResearch/liquidity.dfi.dev: CFP-2207-17: DFI Liquidity Mining Program.,
Quantum bridge: GitHub - BirthdayResearch/quantum: Quantum is a trusted, bi-directional bridge that directly connects DeFiChain (DFI) and Ethereum (ETH).,

Edit: Added milestones table.

Thanks for the proposal @No-rush.

I´d like to understand more the complexity of the project, as far as I can tell, there´s a very manageable number of uses of the ethers library. 64 in CoW Swap and 22 in the SDK. These uses are uilising over and over the same types and functions, furthermore, from the 64 in CoW Swap, 47 are auto-generated code that could go away. So I would think there are only a handful of functions to migrate.

Therefore, the migration 5 to 6 shouldn’t be that hard in my opinion. There’s also guides and even IA can assist in giving the conversion from one to the other, so it looks at first sight that milestones 1-4 would not require so many weeks.

I’m particularly interested in Milestone 5, especially for the SDK, I would like to see that one earlier.

Lastly, I’m not sure we should leave CoW Swap with ethers-6 after these changes, once this is abstracted and we can use any library I would be inclined to use viem in CoW Swap.

1 Like

Hi @anxolin,

You are correct, I have updated the timeline accordingly. Additionally, I have added one week to the milestone 3.

For milestone 3, View will also be the part of the abstraction layer. It skipped my mind. To be clear, both Ether.js and View will be the part of abstraction layer.

Edit: Updated milestone.

hey - just wanted to let you know that the team is a bit busy and might also need some more time to review. There is also at least one additional team we know of that will apply.
I kindly ask to be a bit patient: likely this will be another week pending.
Thanks so much!

1 Like