- This fee is not the same depending on the fork. For example, Pancake V2 uses a 0.25% fee, while the USV2 fee is 0.3%. We were wrongly hard-coding this fee to 0.3%.
- We have decided to now support calling our executors normally (without using delegatecalls) since they now support specifying token transfers.
- This was disabled for UniswapV3 in the past also because of data decoding issues. This seems to be the solution, though.
Do our own implementation. In the end this is much cleaner than I expected and I was able to do a few improvements:
- we don't need to use actions. using function selectors and delegate call instead
- we don't need to convert into V4 Router types
- we don't need to check balances to get the amount out, we can just use the returned value
--- don't change below this line ---
ENG-4437 Took 3 hours 56 minutes
Took 3 minutes
Took 11 minutes
Only the first swap of a SwapGroup would actually get a transfer in, so we don't need to do this inside of the swaps loop
Rename in_token and out_token to token_in and token_out in SwapGroup
--- don't change below this line ---
ENG-4446 Took 22 minutes
In both encoding and contracts:
- Make sure that the tests names/encoder match what is happening (we had test_split_... that was only a single swap).
- Made modules inside the encodings tests
- In swap_encoders: there is one module per protocol
- In strategy_encoders: there is one module per strategy and an extra protocol_integration module. Inside the sequential module there is another module called chained_swaps
- In contracts, each strategy has its own file. Integration tests per strategy should also be here. Renamed TychoRouterIntegration to TychoRouterProtocolIntegration. Only protocol integration tests should be in this file
--- don't change below this line ---
ENG-4327 Took 1 hour 13 minutes
- In Tycho Router
- Fix integration tests
- If the trade is cyclical, we can't do the balance check for the correctness of the amountOut transfers
- In encoding,
- if it is a wrap trade, the transfer should be just a normal Transfer (not TransferFrom nor a Permit2Transfer)
- add test names to println! statements
--- don't change below this line ---
ENG-4315 Took 1 hour 0 minutes
Took 30 seconds
Took 21 seconds
Took 16 seconds
Took 17 seconds
Add transfer in Executor and pass receiver address in encoding
This is done by using the TAKE action instead of TAKE_ALL
--- don't change below this line ---
ENG-4315 Took 1 hour 36 minutes
Took 2 minutes
- Also do some renamings and comment improvements:
transfer method -> type
- Remove integration tests since we no longer support direct calls to USV3 executor, even for testing.
- This needed to be in BalancerV2 so that the executor can also take care of transfers from the user into the tycho router, to avoid having transfer actions mixed between the router and executors
Add transfer in Executor and pass receiver address in encoding
Remove integration test with StETH pool because we don't support it at simulation level and there is something weird with the amounts (that it is not worth it to investigate now)
--- don't change below this line ---
ENG-4315 Took 34 minutes
Took 2 minutes
- This needed to be in Curve so that the executor can also take care of transfers from the user into the tycho router, to avoid having transfer actions mixed between the router and executors
- The out transfer is now a responsibility of the Executors -> remove this from router methods
- Also adding a check that the receiver got the full amount out
- In encoding, if it is the last swap, pass the receiver as the trade receiver and not the router address (fix encoding tests)
- Fixed some solidity tests (after rebasing with a PR that is still open, I will fix them all)
TODO: Adapt curve and uniswap v4 to support this
--- don't change below this line ---
ENG-4315 Took 3 hours 7 minutes
Took 20 minutes
Took 59 seconds
Took 7 minutes
- Renamed ExecutorTransferMethods to TokenTransfer to avoid leaking information about how the transfer happens into the executor. The executor shouldn't care if there are multiple methods or one single method that takes care of everything.
- Also renamed TransferMethod to TransferType to match the rust encoding
- This arbitrary sender should be same, since the sender is always set to be msg.sender from within the contract (no calldata can be sent specifying otherwise). This is just used to circumvent msg.sender being the pool/protocol during callbacks.