question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-simple-event-func-name should have an exception of ERC20 token

See original GitHub issue

ERC 20 is a standard. Unfortunately, they named their Transfer event the same as their transfer function.

You’re correct in marking this as a warning if no-simple-event-func-name is being checked, but I think it’s a bad idea to do so.

A nieve programmer may change that event name to something else, only to silence the linter, but this will make the token contract non-compliant. In order to remove the warning, the programmer must create an incompatible client.

I would make an exception and not report a warning if the smart contract is an ERC20 token (which may be impossible, but in that case simply don’t warn for the Transfer(address indexed, address indexed, uint256) event.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nventurocommented, Dec 20, 2018

I ended up disabling this rule globally: I find that forcing events to use CamelCase and functions to use mixedCase is enough to differentiate them.

1reaction
pablofullanacommented, Sep 28, 2018

hey @mswezey23 thanks for the feedback. I really like the idea of checking if a given code is ERCXYZ compliant, looks to me that it’s worth researching into it. First thing that comes to my mind is checking that it matches proposed interface. Do you think there may be other stuff to check/validate?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERC20 token standard vulnerability classification. · GitHub
This is a critical flaw of the standard that led to impossibility of error handling. Also depositing tokens to a contract with transfer...
Read more >
How to Create an ERC20 Token the Simple Way - Toptal
This article will detail how you can create your own Ethereum token, but before we get started, let's take a closer look at...
Read more >
Navigating the pitfalls of securely interacting with ERC20 tokens
If the call itself didn't revert, it therefore must mean that the transfer was successful and true should have been returned. With the...
Read more >
ERC 20 - OpenZeppelin Docs
SafeERC20 is a wrapper around the interface that eliminates the need to handle boolean return values. TokenTimelock can hold tokens for a beneficiary...
Read more >
Minting Your Own ERC-20 Tokens in Ethereum
For the stalls at the carnivals, they would only accept tokens as a form of payment — strictly no cash for them. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found