{"id":28630846,"url":"https://github.com/aztecprotocol/aztec-starter","last_synced_at":"2026-04-02T12:43:16.535Z","repository":{"id":213426073,"uuid":"733726710","full_name":"AztecProtocol/aztec-starter","owner":"AztecProtocol","description":"A simple aztec contract + test to get started.","archived":false,"fork":false,"pushed_at":"2025-06-08T02:36:15.000Z","size":1230,"stargazers_count":75,"open_issues_count":3,"forks_count":74,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-06-09T05:14:50.320Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AztecProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-20T01:41:12.000Z","updated_at":"2025-06-08T02:36:19.000Z","dependencies_parsed_at":"2023-12-21T00:30:07.881Z","dependency_job_id":"cf0beeea-49ee-4e2d-8ca7-c6d04ec4aa5d","html_url":"https://github.com/AztecProtocol/aztec-starter","commit_stats":null,"previous_names":["aztecprotocol/aztec-starter"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/AztecProtocol/aztec-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Faztec-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Faztec-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Faztec-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Faztec-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AztecProtocol","download_url":"https://codeload.github.com/AztecProtocol/aztec-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Faztec-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259470959,"owners_count":22862999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T13:08:49.671Z","updated_at":"2026-01-17T22:54:50.399Z","avatar_url":"https://github.com/AztecProtocol.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://aztec.network\"\u003e\n    \u003cimg src=\"https://cdn.prod.website-files.com/6847005bc403085c1aa846e0/6847514dc37a9e8cfe8a66b8_aztec-logo.svg\" alt=\"Aztec Protocol Logo\" width=\"300\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n# Aztec Starter\n\n## Local Network\n\nThis repo is meant to be a starting point for learning to write Aztec contracts and tests on the Aztec local network (local development environment). It includes an example contract, useful commands in `package.json` and helpful scripts in `./scripts`.\n\nYou can find the **Pod Racing Game contract** in `./src/main.nr`. A simple integration test is in `./src/test/e2e/index.test.ts`.\n\nThe Pod Racing contract is a two-player competitive game where players allocate points across 5 tracks over multiple rounds. The game demonstrates Aztec's private state capabilities - round choices remain private until players reveal their final scores.\n\n## Devnet\n\nThis repo connects to a locally running Aztec local network by default, but can be configured to connect to the devnet by specifying `AZTEC_ENV=devnet` in a `.env` file or by prefixing a command e.g. `AZTEC_ENV=devnet yarn deploy`.\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub Repo stars](https://img.shields.io/github/stars/AztecProtocol/aztec-starter?logo=github\u0026color=yellow)](https://github.com/AztecProtocol/aztec-starter/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/AztecProtocol/aztec-starter?logo=github\u0026color=blue)](https://github.com/AztecProtocol/aztec-starter/network/members)\n[![Build](https://github.com/AztecProtocol/aztec-starter/actions/workflows/update.yaml/badge.svg)](https://github.com/AztecProtocol/aztec-starter/actions)\n[![GitHub last commit](https://img.shields.io/github/last-commit/AztecProtocol/aztec-starter?logo=git)](https://github.com/AztecProtocol/aztec-starter/commits/main)\n[![License](https://img.shields.io/github/license/AztecProtocol/aztec-starter)](https://github.com/AztecProtocol/aztec-starter/blob/main/LICENSE)\n[![Discord](https://img.shields.io/badge/discord-join%20chat-5B5EA6)](https://discord.gg/aztec)\n[![Twitter Follow](https://img.shields.io/twitter/follow/aztecnetwork?style=flat\u0026logo=twitter)](https://x.com/aztecnetwork)\n\n\u003c/div\u003e\n\n---\n\n## 🚀 **Getting Started**\n\nUse **Node.js version 22.15.0**.\n\n[Start your codespace from the codespace dropdown](https://docs.github.com/en/codespaces/getting-started/quickstart).\n\nGet the **local network, aztec-cli, and other tooling** with this command:\n\n```bash\nbash -i \u003c(curl -s https://install.aztec.network)\n```\n\nInstall the correct version of the toolkit with:\n\n```bash\nexport VERSION=3.0.0-devnet.6-patch.1\naztec-up \u0026\u0026 docker pull aztecprotocol/aztec:$VERSION \u0026\u0026 docker tag aztecprotocol/aztec:$VERSION aztecprotocol/aztec:latest\n```\n\n### Environment Configuration\n\nThis project uses JSON configuration files to manage environment-specific settings:\n\n- `config/local-network.json` - Configuration for local network development\n- `config/devnet.json` - Configuration for devnet deployment\n\nThe system automatically loads the appropriate configuration file based on the `ENV` environment variable. If `ENV` is not set, it defaults to `local-network`.\n\nThe configuration files contain network URLs, timeouts, and environment-specific settings. You can modify these files to customize your development environment.\n\n### Running on Local Network (Local Development)\n\nStart the local network with:\n\n```bash\naztec start --local-network\n```\n\nRun scripts and tests with default local network configuration:\n\n```bash\nyarn compile \u0026\u0026 yarn codegen  # Compile contract and generate TS\nyarn deploy       # Deploy to local network\nyarn test         # Run tests on local network\n```\n\n### Running on Devnet\n\nAll scripts support a `::devnet` suffix to automatically use devnet configuration:\n\n```bash\nyarn deploy::devnet              # Deploy to devnet\nyarn test::devnet                # Run tests on devnet\nyarn deploy-account::devnet      # Deploy account to devnet\nyarn interaction-existing-contract::devnet  # Interact with devnet contracts\n```\n\nThe `::devnet` suffix automatically sets `ENV=devnet`, loading configuration from `config/devnet.json`.\n\n---\n\n## 📦 **Install Packages**\n\n```bash\nyarn install\n```\n\n---\n\n## 🏗 **Compile**\n\n```bash\naztec compile\n```\n\nor\n\n```bash\nyarn compile\n```\n\n---\n\n## 🔧 **Codegen**\n\nGenerate the **contract artifact JSON** and TypeScript interface:\n\n```bash\nyarn codegen\n```\n\n---\n\n:warning: Tests and scripts set up and run the Private Execution Environment (PXE) and store PXE data in the `./store` directory. If you restart the local network, you will need to delete the `./store` directory to avoid errors.\n\n## Transaction Profiling\n\n**Make sure the local network is running before profiling.**\n\n```bash\naztec start --local-network\n```\n\nThen run an example contract deployment profile with:\n\n```bash\nyarn profile\n```\n\nYou can specify the bb binary path for faster native proving, e.g.\n\n```bash\nBB_BINARY_PATH=\"/home/user/.bb/bb\" BB_WORKING_DIRECTORY=\"/tmp/bb\" CRS_PATH=\"/tmp/bb\" yarn profile\n```\n\nSee the [demo-wallet for an example](https://github.com/AztecProtocol/demo-wallet/blob/main/app/scripts/copyBB.js) of how to fetch the appropriate bb binary (version and OS) in an application.\n\n## 🧪 **Test**\n\n**Make sure the local network is running before running tests.**\n\n```bash\naztec start --local-network\n```\n\nThen test with:\n\n```bash\nyarn test\n```\n\nTesting will run the **TypeScript tests** defined in `index.test.ts` inside `./src/test/e2e`, as well as the [Aztec Testing eXecution Environment (TXE)](https://docs.aztec.network/developers/guides/smart_contracts/testing) tests defined in [`first.nr`](./src/test/first.nr) (imported in the contract file with `mod test;`).\n\nNote: The Typescript tests spawn an instance of the local network to test against, and close it once the TS tests are complete.\n\n---\n\n## Scripts\n\nYou can find a handful of scripts in the `./scripts` folder.\n\n- `./scripts/deploy_account.ts` is an example of how to deploy a schnorr account.\n- `./scripts/deploy_contract.ts` is an example of how to deploy a contract.\n- `./scripts/fees.ts` is an example of how to pay for a contract deployment using various fee payment methods.\n- `./scripts/multiple_wallet.ts` is an example of how to deploy a contract from one wallet instance and interact with it from another.\n- `./scripts/profile_deploy.ts` shows how to profile a transaction and print the results.\n- `./scripts/interaction_existing_contract.ts` demonstrates how to interact with an already deployed pod racing contract, including creating games.\n- `./scripts/get_block.ts` is an example of how to retrieve and display block information from the Aztec node.\n\n### Utility Functions\n\nThe `./src/utils/` folder contains utility functions:\n\n- `./src/utils/create_account_from_env.ts` provides functions to create Schnorr accounts from environment variables (SECRET, SIGNING_KEY, and SALT), useful for account management across different environments.\n- `./src/utils/setup_wallet.ts` provides a function to set up and configure the TestWallet with proper configuration based on the environment.\n- `./src/utils/deploy_account.ts` provides a function to deploy Schnorr accounts to the network with sponsored fee payment, including key generation and deployment verification.\n- `./src/utils/sponsored_fpc.ts` provides functions to deploy and manage the SponsoredFPC (Fee Payment Contract) for handling sponsored transaction fees.\n- `./config/config.ts` provides environment-aware configuration loading, automatically selecting the correct JSON config file based on the `ENV` variable.\n\n## ❗ **Error Resolution**\n\n:warning: Tests and scripts set up and run the Private Execution Environment (PXE) and store PXE data in the `./store` directory. If you restart the local network, you will need to delete the `./store` directory to avoid errors.\n\n### 🔄 **Update Node.js and Noir Dependencies**\n\n```bash\nyarn update\n```\n\n### 🔄 **Update Contract**\n\nGet the **contract code from the monorepo**. The script will look at the versions defined in `./Nargo.toml` and fetch that version of the code from the monorepo.\n\n```bash\nyarn update\n```\n\nYou may need to update permissions with:\n\n```bash\nchmod +x .github/scripts/update_contract.sh\n```\n\n## AI Agent Contributor Guide\n\nThis repository includes an [AGENTS.md](./AGENTS.md) file with detailed\ninstructions for setting up your environment, running tests, and creating\npull requests. Please read it before contributing changes.\n\n### 💬 Join the Community:\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://forum.aztec.network\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Aztec%20%20Forum-5C4C9F?style=for-the-badge\u0026logo=startrek\u0026logoColor=white\" alt=\"Forum\"\u003e\n  \u003c/a\u003e  \n  \u003ca href=\"https://t.me/AztecAnnouncements_Official\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Telegram-26A5E4?logo=telegram\u0026logoColor=white\u0026style=for-the-badge\" alt=\"Telegram\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/aztec\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Discord-5865F2?logo=discord\u0026logoColor=white\u0026style=for-the-badge\" alt=\"Discord\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://x.com/aztecnetwork\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Twitter-000000?logo=x\u0026logoColor=white\u0026style=for-the-badge\" alt=\"Twitter (X)\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faztecprotocol%2Faztec-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faztecprotocol%2Faztec-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faztecprotocol%2Faztec-starter/lists"}