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

Split accounts #246

Merged
merged 25 commits into from
Oct 17, 2023
Merged

Split accounts #246

merged 25 commits into from
Oct 17, 2023

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented Oct 16, 2023

Some scaffolding for splitting accounts, early feedback appreciated

@vercel
Copy link

vercel bot commented Oct 16, 2023

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

Name Status Preview Comments Updated (UTC)
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 5:19pm
staking-devnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 5:19pm

@guibescos guibescos changed the title Split accounts2 Split accounts Oct 16, 2023
Copy link
Collaborator

@jayantk jayantk left a comment

Choose a reason for hiding this comment

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

I'm not sure i understand how this is supposed to work. I think I get the split part -- you request a split, and it creates a PDA for the request, and that guarantees there can only be one split request for a given stake account.

I don't understand the approve part though. It seems like the current logic is leaving the positions and stuff in an inconsistent state (?) If that's the intent, I suggest making the instruction a noop and filling in the logic in a later PR (not like you have a ton of stuff in there now). That seems a little safer, and also clearer that the code isn't complete.

staking/programs/staking/src/context.rs Show resolved Hide resolved
staking/tests/split_vesting_account.ts Outdated Show resolved Hide resolved
staking/programs/staking/src/lib.rs Show resolved Hide resolved
* give a part of it to another user. This is mostly useful to transfer unvested
* tokens.
* In the first step, the user requests a split by specifying the `amount` of tokens
* they want to give to the other user and the `recipient`'s pubkey.
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggest adding: "each user can only have one active split request at a time"

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