Linked Questions

9 votes
2 answers
6k 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 ...
Basilji's user avatar
  • 199
5 votes
1 answer
8k 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 ...
TimRicta's user avatar
  • 167
2 votes
1 answer
500 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 ...
wakerch's user avatar
  • 441
1 vote
0 answers
285 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 ...
rachel_hong'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
51 votes
4 answers
41k 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 ...
Rob Hitchens's user avatar
  • 54.8k
18 votes
3 answers
3k 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 ...
madhan siva's user avatar
3 votes
2 answers
2k 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!) ...
Sergey Potekhin's user avatar
4 votes
4 answers
2k 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 ...
Roy Pun's user avatar
  • 209
3 votes
2 answers
2k 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 ...
ethereal's user avatar
  • 1,805
4 votes
1 answer
818 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 ...
manidos's user avatar
  • 4,278
4 votes
1 answer
843 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?
Paul's user avatar
  • 43
5 votes
1 answer
928 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. ...
Kamal Kishor Mehra's user avatar
2 votes
1 answer
776 views

Why is it impossible to get return values of state-changing calls? [duplicate]

From reading I have surmised that it is impossible to get the return value of state changing calls. Consider this example.sol: contract F { function createChildContract() public returns (address ...
The Burger King's user avatar
0 votes
1 answer
315 views

Function returns undefined

I have a very simple function in my Solidity contract, that I'm trying to test its return value with Hardhat. function mintNFT(address _recipient) public returns (uint256) { uint256 ...
teh0wner's user avatar
  • 101

15 30 50 per page