Skip to content

Commit 0fab1a5

Browse files
committed
Add warning about unlinked library normalization
1 parent a237c00 commit 0fab1a5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/4. repository/1. sourcify-database.mdx

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ You can access the live schema of the database [here](https://dbdiagram.io/d/Sou
1818
In short:
1919
- Every verified contract is a coupling between a deployed contract (`contract_deployments`) and a compilation (`compiled_contracts`)
2020
- "Transformations" are applied to reach the final matching onchain bytecode from a bytecode from a compilation.
21-
- Contract bytecodes are "normalized" for deduplication. A bytecode of a popular contract like `ERC20.sol` will only be stored once.
21+
- Bytecodes and sources are dedeplicated. The bytecode and the sources of a popular contract like `ERC20.sol` will only be stored once in `sources` and `code` respectively.
22+
23+
:::warning
24+
If the contract has ["unlinked libraries"](https://docs.soliditylang.org/en/v0.8.30/using-the-compiler.html#library-linking), the placeholder strings like `__$53ae...a537$__` in bytecodes will be normalized to `0000...0000`s. This is required since the `code` column is a `bytea` type in the DB.
25+
26+
Therefore, the bytecode string from the DB **will not be identical** to the output of the compilation. You can "de-normalize" these fields by looking at the library transformations and filling the placeholders with the library identifier.
27+
:::
2228

2329
For more information about the schemas of the json fields below check the [Verifier Alliance repo](https://github.com/verifier-alliance/database-specs/tree/master/json-schemas).
2430

0 commit comments

Comments
 (0)