Skip to content

Formatting practice [ Do not actually help :) ] #1560

Answered by othaime-en
trxnt asked this question in Q&A
Discussion options

You must be logged in to vote

Functions need to have the payable specifier to receive funds. The funds are usually contained in msg.value hence you have to add the specifier payable in your function declaration.

Change your function declaration to: function fund() public payable {}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@othaime-en
Comment options

@trxnt
Comment options

Answer selected by trxnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants