Skip to content

Commit

Permalink
feat: deregister vesting for list of accounts (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
onikonychev authored Mar 8, 2024
1 parent 74450b0 commit a8163a9
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 234 deletions.
2 changes: 2 additions & 0 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
382c05baf544f2886de849933ecf59e8bc3bcdcdd552d5a63537bd6d63f2ecf1 controller.wasm
6cf70cdf7ca010cbeff5fff2ca992ccb6d48fa669baf2b9ee26c8289a926413c core_token_vesting_v2.wasm
b56a880d4c67d9f353f549b502256f73159f89b50aa6dae683948e117efa4792 cw3_flex_multisig.wasm
1ecff403bbf3b5fcedccb5de76a0ef5f1fdbcc5f60890e3388f5425584899f0b incentives.wasm
dc89ed88f1c69bf63fc284492b7bf6935e3a85da2945067d70f71f08c01df60d lockup.wasm
Expand All @@ -7,3 +8,4 @@ ef5b4de76526713e3531c3b9bbc4620b5d61599c4a0e8605365ebb0f1d7ee2ac nibi_stargate_
0074489ff40c8ecbd766f7140b32d288dcaf7302ba630d452f79e7d292ea57ef nusd_valuator.wasm
955592d08017aa41f3c9ba3883153d6de024e8c7a3a79aa3b664a241ec1e7a19 pricefeed.wasm
354fdeff1386394d7aa829358323f89bde548d4aa782bae4a16dddfe33dad739 shifter.wasm
8d982ca2d679ea8d44f825fe91a3d4e0cb92150b12e4684497eee9e76991d247 token_vesting.wasm
Binary file added artifacts/core_token_vesting_v2.wasm
Binary file not shown.
25 changes: 18 additions & 7 deletions contracts/core-token-vesting-v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@ This creates a set of vesting accounts for the given users.

```rust
DeregisterVestingAccount {
address: String,
vested_token_recipient: Option<String>,
left_vesting_token_recipient: Option<String>,
addresses: Vec<String>,
},
```

- DeregisterVestingAccount - deregister vesting account
- It will compute `claimable_amount` and `left_vesting_amount`. Each amount respectively sent to (`vested_token_recipient` or `vesting_account`)
and (`left_vesting_token_recipient` or `master_address`).
- It will compute `claimable_amount` and `left_vesting_amount` and send back to the contract admin.

#### By admin only

Expand Down Expand Up @@ -139,10 +136,10 @@ cat << EOF | jq '.' | tee reward.json
}
],
"vesting_schedule": {
"linear_vesting": {
"linear_vesting_with_cliff": {
"start_time": "1708642800",
"end_time": "1708729200",
"vesting_amount": "0"
"cliff_time": "1708642800"
}
}
}
Expand Down Expand Up @@ -191,4 +188,18 @@ cat << EOF | jq '.' | tee withdraw.json
EOF
JSON_DATA="$(<withdraw.json)"
nibid tx wasm execute $CONTRACT_ADDRESS "$JSON_DATA" --from $MANAGER_WALLET "${TX_FLAG[@]}"

# Deregister vesting accounts
cat << EOF | jq '.' | tee deregister.json
{
"deregister_vesting_accounts": {
"addresses": [
"nibi1zrz9q4xr2u6tk0gtrzu7c7vyu53uyzp0cr9wgf",
"nibi1dczse3mp5cg5jcjwxu5qreh277su4x7fku389c"
]
}
}
EOF
JSON_DATA="$(<deregister.json)"
nibid tx wasm execute $CONTRACT_ADDRESS "$JSON_DATA" --from $MANAGER_WALLET "${TX_FLAG[@]}"
```
Loading

0 comments on commit a8163a9

Please sign in to comment.