Skip to main content
grammar
Source Link

Being new to Ethereum smart contracts, I didn't realize how easy it was to send eth from a testBrownie test to a deployed contract. For future newbies, here's how:

# deploy contract
myContract = MyContract.deploy({'from': admin})

# transfering from an account to contract calls the contract's __default__() method
accounts[0].transfer(myContract.address, 1) 

Being new to Ethereum smart contracts, I didn't realize how easy it was to send eth from a test to a deployed contract. For future newbies, here's how:

# deploy contract
myContract = MyContract.deploy({'from': admin})

# transfering from an account to contract calls the contract's __default__() method
accounts[0].transfer(myContract.address, 1) 

Being new to Ethereum smart contracts, I didn't realize how easy it was to send eth from a Brownie test to a deployed contract. For future newbies, here's how:

# deploy contract
myContract = MyContract.deploy({'from': admin})

# transfering from an account to contract calls the contract's __default__() method
accounts[0].transfer(myContract.address, 1) 
Source Link

Being new to Ethereum smart contracts, I didn't realize how easy it was to send eth from a test to a deployed contract. For future newbies, here's how:

# deploy contract
myContract = MyContract.deploy({'from': admin})

# transfering from an account to contract calls the contract's __default__() method
accounts[0].transfer(myContract.address, 1)