Linked Questions

9 votes
2 answers

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

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

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

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

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

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

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

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

See the below contract function of which return the string (Tested in 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

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

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

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
1 vote
1 answer

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

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
0 votes
1 answer

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

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
2 3 4 5