Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Hands-On Blockchain for Python Developers
  • Table Of Contents Toc
Hands-On Blockchain for Python Developers

Hands-On Blockchain for Python Developers - Second Edition

By : Arjuna Sky Kok
close
close
Hands-On Blockchain for Python Developers

Hands-On Blockchain for Python Developers

By: Arjuna Sky Kok

Overview of this book

We are living in the age of decentralized fi nance and NFTs. People swap tokens on Uniswap, borrow assets from Aave, send payments with stablecoins, trade art NFTs on OpenSea, and more. To build applications of this kind, you need to know how to write smart contracts. This comprehensive guide will help you explore all the features of Vyper, a programming language designed to write smart contracts. You’ll also explore the web3.py library. As you progress, you’ll learn how to connect to smart contracts, read values, and create transactions. To make sure your foundational knowledge is strong enough, the book guides you through Ape Framework, which can help you create decentralized exchanges, NFT marketplaces, voting applications, and more. Each project provides invaluable insights and hands-on experience, equipping you with the skills you need to build real-world blockchain solutions. By the end of this book, you’ll be well versed with writing common Web3 applications such as a decentralized exchange, an NFT marketplace, a voting application, and more.
Table of Contents (27 chapters)
close
close
Lock Free Chapter
1
Part 1:Blockchain and Smart Contract
5
Part 2: Web3 and Ape Framework
9
Part 3: Graphical User Interface Applications
12
Part 4: Related Technologies
16
Part 5: Cryptocurrency and NFT
19
Part 6: Writing Complex Smart Contracts
23
Part 7: Building a Full-Stack Web3 Application

Data types

After the version pragma, you can declare variables. The variable can have different data types. Create a file named DataTypes.vy, and then add some data types to it:

# @version ^0.3.0
life_is_beautiful: bool
var_int1: int8
var_int2: int64
var_int3: int128
var_int4: int256
var_uint1: uint8
var_uint2: uint64
var_uint3: uint128
var_uint4: uint256
pi: decimal

If you come from languages such as C/C++, you should be familiar with these data types. However, Vyper has more data types. Add the following data types below the previous code:

my_grandma_wallet: address
var_byte1: bytes32
var_byte2: bytes18
var_bytes: Bytes[56]
author: String[100]
enum Direction:
    NORTH
    SOUTH
    WEST
    EAST
direction: Direction
my_list: int16[5]
my_dynamic_array: DynArray[int128, 5]
struct Permission:
    write: bool
    execute: bool
my_permission: Permission
donaturs...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Hands-On Blockchain for Python Developers
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon