0
ParserError: Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead. --> contracts/Mhetoken.sol:88:17: | 88 | function () { | ^
1
  • Hi! Could you please include the code in the contract that is causing the error? The message you posted says it's on line 88
    – Linum Labs
    May 4, 2021 at 14:22

1 Answer 1

0

Although the contract code is not provided. But looking at the error message seems like OP is trying to declare a fallback function. The correct syntax is:

fallback() external {
      
}

receive is a new keyword in Solidity 0.6.x that is used as a fallback function that is only able to receive ether.

  • receive() external payable — for empty calldata (and any value)
  • fallback() external payable — when no other function matches (not even the receive function). Optionally payable.
1
  • CAN YOU SOMEHOW CALL ON CONTACT ME. I EMALILED YOU May 4, 2021 at 17:20

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.