You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have identified that the cargo stylus export-abi --json command causes an "Identifier already declared" error for contracts written in Rust (even though commands like check and deploy work without issues).
While troubleshooting the issue, we found that the command works correctly when executed without the --json option.
Ultimately, we confirmed that running the solc --abi command on the interface generated by cargo stylus export-abi also results in the same error.
The root cause of the problem is as follows:
4.1. We found that this issue occurs when extracting the ABI from inherited smart contracts.
4.2. Due to inheritance, duplicate functions are automatically removed during extraction, but duplicate error declarations are not.
4.3. When adding the --json option to cargo stylus export-abi, it converts the extracted interface into a JSON file and uses solc --abi , which causes the error.
To resolve this issue, the logic for generating the interface needs to check for and remove duplicate error declarations as well as functions.
My cargo version is cargo 1.80.0, and the cargo stylus version is 0.4.2. Thank you.
The text was updated successfully, but these errors were encountered:
markjung96
changed the title
The cargo stylus export-abi command causes an error with interfaces that have inheritance structures.
[Bug] The cargo stylus export-abi command causes an error with interfaces that have inheritance structures.
Aug 14, 2024
4.1. We found that this issue occurs when extracting the ABI from inherited smart contracts.
4.2. Due to inheritance, duplicate functions are automatically removed during extraction, but duplicate error declarations are not.
4.3. When adding the --json option to cargo stylus export-abi, it converts the extracted interface into a JSON file and uses solc --abi , which causes the error.
The text was updated successfully, but these errors were encountered: