Skip to content

Commit 4f225b7

Browse files
committed
add asm transfer example
1 parent 03c9b75 commit 4f225b7

12 files changed

Lines changed: 1742 additions & 7 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ members = [
4343
"basics/transfer-sol/native/program",
4444
"basics/transfer-sol/pinocchio/program",
4545
"basics/transfer-sol/anchor/programs/*",
46+
"basics/transfer-sol/asm",
4647

4748
# tokens
4849
"tokens/token-2022/mint-close-authority/native/program",
@@ -89,3 +90,4 @@ solana-keypair = "3.0.1"
8990
solana-pubkey = "3.0.0"
9091
solana-transaction = "3.0.1"
9192
solana-native-token = "3.0.0"
93+
solana-address = "2.1.0"

basics/transfer-sol/asm/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build/**/*
2+
deploy/**/*
3+
node_modules
4+
.sbpf
5+
.DS_Store
6+
.vscode
7+
keypair.json
8+
package-lock.json
9+
test-ledger
10+
yarn.lock
11+
target

basics/transfer-sol/asm/Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "asm"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
8+
[dev-dependencies]
9+
litesvm.workspace = true
10+
solana-instruction.workspace = true
11+
solana-address.workspace = true
12+
solana-keypair.workspace = true
13+
solana-native-token.workspace = true
14+
solana-pubkey.workspace = true
15+
solana-transaction.workspace = true
16+
solana-system-interface.workspace = true
17+
18+
[features]
19+
test-sbf = []

basics/transfer-sol/asm/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# asm
2+
3+
Created with [sbpf](https://github.com/blueshift-gg/sbpf)

basics/transfer-sol/asm/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 --bpf-out-dir=./program/target/so
8+
solana program deploy ./program/target/so/program.so
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"type": "module",
3+
"scripts": {
4+
"test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts",
5+
"build-and-test": "sbpf build && pnpm test",
6+
"build": "sbpf build",
7+
"deploy": "solana program deploy ./program/target/so/program.so"
8+
},
9+
"dependencies": {
10+
"@solana/web3.js": "^1.47.3",
11+
"buffer-layout": "^1.2.2",
12+
"fs": "^0.0.1-security"
13+
},
14+
"devDependencies": {
15+
"@types/bn.js": "^5.1.0",
16+
"@types/chai": "^4.3.1",
17+
"@types/mocha": "^9.1.1",
18+
"chai": "^4.3.4",
19+
"mocha": "^9.0.3",
20+
"solana-bankrun": "^0.3.0",
21+
"ts-mocha": "^10.0.0",
22+
"typescript": "^4.3.5"
23+
}
24+
}

0 commit comments

Comments
 (0)