pragma solidity 0.4.16 contract code - Am receiving the following message:

Could not compile source code

No visibility specified. Defaulting to "public".

function transfer (address, receiver, uint, amount);

^ ----------------^ ,

  • 1
    That's not an error. It's a warning. If you want to get rid of the warning, read what it says. If you still need help, please explain what you've tried so far.
    – user19510
    Feb 7, 2018 at 21:26

1 Answer 1


You have to specify the visibility for your function.

  function transfer public (address, receiver, uint, amount);

For your Info :-

public - all

private - only this contract

internal - only this contract and contracts deriving from it

external - Cannot be accessed internally, only externally.

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.