Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Make each program into a heading #17

Merged
merged 1 commit into from
Nov 15, 2024
Merged
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
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ SBF_OUT_DIR="./asm/out" cargo test

## Current Programs

* Helloworld: logs a static string using the `sol_log_` syscall
### Helloworld

Logs a static string using the `sol_log_` syscall.

| Language | CU Usage |
| --- | --- |
Expand All @@ -157,8 +159,10 @@ Since this is just doing a syscall, all the languages behave the same. The only
difference is that the Assembly version *doesn't* set the return code to 0, and
lets the VM assume it worked.

* Transfer-Lamports: moves lamports from a source account to a destination, with
the amount given by a little-endian u64 in instruction data.
### Transfer-Lamports

Moves lamports from a source account to a destination, with the amount given by
a little-endian u64 in instruction data.

| Language | CU Usage |
| --- | --- |
Expand All @@ -173,9 +177,11 @@ input. Since the assembly version knows exactly where to find everything, it can
be hyper-optimized. The pinocchio version performs very closely to the assembly
implementation!

* CPI: allocates a PDA given by the seed "You pass butter" and a bump seed in
the instruction data. This requires a call to `create_program_address` to check
the address and `invoke_signed` to CPI to the system program.
### CPI

Allocates a PDA given by the seed "You pass butter" and a bump seed in the
instruction data. This requires a call to `create_program_address` to check the
address and `invoke_signed` to CPI to the system program.

| Language | CU Usage | CU Usage (minus syscalls) |
| --- | --- | --- |
Expand All @@ -188,9 +194,11 @@ Note: `create_program_address` consumes 1500 CUs, and `invoke` consumes 1000, so
we can subtract 2500 CUs from each program to see the actual cost of the program
logic.

* Token: a reduced instruction set from SPL-Token. Includes an entrypoint,
instruction deserialization, and account serde. The Rust version is the full SPL
Token program.
### Token

A reduced instruction set from SPL-Token. Includes an entrypoint, instruction
deserialization, and account serde. The Rust version is the full SPL Token
program.

* Initialize Mint

Expand Down