Formatting practice [ Do not actually help :) ] #1560
-
function fund() public {
require (msg.value.getConversionRate() >= MINIMUM_USD, "Didn't send enough eeeeth"); // 1e18 == 1 * 10 ** 18
funders.push(msg.sender);
addressToAmountFunded[msg.sender] += msg.value;
}
On this function I'm running into this error:
Can someone tell me what's going on? |
Beta Was this translation helpful? Give feedback.
Answered by
othaime-en
Aug 5, 2022
Replies: 1 comment 2 replies
-
Functions need to have the Change your function declaration to: |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
trxnt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Functions need to have the
payable
specifier to receive funds. The funds are usually contained inmsg.value
hence you have to add the specifierpayable
in your function declaration.Change your function declaration to:
function fund() public payable {}