Quick Start
Get your first Algorand smart contract compiled in under 5 minutes. No installation required.
What you'll learn
- Create a new project in AVM Studio
- Write a simple smart contract
- Compile your contract to TEAL
- View the generated artifacts
Step 1: Open the Editor
Navigate to the Editor page. If you don't have a project yet, you'll be prompted to create one.
- Click New Project or go to Projects
- Select Algorand TypeScript as your language
- Name your project (e.g., "my-first-contract")
- Click Create
Tip
You can also start with a template by selecting one from the template dropdown when creating a project.
Step 2: Write Your Contract
In the editor, you'll see a starter file. Replace its contents with this simple counter contract:
counter.algo.ts TypeScript
1import { Contract, GlobalState, assert, uint64 } from '@algorandfoundation/algorand-typescript'
2
3class Counter extends Contract {
4 count = GlobalState<uint64>({ initialValue: 0 })
5
6 increment(): void {
7 this.count.value = this.count.value + 1
8 }
9
10 decrement(): void {
11 assert(this.count.value > 0, 'Count cannot be negative')
12 this.count.value = this.count.value - 1
13 }
14
15 getCount(): uint64 {
16 return this.count.value
17 }
18}
This contract:
- Stores a counter value in global state
- Has methods to increment and decrement the counter
- Includes a safety check to prevent negative values
Step 3: Build Your Contract
Click the Build button in the top toolbar (or press Cmd/Ctrl + B).
The build panel will show:
- Build status - Success or failure with any error messages
- Compilation logs - Details about the build process
- Build time - How long the compilation took
Note
The first build may take a few seconds as the compiler initializes. Subsequent builds are faster.
Step 4: View Artifacts
After a successful build, you can view the generated artifacts (named after your contract):
- {Contract}.approval.teal - The approval program (main contract logic)
- {Contract}.clear.teal - The clear state program
- {Contract}.arc56.json - ARC-56 application specification (ABI)
- {Contract}Client.ts - Generated TypeScript client
- {Contract}.docs.md - Human-readable documentation
Click on the Preview tab to see the generated TEAL code, or Artifacts to download them.
Step 5: (Optional) Deploy
Ready to deploy to a network?
- Go to the Deploy tab
- Select a network (start with Testnet for testing)
- Configure your signing account (or connect a wallet)
- Click Deploy
Testnet First
Always deploy to Testnet first to verify your contract works correctly. Never deploy untested contracts to Mainnet.
Congratulations!
You've just created and compiled your first Algorand smart contract! Here's what you can do next:
- Build a complete counter app - A more detailed tutorial
- Test your contract - Learn about Ghost testing
- Deploy to a network - Put your contract on-chain
- Learn PuyaTS - Deep dive into Algorand TypeScript