-
Notifications
You must be signed in to change notification settings - Fork 5
feat: configurable fees receiver #90
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
Open
Dodecahedr0x
wants to merge
30
commits into
main
Choose a base branch
from
feat/fee-receiver
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a9bffed
feat: configurable fees receiver
Dodecahedr0x fa71919
feat: remote claim admin
Dodecahedr0x 1ff8e98
docs: fix
Dodecahedr0x ab07130
Merge branch 'main' into feat/fee-receiver
Dodecahedr0x e7cf69c
fix: move fees receiver to fees vault PDA
Dodecahedr0x 932f418
Merge branch 'main' into feat/fee-receiver
Dodecahedr0x ce0a0c5
test: assert fees vault
Dodecahedr0x 90e02a1
test: wrong receiver
Dodecahedr0x 794d846
fix: remove program config changes
Dodecahedr0x 04d31e2
feat: prevent fees vault as receiver
Dodecahedr0x d06db16
feat: get rent sysvar
Dodecahedr0x 58bad68
docs: refer to fees vault
Dodecahedr0x 60552e9
feat: use default fees vault on migration
Dodecahedr0x 364abb2
feat: load system program
Dodecahedr0x 584d0bc
feat: remove unused program
Dodecahedr0x bd8dd99
test: helper for common code
Dodecahedr0x 74c5e7f
docs: removed irrelevant change
Dodecahedr0x e41c86e
test: check state
Dodecahedr0x e42869f
feat: remove unused program account
Dodecahedr0x 09760e9
docs: fix comments
Dodecahedr0x 0102b0b
test: match specific error
Dodecahedr0x 7b1fb92
feat: short circuit no-op transfer
Dodecahedr0x 42ce607
test: assert balance after
Dodecahedr0x fc11856
test: unauthorized
Dodecahedr0x efce731
feat: compute rent using actual account
Dodecahedr0x 1117c3e
docs: fix comment
Dodecahedr0x fa55c6e
test: assert balances unchanged
Dodecahedr0x 16ecbac
test: assert state unchanged
Dodecahedr0x d974afb
feat: cache balances
Dodecahedr0x 16b560b
test: edge cases
Dodecahedr0x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| use borsh::{BorshDeserialize, BorshSerialize}; | ||
| use solana_program::pubkey::Pubkey; | ||
|
|
||
| #[derive(BorshSerialize, BorshDeserialize)] | ||
| pub struct SetFeesReceiverArgs { | ||
| pub fees_receiver: Pubkey, | ||
| } |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| use borsh::to_vec; | ||
| use solana_program::instruction::Instruction; | ||
| use solana_program::{ | ||
| bpf_loader_upgradeable, instruction::AccountMeta, pubkey::Pubkey, system_program, | ||
| }; | ||
|
|
||
| use crate::args::SetFeesReceiverArgs; | ||
| use crate::discriminator::DlpDiscriminator; | ||
| use crate::pda::fees_vault_pda; | ||
|
|
||
| /// Set the fees receiver. | ||
| /// See [crate::processor::process_set_fees_receiver] for docs. | ||
| pub fn set_fees_receiver(admin: Pubkey, fees_receiver: Pubkey) -> Instruction { | ||
| let fees_vault_pda = fees_vault_pda(); | ||
| let delegation_program_data = | ||
| Pubkey::find_program_address(&[crate::ID.as_ref()], &bpf_loader_upgradeable::id()).0; | ||
| Instruction { | ||
| program_id: crate::id(), | ||
| accounts: vec![ | ||
| AccountMeta::new(admin, true), | ||
| AccountMeta::new(fees_vault_pda, false), | ||
| AccountMeta::new_readonly(delegation_program_data, false), | ||
| AccountMeta::new_readonly(system_program::id(), false), | ||
| ], | ||
| data: [ | ||
| DlpDiscriminator::SetFeesReceiver.to_vec(), | ||
| to_vec(&SetFeesReceiverArgs { fees_receiver }).unwrap(), | ||
| ] | ||
| .concat(), | ||
| } | ||
| } | ||
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.