Skip to content

Commit

Permalink
token: Optimize zig version (#19)
Browse files Browse the repository at this point in the history
#### Problem

There were a few issues holding back the zig version of the SPL Token.
There was an unnecessary copy in close account and a few checks that
could be moved.

#### Summary of changes

Use the newest SDK with a more efficient entrypoint. Optimize some stuff
and refactor the code for readability.
  • Loading branch information
joncinque authored Nov 18, 2024
1 parent c7c9be0 commit 8bab91a
Show file tree
Hide file tree
Showing 4 changed files with 361 additions and 399 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,39 +215,39 @@ program.
| Language | CU Usage |
| --- | --- |
| Rust | 1115 |
| Zig | 166 |
| Zig | 158 |

* Initialize Account

| Language | CU Usage |
| --- | --- |
| Rust | 2071 |
| Zig | 189 |
| Zig | 176 |

* Mint To

| Language | CU Usage |
| --- | --- |
| Rust | 2189 |
| Zig | 195 |
| Zig | 179 |

* Transfer

| Language | CU Usage |
| --- | --- |
| Rust | 2208 |
| Zig | 160 |
| Zig | 148 |

* Burn

| Language | CU Usage |
| --- | --- |
| Rust | 2045 |
| Zig | 157 |
| Zig | 145 |

* Close Account

| Language | CU Usage |
| --- | --- |
| Rust | 1483 |
| Zig | 260 |
| Zig | 130 |
4 changes: 2 additions & 2 deletions token/zig/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// internet connectivity.
.dependencies = .{
.@"solana-program-sdk" = .{
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.15.0.tar.gz",
.hash = "1220c255d7d80a59251d901da4d2982eb660d099680c1207b14f51078987c655c979",
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.15.1.tar.gz",
.hash = "12203631b9eba91c479991ec8f0525f181addb5879bbb96e256427f802c2ca67e108",
},
},

Expand Down
Loading

0 comments on commit 8bab91a

Please sign in to comment.