Verification with Libraries
Normally when a contract has linked libraries these are noted in the
libraries field in the metadata:
These contract addresses for linked libraries need to be passed to the compiler for linking prior to the compilation, and should not be replaced directly in the bytecode. See the Warning in Solidity docs.
However some tools and frameworks do regex replace the placeholders in the bytecode. This causes the addresses not to be found in the metadata. In that case, Sourcify compares the onchain deployed bytecode with the compiled deployed bytecode (with placeholders) to extract the linked library addresses. This will be saved in a file called
library-map.json in the repository.
Check out these examples:
Starting from Solidity v0.5.0, the placeholders are of format
__$<keccak256LibraryNameHash>$__ but before the format was