Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
ae57453
update restaking program.
RustNinja Sep 17, 2024
7a50e89
add whitelisted_token to prevent deposit for not allowed tokens.
RustNinja Sep 17, 2024
9bd6c83
add validation to allow withdraw or deposit only if token mint allowed.
RustNinja Sep 17, 2024
b3655fa
introduce update_token_whitelist instruction for staking contract.
RustNinja Sep 17, 2024
1a537aa
new pause params for init instruction. + update_token_pause_flag_staking
RustNinja Sep 17, 2024
11e2073
do not allow stake if common state paused is paused.
RustNinja Sep 17, 2024
d2939af
added unstaking period as a config for initialize + stake status PDA
RustNinja Sep 17, 2024
4fb3512
staked info for new era in deposit instruction
RustNinja Sep 18, 2024
947a456
introduce 2 modes into staking. with/without lsMantis.
RustNinja Sep 19, 2024
51e7dae
fix build adding derive for EpochState struct
RustNinja Sep 19, 2024
89138db
deposit_staking_mode_1 done.
RustNinja Sep 19, 2024
22c36a2
new withdraw_staking_mode_1 that updates stake/unstake lists for user
RustNinja Sep 20, 2024
98e5c30
implement withdraw unbonded stake instruction that return tokens back.
RustNinja Sep 20, 2024
94d8bbe
return error NotEnoughReceiptTokensToWithdraw when nothing to withdraw
RustNinja Sep 20, 2024
9c7fe44
introduce claim rewards instruction and reward_token_account for init
RustNinja Sep 20, 2024
f60f31e
implement claim_rewards with a regroup for optimisation reason.
RustNinja Sep 20, 2024
b751ac3
withdraw_staking_mode allow to withdraw only if user claim rewards
RustNinja Sep 20, 2024
3ddd741
cargo fmt -- only for restaking v2 lib.rs
RustNinja Sep 20, 2024
af35da8
rename fn and increase amount that should be subtract from next era
RustNinja Sep 20, 2024
d2f294c
finalised mode 1, stake, unbond, withdraw, claim, submit reward by admin
RustNinja Sep 20, 2024
cc251dd
implement rebond staking fn. possible to stake token in unbonding state.
RustNinja Sep 20, 2024
bdb9599
extract calc of epoch id into to_epoch_index fn and fix bug in claim fn
RustNinja Sep 21, 2024
0f5f1b8
removed commented code
RustNinja Sep 23, 2024
f6b5b75
update claim_rewards to use remaining account to iterate via epochs
RustNinja Sep 25, 2024
db77e6e
complete submit_epoch_rewards_by_admin with instruction attr for account
RustNinja Sep 26, 2024
ec0d9ee
add validate_remaining_accounts fn to check remaining epochs accounts
RustNinja Sep 27, 2024
f66dd4f
move and update validate_remaining_accounts fn
RustNinja Sep 27, 2024
41df8f6
validate remaining accounts during claim instruction before claim reward
RustNinja Sep 27, 2024
dcef1e1
removed last_200_epochs from common staking account
RustNinja Sep 27, 2024
ea80c73
adapt staking mode 2 with lsMantis to be compatible with mode1(non lst)
RustNinja Sep 27, 2024
c5145d8
staking/unstaking mode2 adapt to work together to track unstake status.
RustNinja Sep 27, 2024
88f0efb
rename withdraw staking into unbond_staking_mode_2
RustNinja Sep 27, 2024
f6c87ff
fix hardcoded index when iterate over remaining account in for.claim fn
RustNinja Sep 27, 2024
77c01ee
checked math. validation on claim.
RustNinja Sep 28, 2024
d556616
fix bug on claim and on initialise instruction
RustNinja Sep 28, 2024
681be54
checked add/sub for safety
RustNinja Sep 28, 2024
bd96b89
update total stake during epoch based how many was unstaked on this time
RustNinja Sep 29, 2024
2c3955f
withdraw staking mode 2 allow to get Mantis after unstaking lsMantis
RustNinja Sep 29, 2024
e59c1a5
update submit_epoch_rewards_by_admin_both_mode to split rewards
RustNinja Sep 29, 2024
3e1200d
remove unnecessary program instruction related to restaking v2
RustNinja Sep 29, 2024
20e09c5
update submit_epoch_rewards to set lsmantis / mantis exchange rate
RustNinja Sep 30, 2024
d2608f5
reset lsMantis/mantis exchange rate to 1 if ls supply is zero
RustNinja Sep 30, 2024
3a7b447
fix build and use f64 as type for lsMantis/Mantis exchange rate
RustNinja Sep 30, 2024
a804093
mint ls mantis and unbond mantis amount according to exchange rate
RustNinja Sep 30, 2024
092c4e1
refactoring. remove unused context struct and unnecessary comments
RustNinja Sep 30, 2024
d9157a6
remove initialize staking for mode 2. token pause update for 2 modes
RustNinja Sep 30, 2024
267d302
add comments for instruction and update add new field to store next rate
RustNinja Sep 30, 2024
7068c8d
docs/comments for each program instruction that now correspond reality
RustNinja Sep 30, 2024
5dcba55
use checked math fn to avoid issue with over/under flow
RustNinja Sep 30, 2024
8ab007f
cargo fmt --
RustNinja Sep 30, 2024
41d5b21
fix build.
RustNinja Oct 1, 2024
09a76d1
update staking contract according to pr comments
RustNinja Oct 2, 2024
c58d5fc
rename error.
RustNinja Oct 2, 2024
7453ed7
Update solana/restaking-v2/programs/restaking-v2/src/lib.rs
RustNinja Oct 2, 2024
167baef
fix build
RustNinja Oct 2, 2024
f6e5df2
add sec to params that mean some timestamp
RustNinja Oct 4, 2024
9c9f1c8
move merkle distributor and verify folders into repo with all contracts.
RustNinja Nov 9, 2024
bc3c582
add deposit_and_stake_and_vest_mode_1
RustNinja Nov 9, 2024
90803b7
call vesting contract to notify about staking/unstaking actions
RustNinja Nov 11, 2024
cf33eb2
update_stake add staking/unstaking events from staking program.
RustNinja Nov 11, 2024
a178c0a
redefine update stake implementation to update unstake time for stake
RustNinja Nov 11, 2024
c083d89
improve update_stake instruction to keep track of partially unstake
RustNinja Nov 11, 2024
9da590a
clean up, refactoring, remove stake/unstake instruction from vesting.
RustNinja Nov 12, 2024
87ea104
rename to staking program. clean up warnings of unused variables.
RustNinja Nov 13, 2024
2452563
basic docs functionally of vesting contract + relationship with staking
RustNinja Nov 13, 2024
5efbfe6
Update staking programs docs.
RustNinja Nov 13, 2024
6bdc753
fix: high audit issues
composable-kvn Dec 10, 2024
96d94f8
fix: audit hgh issue4
composable-kvn Dec 10, 2024
0003e30
fix: audi low issue-14
composable-kvn Dec 10, 2024
87a9f3f
fix: audit low issue - 16
composable-kvn Dec 10, 2024
b99b0e6
fix: audit low issue - 17
composable-kvn Dec 10, 2024
0ddbf43
Merge pull request #6 from composable-kvn/audit-fix-pr2
RustNinja Dec 10, 2024
f30d50f
Merge pull request #7 from composable-kvn/audit-fix-low-14
RustNinja Dec 10, 2024
157ca6f
Merge pull request #8 from composable-kvn/audit-fix-low-15
RustNinja Dec 10, 2024
29f29c2
fix high issue no 4. send reward token from admin to reward acc.
RustNinja Dec 11, 2024
82e5401
Merge pull request #10 from ComposableFi/high-issue-4
RustNinja Dec 11, 2024
1b774d3
high-issue-3. ls mantis rate.
RustNinja Dec 11, 2024
96260cd
Merge pull request #11 from ComposableFi/high-issue-3
RustNinja Dec 11, 2024
3c40fd9
high-issue-5. add validation to claim_rewards_mode_1
RustNinja Dec 11, 2024
28df96f
Merge pull request #12 from ComposableFi/high-issue-5
RustNinja Dec 11, 2024
4a22833
fix high-issue-6
RustNinja Dec 12, 2024
017ac2e
Merge pull request #13 from ComposableFi/high-issue-6
RustNinja Dec 12, 2024
1aa1520
remove line that make unstake_list empty vec during deposit mode 2 instr
RustNinja Dec 12, 2024
60d00fa
Merge pull request #14 from ComposableFi/high-issue-10
RustNinja Dec 12, 2024
2a2acf5
rename variable high-issue-7. no need changes. similar to ibc stake
RustNinja Dec 12, 2024
b25ff38
fix bug in calculation when check consequence of epoch in claim.
RustNinja Dec 12, 2024
c8d74f5
Merge branch 'main' of https://github.com/composable-kvn/mantis-staki…
composable-kvn Dec 12, 2024
b8d1918
fix: introduce Option for effect_vesting
composable-kvn Dec 12, 2024
25e4cd6
fix: resolve conflicts
composable-kvn Dec 12, 2024
270be4f
Merge pull request #5 from composable-kvn/audit-fix-pr1
RustNinja Dec 13, 2024
f2ab490
update anchor toml to deploy staking/vesting with anchor deploy
RustNinja Dec 17, 2024
fa1d646
Merge remote-tracking branch 'origin/main'
RustNinja Dec 17, 2024
65ac0b7
add fn handle_remove_claim for admin to stop vesting for any acc
RustNinja Dec 17, 2024
ccf7694
added remove_new_claim instruction to remove vesting by admin
RustNinja Dec 18, 2024
a8f5fdb
added new instruction admin_new_claim that allow admin to submit vesting
RustNinja Dec 19, 2024
7f26249
added claim_new_claim to allow claimant to claim tokens given by admin.
RustNinja Dec 19, 2024
239ab5c
feat: add initialization script
composable-kvn Dec 19, 2024
2294b68
rename PageState into PageVestingItem, replace remaining accounts to acc
RustNinja Dec 19, 2024
31a3b47
fix: audit info issue - security_txt
composable-kvn Dec 23, 2024
17362c3
Merge pull request #16 from composable-kvn/audit-fix-security-txt
RustNinja Dec 23, 2024
f8f02c5
staking hashmap fix.
RustNinja Dec 23, 2024
b60d22f
Merge pull request #17 from ComposableFi/staking-hashmap-fix
RustNinja Dec 23, 2024
2ac6845
added idl files .ts with a types for program
RustNinja Dec 26, 2024
28a2412
push unit tests for eth signature verification.
RustNinja Dec 26, 2024
fc476bc
add verify polkadot signature
RustNinja Dec 26, 2024
fe9c976
added new fn add_new_vesting_plan_on_solana_mantis. for admin.
RustNinja Dec 26, 2024
6e045d0
prepare to use fn that submit new vesting + refactor vesting.
RustNinja Dec 26, 2024
3955d8d
added actix to enable backend feature for FE to submit signatures
RustNinja Dec 27, 2024
5cc7f6c
enable back end service to be active and accept eth/cosmos/polkadot sigs
RustNinja Dec 27, 2024
a246bb6
Merge branch 'main' into add-init-script
RustNinja Jan 2, 2025
9e717f7
Merge pull request #15 from composable-kvn/add-init-script
RustNinja Jan 2, 2025
53ffe0e
fix Incorrect validations prevents admin to create new claim
RustNinja Jan 6, 2025
822bd57
add validation of clawed_back for handle_remove_claim fn
RustNinja Jan 6, 2025
df6e22f
Merge pull request #19 from ComposableFi/fix-for-audit-2
RustNinja Jan 6, 2025
cab8973
anchor build and redeploy staking.
RustNinja Jan 10, 2025
f214a93
commit new staking idl
RustNinja Jan 14, 2025
cbbada1
update idl file for staking.
RustNinja Jan 14, 2025
e6e829a
update readme with a note how to fix IdlError: TypeNot Found
RustNinja Jan 14, 2025
32e569d
generate IDL for staking/vesting. use Anchor serdeser instead [accounts]
RustNinja Jan 14, 2025
126928b
update anchor
RustNinja Jan 29, 2025
c2037d7
update vesting program to fix idl issue.
RustNinja Jan 30, 2025
a1cb7ad
updated staking program id.
RustNinja Jan 30, 2025
4a77e2e
add cli to instantiate vesting
RustNinja Jan 30, 2025
7538b90
update cli merkle to remove categories stakers/validators/searchers
RustNinja Jan 30, 2025
1a5dafc
update staking script.
RustNinja Jan 31, 2025
f72af9b
update staking. fix solana instruction stack overflow issue.
RustNinja Jan 31, 2025
b790f2f
prepare vesting cli to set a vesting merke tree.
RustNinja Jan 31, 2025
265291b
initialize vesting with cli.
RustNinja Jan 31, 2025
ac429c7
add get_function_hash. to create discriminator.
RustNinja Feb 3, 2025
1961085
add logs about pub key in vesting execution.
RustNinja Feb 3, 2025
299948e
prepare API for FE to validate solana wallet with eth/polkadot signature
RustNinja Feb 6, 2025
802b852
added readme file. how to start new distributor, new claim
RustNinja Feb 7, 2025
b6c6ac6
new staking contract
RustNinja Feb 7, 2025
0bfec7f
anchor updates.
RustNinja Feb 7, 2025
f26f48f
latest changes to allow unbond/withdraw without claming.
RustNinja Feb 7, 2025
cd03f98
port 3125
RustNinja Feb 7, 2025
5590948
add AdminNewClaim command to set up vesting by admin request.
RustNinja Feb 8, 2025
174dff8
fix merkle distributor derive instuction params order.
RustNinja Feb 8, 2025
7b29309
latest anchor program id for vesting.
RustNinja Feb 8, 2025
49b59ec
get_page_account_pda
RustNinja Feb 8, 2025
36cf370
CLI ready to be called from vesting backend api to give vesting by admin
RustNinja Feb 8, 2025
7d79017
make cli possible to call as a lib from vesting backend.
RustNinja Feb 8, 2025
e51b04a
added settestvesting for simple testing of admin env
RustNinja Feb 9, 2025
7ae79ab
enable vesting airdrop for polkadot signature.
RustNinja Feb 9, 2025
85ef19b
enable post body response for eth/polkadot signatures.
RustNinja Feb 9, 2025
ec2a29f
add readme file.
RustNinja Feb 9, 2025
b754343
readme more info.
RustNinja Feb 9, 2025
e0f0028
adapt signature for FE. finalised.
RustNinja Feb 9, 2025
ffd9cc8
added amount to api resp
RustNinja Feb 9, 2025
02f0414
return pageindex and amount for FE.
RustNinja Feb 9, 2025
abd5bc8
CPI improvement between staking and vesting program.
RustNinja Feb 10, 2025
66211b6
update code to use box.
RustNinja Feb 10, 2025
9bade38
latest staking program id.
RustNinja Feb 10, 2025
0e932d1
updated vesting with staking. to allow to set staking program by admin.
RustNinja Feb 11, 2025
65d0b3e
latest devnet staking/vesting.
RustNinja Feb 11, 2025
c36f87c
enable cosmos signature.
RustNinja Feb 11, 2025
dff646a
commit latest prod staking program id angels, solvers allocation
RustNinja Feb 11, 2025
40af030
add cliff/advisors
RustNinja Feb 11, 2025
961f50c
allocations files
RustNinja Feb 11, 2025
fcae529
latest production changes.
RustNinja Feb 11, 2025
7cf28a7
airdrop
RustNinja Feb 11, 2025
b67eb73
update the path.
RustNinja Feb 11, 2025
10cc54c
new file for testing on devnet.
RustNinja Feb 11, 2025
5f12a22
add allocation amount to resp.
RustNinja Feb 11, 2025
2355073
extend get method.
RustNinja Feb 11, 2025
7e0367a
updated.
RustNinja Feb 11, 2025
3b5a912
add print.
RustNinja Feb 11, 2025
2d65d51
solvers
RustNinja Feb 11, 2025
511ae4d
change path to file.
RustNinja Feb 11, 2025
c61e0a3
vesting status
RustNinja Feb 11, 2025
8d04faa
addap polkadot signature.
RustNinja Feb 11, 2025
4a2affd
refactoring.
RustNinja Feb 11, 2025
7e79bf7
push.
RustNinja Feb 11, 2025
eb3804f
add info about claimed amount when it already happened.
RustNinja Feb 11, 2025
5453244
refactoring. make clean clear, remove duplicates and well organised
RustNinja Feb 11, 2025
c3e511f
change endpint of ngnix.
RustNinja Feb 11, 2025
34a8905
file.
RustNinja Feb 12, 2025
fcf03d8
return page index None when error.
RustNinja Feb 12, 2025
04acf37
set duration via set staking instruction.
RustNinja Feb 12, 2025
19cd7dc
pass args.
RustNinja Feb 12, 2025
570a8f2
git ignore and crawlback address.
RustNinja Feb 12, 2025
d307ff5
ignore.
RustNinja Feb 12, 2025
ec77217
correct mainnet program id.
RustNinja Feb 12, 2025
06d8fcc
new cli to set staking params by admin. ec7721
RustNinja Feb 15, 2025
aa7e67d
update page index.
RustNinja Feb 13, 2025
eff6c5f
realocate space if needed for vesting update stake list.
RustNinja Feb 13, 2025
df11a3c
allow any address claim on devnet.
RustNinja Feb 14, 2025
89c3843
refactoring.
RustNinja Feb 14, 2025
cc295e4
enable check of allocation
RustNinja Feb 14, 2025
82bd196
update fn signature.
RustNinja Feb 14, 2025
0d825bf
extra method to staking contract to update unbond period by admiin/cli
RustNinja Feb 14, 2025
6de3069
disable.
RustNinja Feb 14, 2025
632f2fc
enable check.
RustNinja Feb 14, 2025
668ee68
angular
RustNinja Feb 14, 2025
1eec44e
remove mock allocation.
RustNinja Feb 15, 2025
150bb6f
fix hex for cosmos signature validation.
RustNinja Feb 17, 2025
5d8c8fb
add cosmos_signature test
RustNinja Feb 17, 2025
98336f1
different versions to try derive account id from pub key.
RustNinja Feb 18, 2025
7156dfa
trying different approach to verify signature received from FE.
RustNinja Feb 19, 2025
8574c4f
cargo lock.
RustNinja Feb 19, 2025
203412c
use verify_keplr_sign to verify signature from FE.
RustNinja Feb 20, 2025
d7da20d
add validation of cosmos signature for API using keplr library.
RustNinja Feb 20, 2025
7de5ca9
refactoring, remove unnecessary code and dependency to build faster.
RustNinja Feb 20, 2025
863c8f6
introduce allocate_space when exceed length for vec.
RustNinja Feb 22, 2025
f9e89cb
update cli for set_admin fn to read key from env variable.
RustNinja Feb 22, 2025
7dc76c3
added csv file related to vesting allocation.
RustNinja Feb 22, 2025
b2bb01f
vesting api to return false immediately if any duplicate in file.
RustNinja Feb 22, 2025
075a58d
write.
RustNinja Feb 24, 2025
b235d97
page index always 1
RustNinja Feb 24, 2025
3b301c8
correct data type.
RustNinja Feb 24, 2025
cf720d0
ignore .env_dev file. add validation to not link solana twice.
RustNinja Feb 25, 2025
9130bc3
more docs with location of everything.
RustNinja Feb 25, 2025
999990e
contracts.
RustNinja Feb 25, 2025
01d9dcc
fix: rustfmt
godilov Mar 18, 2025
1151977
fix: polkadot ed25519 and ecdsa signatures support
godilov Apr 16, 2025
a16c609
Merge pull request #28 from ComposableFi/godilov/polkadot-signature
godilov Apr 16, 2025
3ffb088
fix: polkadot full signature check
godilov Apr 28, 2025
85371c4
Merge pull request #29 from ComposableFi/godilov/polkadot-signature
godilov Apr 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@

target/
.env
cli/.env_prod

solana/staking/script/.env_dev

cli/.env_dev
17 changes: 6 additions & 11 deletions Anchor.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
[toolchain]
anchor_version = "0.29.0"

[features]
seeds = false
skip-lint = false

[programs.devnet]
restaking = "8n3FHwYxFgQCQc2FNFkwDUf9mcqupxXcCvgfHbApMLv3"
restaking_v2 = "H69iS4rPnrRAMciLJcpEY3tRtFro7Mo7a2YAU8Q1busv"
solana_ibc = "2HLLVco5HvwWriNbUhmVwA2pCetRkpgrqwnjcsZdyTKT"

[programs.localnet]
restaking = "8n3FHwYxFgQCQc2FNFkwDUf9mcqupxXcCvgfHbApMLv3"
restaking_v2 = "H69iS4rPnrRAMciLJcpEY3tRtFro7Mo7a2YAU8Q1busv"
solana_ibc = "2HLLVco5HvwWriNbUhmVwA2pCetRkpgrqwnjcsZdyTKT"
merkle_distributor = "A7rDhNV2tVn5gS7g3yWeZAFpsixKXmRdjqHtLXLnYy41"
staking = "FaX6Aqph9zpER3HQ3LRmp67z6uu1QWH7dK3XgbydAeYV"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "/Users/dhruvjain/.config/solana/id.json"
cluster = "https://mainnet.helius-rpc.com/?api-key=66e40465-1f5b-4fb0-a84b-2175801a5ac4"
wallet = "/Users/mykyta/.config/solana/id.json"

[workspace]
members = ["solana/restaking/programs/restaking", "solana/solana-ibc/programs/solana-ibc", "solana/restaking-v2/programs/restaking-v2"]
members = ["solana/staking/programs/staking", "solana/merkle-distributor"]

[scripts]
test = "./solana-test.sh"
Expand Down
Loading
Loading