0
//This is the code:
pragma solidity ^0.4.16;

contract FunctionTest {

  bool public foo = true;
  string public name;
  uint256 public counter = 0;

  function setName(string name) public string returns(string) {
    string a = name;
    return a;
  }

  function writeToStorage() {
    foo = !foo;
  }

  function readFromStorageConstant() public constant returns (bool) {
    return foo;
  }

  function readFromStorageView() public view returns (bool) {
    return foo;
  }

  function increaseCounter(uint256 counter)  public returns(uint256)
  {
    counter = counter + 10;
    return counter;
  }
}
1

This line is syntactically incorrect:

function setName(string name) public string returns(string) {

It should read just:

function setName(string name) public returns(string) {

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.