feat(currency-creator): fund currency launches with any currency#1095
Merged
Conversation
Create a currency paying with USDF or another launchpad currency: - Funding-source token picker inside the flow (its own top bar hidden to avoid stacking), with a "Ready To Create?" confirmation before paying. - launchToken mints and funds in one call, routing on the funding token — USDF via a plain buy of the freshly-launched stub, any other currency via the treasury-funded cross-currency swap that creates and funds the new currency in a single transaction. - Split the overloaded crossCurrencySwap into an explicit swap (existing currencies) and launchToken (treasury launch); the launch's full-amount exchange data and funding intent report funding-token quarks valued at the exact USD launch cost, per the server contract. - Intro gate now checks any held currency (no balance vs. insufficient).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a new currency be created paying with USDF or another launchpad currency (a treasury-funded cross-currency swap), rather than USDF reserves only.
UI
ConfirmPurchase→ modal → launch).Service layer (opencode)
launchTokenmints and funds in one call, routing on the funding token:buyof the freshly-launched stub.crossCurrencySwap(which switched modes on a nullablefullAmountExchangeData) is split intoswap(existing-currency swaps) andlaunchToken(new-currency treasury launch). The internal exchange-data type no longer leaks into the app-facing interface.TokenCreateRequestcarries aFundingdescribing how the launch is paid for; the service decides buy vs. swap and builds the exchange data from it.Server contract (treasury swap)
The new-currency swap's
full_amount_exchange_dataand the funding intent are validated against the ocp-server rules:quarksare funding-token quarks (the reserve sells them),native_amountis the exact USD launch cost in USD, and the fee is likewise funding-token quarks valued at its USD amount. A smallVerifiedFiat.valuedAt(...)helper pins the native to the exact cost (kept in the transaction controller so the exchange-data construction is self-contained).