0

When I debug a similar contract in Remix:

function ConstructorFunction(uint _inputOne, uint _inputTwo){
    callsAnotherFunction('string') returns (bool success);
}

I am returned this error:

contract.sol:2:36: Error: Expected token Semicolon got 'Returns'

callsAotherRunction('string') returns (bool success);

                          ^

(note regarding formatting: '^' appears beneath the 'r' in 'returns')

This seems to occur everytime I include a returns after a function. What is the appropriate syntax?

2
function ConstructorFunction(uint _inputOne, uint _inputTwo)
  public
  returns (bool success)
{
    callAnotherFunction('string');
    return true;
}

With summarized explanation:

// describe the function i/o and visibility
// input - types and optional variable name assigments 
function ConstructorFunction(uint _inputOne, uint _inputTwo)
  // visibility
  public
  // output - returned type(s) and optional labels
  returns (bool success)
// define the function
{
    // do something
    callAnotherFunction('string');
    // return args with types that match expected interface described above
    return true;
}

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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