Virtual Machine
The node runs the Phantasma VM. It executes:
- standalone custom contracts deployed with
Runtime.DeployContract(...) - token-backed contracts created with
Nexus.CreateToken(...)or attached later withNexus.AttachTokenContract(...) - trigger code:
onMint,onBurn,onSend,onReceive,onInfuse,onSeries,onAttach,onUpgradeandonWrite - transaction scripts and read-only scripts executed through the VM entry context
This section describes what the VM executes, how contracts are admitted, and which interops the node implements.
What To Read First
- architecture.md
- how execution contexts, registers, stack, interop, gas, and triggers fit together
- types.md
- the VM value model used by scripts, ABIs, and interop calls
- opcodes.md
- the core instruction set and base opcode gas costs
- interop.md
- the native bridge from VM code into token, NFT, storage, and contract lifecycle operations
Practical Scope
For most contract authors, the most important parts are:
- custom contract lifecycle through
Runtime.DeployContract(...)andRuntime.UpgradeContract(...) - token-backed lifecycle through
Nexus.CreateToken(...),Nexus.AttachTokenContract(...), andRuntime.UpgradeContract(...) - token and NFT interops such as
Runtime.MintTokens,Runtime.MintToken,Runtime.TransferTokens,Runtime.TransferToken,Runtime.ReadToken, andNexus.CreateTokenSeries - storage helpers
Data.*,Map.*, andList.*
If you are deploying contracts rather than writing raw scripts, start with the tools: