You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
owner: address
depositors: wei_value[address]
depositorsNext: num
def __init__(_owner: address):
self.owner = _owner
self.depositorsNext = 1
def check_balance() -> wei_value:
# Return our current balance
return(self.balance)
def drain():
# Send all stored value to owner
send(self.owner, self.balance)
def deposit() -> bool:
# Deposit value in the contract and record the sender and value
assert(msg.value > 0)
if self.depositors[msg.sender]:
self.depositors[msg.sender] += msg.value
return True
else:
self.depositors[msg.sender] = msg.value
return True
When using geth to estimate gas on the deposit function, I'm getting gas higher than the block limit. Is this a viper compiler error, or just a really poorly defined function on my part?
> test_contract.deposit.estimateGas()
4712388
The text was updated successfully, but these errors were encountered:
Same test contract as #270.
When using
geth
to estimate gas on thedeposit
function, I'm getting gas higher than the block limit. Is this aviper
compiler error, or just a really poorly defined function on my part?The text was updated successfully, but these errors were encountered: