[BUG] Fix swap method for ETH>>USDC market on Optimism#150
[BUG] Fix swap method for ETH>>USDC market on Optimism#150shreyaspapi wants to merge 1 commit intoRicochet-Exchange:v2from
Conversation
mikeghen
left a comment
There was a problem hiding this comment.
@shreyaspapi, I can simulate this in tenderly. If you can take a further look at the tests to get it working with optimism, that would be a huge help. Eventually Id like to be able to run tests against all the networks for all the markets, a comprehensive integration test, you see what I mean?
| ISETHCustom(address(inputToken)).downgradeToETH( | ||
| inputToken.balanceOf(address(this)) | ||
| ); | ||
| } |
There was a problem hiding this comment.
LGTM, this is how I had it in mind, downgrade is the common case so try that first, if that method doesn't exist use downgradeToETH
|
@shreyaspapi, I think I have a good solution, maybe swap the left over tokens to RIC and the IDA distribute the RIC? Something to consider. I also think implementing |
Description
The swap method for the ETH>>USDC market is currently not working on Optimism. This PR adds a try-catch block to the swap method to check if the downgrade method is available, which should fix the issue.