Linked Questions

259 votes
9 answers
194k views

What is meant by the term "gas"?

An Ethereum application that I want to use talks about needing "gas" to run. What is gas, and where do I get it?
Jeff Coleman's user avatar
192 votes
2 answers
57k views

What is the difference between a transaction and a call?

What is the difference between a transaction and a call? In some interfaces, I can interact with contracts via calls or via transactions. What is the difference between the two, and can contracts also ...
mKoeppelmann's user avatar
  • 7,586
35 votes
2 answers
48k views

How do Ethereum's transaction fees compare to Bitcoin?

Ethereum has faster transactions than the 10 minutes of standard bitcoin protocol. How do the transaction fees compare at the moment if you translate the price into a comparable currency like dollars ...
Christian's user avatar
  • 753
18 votes
4 answers
8k views

How can I call a constant function without spending any gas inside a transaction function?

I have a sorted linked list that contains around 1000 items. When I receive a new item my goal is to push the item to the list keeping the sorted order. So if I receive very small value, I am required ...
alper's user avatar
  • 8,368
17 votes
1 answer
29k views

What does Solidity's "call" function mean?

address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2; nameReg.call("register", "MyName"); //1 nameReg.call(bytes4(sha3("fun(uint256)")), a); //2 if(!nameReg.call.value(10)){throw;} //3 Here ...
Jim Green's user avatar
  • 677
17 votes
2 answers
2k views

Can Solidity view/pure functions be arbitrarily complex?

Non-constant functions are limited in computational complexity by the block gas limit. I assume, but am not sure, that this does not apply to view/pure functions. Are view/pure functions in any way ...
SCBuergel's user avatar
  • 8,704
5 votes
2 answers
3k views

Who, what or where is a contract executed on a call? [duplicate]

In most exaplanations of the essentials of Ethereum, I miss an important detail: "Who runs the computations of a smart contract?". Say I make a call, add some gas, all of which allows me to, say, ...
berkes's user avatar
  • 217
9 votes
1 answer
2k views

Does Solidity's constant keyword do anything?

It seems that the purpose of function foo() constant {} is to indicate that a function does not change the contract's state. And yet, as it states here, the compiler doesn't actually enforce this. So ...
redsquirrel's user avatar
5 votes
1 answer
1k views

What's the difference in the ways of calling a contract function?

After I get an instance of a contract, there are 3 ways to call the contract function below: 1.testInstance.testfunc({from:eth.accounts[0]}) 2.testInstance.testfunc.sendTransaction({from:eth.accounts[...
user2781581's user avatar
5 votes
3 answers
788 views

Constant contract calls from web3 returning inconsistent values

I've got this dapp on the main net here. The following contract has been deployed at this address : pragma solidity ^0.4.19; import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; import '...
teawaterwire's user avatar
0 votes
1 answer
1k views

Can a contract function both change the state and return a value when it's called externally [duplicate]

Assume we have a test() function in our contract: contract { uint state; function test() returns (bool ){ state= 5; return true; } } I'm aware that if the test() function didn't have to ...
Aydin's user avatar
  • 2,107
1 vote
1 answer
110 views

Transaction not being recorded

I'm writing a snippet of code that should call an API and record the response to the chain: function(APIResponse) { // Write to chain console.log(`API responded with:\n${APIResponse}`); ...
user3223162's user avatar