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
The Essential Guide to Web3

You're reading from   The Essential Guide to Web3 Develop, deploy, and manage distributed applications on the Ethereum network

Arrow left icon
Product type Paperback
Published in Nov 2023
Publisher Packt
ISBN-13 9781801813471
Length 366 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Vijay Krishnan Vijay Krishnan
Author Profile Icon Vijay Krishnan
Vijay Krishnan
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Part 1 – Introduction to Web3 FREE CHAPTER
2. Chapter 1: Fundamentals of Blockchain and Web3 3. Chapter 2: Getting Started With Ethereum 4. Chapter 3: Your First Ethereum Transaction 5. Part 2 – All about Smart Contracts
6. Chapter 4: Introduction to Smart Contracts 7. Chapter 5: Creating and Deploying Your First Smart Contract 8. Chapter 6: Smart Contract Security and Access Controls 9. Part 3 – Writing Your DApps for Web3
10. Chapter 7: Developer Tools and Libraries for Web3 Development 11. Chapter 8: Writing and Testing Your First dApp on Web3 12. Part 4 – Fungible Tokens
13. Chapter 9: Introduction to Tokenization 14. Chapter 10: Creating Your First Token 15. Part 5 – Non-Fungible Tokens
16. Chapter 11: Non-Fungible Token Standards 17. Chapter 12: Creating Your First Non-Fungible Token 18. Part 6 – Web3 Advanced Topics
19. Chapter 13: Understanding Oracles 20. Chapter 14: Zero-Knowledge Proofs and Zero-Knowledge EVMs 21. Chapter 15: L2 Networks and Rollups 22. Chapter 16: Decentralized Autonomous Organizations – Overview 23. Index 24. Other Books You May Enjoy

Deploying and testing the ERC-20 token smart contract

You are already familiar with the steps to test a smart contract, but here is another method of testing the MySimpleToken contract.

The tests for the MySimpleToken smart contract are in the test folder and a file named MySimpleToken.test.js, which contains the following test cases:

  • Test case 1 to create a token with a name
  • Test case 2 to create a token with a symbol
  • Test case 3 to check that tokens have the correct number of decimals
  • Test case 4 to check whether the token has a valid total supply
  • Test case 5 to check if users are able to query account balances
  • Test case 6 to transfer the right amount of tokens to/from an account
  • Test case 7 to see if the smart contract emits a transfer event with the right arguments
  • Test case 8 to allow for allowance approvals and queries
  • Test case 9 to emit an approval event with the right arguments
  • Test case 10 to allow an approved sender to transfer...
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 €18.99/month. Cancel anytime