Linked Questions

1
vote
1answer
942 views

How do I get the transaction hash and boolean return value? [duplicate]

I'm making a simple time-lock contract in Solidity. In my funds withdraw function I have: function withdraw_funds() public returns (bool) { if (getAccounts[msg.sender].amount > 0) { ...
1
vote
1answer
1k views

How to return address from newly created contract? [duplicate]

I am trying to create a factory contract that dynamically creates new instances of another contract. And I want the factory to return the newly created contract's address; however, when I test it in ...
0
votes
1answer
620 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 ...
0
votes
1answer
600 views

web3: call function in contract that creates another contract and returns address [duplicate]

from what I (quickly) looked up, payable functions do not return values to the web3 API. In my particular use case, I have a 'Master' contract that serves as a factory for other contracts, and stores ...
0
votes
2answers
242 views

How to return the index value of transaction? [duplicate]

I wish to return the new index value once the transaction is done. pragma solidity ^0.4.18; contract Courses { struct Instructor { uint age; string fName; string lName; ...
0
votes
1answer
25 views

Retrieve the return value from a non-constant function [duplicate]

Recently, I was reading a paper in which the writers stated that "In the Ethereum smart contract, the return value of the nonconstant function can only be obtained through logs event." ...
0
votes
0answers
24 views

How to get return value from a contract on JavaScript? [duplicate]

I am making a contract with a front-end made with JS, I studied myself how to make it work calling the functions with or without variables. But I don't know how to get the return value. I would ...
0
votes
0answers
19 views

can i get returned value from contracts that changes state in javascript [duplicate]

pragma solidity >= 0.5.0; uint x; function getX() public returns(uint){ x = 6; return x; }
151
votes
2answers
32k 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 ...
26
votes
3answers
27k views

How to get return values when function with argument is called?

I am writing below a simple contract which stores all results of questionnaires for each ID. contract answer{ mapping(address => mapping(string => bool)) voters; struct qList { uint ...
7
votes
2answers
4k views

How to manipulate data in a Solidity smart contract?

I have a smart contract with some members which should get modified on certain events. For simplicity, let's imagine we have a greeter contract. If I call greeter.greet() in the JavaScript console, ...
16
votes
2answers
2k views

How do I retrieve the Voted events from TheDAO?

This question was asked by @Pablo Yabo in the comment section of the question How can I view The DAO proposals including the current voting status?.
7
votes
2answers
1k views

What's the point of returning a value in a non-constant function?

As we know you can't get the return value of a non-constant function Still ERC20 does this a lot, for example: function approve(address _spender, uint256 _value) returns (bool success) Hypothesis:...
2
votes
2answers
2k views

Retrieve data from smart contract using sendTransaction

Lets take a very basic smart contract that has one function in which you send a number and it will return the square. It has another function that returns a fixed string. contract MyContract { uint ...
4
votes
1answer
591 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 ...

15 30 50 per page