Linked Questions
15 questions linked to/from Why does a Solidity throw consume all gas?
105
votes
5
answers
44k
views
Difference between require and assert and the difference between revert and throw
I was looking at the docs and I'm looking for clarification on the difference between require and assert and throw and revert.
assert(bool condition): abort execution and revert state changes if
...
47
votes
1
answer
43k
views
Transaction Status
A very elementary question, how do I get a transaction status after firing the transaction? I mean suppose I do a sendTransaction where I transfer some amount of ether from 1 account to other, how can ...
13
votes
3
answers
5k
views
How does Ethereum cope with division of prime numbers?
I have seen this question here about representing decimals in solidity, and although of course the answer is that 'msg.value' is always in Wei, this got me thinking about how Ethereum handles division ...
15
votes
5
answers
5k
views
How do I know when I've run out of gas programmatically?
This keeps coming up on the gitter forums so I thought I'd ask and answer this question: How do you know when you've run out of gas?
2
votes
2
answers
2k
views
How to increase gas supply while making a transaction call?
I am using a private chain for deploying contracts. I came to a problem that when I call one of my functions in contract, it runs out of gas and function could not get executed. Any suggestions on how ...
3
votes
2
answers
2k
views
Checking if transaction failed over RPC
I call a contract over geth RPC using sendTransaction and get a transaction hash. Is there a way to verify over the geth RPC interface if this transaction failed due to a VM abort (Solidity throw ...
10
votes
1
answer
595
views
What is meant in this tutorial when it says that using throw will "consume all provided gas"?
When reading the solidity documentation (http://solidity.readthedocs.org/en/latest/solidity-by-example.html#voting), I came across this:
function giveRightToVote(address voter)
{
if (msg.sender !=...
4
votes
2
answers
618
views
Contract created by another contract and exceptions
I have two questions regarding contract creation and exceptions:
If contract A creates contract B and then throws in the same function, is B also deleted?
If contract A creates contract B, and B ...
6
votes
1
answer
618
views
Contract 'throw' - ether sent by the contract also reverted?
If a contract throws a exception (using 'throw') is any ether sent by the contract to other contracts or external accounts also reverted?
I understand that any contract callers have the ether value ...
2
votes
1
answer
2k
views
Unable to send ether to contract
I am working on private test-net and trying to send ether to contract but ether is not being transferred. I tried using both geth console and Mist.
eth.sendTransaction({from:eth.accounts[0], to: "...
4
votes
1
answer
529
views
Buy function not working with solidity 0.4.2
I don't know if there is any such change in latest Solidity version that is preventing execution of this function:
function buy() returns (uint amount){
amount = msg.value / buyPrice; ...
2
votes
2
answers
308
views
What should happen if I push a value into array and the function fail afterwards?
What should happen when I modify an array, afterwards in the same execution the function fails?
Should I expect the pushed value to be presented or does it get deleted?
for example:
contract ...
0
votes
1
answer
829
views
Refund mechanism - How is it possible to have transactions with M$ fee?
As stated here, my current understanding is that an unused gas is refund when the transaction succeeds (otherwise it is fully consumed)
Lately I found an article about some fee mistakes that led to ...
2
votes
1
answer
414
views
Cost if contract fails
I am busy designing a system to use smart contracts. Essentially a user selects a digital item from a website adds them to a basket, enters their wallet address and clicks "pay".
Before a contract ...
1
vote
0
answers
44
views
Why is there gas infinity here?
I'm starting with Solidity and Smart Contracts, and the static analysis in Remix is complaining about gas infinity for the function bet:
contract Forecast {
struct Bet {
address ...