> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abs.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Foundry - Compiling Contracts

> Learn how to compile your smart contracts using Foundry on Abstract.

Smart contracts must be compiled to [Zksync VM](https://docs.zksync.io/zksync-protocol/vm)-compatible bytecode using the [`zksolc`](https://matter-labs.github.io/era-compiler-solidity/latest/) compiler to prepare them for deployment on Abstract.

<Steps>
  <Step title="Configure foundry.toml">
    Update your `foundry.toml` file to include the following options:

    ```toml theme={null}
    [profile.default]
    src = 'src'
    libs = ['lib']
    fallback_oz = true
    is_system = false # Note: NonceHolder and the ContractDeployer system contracts can only be called with a special is_system flag as true
    mode = "3"

    [etherscan]
    abstractTestnet = { chain = "11124", url = "https://api-sepolia.abscan.org/api", key = "TACK2D1RGYX9U7MC31SZWWQ7FCWRYQ96AD"}
    abstractMainnet = { chain = "2741", url = "https://api.abscan.org/api", key = ""}
    ```
  </Step>

  <Step title="Compile contracts">
    Compile your contracts using the following command:

    ```bash theme={null}
    forge build --zksync
    ```

    This will generate the `zkout` directory containing the compiled smart contracts.
  </Step>
</Steps>
