Contracting
Python Powered Smart Contracts
Native Python
Develop smart contracts in your favorite Python IDE and testing suite.
Get Empowerd
Translate your ideas to the blockchain without worrying about abstract coding paradigms.
Save Time
Spend time focusing on your product and not complex smart contract languages.
Quickstart
Install
pip3 install contracting
Your First Smart Contract
nano my_token.py
#create some state
balances = Hash(default_value=0)
#seed initial balances
@construct
def seed():
balances["me"] = 1000000
#transfer funds
@export
def transfer(to: str, from: str, amount: int):
assert balances[from] >= amount, "Insufficient Funds"
balances[to] += amount
balances[from] -= amount
Tutorials
"My Token" Tutorial Series
Create a token smart contract from scratch using Python's Contracting package. The simple smart contract will mint an initial supply to a user of our choice and then define a tansfer method for our users to use. To finish it off we create unit test to validate our new smart contact does exactly what we want it to do.
Juypter Notebook Quickstart
Jupyter is a great tool for Python programmers to develop and explore in as they combine the high feedback of a REPL with the presentation and saving of a program. If you are a Python programmer, chances are you already have Jupyter installed. If not, follow this guide to get started.