Full lesson
solang
Solidity Compiler for Solana, Polkadot and Stellar
What it does
From the project README:
[](https://discord.gg/hyperledger) [](https://github.com/hyperledger-solang/solang/actions) [](https://solang.readthedocs.io/en/latest/?badge=latest) [](LICENSE) [](https://github.com/hyperledger-solang/solang)
- Original
- hyperledger-solang/solang
- SuperStack fork
- Blockchains/solang @
d99ae7d - Stars
- 1,380
- Last push (original)
- 2026-09-30
- Languages
- Rust, Solidity, TypeScript, C, JavaScript, Makefile
- Detected stack
- Anchorweb3.js
- Categories
- Infrastructure & Tooling
- Licence
- Apache-2.0
- Homepage
- https://solang.readthedocs.io/
Architecture
1920 source files. By extension: .sol ×1443, .rs ×388, .ts ×69, .js ×11, .c ×7, .py ×1.
| Top-level directory | Source files |
|---|---|
tests | 1169 |
integration | 178 |
src | 176 |
docs | 158 |
fmt | 156 |
examples | 35 |
vscode | 24 |
solang-parser | 11 |
On-chain programs: integration/anchor/programs/anchor
Dapp: deploying
This fork is queued for its own live dapp on Sol.College, with a Devnet/Mainnet switch. It appears here, at /dapps/solang/, once it is deployed and checked on devnet. Until then, run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
integration/anchor/programs/anchor/src/lib.rs L157–180 @ d99ae7d · Apache-2.0 · original#[derive(Accounts)]pub struct Initialize<'info> { #[account(init, payer = user, space = 8 + 64)] pub my_account: Account<'info, MyAccount>, #[account(mut)] pub user: Signer<'info>, pub system_program: Program<'info, System>,} #[derive(Accounts)]#[instruction(seed_a: Vec<u8>)]pub struct InitializeSeed<'info> { #[account(init, seeds = [seed_a.as_ref()], bump, payer = user, space = 8 + 64)] pub my_account: Account<'info, MyAccount>, #[account(mut)] pub user: Signer<'info>, pub system_program: Program<'info, System>,} #[derive(Accounts)]pub struct NoAccountsNeeded {} #[account]pub struct MyAccount {- Line 159
#[account(init, payer = user, space = 8 + 64)]: Creates and pays for a new account. Space and payer must be specified. - Line 162
pub user: Signer<'info>,: Requires this account to have signed the transaction. - Line 169
#[account(init, seeds = [seed_a.as_ref()], bump, payer = user, space = 8 + 64)]: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 169
#[account(init, seeds = [seed_a.as_ref()], bump, payer = user, space = 8 + 64)]: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
integration/solana/create_contract.sol L121–144 @ d99ae7d · Apache-2.0 · original sign2(seeds, tx.accounts.dataAccount.key, tx.accounts.creator_program_id.key); } function sign2(bytes[2][1] seeds, address child, address creator_program_id) view internal { AccountMeta[1] metas = [ AccountMeta({pubkey: child, is_signer: true, is_writable: false}) ]; creator.call_with_signer{seeds: seeds, accounts: metas, program_id: creator_program_id}(); } @account(pdaSigner) @account(creatorId) function pda_sign(uint8 bump) external view { (address pda, bytes1 _bump) = try_find_program_address(["mint_authority"], address(this)); assert(bump == _bump); assert(pda == tx.accounts.pdaSigner.key); AccountMeta[1] metas = [ AccountMeta({pubkey: tx.accounts.pdaSigner.key, is_signer: true, is_writable: false}) ]; creator.call_with_signer{accounts: metas, seeds: [["mint_authority", abi.encode(_bump)]], program_id: tx.accounts.creatorId.key}();- Line 135
function pda_sign(uint8 bump) external view {: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 136
(address pda, bytes1 _bump) = try_find_program_address(["mint_authority"], address(this));: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.
solana-library/spl_token.sol L1–24 @ d99ae7d · Apache-2.0 · original// SPDX-License-Identifier: Apache-2.0 // Disclaimer: This library provides a way for Solidity to interact with Solana's SPL-Token. Although it is production ready,// it has not been audited for security, so use it at your own risk. import 'solana'; library SplToken { address constant tokenProgramId = address"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; enum TokenInstruction { InitializeMint, // 0 InitializeAccount, // 1 InitializeMultisig, // 2 Transfer, // 3 Approve, // 4 Revoke, // 5 SetAuthority, // 6 MintTo, // 7 Burn, // 8 CloseAccount, // 9 FreezeAccount, // 10 ThawAccount, // 11 TransferChecked, // 12 ApproveChecked, // 13- Line 18
MintTo, // 7: Mints new tokens. The mint authority must sign. - Line 23
TransferChecked, // 12: A checked token transfer, which also verifies the mint and decimals.
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.
| Directory | Command | Runs |
|---|---|---|
integration/polkadot | npm run build | ./build.sh |
integration/polkadot | npm run test | tsc; ts-mocha -t 20000 --exit *.spec.ts |
integration/anchor | npm run build | solang compile tests/*.sol --importpath tests --target solana -v -o tests/ |
integration/anchor | npm run lint | prettier */*.js "*/**/*{.js,.ts}" --check |
integration/solana | npm run build | solang compile *.sol --target solana -v |
integration/solana | npm run test | tsc; ts-node setup.ts; mocha --parallel *.spec.ts |
integration/soroban | npm run build | solang compile *.sol --target soroban && solang compile storage_types.sol --target soroban --release |
integration/soroban | npm run test | mocha *.spec.js --timeout 100000 |
vscode | npm run test | NODE_ENV=test node ./out/test/runTest.js |
vscode | npm run lint | eslint src --ext ts |
integration/anchor | anchor build | compile programs and generate IDLs |
integration/anchor | anchor test | local validator + test suite |
integration/anchor | anchor run test | yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts |
. | cargo build | Rust workspace build |
. | cargo test | Rust tests |
What you could build from it
- Fork the SuperStack copy and extend it within the Infrastructure & Tooling gaps listed on the idea page.
- Learn the pattern first: Building and sending transactions from a client
- Learn the pattern first: Anchor account constraints