Sol.College

Structure lesson (licence does not allow quoting code)

aeon-program-v1

Anchor-based Solana program for Aeon Protocol

Original
1802-Labs/aeon-program-v1
SuperStack fork
Blockchains/aeon-program-v1 @ 0d373b8
Stars
2
Last push (original)
2024-10-07
Languages
TypeScript, Rust, Makefile
Detected stack
Anchor
Categories
Infrastructure & Tooling
Licence
none detected: code not quoted on Sol.College

Architecture

28 source files. By extension: .rs ×15, .ts ×13.

Top-level directorySource files
programs15
scripts7
tests5
migrations1

On-chain programs: programs/aeon-program-v1

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
vault_createVaultCreateprograms/aeon-program-v1/src/lib.rs:15
vault_withdraw_solVaultWithdrawSOLprograms/aeon-program-v1/src/lib.rs:19
vault_withdraw_tokenVaultWithdrawTokenprograms/aeon-program-v1/src/lib.rs:23
service_createServiceCreateprograms/aeon-program-v1/src/lib.rs:27
service_status_updateServiceStatusUpdateprograms/aeon-program-v1/src/lib.rs:31
plan_status_updatePlanStatusUpdateprograms/aeon-program-v1/src/lib.rs:35
plan_addPlanAddprograms/aeon-program-v1/src/lib.rs:39
subscribe_solSubscribeSOLprograms/aeon-program-v1/src/lib.rs:43
subscribe_tokenSubscribeTokenprograms/aeon-program-v1/src/lib.rs:47
charge_solChargeSOLprograms/aeon-program-v1/src/lib.rs:51
charge_tokenChargeTokenprograms/aeon-program-v1/src/lib.rs:55
unsubscribeUnSubscribeprograms/aeon-program-v1/src/lib.rs:59
perform_createSelfprograms/aeon-program-v1/src/instructions/service_create.rs:45
perform_withdrawSelfprograms/aeon-program-v1/src/instructions/vault_withdraw.rs:26
perform_withdrawSelfprograms/aeon-program-v1/src/instructions/vault_withdraw.rs:63
perform_updateServiceStatusUpdateprograms/aeon-program-v1/src/instructions/service_update.rs:25
perform_updatePlanStatusUpdateprograms/aeon-program-v1/src/instructions/service_update.rs:48
perform_addPlanAddprograms/aeon-program-v1/src/instructions/service_update.rs:79
perform_subscribeSelfprograms/aeon-program-v1/src/instructions/subscribe.rs:48
perform_subscribeSelfprograms/aeon-program-v1/src/instructions/subscribe.rs:113
perform_unsubscribeSelfprograms/aeon-program-v1/src/instructions/subscribe.rs:168
perform_createSelfprograms/aeon-program-v1/src/instructions/vault_create.rs:23
perform_chargeSelfprograms/aeon-program-v1/src/instructions/charge.rs:46
perform_chargeSelfprograms/aeon-program-v1/src/instructions/charge.rs:110

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
tests/charge-tests.tsPublicKey, findProgramAddressSync, getAssociatedTokenAddress, Keypair, getBalance, Program
tests/subscribe-tests.tsPublicKey, findProgramAddressSync, getBalance, getAssociatedTokenAddress, Keypair, getAssociatedTokenAddressSync
tests/vault-tests.tsgetBalance, Keypair, getAssociatedTokenAddressSync, requestAirdrop, Program, createMint
scripts/plugin.tsPublicKey, findProgramAddressSync, Program, Transaction, getLatestBlockhash, getAssociatedTokenAddressSync
tests/utils.tsPublicKey, Connection, Keypair, transfer, Program, getAssociatedTokenAddress
scripts/trial.tsTransaction, Program, PublicKey, Connection, AnchorProvider, transfer
tests/service-tests.tsKeypair, seeds, Program, PublicKey, findProgramAddressSync, AnchorProvider
programs/aeon-program-v1/src/instructions/subscribe.rsseeds, Program
scripts/service.tsPublicKey, Program, getAssociatedTokenAddressSync, findProgramAddressSync, AnchorProvider, Transaction
scripts/vault.tsProgram, transfer, AnchorProvider, PublicKey, findProgramAddressSync, Transaction
scripts/mint.tscreateMint, mintTo, Keypair, Program, AnchorProvider
programs/aeon-program-v1/src/instructions/charge.rsseeds, Program

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/aeon-program-v1/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run lint
.anchor build
.anchor test
.anchor run test
.anchor run generate_vault_txns
.anchor run mint_txns
.anchor run service_txns
.anchor run trial_txns
.cargo build
.cargo test
.make deploy-dev
.make deploy-live

What you could build from it