sourcify
sourcify copied to clipboard
Verification using standard-json input
https://docs.soliditylang.org/en/v0.7.4/using-the-compiler.html#input-description
Example of a contract verified using this method on Etherscan https://rinkeby.etherscan.io/address/0x964690ade8a0f58c11f0150abde3099afaf79b22#code
@xuhcc, sorry for the delay, your issue was temporarily put aside as it was seen as an enhancement proposal, rather than a bug. I did some thinking, but don't see an efficient way of getting the compiler version just out of a standard-json file. While metadata.json specifies compiler.version and compilationTarget, the usual standard-json input used by solc does not use either of those properties. Also I'd like to clarify the use case you are referring to: should a user be able to upload only a single file (standard-json which also has the content of each source file), or do you mean that a standard-json file could be used as a replacement for metadata.json?
I did some thinking, but don't see an efficient way of getting the compiler version just out of a standard-json file. While metadata.json specifies compiler.version and compilationTarget, the usual standard-json input used by solc does not use either of those properties.
I generally like Etherscan UI. It asks user to specify the compiler version in a separate drop-down field.
Also I'd like to clarify the use case you are referring to: should a user be able to upload only a single file (standard-json which also has the content of each source file), or do you mean that a standard-json file could be used as a replacement for metadata.json?
I was referring to uploading a single file, as it simplifies the process and helps to avoid mistakes. In my case the tooling that I use (buidler/hardhat) automatically generates standard-json input file when it compiles contracts.
So, what are your thoughs on this? @FabijanC
This could be implemented but then we would need to update UI and add validation on the frontend side (validation would check from uploaded file/files what is missing user would be able to add that).
We are definitely planning to do this, it's just not on the list of top priorities of now but will definitely update you on progress.
Tnx for the proposal!
@kuzdogan is "supporting verification with sources only" something we want? Or right now we want to force the user to always upload the metadata?
Support for standard-json is definitely something we want, also since it's what the import from Etherscan does, and it gives a fair amount of perfect matches. About the verification with sources, I'm not completely sure but leaning towards supporting it. In that case we'd want to add additional steps to nudge the user to add the metadata (or compilation output json's), and worst case make them aware of what it is. For that reason maybe we keep it UI only