We don't know the pool tokens in the ProtocolComponent, so we can't infer the indexes correctly. Added a call to the MetaRegistry curve contract to get the correct token indexes. To do this, I had to move the get_client to utils. We could actually refactor the transaction logic into its' own struct and use it here and in the approval logic
It was assumed that all the pools will have a "factory" static attribute, even if empty
--- don't change below this line ---
ENG-4306 Took 2 hours 28 minutes
Took 27 seconds
We don't need to use all the functionalities of the Curve Router, only the swap type 1 (exchange). By bypassing the router we can save gas on 2 token transfers and with smaller calldata
A nice side effect is that the executor is much more readable and understandable now
--- don't change below this line ---
ENG-4305 Took 2 hours 25 minutes
Took 12 seconds
- Needed to take pool code init hash as input param for executors
- Added tests for ethereum. Will test base on-chain.
- Important note: Pancakeswap uses their deployer instead of their factory (this is a different address) for target verification.
- This factory is not the same for Ethereum and Base, so Base txs were failing when verifying pool addresses.
- I've double checked that we don't have this problem for Balancer V2 - the vault address in the same on Base and on Ethereum Mainnet.
The selector and executor are decoded inside this function now.
For Uniswap V3 I had to manually slice the msg.data from uniswapV3SwapCallback to get the data that matters for the callback
Took 3 hours 12 minutes
Construct the uniswap v4 specific objects inside the executor
The swap test in the executor alone doesn't work anymore because of the callback data prepended to the rest of he calldata
--- don't change below this line ---
ENG-4222 Took 4 hours 0 minutes
Took 40 seconds
Make TychoRouter inherit from SafeCallback and then delegatecall to the UniswapV4 executor
Add a test for this. I had to update the block of our forked network in the tests. Because of this I had to update all the asserts in previous tests
Had to change the optimizer_runs in foundry.toml because of weird Yul errors when compiling
--- don't change below this line ---
ENG-4223 Took 1 hour 21 minutes
Took 7 seconds
Took 35 seconds