Linked Questions

4
votes
1answer
4k views

How to get return value in web3 [duplicate]

I have a not constant function in my contract, with a boolean return value, when i call this function via web3, i always get 'undefined' Contract myContract { function setFinished(bool ...
3
votes
2answers
841 views

return function value instead of transaction receipt with web3 [duplicate]

Currently I am getting the transaction receipt instead of return value from a contract function using web3. Is there anyway to get the actual return value from a contract function call using web3 ...
2
votes
1answer
239 views

How do I capture a smart contract function return values when changing the contract status? [duplicate]

pragma solidity ^0.4.6; contract Demo { uint a; function set(uint b) returns (uint) { a = b; return a * b; } function get() constant returns (uint) { return ...
1
vote
0answers
219 views

Web3 & Solidity | How can I get return value from my method? [duplicate]

Is there any way to get return value from my method/function using web3? function sell(address _seller, uint256 _amount) public returns (uint256 _ethUserShouldReceive) { uint256 ...
143
votes
2answers
27k 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 ...
29
votes
4answers
19k views

When to use “View” and “Pure” in place of “Constant” [duplicate]

According to the solidity 0.4.17 Release Notes this release finally checks the modifiers view (used to be named constant) and pure on functions. As a rule of thumb, use view if your function ...
15
votes
2answers
1k views

How to get values returned by non constant transaction functions?

As per my understanding when I invoke a constant function without a transaction in a contract and if the function returns some result I am able to get it in EthereumJ or Go-Ethereum, But when a ...
4
votes
4answers
1k views

How can I verify that token balance (not ether balance) sent in a transaction were indeed transferred successfully?

In a transaction in which some token (e.g. DGD, DAO) balance is transferred, there is no need to verify that the address has enough tokens before sending the transaction. But if the sender doesn't ...
3
votes
2answers
868 views

Best way for web3 to receive data from function return?

Now I'm trying to delelop my first Dapp (using Metamask plugin). everything is going to be all right, but I can't get one thing: Is it possible to receive return from function, using Web3 (not JS VM!) ...
3
votes
2answers
845 views

Function call returns 0

Hey can someone help me figure out why this function returns 0, when I call it? The function doesn't throw any errors when I send a transaction to it, but the Ether isn't sent and the variables aren't ...
4
votes
1answer
550 views

Understanding TokenCreator/OwnedToken example from Solidity documentation

Here's the page containing the example https://solidity.readthedocs.io Here are two contracts that are supposed to work together(my questions are below): Here's how I think it works. Please correct ...
4
votes
1answer
687 views

How to get the transaction hash once it is mined?

In JavaScript (web3.js), how do I get the transaction-hash corresponding to a function executed in my smart contract?
5
votes
1answer
594 views

Why contract function return null decoded output in private network?

I am trying to update contract variable value and return value in the same function, It will return value if I deploy it on JavaScript VM but it returns null when I deploy contract on private network. ...
1
vote
1answer
257 views

Calling Smart Contract whoAmI function

Having a smart contract mined on testnet at address 0x5a6661c75df7de88ba74437a6dc372ccfa72a564 with the following function: function whoAmI() constant returns (address) { return msg....
0
votes
2answers
221 views

Why doesn't the contract return exact value?

I wrote a contract source which is just a FIFO queue below: pragma solidity ^0.4.0; contract queue { struct Queue { uint256[] data; uint256 front; uint256 back; } /...

15 30 50 per page