Search GitHub for Algorand smart contract examples and patterns. Use when finding example implementations of specific patterns (BoxMap, inner transactions), looking up contract feature usage, discovering Algorand repositories, or retrieving files from algorandfoundation repos. Strong triggers include "find an example of...", "show me how to use BoxMap", "search for voting contract examples", "get the code from puya-ts examples", "find Algorand NFT repositories".
Find working contract examples and code patterns from Algorand Foundation repositories using GitHub tools.
github_search_code, github_get_file_contents, or github_search_repositories)Determine the search type:
github_search_codegithub_get_file_contentsgithub_search_repositoriesSearch priority repositories first:
| Priority |
|---|
| Repository |
|---|
| Best For |
|---|
| 1 | algorandfoundation/devportal-code-examples | Beginner-friendly patterns |
| 2 | algorandfoundation/puya-ts | Advanced TypeScript examples |
| 3 | algorandfoundation/puya | Python examples |
| 4 | algorandfoundation/algokit-* | Templates and utilities |
Execute the search:
# Search for code patterns
github_search_code query:"BoxMap org:algorandfoundation language:typescript"
# Get specific file
github_get_file_contents owner:algorandfoundation repo:puya-ts path:examples/voting/contract.algo.ts
# List directory contents
github_get_file_contents owner:algorandfoundation repo:puya-ts path:examples
# Find repositories
github_search_repositories query:"topic:algorand smart-contract"
Always fetch test files:
*.spec.ts or *_test.pyorg:algorandfoundation and language:typescript for better resultsprojects/typescript-examples/contracts/projects/python-examples/contracts/Use web search as fallback:
site:github.com algorandfoundation {pattern} language:typescripthttps://github.com/algorandfoundation/puya-ts/tree/main/examplessite:github.com algorand {topic}Key URLs to browse directly:
| Scenario | Approach |
|---|---|
| Pattern not found in algorandfoundation | Expand search to all of GitHub |
| Need Python instead of TypeScript | Search algorandfoundation/puya instead |
| Looking for deployment patterns | Check algokit-*-template repos |
| Need ARC standard implementation | Search for "ARC-{number}" in code |