Skip to content

Commit 8bab91a

Browse files
authored
token: Optimize zig version (#19)
#### 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.
1 parent c7c9be0 commit 8bab91a

File tree

4 files changed

+361
-399
lines changed

4 files changed

+361
-399
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,39 +215,39 @@ program.
215215
| Language | CU Usage |
216216
| --- | --- |
217217
| Rust | 1115 |
218-
| Zig | 166 |
218+
| Zig | 158 |
219219

220220
* Initialize Account
221221

222222
| Language | CU Usage |
223223
| --- | --- |
224224
| Rust | 2071 |
225-
| Zig | 189 |
225+
| Zig | 176 |
226226

227227
* Mint To
228228

229229
| Language | CU Usage |
230230
| --- | --- |
231231
| Rust | 2189 |
232-
| Zig | 195 |
232+
| Zig | 179 |
233233

234234
* Transfer
235235

236236
| Language | CU Usage |
237237
| --- | --- |
238238
| Rust | 2208 |
239-
| Zig | 160 |
239+
| Zig | 148 |
240240

241241
* Burn
242242

243243
| Language | CU Usage |
244244
| --- | --- |
245245
| Rust | 2045 |
246-
| Zig | 157 |
246+
| Zig | 145 |
247247

248248
* Close Account
249249

250250
| Language | CU Usage |
251251
| --- | --- |
252252
| Rust | 1483 |
253-
| Zig | 260 |
253+
| Zig | 130 |

token/zig/build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
// internet connectivity.
1717
.dependencies = .{
1818
.@"solana-program-sdk" = .{
19-
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.15.0.tar.gz",
20-
.hash = "1220c255d7d80a59251d901da4d2982eb660d099680c1207b14f51078987c655c979",
19+
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.15.1.tar.gz",
20+
.hash = "12203631b9eba91c479991ec8f0525f181addb5879bbb96e256427f802c2ca67e108",
2121
},
2222
},
2323

0 commit comments

Comments
 (0)