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

Include return param names in modified namespaced compilation #1050

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

ericglau
Copy link
Member

When making a modified copy of solc input to extract namespaced storage layout, we converted function return variables to unnamed bools e.g. return (bool). This allowed compilation to pass even if the NatSpec was documented with the return variable name as @return x

However, if the NatSpec of the return variable was documented by the user as in the below example using @param x instead of @return x, this fails the modified compilation even though the original format was allowed by Solidity:

/*
 * @param x my param
 */
function foo() pure returns (uint x) {
}

We should keep the return param name in the return parameters to avoid this issue.

Fixes #1049

@ericglau ericglau requested a review from a team July 22, 2024 17:28
@ericglau
Copy link
Member Author

Note: eventually we may want to remove any NatSpec and comments (other than the NatSpec for the ERC7201 storage location annotations for structs) to help avoid these kinds of issues.

@ericglau ericglau merged commit 742415c into OpenZeppelin:master Jul 22, 2024
11 checks passed
@ericglau ericglau deleted the 1049 branch July 22, 2024 18:35
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

Successfully merging this pull request may close these issues.

Hardhat compile error with @openzeppelin/hardhat-upgrades
2 participants