Skip to main content
When building smart contracts on Abstract, you often need to interact directly with system contracts to perform operations, such as:

Installing system contracts

To use system contracts into your smart contracts, install the @matterlabs/zksync-contracts package. forge install matter-labs/era-contracts
Then, import the system contracts into your smart contract:

Available System Contract Helper Libraries

A set of libraries also exist alongside the system contracts to help you interact with them more easily.

System contract libraries source code

View all the source code for the system contract libraries.

The isSystem Flag

Each transaction can contain an isSystem flag that indicates whether the transaction intends to use a system contract’s functionality. Specifically, this flag needs to be true when interacting with the ContractDeployer or the NonceHolder system contracts. To make a call with this flag, use the SystemContractsCaller library, which exposes functions like systemCall, systemCallWithPropagatedRevert, and systemCallWithReturndata.

Configuring Hardhat & Foundry to use isSystem

You can also enable the isSystem flag for your smart contract development environment.

Hardhat

Add enableEraVMExtensions: true within the settings object of the zksolc object in the hardhat.config.js file.

Foundry

Add the enable_eravm_extensions = true flag to the foundry.toml configuration file.