Sol.College

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 directorySource files
tests1169
integration178
src176
docs158
fmt156
examples35
vscode24
solang-parser11

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.

hyperledger-solang/solang · 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 {
  1. Line 159 #[account(init, payer = user, space = 8 + 64)]: Creates and pays for a new account. Space and payer must be specified.
  2. Line 162 pub user: Signer<'info>,: Requires this account to have signed the transaction.
  3. 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.
  4. 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.
hyperledger-solang/solang · 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}();
  1. 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.
  2. 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.
hyperledger-solang/solang · 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
  1. Line 18 MintTo, // 7: Mints new tokens. The mint authority must sign.
  2. 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.

DirectoryCommandRuns
integration/polkadotnpm run build./build.sh
integration/polkadotnpm run testtsc; ts-mocha -t 20000 --exit *.spec.ts
integration/anchornpm run buildsolang compile tests/*.sol --importpath tests --target solana -v -o tests/
integration/anchornpm run lintprettier */*.js "*/**/*{.js,.ts}" --check
integration/solananpm run buildsolang compile *.sol --target solana -v
integration/solananpm run testtsc; ts-node setup.ts; mocha --parallel *.spec.ts
integration/sorobannpm run buildsolang compile *.sol --target soroban && solang compile storage_types.sol --target soroban --release
integration/sorobannpm run testmocha *.spec.js --timeout 100000
vscodenpm run testNODE_ENV=test node ./out/test/runTest.js
vscodenpm run linteslint src --ext ts
integration/anchoranchor buildcompile programs and generate IDLs
integration/anchoranchor testlocal validator + test suite
integration/anchoranchor run testyarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts
.cargo buildRust workspace build
.cargo testRust tests

What you could build from it