Ephemeral SPL Token program implementing MIMD 0013. It provides temporary (ephemeral) balances for SPL tokens that can be delegated to Data Layer Programs (DLPs) and later undelegated with state reconciliation.
e-token— On-chain program (cdylib) implementing the Ephemeral SPL Token logic.e-token-api—no_stdrlib with the program ID, instruction discriminators, and shared types used by clients and tests.
The program exposes the following instructions (see e-token-api/src/lib.rs):
0InitializeEphemeralAta — create the Ephemeral ATA PDA derived from[payer, mint].1InitializeGlobalVault — create the global vault PDA derived from[mint].2DepositSplTokens — transfer tokens from the user into the global vault and increase the Ephemeral ATA balance.3WithdrawSplTokens — transfer tokens back to the user from the global vault and decrease the Ephemeral ATA balance.4DelegateEphemeralAta — delegate the Ephemeral ATA to a DLP program using PDA seeds.5UndelegateEphemeralAta — commit state and undelegate via the delegation program.
Program ID and external program:
- Ephemeral SPL Token Program ID is declared in
e-token-api/src/lib.rsunderprogram::id(). - Uses the MagicBlock Delegation Program via
ephemeral-rollups-pinocchiofor delegation/undelegation flows.
- Rust (toolchain pinned via
rust-toolchain.toml). - Solana CLI =
2.3.4(see[workspace.metadata.cli]inCargo.toml).
Build the on-chain program to SBF:
cargo build-sbfRun the test suite (with program logs enabled via the logging feature):
cargo test-sbf --features loggingTips:
- You can run a single test by passing its name, for example:
cargo test-sbf --features logging delegate_ephemeral_ata
- Tests live under
e-token/tests/and cover delegation/undelegation flows and balance accounting.
- The workspace depends on
ephemeral-rollups-pinocchioand several Solana crates; ensure your local environment matches the versions declared in the workspaceCargo.toml. - The program enables additional logs when compiled with the
loggingfeature; this is useful for debugging both unit and integration tests.