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

[Bug] The cargo stylus export-abi command causes an error with interfaces that have inheritance structures. #71

Open
markjung96 opened this issue Aug 13, 2024 · 0 comments

Comments

@markjung96
Copy link

  1. 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).
  2. While troubleshooting the issue, we found that the command works correctly when executed without the --json option.
  3. Ultimately, we confirmed that running the solc --abi command on the interface generated by cargo stylus export-abi also results in the same error.
  4. 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.
  5. To resolve this issue, the logic for generating the interface needs to check for and remove duplicate error declarations as well as functions.
@markjung96 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
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