Member-only story

Implementing Smart Contracts Using Vyper — A Python Approach

Abhishek Chauhan
Better Programming
Published in
7 min readMar 21, 2022

--

photo by — Jan Kopřiva

Many programmers who are learning how to write a smart contract will learn about the Solidity language. There are abundant sources of online tutorials and books which will teach you about Solidity. When combined with the Truffle framework, Solidity forms a killer combo for developing a smart contract. Almost all smart contracts that live on the Ethereum blockchain are written in the Solidity programming language.

In this article, we will explore how to write a smart contract in the Vyper programming language.

Topics Covered

  1. Introduction
  2. Setting Environment
  3. Creating a smart contract using Vyper
  4. Deploying a smart contract to Ganache
  5. Interacting with smart contracts
  6. Interacting with other smart contracts
  7. Compiling code programmatically

Introduction

What is Vyper?

Vyper is a contract-oriented, pythonic programming language that targets the Ethereum Virtual Machine (EVM). Vyper has very simple/intelligible syntax; one of the principles of Vyper is to make it virtually impossible for developers to code misleading programs.

Why Vyper?

  • Security: It should be possible and natural to build secure smart contracts in Vyper.
  • Language and compiler simplicity: The language and the compiler implementation should strive to be simple.
  • Auditability: Vyper code should be maximally human-readable. Furthermore, it should be maximally difficult to write misleading code. Simplicity for the reader is more important than simplicity for the writer, and simplicity for readers with low prior experience with Vyper (and low prior experience with programming in general) is particularly important.

Because of this Vyper provides the following features:

  • Bounds and overflow checking: On array accesses and…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

--

--

Abhishek Chauhan
Abhishek Chauhan

Written by Abhishek Chauhan

👨‍💻 Blockchain dev sharing insights on innovative solutions. Follow me on LinkedIn: https://www.linkedin.com/in/ac12644 🤝 GitHub: https://github.com/ac12644

Responses (1)

Write a response