I usually don't want to learn a new language when it comes to new technology and would always first lookout for alternatives to the language am familiar with before I give in.
We all know Solidity is the language used to write Ethereum smart contracts. It took inspiration from C++, Javascript, and Python. But what if I told you that you could write smart contracts with python too.
There is a language called Vyper. Vyper is a contract-oriented, pythonic programming language that targets the Ethereum Virtual Machine (EVM) and we shall not look at this today.
Using a popular programming language, such as Python, to write smart contracts is an immense advantage for first-time smart contract programming.
Some of the popular blockchains developed using Python are Ethereum, Hyperledger Fabric, Steem, and NEO.
So let's jump right in;
๐ SmartPy
SmartPy is an intuitive and powerful smart contract development platform for Tezos.
The SmartPy
language is available through a Python library for building and analyzing Tezos smart contracts.
Tezos is a self-upgradable and energy-efficient Proof of Stake blockchain. Tezos is a decentralized open-source blockchain that can execute peer-to-peer transactions and serve as a platform for deploying smart contracts.
๐ Brownie
Brownie is a popular smart contract development and testing framework for the Ethereum Virtual Machine, supporting Solidity and Vyper as the smart contract languages.
Easily Install Brownie
pip install --user pipx
pipx ensurepath
pipx install eth-brownie
pipx
is a specialized package installer. It can only be used to install packages with cli
entrypoints. pipx
and pip
both install packages from PyPI (or locally) pipx
relies on pip
(and venv
)
๐ PyTeal
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.
๐ Slither
Slitheris a Solidity static analysis framework written in Python 3. It runs a suite of vulnerability detectors, prints visual information about contract details, and provides an API to easily write custom analyses.
Slither enables developers to find vulnerabilities, enhance their code comprehension, and quickly prototype custom analyses.
๐ PyTest
PyTest is the framework that makes it easy to write, test, and scale to support complex testing for applications and libraries.
Testing is really essential before you deploy your smart contracts to any blockchain because of its immutability nature.
๐ Web3 Py
Web3 Py interacts with the Ethereum blockchain via a set of publicly exposed APIs.
pip install web3
Web3.Py
is a set of libraries that allow developers to interact with Ethereum nodes using HTTP, IPC, or WebSocket protocols with Python.
You can create Ethereum transactions, and read and write data from the blockchain (this includes smart contract interaction).
๐ Mythril
Mythril is a security analysis tool for EVM
bytecode. It detects security vulnerabilities in smart contracts built for Ethereum, Hedera, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains.
๐ ApeWorX
The Ethereum application development framework for Python Developers, Data Scientists, and Security Professionals.
ApeWorX is a python-oriented tool to make a more modular finance-focused framework. It helps in managing and developing blockchain tasks.
๐ Manticore
Manticore is a multi-purpose tool written in Python. It is a super flexible smart contract audit tool. With its own command line tools and scriptable Python APIs
Obviously, there are more tools which I have not mentioned here like oyente, Python SDKs and APIs offered by different providers that you can still leverage to get started with smart contracts.
๐ Conclusion
Once again, hope you learned something today from my little closet.
Please consider subscribing or following me for related content, especially about Tech, Python & General Programming.
You can show extra love by buying me a coffee to support this free content and I am also open to partnerships, technical writing roles, collaborations and Python-related training or roles.
๐ข You can also follow me on Twitter : โฅ โฅ Waiting for you! ๐ </center