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);

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

bumped to the homepage by Community 10 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • 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 '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 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.