0

When I compile the program it says it's expecting a ; somewhere in line 8.

I've tried adding it in, getting rid of brackets in the line where it's telling me to, but with no avail.

Be great if you could help me out please.

Regards, New to solidity person

contract SimpleStorage {

    //this will get init to 0
    uint256 public favoriteNumber;
    
    functon store(uint256 _favoriteNumber) public {
        favoriteNumber = _favoriteNumber;
    }

}
1
  • functon -> function
    – Mad Jackal
    Commented Dec 17, 2021 at 6:04

1 Answer 1

0

You misspelled function.

contract SimpleStorage {

    //this will get init to 0
    uint256 public favoriteNumber;
    
    function store(uint256 _favoriteNumber) public {
        favoriteNumber = _favoriteNumber;
    }

}

On to the next issue.

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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