1

This question already has an answer here:

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() public returns (uint) {
      return  setvalues({b:90,a:45});
    }
}

enter image description here

marked as duplicate by Ismael, Community Nov 25 '17 at 4:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Hum.. your input does not seem to be a uint, am I wrong? – Florian Castelain Nov 24 '17 at 8:42
  • 1
    Since caller doesn't have view nor pure modifiers remix assumes they are part of a transaction. You should add one of those modifiers. – Ismael Nov 25 '17 at 4:38
1

I gave a try executing your code in remix and I am able to get the return value as 45 ,which is the expected output. Make sure you have the contract defined as a separate sol file or inject the dependencies if it's used with other contract.

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.