• Stars
    star
    280
  • Rank 142,850 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated 11 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Algorand Smart Contracts in Python

PyTeal logo

PyTeal: Algorand Smart Contracts in Python

Build Status PyPI version Documentation Status Code style: black

PyTeal is a Python language binding for Algorand Smart Contracts (ASC1s).

Algorand Smart Contracts are implemented using a new language that is stack-based, called Transaction Execution Approval Language (TEAL).

However, TEAL is essentially an assembly language. With PyTeal, developers can express smart contract logic purely using Python. PyTeal provides high level, functional programming style abstractions over TEAL and does type checking at construction time.

Install

PyTeal requires Python version >= 3.10.

If your operating system (OS) Python version < 3.10, we recommend:

  • Rather than override the OS Python version, install Python >= 3.10 alongside the OS Python version.
  • Use pyenv or similar tooling to manage multiple Python versions.

Recommended: Install from PyPi

Install the latest official release from PyPi:

  • pip install pyteal

Install Latest Commit

If needed, it's possible to install directly from the latest commit on master to use unreleased features:

WARNING: Unreleased code is experimental and may not be backwards compatible or function properly. Use extreme caution when installing PyTeal this way.

  • pip install git+https://github.com/algorand/pyteal

Documentation

Development Setup

Setup venv (one time):

  • python3 -m venv venv

Active venv:

  • . venv/bin/activate (if your shell is bash/zsh)
  • . venv/bin/activate.fish (if your shell is fish)

Pip install PyTeal in editable state with dependencies:

  • make setup-development
  • OR if you don't have make installed:
    • pip install -e . && pip install -r requirements.txt

Format code:

  • black .

Lint using flake8:

  • flake8 docs examples pyteal scripts tests *.py

Type checking using mypy:

  • mypy pyteal scripts

Run unit tests:

  • pytest pyteal tests/unit

Run integration tests (assumes a developer-mode algod is available on port 4001):

  • pytest tests/integration

Stand up developer-mode algod on ports 4001, 4002 and tealdbg on port 9392 (assumes Docker is available on your system):

  • docker-compose up -d

Tear down and clean up resources for the developer-mode algod stood up above:

  • docker-compose down

More Repositories

1

go-algorand

Algorand's official implementation in Go.
Go
1,328
star
2

js-algorand-sdk

The official JavaScript SDK for Algorand.
TypeScript
280
star
3

py-algorand-sdk

Algorand Python SDK
Python
256
star
4

sandbox

Algorand node sandbox
Shell
233
star
5

go-algorand-sdk

Algorand Golang SDK
Go
184
star
6

indexer

searchable history and current state
Go
111
star
7

smart-contracts

Example stateful and stateless smart contracts.
JavaScript
69
star
8

java-algorand-sdk

Algorand SDK for Java7+ to interact with the Algorand network
Java
66
star
9

auction-demo

An example smart contract NFT auction on Algorand
Python
57
star
10

pointproofs

Rust
46
star
11

bls_sigs_ref

Algorand's reference implementation of bls signature scheme
Python
44
star
12

go-algorand-doc

Documentation for Algorand's Go implementation
Shell
39
star
13

conduit

Algorand's data pipeline framework.
Go
35
star
14

pyteal-utils

Python
29
star
15

node-ui

Terminal UI for remote Algorand node management.
Go
27
star
16

ledger-app-algorand

C
22
star
17

algorand-sdk-testing

Testing framework for Algorand SDKs
Gherkin
20
star
18

pairing-plus

This is a fork of pairing library with additional efficiency functionality improvement.
Rust
20
star
19

graviton

๐Ÿง‘โ€๐Ÿ”ฌ verify your TEAL program by experiment and observation
Jupyter Notebook
18
star
20

pixel

Algorand's implementation of pixel consensus signature
Rust
18
star
21

falcon

C
17
star
22

vrf

Some tools for debugging/testing the VRF
C
13
star
23

tealviewer

JavaScript
11
star
24

reach-auction

Getting Started With Reach
JavaScript
11
star
25

mule

General automation framework
Python
11
star
26

msgp

Go
10
star
27

light-client-poc

Go
9
star
28

code-samples

Code samples tied to tutorials and solutions.
JavaScript
8
star
29

go-sumhash

Go
8
star
30

generator

OpenAPI parser/generator.
Java
7
star
31

symteal

Symteal is an automated verification framework for Algorand
Racket
6
star
32

go-stateproof-verification

Go
6
star
33

avm-abi

ARC-4 ABI Reference Implementation
Go
6
star
34

pointproofs-paramgen

Rust
5
star
35

pixel_param

A rust implementation for parameter generations of Pixel signature scheme
Rust
5
star
36

avm-debugger

Debug Adapter Protocol Debugger for the Algorand Virtual Machine
JavaScript
5
star
37

messagepack-debugger

Visually compare MessagePack objects to assist with debugging.
Kotlin
4
star
38

DerivhackExamples

Examples for the 2019 Derivhack Hackathon
Java
4
star
39

app-service

Java
4
star
40

graphtrace

System for tracing timing and propagation of messages across a mesh network
Go
4
star
41

stateful-teal-auction-demo

A demo of an auction on stateful TEAL.
Shell
3
star
42

conduit-plugin-template

Get started with Algorand streaming APIs with Conduit plugin templates project.
Go
3
star
43

wallet_addresses

Algorand Inc.'s Wallet Addresses: https://github.com/algorand/wallet_addresses
3
star
44

tealsign-demo

Shell
2
star
45

conduit-cockroachdb

Experimental CockroachDB exporter for Conduit.
Go
2
star
46

aardvark-prototype

Aardvark evaluation artifact
Go
2
star
47

tealfuzz

Go
2
star
48

sortition

C++
1
star
49

ledgerfuzz

C
1
star
50

Derivhack-Demo

1
star
51

walletconnect-automation

Automation for deploying walletconnect to eks
Shell
1
star
52

py-exebot

Bot for executing code off-chain.
1
star