Skip to content

iamvon/q-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

q-token

q-token is a Quasar-based token program that targets SPL Token instruction compatibility while keeping account access zero-copy and benchmark-friendly.

Current scope

  • Quasar entrypoint and dispatcher
  • SPL-compatible mint, token-account, and multisig layouts
  • Core SPL Token instructions through UiAmountToAmount
  • Unit coverage for state initialization and transfer flow
  • Binary-level benchmark harness for spl-token, p-token, and q-token

Implemented instruction surface

q-token currently implements the SPL-compatible instruction set covered by the benchmark suite:

  • InitializeMint
  • InitializeAccount
  • InitializeMultisig
  • Transfer
  • Approve
  • Revoke
  • SetAuthority
  • MintTo
  • Burn
  • CloseAccount
  • FreezeAccount
  • ThawAccount
  • TransferChecked
  • ApproveChecked
  • MintToChecked
  • BurnChecked
  • InitializeAccount2
  • SyncNative
  • InitializeAccount3
  • InitializeMultisig2
  • InitializeMint2
  • GetAccountDataSize
  • InitializeImmutableOwner
  • AmountToUiAmount
  • UiAmountToAmount

P-Token-only extensions such as batch, unwrap_lamports, and withdraw_excess_lamports are not part of q-token yet.

Compute benchmarks

Measured with real SBF ELFs loaded into Mollusk:

Instruction SPL P-Token Q-Token
InitializeMint 2968 105 146
InitializeAccount 4501 154 175
InitializeMultisig 2783 178 298
Transfer 4645 76 207
Approve 2904 126 156
Revoke 2677 108 105
SetAuthority 2896 138 160
MintTo 4492 119 188
Burn 4743 123 195
CloseAccount 3051 118 194
FreezeAccount 4265 145 161
ThawAccount 4267 141 163
TransferChecked 6173 105 247
ApproveChecked 4431 163 197
MintToChecked 4499 161 195
BurnChecked 4744 126 199
InitializeAccount2 4362 172 175
SyncNative 3045 205 228
InitializeAccount3 4214 239 279
InitializeMultisig2 2636 289 401
InitializeMint2 2828 219 254
GetAccountDataSize 1595 183 161
InitializeImmutableOwner 1405 38 31
AmountToUiAmount 2397 444 436
UiAmountToAmount 2985 700 821

Test status

  • cargo test --lib
  • cargo test --test benchmark_token -- --nocapture
  • cargo build-sbf --offline

The benchmark suite compares q-token against:

  • the local q-token SBF artifact at target/deploy/q_token.so
  • a built p-token SBF artifact from the sibling token repository

Local workflow

cargo check
cargo test --lib
cargo build-sbf --offline
cargo test --test benchmark_token -- --nocapture

To include Pinocchio benchmarks, build the upstream program first. If the token repository sits next to this one, run:

cargo build-sbf --manifest-path ../token/pinocchio/program/Cargo.toml

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages