4
Using Web3.py to Interact with Smart Contracts
In this chapter, we will learn how to use the web3.py library to deploy and interact with smart contracts. The web3.py library doesn’t negate the necessity of writing smart contracts with Vyper or Solidity. In the previous chapter, you deployed smart contracts and interacted with smart contracts with Remix IDE. What the web3.py library does is similar to Remix IDE, so much so that you can completely replace Remix IDE with the web3.py library.
The following topics will be covered in this chapter:
- Installing web3.py
- Deploying a smart contract
- Interacting with smart contracts
Technical requirements
The code for this chapter can be found at https://github.com/PacktPublishing/Hands-On-Blockchain-for-Python-Developers--2nd-Edition/tree/main/chapter_4 ...
Get Hands-On Blockchain for Python Developers - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.