docs: add NatSpec to StdMath and StdError - #845
Merged
zerosnacks merged 1 commit intoApr 13, 2026
Merged
Conversation
sylvarissolutions-max
requested review from
0xrusowsky,
DaniPopes,
grandizzy,
mattsse,
onbjerg and
zerosnacks
as code owners
April 11, 2026 06:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #653. Two more of the files listed in the NatSpec docs checklist.
StdMath.sol
Added `@notice`, `@param`, and `@return` tags to the library and all five internal functions:
I did not rename `INT256_MIN` to `_INT256_MIN` even though the issue mentions the underscore-prefix convention for private variables. The already-merged StdAssertions.sol work (PR #666 / StdInvariant) left its private constants without the underscore prefix (for example `FAILED_SLOT`), so I matched that pattern to keep this PR purely additive. Happy to apply the rename in a follow-up or in this PR if you prefer the underscore convention going forward. Let me know which way you want to settle it.
StdError.sol
Added `@notice` to each of the nine public panic-code constants describing what Solidity panic it corresponds to. Panic codes cross-checked against the Solidity docs.
What is not in this PR
Testing
I do not have Foundry set up on this machine so I have not run `forge fmt --check` or `forge test` locally. The diff is 38 insertions and 0 deletions, all inside NatSpec comment blocks above existing declarations, so behavior is unchanged. CI should cover the formatting and test pass. If CI flags anything I will fix it in this branch.
Happy to split this into two PRs (one per file) if that is easier to review.