Linked Questions

9 votes
2 answers
7k 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
7 votes
4 answers
4k views

Why do we need to specify constant in the return value [duplicate]

Referring to the constant below: function totalSupply() constant returns (uint256 totalSupply);
metalbean's user avatar
1 vote
1 answer
3k views

Calculator Smart Contract [duplicate]

Below is my smart contract code for calculator. pragma solidity 0.4.24; contract Calculator{ uint result=10; function Calculator() public { } function getResult() public view ...
Ashwinkumar Suryavanshi's user avatar
0 votes
1 answer
2k views

ERC20 TestToken code returns 0 for allowance after approval [duplicate]

I have the following code in my testtoken.js and am wondering why the assertion fails with "AssertionError: allowance wasn't set to 30: expected '0' to equal 30". it("Approve an allowance of 30 ...
Jonathan Scialpi's user avatar
2 votes
1 answer
803 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
1 vote
1 answer
1k views

Function does not return value [duplicate]

The function caller() below does not return any value pragma solidity ^0.4.18; contract M2M{ function setvalues(uint a ,uint b) returns (uint){ return a; } function caller() ...
Libra Coder's user avatar
1 vote
1 answer
2k views

Can Solidity smart contracts send transactions on Ethereum? [duplicate]

I am trying to figure out whether Solidity smart contracts deployed on the Ethereum main net can send transactions. In other terms, can the address of a smart contract appear as the sender of a ...
user40789's user avatar
1 vote
1 answer
670 views

Can't return string when function not pure? [duplicate]

See the below contract function of which return the string (Tested in Remix.org): pragma solidity >=0.4.22 <0.6.0; contract HelloWorld { function get() pure public returns (string memory){ ...
Shuai Xu's user avatar
  • 101
0 votes
1 answer
668 views

Truffle not returning address [duplicate]

I'm trying to return sender address and value in truffle under private blockchain. When function is called from truffle console I'm not getting proper msg.sender address. Contract code pragma ...
Jaydeep Chauhan's user avatar
1 vote
2 answers
386 views

How to read data returned by a function? [duplicate]

Counter.sol: pragma solidity >=0.5.0 <0.7.0; contract Counter { uint public _counter = 0; function GenNextID() public returns (uint) { return _counter++; } } I use ...
warchantua's user avatar
0 votes
1 answer
478 views

How do I take value from array of objects? [duplicate]

I have a problem with my code. contract Registration { address public owner; uint conceptPrice; uint conceptValue; function Registration(uint _conceptPrice) public { owner = msg.sender; ...
Davide's user avatar
  • 13
0 votes
1 answer
357 views

ENS Resolver Transaction [duplicate]

If I want to find out which address a name resolves to, say example.eth, does this mean I need to send a transaction to the appropriate ENS contract for resolution? Does running a local node reduce ...
Lul Bai's user avatar
  • 191
1 vote
1 answer
275 views

Solidity, push overrides array [duplicate]

pragma solidity 0.4.24; contract ArraysExample { uint[] numbers; function addUser() public returns (uint[]) { numbers.push(random()); return numbers; } function random() ...
Marcello Bardus's user avatar
0 votes
1 answer
211 views

Function not returning expected value [duplicate]

I have a function in my contract which normally return uint function insertPerson( bytes32 personAddress, bytes32 email, bytes32 fname, bytes32 lname) public returns(uint index) { if(...
friedman1987's user avatar
0 votes
2 answers
338 views

Function does not return value on ropsten [duplicate]

This code returns the address perfectly when i run it on ganache local chain but when i run this on ropsten it just returns a "-" Any idea on what the problem is? function newMatch(uint _matchId,...
Sundeep Kumar's user avatar

15 30 50 per page
1
2 3 4 5
8