Linked Questions

1
vote
1answer
845 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
541 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
1answer
417 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
2answers
165 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; ...
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 ...
23
votes
3answers
23k 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
3k 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
964 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
548 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
0answers
180 views

Can I `eth_call` a non constant function from javascript?

I know that I can't get the return value from a transaction (How to get values returned by non constant transaction functions?), and non-constant functions have return value because they can be called ...
1
vote
1answer
135 views

Where to check value returnd by function in wallet?

where do I check the value returned by a function in Ethereum wallet (I'm using v. 0.8.3)? I have set a test net and it works fine. So, after I call a function of my deployed contract , I mine on ...
0
votes
1answer
108 views

Getting hex instead of uint through mapping [duplicate]

I have a simple method where I count how many times certain address has called method of smart contract. Here is code: mapping (address => uint) countTotal; function countSends() public returns(...

15 30 50 per page