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. – smarx Feb 7 '18 at 21:26

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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