Skip to main content
Alephium smart contracts are written in Ralph and compiled to bytecode before deployment. Contract addresses are base58-encoded like regular addresses. You can read contract state, call view functions, and query emitted events through the RPC API.

Get contract state

Returns the current state of a deployed contract including its fields and token balances.
immFields are set at deployment and never change. mutFields are the contract’s mutable state that changes with each transaction.

Get contract bytecode

Returns the deployed bytecode for a contract.

Call a contract function

Calls a view function on a contract without creating a transaction. View functions read state but don’t modify it.

Test a contract

Runs a contract function in a sandboxed environment without submitting to the chain. Useful for testing logic before deployment.

Compile a contract

Compiles Ralph source code and returns the bytecode. This is what the Ralph Studio IDE uses under the hood.

Get contract events

Returns events emitted by a contract. Events are indexed by contract address and block hash.

Get events by transaction

Returns all events emitted in a specific transaction.

Get subcontracts

Returns contracts that were created by a parent contract.

Parameters reference