Skip to content

Commit

Permalink
Merge branch 'main' into db/update-supported-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tomimor authored Oct 18, 2024
2 parents 124825f + 2b86f6f commit c3078f2
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/zksync-specifics/limitations/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,33 @@ There are three possible solutions to address this issue:
contract MainContract is ContractPart1, ContractPart2 {
// Logic to combine the functionalities of both parts
}
```
```
### Non inlinable libraries
Compiling contracts without linking non-inlinable libraries is currently not supported. Libraries need to be deployed before building contracts using them.
When building the contracts, the addresses need to be passed using the `libraries` config which contains a list of `CONTRACT_PATH`:`ADDRESS` mappings.
on `foundry.toml`:
```toml
libraries = [
"src/MyLibrary.sol:MyLibrary:0xfD88CeE74f7D78697775aBDAE53f9Da1559728E4"
]
```
as a `cli` flag:
```bash
forge build --zksync --libraries src/MyLibrary.sol:MyLibrary:0xfD88CeE74f7D78697775aBDAE53f9Da1559728E4
```
For more information please refer to [official docs](https://docs.zksync.io/build/developer-reference/ethereum-differences/libraries).
#### Listing missing libraries
To scan missing non-inlinable libraries, you can build the project using the `--zk-detect-missing-libraries` flag. This will give a list of the libraries that need to be deployed and their addresses provided via the `libraries` option for the contracts to compile. Metadata about the libraries will be saved in `.zksolc-libraries-cache/missing_library_dependencies.json`.

0 comments on commit c3078f2

Please sign in to comment.