argotorg / argotorg/solidity

NatSpec and multiple events with identical signature

Open
#11,114 4 comments 0 reactions 0 assignees View on GitHub
low effort low impact must have natspec selected for development
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.