Skip to content

Commit 5f4a6c8

Browse files
add pinocchio escrow example (#598)
* add pinocchio escrow example * fix pre-existing repo-wide biome errors The whole-repo `biome check ./` (TypeScript CI job) was failing on three files unrelated to this PR, which kept the check red: - basics/cross-program-invocation/pinocchio/tests/test.ts: remove an unused discriminator constant and replace non-null assertions with explicit null guards - tokens/token-swap/anchor/tests/deposit-liquidity.ts: apply the biome formatter - tokens/token-2022/.../app/public/{next,vercel}.svg: add a <title> element (noSvgWithoutTitle) --------- Co-authored-by: MarkFeder <5670736+MarkFeder@users.noreply.github.com> Co-authored-by: Perelyn <64838956+Perelyn-sama@users.noreply.github.com>
1 parent fe68bb6 commit 5f4a6c8

18 files changed

Lines changed: 2378 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 12 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
@@ -51,6 +51,7 @@ members = [
5151
"basics/transfer-sol/asm",
5252

5353
# tokens
54+
"tokens/escrow/pinocchio/program",
5455
"tokens/transfer-tokens/pinocchio/program",
5556
"tokens/token-2022/mint-close-authority/native/program",
5657
"tokens/token-2022/non-transferable/native/program",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Create an NFT collection, mint NFTs, and verify NFTs as part of a collection usi
155155

156156
Allow two users to swap digital assets with each other, each getting 100% of what the other has offered due to the power of decentralization!
157157

158-
[anchor](./tokens/escrow/anchor) [native](./tokens/escrow/native)
158+
[anchor](./tokens/escrow/anchor) [pinocchio](./tokens/escrow/pinocchio) [native](./tokens/escrow/native)
159159

160160
### Fundraising with SPL Tokens
161161

tokens/escrow/pinocchio/cicd.sh

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+
"scripts": {
3+
"test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts",
4+
"build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test",
5+
"build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so",
6+
"deploy": "solana program deploy ./program/target/so/program.so"
7+
},
8+
"dependencies": {
9+
"@solana/spl-token": "^0.4.9",
10+
"@solana/web3.js": "^1.98.4",
11+
"bn.js": "^5.2.2"
12+
},
13+
"devDependencies": {
14+
"@types/bn.js": "^5.1.0",
15+
"@types/chai": "^4.3.1",
16+
"@types/mocha": "^10.0.9",
17+
"@types/node": "^22.8.6",
18+
"borsh": "^2.0.0",
19+
"chai": "^4.3.4",
20+
"mocha": "^10.8.2",
21+
"solana-bankrun": "^0.4.0",
22+
"ts-mocha": "^10.0.0",
23+
"typescript": "^5"
24+
}
25+
}

0 commit comments

Comments
 (0)