-
Notifications
You must be signed in to change notification settings - Fork 72
Add return_funds instruction to Launchpad v6
#387
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
base: develop
Are you sure you want to change the base?
Conversation
| ); | ||
|
|
||
| // Transfer wrongly sent USDC to the launch signer | ||
| await this.transfer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Wut?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Launch signer controls the launch USDC vault, so this essentially raw sends USDC to the signer's vault. I've updated the comment to better reflect this.
| amount_wrongly_sent.toNumber(), | ||
| ); | ||
|
|
||
| await launchpadClient.launchpad.methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add an idempotent I think...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. Didn't really think about it as USDC is so ubiquitous, but it makes sense.
| let signer = &[&seeds[..]]; | ||
|
|
||
| // Transfer USDC back to the recipient | ||
| token::transfer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does transfer handle the idempotent create?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't (or at least shouldn't).
…return funds test.
Adds an admin-only instruction that allows the MetaDAO operational multisig to recover USDC from a launch's quote vault by transferring it to a specified recipient.
Motivation
This instruction serves as a recovery mechanism for funds that may have been mistakenly sent directly to a launch's quote vault outside of normal program flows (e.g., accidental transfers). Without this, such funds would be permanently locked since only the launch's PDA signer can authorize transfers from the vault.
Changes
return_fundsinstruction that transfers a specified amount of USDC fromlaunch_quote_vaultto a recipient's associated token accountLaunchFundsReturnedEventemitted on each recovery for off-chain trackingInvalidAdminerror codeNotes
Launchaccount other than incrementingseq_num