> For the complete documentation index, see [llms.txt](https://docs.lumia.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lumia.org/build-on-lumia/smart-contracts.md).

# Smart contracts

**Who this is for:** developers writing and deploying Solidity contracts on Lumia. By the end of this page you'll know which tools are supported and where each task guide in this subsection lives.

**Prerequisites:** a wallet funded on Beam testnet. See [Accounts & Wallets on Lumia](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/wallets/accounts-and-wallets-on-lumia) and [Get testnet tokens](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/environment/get-testnet-tokens-faucet).

### What's different from Ethereum

Lumia is an EVM-equivalent zkEVM L2: standard Solidity compiles and runs as-is, and standard Ethereum tooling points at Lumia the same way it would at any other EVM chain. You change the network configuration, not your contracts or your workflow. A small number of opcodes behave differently or are unsupported under the zkEVM's proving constraints; see [EVM differences on Lumia](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/evm-differences-on-lumia) before you rely on anything unusual (precompiles, specific hash opcodes) in a contract you intend to deploy here.

### Supported tooling

Hardhat and Truffle both deploy and verify a contract on Lumia the same way: point their standard network config at Lumia's RPC and chain ID, then run the same commands you would on any other EVM chain.

{% tabs %}
{% tab title="Hardhat" %}
Scaffolded with `@nomicfoundation/hardhat-toolbox` (bundles ethers v6, chai matchers, gas reporter).

1. [Deploy a contract with Hardhat](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/deploy-a-contract-with-hardhat)
2. [Verify a contract with Hardhat](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/verify-a-contract-with-hardhat)
   {% endtab %}

{% tab title="Truffle" %}
Signs transactions through `@truffle/hdwallet-provider`.

1. [Deploy a contract with Truffle](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/deploy-a-contract-with-truffle)
2. [Verify a contract with Truffle](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/verify-a-contract-with-truffle)
   {% endtab %}
   {% endtabs %}

**Foundry**: standard `forge create`/`cast` pointed at Lumia's RPC works the same way it does for any other EVM chain.

### From local project to a verified contract

The diagram below shows the mechanism every deploy and verify guide in this section walks you through: a local project submits a transaction through an RPC endpoint to the network, and a separate later step publishes the source code on the explorer.

```mermaid
flowchart LR
    A[Local Hardhat or Truffle project] -->|network config: RPC URL and chain ID from reference/networks| B[Deploy command]
    B -->|submits deployment transaction| C[RPC endpoint]
    C -->|processed by| D[Lumia network: Beam testnet or mainnet]
    D -->|prints deployed address on success| E[Deployed contract address]
    E -->|verify command with constructor args| F[Explorer verification]
    F -->|source matched to bytecode| G[Explorer Contract tab]
```

### Task guides in this section

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Interact with a deployed contract</strong></td><td>Read and write a deployed contract from a script (ethers.js/web3.js) or directly from the block explorer.</td><td><a href="https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/interact-with-a-deployed-contract">https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/interact-with-a-deployed-contract</a></td></tr><tr><td><strong>Relayers &#x26; meta-transactions</strong></td><td>Gasless transaction patterns, via the account-abstraction paymaster path.</td><td><a href="https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/relayers-and-meta-transactions">https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/relayers-and-meta-transactions</a></td></tr><tr><td><strong>Web3 functions</strong></td><td>Off-chain automation triggers.</td><td><a href="https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/web3-functions">https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/web3-functions</a></td></tr><tr><td><strong>EVM differences on Lumia</strong></td><td>Read this before you deploy anything relying on non-standard opcodes or precompiles.</td><td><a href="https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/evm-differences-on-lumia">https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/smart-contracts/evm-differences-on-lumia</a></td></tr></tbody></table>

If you haven't deployed anything on Lumia yet, [Quickstart: your first contract on Lumia](https://app.gitbook.com/s/chmhPiVNAafGw48c4oU2/build-on-lumia/quickstart-your-first-contract-on-lumia) walks the whole path (wallet, funds, deploy, verify, interact) in one guide.
