Skip to content

Commit f3ac044

Browse files
committed
add pinocchio multiple-extensions example
Port the token-2022/multiple-extensions example to pinocchio. Creates a Token-2022 mint that carries both the MintCloseAuthority and NonTransferable extensions, initialized via hand-built CPIs before InitializeMint (there is no pinocchio crate for Token-2022). Mirrors the native example's instruction wire format and the structure of the merged pinocchio token-2022 siblings. The litesvm test decodes the resulting mint with the official Token-2022 codec and asserts both extensions are present (close authority set, non-transferable), plus the extended mint size (206 bytes).
1 parent 4f90945 commit f3ac044

12 files changed

Lines changed: 3284 additions & 0 deletions

File tree

‎Cargo.lock‎

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ members = [
6969
"tokens/token-2022/transfer-fee/native/program",
7070
"tokens/token-2022/transfer-fee/pinocchio/program",
7171
"tokens/token-2022/multiple-extensions/native/program",
72+
"tokens/token-2022/multiple-extensions/pinocchio/program",
7273
]
7374
resolver = "2"
7475

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# This script is for quick building & deploying of the program.
4+
# It also serves as a reference for the commands used for building & deploying Solana programs.
5+
# Run this bad boy with "bash cicd.sh" or "./cicd.sh"
6+
7+
cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so
8+
solana program deploy ./program/target/so/program.so
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"type": "module",
3+
"scripts": {
4+
"test": "mocha --import=tsx -t 1000000 ./tests/test.ts",
5+
"build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test",
6+
"build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so",
7+
"deploy": "solana program deploy ./program/target/so/program.so"
8+
},
9+
"dependencies": {
10+
"@solana-program/system": "^0.12.2",
11+
"@solana-program/token-2022": "^0.12.0",
12+
"@solana/kit": "^7.0.0",
13+
"@solana/sysvars": "^6.10.0",
14+
"litesvm": "^1.3.0"
15+
},
16+
"devDependencies": {
17+
"@types/chai": "^5.2.3",
18+
"@types/mocha": "^10.0.10",
19+
"@types/node": "^26.1.0",
20+
"chai": "^6.2.2",
21+
"mocha": "^11.7.5",
22+
"typescript": "^5.9.3",
23+
"tsx": "^4.19.2"
24+
}
25+
}

0 commit comments

Comments
 (0)