Smart contracts must be compiled to Zksync VM-compatible bytecode using the zksolc compiler to prepare them for deployment on Abstract.

1

Update Hardhat configuration

Ensure your Hardhat configuration file is configured to use zksolc, as outlined in the installation guide:

hardhat.config.ts
import { HardhatUserConfig } from "hardhat/config";
import "@matterlabs/hardhat-zksync";

const config: HardhatUserConfig = {
  zksolc: {
    version: "latest",
    settings: {
      // find all available options in the official documentation
      // https://docs.zksync.io/build/tooling/hardhat/hardhat-zksync-solc#configuration
    },
  },
  defaultNetwork: "abstractTestnet",
  networks: {
    abstractTestnet: {
      url: "https://api.testnet.abs.xyz",
      ethNetwork: "sepolia",
      zksync: true,
      chainId: 11124,
    },
    abstractMainnet: {
      url: "https://api.mainnet.abs.xyz",
      ethNetwork: "mainnet",
      zksync: true,
      chainId: 2741,
    },
  },
  solidity: {
    version: "0.8.24",
  },
};

export default config;
2

Compile contracts

Compile your contracts with zksolc:

npx hardhat clean && npx hardhat compile --network abstractTestnet

This will generate the artifacts-zk and cache-zk directories containing the compilation artifacts (including contract ABIs) and compiler cache files respectively.