Linked Questions

5 votes
2 answers

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, ...
18 votes
4 answers

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 ...
260 votes
9 answers

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?
17 votes
2 answers

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 ...
18 votes
1 answer

What does Solidity's "call" function mean?

address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2;"register", "MyName"); //1"fun(uint256)")), a); //2 if(!{throw;} //3 Here ...
194 votes
2 answers

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 ...
5 votes
3 answers

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 '...
35 votes
2 answers

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 ...
0 votes
1 answer

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
1 answer

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}`); ...
5 votes
1 answer

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[...
9 votes
1 answer

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 ...