Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Blockchain for Python Developers

You're reading from   Hands-On Blockchain for Python Developers Empowering Python developers in the world of blockchain and smart contracts

Arrow left icon
Product type Paperback
Published in Jun 2024
Publisher Packt
ISBN-13 9781805121367
Length 436 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Arjuna Sky Kok Arjuna Sky Kok
Author Profile Icon Arjuna Sky Kok
Arjuna Sky Kok
Arrow right icon
View More author details
Toc

Table of Contents (27) Chapters Close

Preface 1. Part 1:Blockchain and Smart Contract FREE CHAPTER
2. Chapter 1: Introduction to Blockchain Programming 3. Chapter 2: Smart Contract Fundamentals 4. Chapter 3: Using Vyper to Implement a Smart Contract 5. Part 2: Web3 and Ape Framework
6. Chapter 4: Using Web3.py to Interact with Smart Contracts 7. Chapter 5: Ape Framework 8. Chapter 6: Building a Practical Decentralized Application 9. Part 3: Graphical User Interface Applications
10. Chapter 7: Front-End Decentralized Application 11. Chapter 8: Cryptocurrency Wallet 12. Part 4: Related Technologies
13. Chapter 9: InterPlanetary: A Brave New File System 14. Chapter 10: Implementing a Decentralized Application Using IPFS 15. Chapter 11: Exploring Layer 2 16. Part 5: Cryptocurrency and NFT
17. Chapter 12: Creating Tokens on Ethereum 18. Chapter 13: How to Create an NFT 19. Part 6: Writing Complex Smart Contracts
20. Chapter 14: Writing NFT Marketplace Smart Contracts 21. Chapter 15: Writing a Lending Vault Smart Contract 22. Chapter 16: Decentralized Exchange 23. Part 7: Building a Full-Stack Web3 Application
24. Chapter 17: Token-Gated Applications 25. Index 26. Other Books You May Enjoy

Developing smart contracts

Before you develop smart contracts, let’s understand the structure of the project. We start with the ape-config.yaml file. This is the configuration file of your project. Let’s take a look at the content of the file:

$ cat ape-config.yaml
name: Simple Storage

Right now, it only contains the name of the project. But later, you’ll add more configurations to this file for your project.

.gitignore is a configuration file that ignores files in this project directory when you commit the project into a Git repository.

The contracts directory is a directory that keeps your Vyper files. The scripts directory is where you put your Python files that will interact with smart contracts. The tests directory is the place of test files for smart contracts.

Let’s develop a smart contract project using Ape Framework!

Compiling a smart contract

Create a Vyper file named SimpleStorage.vy inside the contracts folder and add the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime