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

External Treasury with config as delegate #31

Merged
merged 4 commits into from
Aug 2, 2023
Merged

Conversation

swimricky
Copy link
Contributor

Summary

Change the treasury to be externally initialized and supplied with tokens. The config will have to be approved as a delegate using the spl-token approve instruction.

This provides 2 benefits:

  1. giving an instant kill-switch by revoking the config as a delegate ( using the spl-token revoke instruction)
  2. No need for an additional instruction if we need to transfer out excess tokens

Notes

  1. If the initial approve_amount for the config/delegate is less than the total amount in the treasury, we will need to monitor the treasury.delegated_amount and periodically re-submit an approve ix.

@vercel
Copy link

vercel bot commented Aug 1, 2023

@swimricky is attempting to deploy a commit to the pyth-web Team on Vercel.

To accomplish this, @swimricky needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.


let mut simulator = DispenserSimulator::new().await;
let claimant_1 = Keypair::new();
let claimant_1_airdrop_ix = system_instruction::transfer(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we replace this by an airdrop function in dispenser_simulator

Copy link
Contributor

@guibescos guibescos left a comment

Choose a reason for hiding this comment

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

Awesome, please address the one comment

@swimricky swimricky merged commit 3c48287 into main Aug 2, 2023
3 checks passed
@swimricky swimricky deleted the treasury-delegate branch August 2, 2023 14:55
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