Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native USDC Support Revisions #75

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

psparacino
Copy link
Collaborator

@psparacino psparacino commented Dec 13, 2024

Given there is no apparent native usdc liquidity in v2 pools, if thesourceToken is native usdc then an initial swap to bridged takes place, which is then used for the subsequent operations.

If there is dust post-retirement and the originalSourceToken was native, then bridged is swapped back to native before returning dust to the user.

Quotes:

This PR depends on the uniswap view quoter: https://github.com/Uniswap/view-quoter-v3. I couldn't locate reference to the view quoter in their docs but in every other respect has been reliable.

RetirementQuoter uses quoteExactOutputSingle so the exact amount of usdc required for the retirement is returned.

Retire functions then optimistically use exactInputSingle given the quote is already returning amountIn of the sourceToken.

Tests:

Applicable tests updated for native usdc as source.

There were several others broken/out-of-date tests (ICR, Bonds) which also have been fixed along the way. Ownership and a few bond tests still failing, but those fail on main and can be adjusted in a follow up PR.

Notes:

  1. The usdc -> usdc.e swap logic could potentially have gone in the getSourceAmount and related functions, but the goal here was to keep v3 and v2 functions and operations distinct.

  2. The following functions: c3RedeemPoolDefault, toucanRedeemExactCarbonPoolDefault, retireExactSourceSpecific, retireExactSourceDefault are currently not used in any app or api, and therefore have not been updated.

  3. forge versions might have changed since the last main merge. Potential dependent PR: Forge format on repo #76

To-Dos:

  • multisig-proposal script

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
solidity ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 5:30pm

@psparacino psparacino changed the title Native USDC Support Native USDC Support Revision Dec 17, 2024
@psparacino psparacino changed the title Native USDC Support Revision Native USDC Support Revisions Dec 17, 2024
const signature = await protocolKitOwner1.signHash(safeTxHash);

// Propose transaction to the service
await apiKit.proposeTransaction({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool will re-use this template to push the marketplace upgrades as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants