Skip to content

Add Wormhole Solana Staking Program #78

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

Merged
merged 131 commits into from
Sep 3, 2024

Conversation

zpoken
Copy link
Collaborator

@zpoken zpoken commented Jun 27, 2024

No description provided.

@zpoken zpoken requested review from alexkeating and nik-suri August 29, 2024 21:29
@zpoken zpoken merged commit 0596370 into main Sep 3, 2024
4 checks passed
@nik-suri nik-suri deleted the feature/draft-solana-staking-program branch September 3, 2024 16:43
marcomariscal pushed a commit that referenced this pull request Dec 9, 2024
* Add configs and structs for StakeAccount

* Add clock utils

* Add ErrorCode

* Add context

* Add init_config function

* Add basic account update functions

* Add fn recover_account

* Add fn create_stake_account

* Add a script to create a verifiable build of the project

* Add tests of configuration and staking account creation

* Add Wormhole token to tests

* Add Wormhole staking-wasm

* Add more config files and scripts

* Fix warning after build. Update wasm staking

* Exclude wasm files from repository tracking

* Use older versions of dependencies

* Add target idl and types

* Fix mock-clock

* Use @pythnetwork/staking-wasm in tests (temporarily)

* Fix tests

* Fix configuration tests

* Add basic definitions for checkpoints to stake account program

* Add Wormhole Governance realm for the use of solana spl-governance

* Use local staking-wasm

* Add VoterWeightRecord from solana-program-library governance

* Fix checkpoints tests

* Fix GlobalConfig size

* Rename to CHECKPOINT_DATA_SIZE

* Update basic functionality of checkpoints

* Fix CheckpointData and CheckpointData tests

* Add fn get_at_probably_recent_timestamp

* Update IDL and types

* Add more tests for CheckpointData

* Add fn delegate

* Add getAllStakeAccountAddresses and getStakeAccounts

* Add api test

* Add interface for delegate

* Fix Delegate context and interface

* Add utils::voter_votes

* Fix test_get_votes

* Add WasmCheckpointData

* Add getVotes interface

* Add voter_votes test

* Add get_past_votes and test_get_past_votes

* Add getPastVotes interface

* Add deploy scripts

* Add delegates interface

* Fix CheckpointData::LEN

* Use cargo fmt

* Apply prettier

* Add prettier config

* Fix staking account creation test

* Fix interface tests

* Fix Delegate context

* Update .gitignore

* Fix WasmCheckpointData. Update tests and interfaces

* Add fn cast_vote

* Add draft state for Proposal and ProposalVotersWeightCast

* Update cast vote

* Add castVote interface

* Fix warning

* Add proposal::proposal_votes

* Convert the identifier to snake case

* Add proposalVotes interface

* Add withdrawTokens interface and test

* Add safe_window and is_voting_safe function

* Add events

* Add add_proposal. Update idl and types

* Add addProposal simple interface

* Add test for addProposal

* Fix test for addProposal

* Add event ProposalCreated

* Add test proposalVotes

* Fix Delegate context. Fix all interface tests

* Add test castVote

* Remove transfer_epoch

* Remove epochDuration

* Reduce the delegate votes when withdrawal

* Fix withdrawTokens. Add withdrawTokens test

* Update test getVotes

* Rename to proposalId

* Fix is_voting_safe. Add isVotingSafe test

* Remove voterWeightRecord

* Remove realm

* Remove spl-governance

* Fix tests

* Update wasm

* Update StakeAccountMetadata::LEN

* Update Solana CLI, Anchor, Node.js and dependencies

* Refactor Checkpoint serialization methods

* Update Cargo.lock

* Use cargo update

* Implement Anchor serialization for Checkpoints struct. Update idl

* Fix warning: use snake case

* Fix warning: delete unused imports and variables

* Update ts tests and app after dependency update

* Add check_size tests

* Small but important corrections

* Update spl-token functions calls

* Quick small fix

* Fix types mismatch

* Use findProgramAddressSync

* Add a script for custom devnet testing

* Add a script to create a stake account in devnet

* Add a script to withdraw WH tokens in devnet

* Add more authority keys. Update scripts for devnet

* Add script for addProposal testing in devnet

* Remove dump_governance

* Add script to delegate in devnet

* Remove optional instruction definitions. Use accountsPartial for proposal accounts

* Update interfaces

* Fix delegate interface

* Add script for castVote testing in devnet

* Add script to proposalVotes in devnet

* Fork and update solana-utils

* Update devnet scripts

* Fix requestWHTokenAirdrop

* Fix index out of bounds error during anchor idl init execution

* Fix filters field in getProgramAccounts

* Update checkpoints max size and CheckpointData::LEN

* Fix all tests

* Apply cargo fmt

* Apply prettier

* Add script for get program transactions

* Add script to get full transaction details

* Add script to decode events from log messages

* Refactor decodeEventsFromLogMessages

* Add printTransactionEvents

* Add multi-user interface testing

* Add check before adding WH token transfer instruction

* Update ts interfaces and fix tests
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