El compilador de Remix Solidity está dando un error (el punto y coma del token esperado obtuvo 'Devoluciones')

Cuando depuro un contrato similar en Remix :

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

Me devuelve este error:

contract.sol:2:36: Error: el punto y coma del token esperado obtuvo 'Devoluciones'

callAotherRunction('cadena') devuelve (bool éxito);

                          ^

(nota sobre el formato: '^' aparece debajo de la 'r' en 'devoluciones')

Esto parece ocurrir cada vez que incluyo un retorno después de una función. ¿Cuál es la sintaxis apropiada?

return inside {} está fuera de lugar.

Respuestas (1)

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

Con explicación resumida:

// 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;
}

Espero eso ayude.