cove-backend
cove-backend copied to clipboard
Feature request: Huff Contracts verification
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.
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:
- [x] Split up
frameworks.rsinto aframeworksfolder 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.rsimplementation with any unit + integration tests.- I don't think huff has a metadata hash (or even a version hash), so in the
Frameworktrait we probably should changeget_artifact_metadata_settingsto return an option too, e.g.Result<Option<SettingsMetadata>, Box<dyn Error>>. Insrc/routes/verify.rsadd the Huff framework to thematch json.build_config.frameworkstatement 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
- I don't think huff has a metadata hash (or even a version hash), so in the
- [ ] 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.
Split up
frameworks.rsinto aframeworksfolder 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 https://github.com/ScopeLift/cove-backend/pull/21
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! :))
Sounds great, looking forward to it!