Libraries

The EraVM execution environment is going to be retired

Within the next six months, chains running EraVM will begin a transition. EraVM's successor is ZKsync Atlas, and all new protocol development happens there. For EraVM, that means security maintenance. Read more in Hardening EraVM: New Security Measures and the Transition Ahead (published Sep 4, 2026).

We rely on the solc optimizer for library inlining, so a library may only be used without deployment if it has been inlined by the optimizer.

The addresses of deployed libraries must be set in the project configuration. These addresses then replace their placeholders in IRs: linkersymbol in Yul and PUSHLIB in EVM legacy assembly.

All linking happens at compile-time. Deploy-time linking is not supported.

For compiling non-linkable libraries, refer to the legacy hardhat-zksync notes.


Made with ❤️ by the ZKsync Community