Ronnie Atuhaire
Ronnie Atuhaire's Blog 🤓

Ronnie Atuhaire's Blog 🤓

Smart Contract Tools For Pythonistas

Smart Contract Tools For Pythonistas

Ronnie Atuhaire's photo
Ronnie Atuhaire
·Jul 6, 2022·

4 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

  • 🌟 SmartPy
  • 🌟 Brownie
  • 🌟 PyTeal
  • 🌟 Slither
  • 🌟 PyTest
  • 🌟 Web3 Py
  • 🌟 Mythril
  • 🌟 ApeWorX
  • 🌟 Manticore
  • 🌟 Conclusion

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.

image.png

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.

image.png

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.

image.png

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.

image.png

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).

image.png

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.

image.png

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.

image.png

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
image.png

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.

image.png

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.

image.png

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.

Buy Ronnie A Coffee

📢 You can also follow me on Twitter : ♥ ♥ Waiting for you! 🙂 </center

 
Share this