Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events which are inherited display undefined in the description #38

Open
0xCourtney opened this issue Sep 20, 2022 · 0 comments
Open

Events which are inherited display undefined in the description #38

0xCourtney opened this issue Sep 20, 2022 · 0 comments

Comments

@0xCourtney
Copy link

If an event is inherited it will not display anything in the description. After digging through this a bit I found that the devdoc and userdoc contain different sets of information if the event was inherited compared to if it was defined on the contract or interface directly. This was not obvious at first but it became very clear after logging the output of the info object for Bar.sol and IBar.sol.

const buildInfo = await hre.artifacts.getBuildInfo(qualifiedName);
const info = buildInfo?.output.contracts[source][name] as CompilerOutputContractWithDocumentation;

const dd: any = buildInfo?.output.contracts[source][name]

console.log(name)
console.log("devdoc event", dd.devdoc.events)
console.log("userdoc event", dd.userdoc.events)
Bar
devdoc event undefined
userdoc event { 'Transfer(uint256)': { notice: 'Emitted when transfer' } }

IBar
devdoc event {
  'Transfer(uint256)': {
    details: 'Transfer some stuff',
    params: { foo: 'Amount of stuff' }
  }
}
userdoc event { 'Transfer(uint256)': { notice: 'Emitted when transfer' } }

Given that the issue is with the incoming data perhaps it makes sense to do the following, 1) when the docs have been created, check if more than one event with the same name, description, and params exists 2) combine the matched events such that they all use the most complete set of information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant