NatSpec and multiple events with identical signature
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
It is impossible to define multiple events with the same signature in the same contract. This lead to the design that the user documentation ("NatSpec") has a mapping of event signatures to the description of the event.
What has been possible for a while now is for a contract to emit events with the same signature but different natspec through the use of libraries or via referencing events of a different contract.. The events emitted this way were ignored in the natspec output so far.
We now have different options to solve this situation:
- change the natspec json to use arrays instead of direct objects
- only use "the first" non-empty natspec (prioritize the event in the current contract or a base and then use AST IDs for priorization)
- somehow combine the documentations (difficult for parameters etc)
- issue a warning if such a clash happens
Contributor guide
Research direction
No source files, tests, or entry points are named. First resolve which NatSpec JSON behavior should be adopted for identical event signatures—arrays, first non-empty documentation, combined documentation, or a warning—then identify the affected compiler and output tests; done means the chosen behavior is implemented and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- compilers, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100