sourcify icon indicating copy to clipboard operation
sourcify copied to clipboard

In CheckedContract's constuctor updating the sources content works diffrently from before the refactoring

Open marcocastignoli opened this issue 2 years ago • 3 comments

check the referenced comment below

marcocastignoli avatar Jan 24 '23 14:01 marcocastignoli

TODO: Summarize the issue in detail and move back to "Todo"

This might be fixed but might have affected older contracts. We need to check the whole repo

kuzdogan avatar Mar 13 '23 09:03 kuzdogan

There used to be a loop in the CheckedContract constructor that was mistakenly rewriting the metadata.

https://github.com/ethereum/sourcify/blob/bd67c955f34698c9b6bc16d9754d933d8afc2a0f/packages/lib-sourcify/src/lib/CheckedContract.ts#L82-L91

The variable sourcesis a reference to the metadata's sources. This means that potentially some saved metadata in the repo contains content and no license fields, which would cause a different metadata with a different hash to be saved in the repo.

marcocastignoli avatar Mar 13 '23 10:03 marcocastignoli

This will not cause a problem if we recompile the contract with the existing incorrect metadata (that's missing the license field) it will output the correct metadata without problems because the license field does not affect compilation. We just need to save the output metadata when we are doing a recompilation.

The problem this causes is that the correct metadata does not get pinned on IPFS

kuzdogan avatar Dec 21 '23 09:12 kuzdogan

I guess this can be closed?

kuzdogan avatar Apr 19 '24 09:04 kuzdogan

We solved this by re-verfifying all the contracts #1287

I also mentioned this issue in the docs

marcocastignoli avatar Apr 22 '24 07:04 marcocastignoli