Practical vyper hello world

#1

Hi,

I’m interested to learn vyper. My challenge currently is to get started.
To get to the point, I see it is obvious how to compile a contract, get the bytecode and the abi. Then, I need to start testing its functions. The documentation is falling behind on this so I need your guys help.

There’s an issue that a guy created here: https://github.com/ethereum/vyper/issues/1481

So that pointed me to the direction of using web3/eth-tester for that.

So I assume that the fastest way to test smart contracts (vyper in this case but this works same for solidity) is working with Ganache, which creates a private local Ethereum blockchain. Am I right?

So then I made this little gist here https://gist.github.com/crypto-diaz/c36110bd357b0e422c4c7b17a9bed931
which is supposed to register Ethereum addresses for a name and then be able to retrieve them.

I run through all of that pointing it to my local Ganache but I’m getting the ZERO ADDRESS when I call lookup for that name that I submit instead of the actual address. Does anybody have any clue why?

Is there any up to date, practical vyper guide on how to test smart-contracts?

I promise I am working on something and share with everybody once I am done, but I need to get started :slight_smile:

#2

I’ll answer my own question if you don’t mind :slight_smile:

Seems to me that once you compile the contract and have the bytecode and the abi, the steps to deploy and test the contract with web3.py are the same no matter if that contract was written in solidity or vyper. The little error that I had there was that I was calling a function that writes to the blockchain like this:
greeter.functions.register(name, address).call()
when in fact I need to call it like this
greeter.functions.register(name, address).transact().

So I need to call transact() instead of call() for functions that write state. And that was it!