1

Does it make sense to make every function in an ERC20 Token Contract unpayable using

require(msg.value == 0); 

just in case that someone accidentally sends eth to the contract.

1 Answer 1

2

No. A function requires the payable modifier to receive ETH.

There's also a fallback (no name) function that can be made payable or not. But it must be made payable.

Keep in mind inheritance if you're using libraries/frameworks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.