Skip to content

Commit

Permalink
Add change log + increase compute unit for cancel instruction (#17)
Browse files Browse the repository at this point in the history
* Add change log + increase compute unit for cancel instruction

* Update detailed changes

* fix comments
  • Loading branch information
tiendv89 authored Sep 11, 2024
1 parent 83ac59a commit 8a0db4f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Breaking Changes

## Program [0.3.0] [PR #5](https://github.com/jup-ag/jup-lock/pull/5) [PR #15](https://github.com/jup-ag/jup-lock/pull/15)

### Breaking Changes

- Endpoint `create_vesting_escrow` add `cancel_mode` to indicates who can cancel the escrow.

### Added

- escrow state add `token_program_flag` to indicates the token program used within the escrow.
- escrow state add `cancelled_at` to indicates the timestamp of the cancellation.
- Add new instruction `cancel_vesting_escrow`, which will cancel the escrow and close the `escrow_token` token account. The claimable amount will be transferred to recipient and the remaining amount will be transferred to creator. The instruction supports both `splToken` and `token2022`.
- Add new v2 instructions to support `token2022` extensions, including: `TransferFeeConfig`, `TokenMetadata`, `MetadataPointer`, `ConfidentialTransferMint`, `ConfidentialTransferFeeConfig`, `PermanentDelegate`, `TransferHook`, `MintCloseAuthority`, `DefaultAccountState` for Token Mint and `MemoTransfer` for Token Account extensions
- `create_vesting_escrow_v2` to create the escrow relevant accounts.
- `claim_v2` to claim from the escrow.

## Program [0.2.2] [PR #8](https://github.com/jup-ag/jup-lock/pull/8)

### Breaking Changes
- Rename `cliff_amount` to `initial_unlock_amount`

- Rename `cliff_amount` to `initial_unlock_amount`

## Program [0.2.1] [PR #4](https://github.com/jup-ag/jup-lock/pull/4)

### Fixed

- Add check `recipient_token` in claim instruction
- Update `emit_cpi` in `claim` and `create_vesting_escrow` instruction

### Breaking Changes
- Endpoint `update vesting_escrow_recipient` allow signer to update `recipient_email` in `escrow_metadata`

- Endpoint `update vesting_escrow_recipient` allow signer to update `recipient_email` in `escrow_metadata`

## Program [0.2.0] [PR #3](https://github.com/jup-ag/jup-lock/pull/3)

### Changed

- Rename account `escrow` to `vesting_escrow`, `escrow_metadata` to `vesting_escrow_metadata`
- Rename endpoint `create_vesting_plan` to `create_vesting_escrow`
- Rename endpoint `create_escrow_metadata` to `create_vesting_escrow_metadata`
- Rename endpoint `update_recipient` to `update_vesting_escrow_recipient`

### Breaking Changes

- escrow state remove field `escrow_token` and add field `token_mint`
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion programs/locker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "locker"
version = "0.2.2"
version = "0.3.0"
description = "Created with Anchor"
edition = "2021"
authors = ["andrew <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion sdk/artifacts/locker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.2",
"version": "0.3.0",
"name": "locker",
"instructions": [
{
Expand Down
7 changes: 6 additions & 1 deletion tests/locker_utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
RemainingAccountsBuilder,
RemainingAccountsType,
} from "./token_2022/remaining-accounts";
import { AccountMeta } from "@solana/web3.js";
import { AccountMeta, ComputeBudgetProgram } from "@solana/web3.js";

export const LOCKER_PROGRAM_ID = new web3.PublicKey(
"2r5VekMNiWPzi1pWwvJczrdPaZnJG59u91unSrTunwJg"
Expand Down Expand Up @@ -563,6 +563,11 @@ export async function cancelVestingPlan(
tokenProgram,
memoProgram: MEMO_PROGRAM,
})
.preInstructions([
ComputeBudgetProgram.setComputeUnitLimit({
units: 400_000,
}),
])
.remainingAccounts(remainingAccounts ? remainingAccounts : [])
.rpc();

Expand Down

0 comments on commit 8a0db4f

Please sign in to comment.