Skip to content

Conversation

grod220
Copy link
Member

@grod220 grod220 commented Apr 1, 2025

A CLI utility helper for creating an escrow account for the token-wrap program. This specifically helps consumers generate one with the right mint authority for the wrap instruction.

Walkthrough for testing locally:

  1. Build program and binary
cargo build-sbf && cargo build
  1. Start solana test validator
solana-test-validator \
  --bpf-program TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR target/deploy/spl_token_wrap.so \
  --reset
  1. Create a new mint
spl-token create-token
# mint addr -> 7uN7hezPKhsCs59xChKgmZnGGjEfEQwE8sAWVxrUSmHV
  1. Create Escrow account (first arg mint, second wrapped token program addr)
cargo run --bin spl-token-wrap create-escrow-account 7uN7hezPKhsCs59xChKgmZnGGjEfEQwE8sAWVxrUSmHV TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb

# Escrow Account Address: 7zRuC2akyz9bAm3xSefwkKxzfqcLD7Ly2dUJxZUoBUb2
# Escrow Account Owner (PDA): CvecTxZ2SdRN4bjNXkQL4BGHnJpvwaZneKQnvsWUAfc2
# Escrow Token Program ID: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
# Signature: 2GjCm5snYsVEjQB687qPB95hMZRWnPaymfWfqdUGDTLYNF35Svd6Uw9UGXnnJfJnBG6qzWZiyNvp1AH2uA4gxsSi

@grod220 grod220 force-pushed the cli-wrap-multisig branch from 59b308c to 4db885c Compare April 3, 2025 14:36
Base automatically changed from cli-wrap-multisig to main April 4, 2025 06:21
@grod220 grod220 marked this pull request as ready for review April 4, 2025 07:05
@grod220 grod220 requested review from joncinque and buffalojoec April 4, 2025 07:05
Copy link

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Looks great! Just tiny nits from me.

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great overall! Just a couple of small things

@grod220 grod220 force-pushed the cli-escrow branch 2 times, most recently from cca6469 to 50f318e Compare April 8, 2025 16:54
@grod220 grod220 requested review from joncinque and buffalojoec April 8, 2025 17:26
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Two last things, then this can go in!

@grod220 grod220 requested a review from joncinque April 9, 2025 10:41
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

gud code, gud docs, ship it. 🫡

@grod220 grod220 merged commit ce527c4 into main Apr 10, 2025
18 of 19 checks passed
@grod220 grod220 deleted the cli-escrow branch April 10, 2025 11:19
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.

3 participants