Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ members = [

# tokens
"tokens/escrow/pinocchio/program",
"tokens/nft-operations/pinocchio/program",
"tokens/transfer-tokens/pinocchio/program",
"tokens/token-2022/mint-close-authority/native/program",
"tokens/token-2022/non-transferable/native/program",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ How to store state that changes size in Solana.

Create an NFT collection, mint NFTs, and verify NFTs as part of a collection using Metaplex Token Metadata.

[anchor](./tokens/nft-operations/anchor)
[anchor](./tokens/nft-operations/anchor) [pinocchio](./tokens/nft-operations/pinocchio)

### Minting a token from inside a program

Expand Down
8 changes: 8 additions & 0 deletions tokens/nft-operations/pinocchio/cicd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# This script is for quick building & deploying of the program.
# It also serves as a reference for the commands used for building & deploying Solana programs.
# Run this bad boy with "bash cicd.sh" or "./cicd.sh"

cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so
solana program deploy ./program/target/so/program.so

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Deploy Path Skips Built Artifact

The build step writes the SBF output with the crate-derived name, nft_operations_pinocchio_program.so. This deploy command still looks for program.so, so bash cicd.sh fails at deploy time even after a successful build.

Suggested change
solana program deploy ./program/target/so/program.so
solana program deploy ./program/target/so/nft_operations_pinocchio_program.so

24 changes: 24 additions & 0 deletions tokens/nft-operations/pinocchio/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type": "module",
"scripts": {
"postinstall": "node prepare.mjs",
"test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts",
"build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test",
"build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so",
"deploy": "solana program deploy ./program/target/so/program.so"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Deploy Script Uses Missing Binary

cargo build-sbf emits the shared object using the crate name, nft_operations_pinocchio_program.so, not program.so. Running pnpm deploy after pnpm build therefore points solana program deploy at a file that was not produced.

Suggested change
"deploy": "solana program deploy ./program/target/so/program.so"
"deploy": "solana program deploy ./program/target/so/nft_operations_pinocchio_program.so"

},
"dependencies": {
"@solana/web3.js": "^1.98.4",
"borsh": "^2.0.0"
},
"devDependencies": {
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.1",
"@types/mocha": "^9.1.1",
"chai": "^4.3.4",
"mocha": "^9.0.3",
"solana-bankrun": "^0.3.0",
"ts-mocha": "^10.0.0",
"typescript": "^4.3.5"
}
}
Loading
Loading