Skip to content

Hello World Contract

← Back to Examples

Example source from examples/hello-world/contract.algo.ts.

LocalNet running (algokit localnet start)

From the repository’s examples directory:

cd examples
npx tsx hello-world/contract.algo.ts

View source on GitHub

import { BaseContract, log, op } from '@algorandfoundation/algorand-typescript'

export default class HelloWorldContract extends BaseContract {
  public approvalProgram(): boolean {
    const name = String(op.Txn.applicationArgs(0))
    log(`Hello, ${name}`)
    return true
  }
}