Linked Questions

210
votes
7answers
138k 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?
145
votes
2answers
28k 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 ...
34
votes
2answers
47k 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 ...
16
votes
3answers
7k views

Could we 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 ...
7
votes
1answer
11k 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 ...
13
votes
2answers
1k views

Can Solidity constant 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 constant functions. Are constant functions in any way ...
9
votes
1answer
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 ...
5
votes
2answers
901 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, ...
5
votes
1answer
972 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[...
5
votes
3answers
474 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 '...
0
votes
1answer
440 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 ...
1
vote
1answer
94 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}`); ...