How much gas should I allocate?

udiWertheimerudiWertheimer Member Posts: 3
edited August 2014 in Smart Contracts and Dapps
I'm playing around with the Go client and Mutan to build the "meta-coin" from this tutorial:

Here is the contract code I used:

contract.storage[tx.origin()] = 10**20

return compile {
var to = this.data[0]
var from = tx.origin()
var value = this.data[1]

if contract.storage[from] > value {
contract.storage[from] = contract.storage[from] - value
contract.storage[to] = contract.storage[to] + value
}
}
How much ether (or other denomination) should I allocate for gas price, and how much gas should I allocate? I seem to always get a "not enough gas" error in the console, but maybe I'm missing something...

Comments

  • StephanTualStephanTual London, EnglandMember, Moderator Posts: 1,282 mod
    Because we're in testnet phase, the limits are set high and the cost high. Try 5000 gas at 10 szabo, I tried it Sunday on the same contract and it worked just fine. The extra gaz will be refunded to you of course.
Sign In or Register to comment.