Deploying a smart contract
To deploy a smart contract, you need a smart contract first. So, let’s create a smart contract. Create a file named SimpleContract.vy and add the following code to it:
# @version ^0.3.0 event Donation: Â Â Â Â donatur: indexed(address) Â Â Â Â amount: uint256 num: uint256 @external def store(num: uint256): Â Â Â Â self.num = num @external def retrieve() -> uint256: Â Â Â Â return self.num @external @payable def donate(): Â Â Â Â log Donation(msg.sender, msg.value)
This smart contract has a method named retrieve to get the value of the num state variable. It also has a method named store to change the value of the num state variable. Lastly, it has a method named donate to accept ETH.
Now, you need to compile the smart contract into the bytecode and the ABI. Let’s save them in files. To do this, first, you need to install Vyper:
(.venv) $ pip install...