Here is the smart contract, written in vyper, to be tested
owner: public(address)
name: public(String[100])
total_amount: uint256
@external
def __init__(_name: String[100]):
self.owner = tx.origin
self.name = _name
@external
@payable
def donate():
#anyone can donate to the piggy bank
self.total_amount += msg.value
@external
@view
def get_total_amount() -> uint256:
return self.total_amount
What is the right way to test the donate()
method of the smart contract with waffle and ethers.js?
Is there a sendTransaction method for ethers.js that can be called on contract's side like in this example of web3+truffle ?