Hello World Contract
Description
Section titled “Description”Example source from examples/hello-world/contract.algo.ts.
Prerequisites
Section titled “Prerequisites”LocalNet running (algokit localnet start)
Run This Example
Section titled “Run This Example”From the repository’s examples directory:
cd examples
npx tsx hello-world/contract.algo.ts
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
}
}
Other examples
Section titled “Other examples”- ARC4 Simple Voting Contract
- Auction
- Calculator Contract
- Hello World Contract
- Hello World ABI Contract
- Htlc Logicsig Signature
- Local Storage Contract
- Marketplace Contract
- Precompiled Precompiled Apps
- Precompiled Precompiled Factory
- Precompiled Precompiled Typed
- Proof Of Attendance Contract
- Scratch Storage Contract
- Simple Voting
- Tealscript Example
- Tealscript Teal Script Base
- Voting Contract
- ZK Whitelist