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

Feature request: Huff Contracts verification #19

Open
PraneshASP opened this issue Aug 31, 2023 · 4 comments
Open

Feature request: Huff Contracts verification #19

PraneshASP opened this issue Aug 31, 2023 · 4 comments

Comments

@PraneshASP
Copy link
Contributor

Currently there's no way to verify Huff contracts, as Etherscan and other explorers doesn't support Huff language yet. It would be very useful for the Huff community if Cove provides this functionality.

I'm happy to jump in and try to implement it, if its desirable to have this feature.

@mds1
Copy link
Contributor

mds1 commented Sep 1, 2023

A PR for this would be awesome! Definitely down to support more frameworks, and it would be cool to support huff as I don't think it's supported anywhere else.

I'm happy to provide any guidance if you need any help. The scope of work here is roughly:

  • Split up frameworks.rs into a frameworks folder so each framework can live in it's own file, e.g. foundry.rs. This is a good initial PR.
  • Then the next PR would be to add the huff.rs implementation with any unit + integration tests.
    • I don't think huff has a metadata hash (or even a version hash), so in the Framework trait we probably should change get_artifact_metadata_settings to return an option too, e.g. Result<Option<SettingsMetadata>, Box<dyn Error>>. In src/routes/verify.rs add the Huff framework to the match json.build_config.framework statement and the compiler should yell about anything else needed from there.
    • I also think there's no huff config file support, so I guess the build hint here would just be the command line args you need to pass to huffc? Not familiar enough with huff offhand to know if there's a better way
  • Frontend PR will be needed to add Huff support

However, just note that verification results are not persisted anywhere, so users will need to visit the cove frontend anytime they want to verify. A lightweight way to do this might be to add a feature to the frontend pre-filling the form with query parameters, so you can directly link a user to a pre-filled form they can verify with.

@mds1
Copy link
Contributor

mds1 commented Sep 1, 2023

Split up frameworks.rs into a frameworks folder so each framework can live in it's own file, e.g. foundry.rs. This is a good initial PR.

Just completed this one in #21

@PraneshASP
Copy link
Contributor Author

Awesome! I'll start working on the next PR. I'm not 100% sure if I could make this work, but it would be great if I could, as there are no options to verify huff atm. Will create a draft PR once I have some reviewable code as it would be easier to review smaller chunks and also it helps me to make sure that I steer towards the right direction / catch mistakes early (as I'm still a rust noob). Thanks for accepting this feature request! :))

@mds1
Copy link
Contributor

mds1 commented Sep 5, 2023

Sounds great, looking forward to it!

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

2 participants