Token warning code Warning: Function state mutability can be restricted to view --> Muscky_Token.sol:20:1: | 20 | function balanceOf(address owner) public returns(uint) { | ^ (Relevant source part starts here and spans across multiple lines).

1 Answer 1


You would just have to declare the function like so:

function balanceOf(address owner) public view returns(uint) {...}

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.