balancer / scaffold-balancer-v3

Starter kit for creating custom pools and hooks contracts on Balancer v3
https://scaffold-balancerv3.vercel.app
MIT License
28 stars 44 forks source link

Upgrade to latest version of SE-2 frontend #43

Open MattPereira opened 5 months ago

MattPereira commented 5 months ago

Overview

Since starting this build, SE-2 has released a major upgrade migrating from using the v1 versions of viem and wagmi to using the v2 versions instead.

Upgrading versions would allow for parsing of the event logs of the transaction receipts for swaps, joins, and exits. Viem v1 lacked support for this so I ended up setting up an event listener that points at the deployed contract which causes a lag between when the tx executes and when the frontend updates.

Since the migration from v1 to v2 versions is fairly intensive and involves many changes to a lot of the custom hooks and components, the best strategy may be to transplant the content of the current scaff bal frontend into the latest version of a fresh SE-2 frontend.

The backend packages/foundry folder will remain unchanged

MattPereira commented 2 months ago

Looks like this upgrade will be needed in order to take advantage of the SDK's buildCallWithPermit2 because it relies on viem v2 Client which is different from viem v1 Client

EDIT: I misunderstood the SDK. Permit2Helper is only for internal testing. buildCallWithPermit2 is now being used for this project