Token (ERC-20 Style)
A full-featured fungible token with transfers, allowances, minting, burning, and pause functionality. Demonstrates mappings, modifiers, and events.
intermediate
Open in Playground →
token/token.sol
// Source file not found Overview
This token contract implements the ERC-20 interface pattern on Solana. It demonstrates SolScript’s most important feature: automatic PDA mapping from Solidity mapping types.
Key features:
balanceOfmapping: Converted to per-address PDA accountsallowancenested mapping: Two-level PDA with owner + spender seeds- Minting and burning: Owner-controlled supply management
- Pause mechanism: Emergency stop pattern
- Custom errors: Rich error types with parameters
This is the most comprehensive example, showing how a real DeFi primitive looks in SolScript.