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

Base documentation off of compiled interface, not IContract file #1306

Merged
merged 9 commits into from
Oct 24, 2024

Conversation

area
Copy link
Member

@area area commented Oct 18, 2024

Closes #1272.

Primarily this is a slight rework of the docgen.js script. Instead of just using the interface file for a contract to work out which functions should be in the docs, it uses the ABI and a flattened version of the source to generate the documentation of every function that is actually on the contracts. In the event of a function being documented in multiple places, it picks the documentation that is the longest.

To get this to work cleanly, I've ended up introducing e.g. BasicMetaTransaction is IBasicMetaTransaction and equivalents in various places, which seems like something we should have been doing anyway to ensure consistency.

NB Currently based on #1305

@area area changed the title Maint/docs Base documentation off of compiled interface, not IContract file Oct 18, 2024
@area
Copy link
Member Author

area commented Oct 18, 2024

The main decision I've taken that I could have gone the other way on is how I've handled getMetaTransactionNonce. I've added (IBasicMetaTransaction, BasicMetaTransaction) to the override where it's relevant. This is because IBasicMetaTransaction defines executeMetaTransaction as an external function (implicitly, because it's an interface), whereas BasicMetaTransaction defines it as public (because it's used in executeMetaTransaction and we don't want an external call). Therefore, if both are inherited, we need to explicitly override both.

The alternative, I think, would be to move (most of) our interfaces to abstract contracts and do the override ourselves in BasicMetaTransaction.

Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚

@kronosapiens kronosapiens merged commit 2a3f7bb into develop Oct 24, 2024
2 checks passed
@kronosapiens kronosapiens deleted the maint/docs branch October 24, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc generation should result in all functions that are on contract
2 participants