Book a free call

How to Deploy a Smart Contract on Base

Deploying a smart contract on Base means publishing code to an Ethereum Layer 2 network. Here is the full path, from testnet to a verified contract on BaseScan.

Hertiv engineering teamReviewed by a senior engineer
6 min read
How to Deploy a Smart Contract on Base
On this page

Short answer

Deploying a smart contract on Base means publishing compiled contract code to the Base network, an Ethereum Layer 2 network, so the contract gets its own address and anyone can call its functions. The process is: write and compile the code, test it on the Base Sepolia testnet, deploy it to Base mainnet, then verify it on BaseScan.

What does deploying a smart contract on Base mean?

Deploying a smart contract on Base means publishing compiled contract code to the Base network, an Ethereum Layer 2 network built on the OP Stack, so the contract gets its own address and anyone can call its functions. Once deployed, the code cannot be changed; only its state changes as people use it.

Base settles transactions on Ethereum, which is what makes it a Layer 2 rather than a separate chain. Fees are paid in ETH, and transactions usually confirm faster and cost less than on Ethereum mainnet, though the exact cost varies with network demand.

Deployment is the last step, not the first. A contract should be written, compiled, tested on a testnet and reviewed before it reaches mainnet, because a bug in a deployed contract cannot be patched the way a bug in a web app can. For the app side, how to build apps on Base covers what runs around the contract.

What do you need before you deploy?

Before you deploy, you need a wallet with ETH, a development tool, and the contract code itself. The wallet pays the deployment fee and owns the deployment transaction, so use a dedicated deployer wallet rather than a personal one.

ToolBest forWhat you need
RemixFirst deploys, learningBrowser wallet, testnet ETH
HardhatJavaScript teams, scriptsNode.js, project setup
FoundryFast testing, Solidity focusCommand line, Rust toolchain
Base SepoliaSafe testingTestnet ETH from a faucet
BaseScanVerification, inspectionContract source code

Testnet ETH has no real value and comes from a faucet, which is a free service that sends small amounts of testnet ETH to a wallet address. Never send real ETH to a testnet address, and never deploy with a wallet that holds funds you cannot afford to lose.

How do you test a contract on Base Sepolia?

You test a contract on Base Sepolia by deploying it to the testnet first and calling every function the way a real user would. Base Sepolia is the test network for Base: it works like mainnet but uses testnet ETH with no real value.

Start by compiling the contract and checking for warnings, then deploy it to Base Sepolia from your chosen tool. Once it has an address, call the read functions to check the state, then call the write functions with small test values and confirm the state changes as expected.

Test the failure paths too, not just the happy path. Send a transaction that should be rejected — a wrong amount, an unauthorised caller, a limit exceeded — and confirm it reverts with the expected error. A contract that only works when everything goes right is not ready for mainnet.

How do you deploy to Base mainnet?

You deploy to Base mainnet by pointing your tool at the Base network, paying the fee in ETH, and recording the contract address and ABI that come back.

  1. Compile the final code. Use the same compiler version and settings you tested with, so the deployed bytecode matches what you reviewed.
  2. Check the constructor arguments. Write down every value the constructor needs, and double-check addresses and limits before you deploy.
  3. Connect to Base mainnet. Add the Base network to your wallet or tool, and confirm the chain ID matches Base mainnet.
  4. Deploy from the deployer wallet. Send the deployment transaction and wait for confirmation on BaseScan.
  5. Save the address and ABI. Store the contract address, the transaction hash and the ABI somewhere the app and the team can find them.
  6. Test the live contract. Call the read functions on mainnet and confirm the state is what you expect before announcing it.

Deploying through a script, rather than by hand, makes the process repeatable: the same script deploys the same code to testnet and mainnet, which removes a whole class of mistakes.

How do you verify a contract on BaseScan?

You verify a contract on BaseScan by submitting its source code and compiler settings so BaseScan can recompile it and confirm it matches the deployed bytecode. A verified contract shows its source code and lets anyone read and write to it through the BaseScan interface.

Verification matters because users and other developers will not trust an unverified contract: they cannot see what it does. Many wallets and apps also treat unverified contracts with suspicion, so verifying is part of launching, not an optional extra.

To verify, open the contract page on BaseScan, choose the verify option, and enter the compiler version, optimisation settings and source code exactly as deployed. If the contract imports other files, submit them all, or use the standard JSON input that lists every source file. A mismatch in any setting will fail verification, so keep the exact build settings from deployment.

What does deploying on Base cost?

Deploying on Base costs a network fee paid in ETH, and the amount varies with the size of the contract and how busy the network is at the time. Larger contracts cost more to deploy because more bytecode has to be stored on chain.

Base fees are usually lower than Ethereum mainnet fees for the same work, because Base batches transactions and settles them on Ethereum in bulk. That is a general property of the network, not a fixed price: fees rise and fall with demand, so check a gas tracker before deploying a large contract.

Budget for more than the deployment itself. Verification is free, but you will also pay for test transactions, for the first real calls that set up the contract, and for any redeployment if testing finds a problem. Deploying on testnet first is how you keep those costs on the test network, where the ETH is free.

Example (hypothetical): deploying three contracts for a small marketplace

Example (hypothetical): a small team is launching a marketplace on Base with three contracts: a token, a listing contract and an escrow contract. They deploy and verify each one, in order, on the same afternoon.

Each contract takes about 2 minutes to deploy and about 5 minutes to verify on BaseScan, which is 7 minutes per contract. For three contracts that comes to 21 minutes of deployment and verification time.

The team also spends 30 minutes on checks: calling the read functions on each live contract, confirming the token supply, and testing one listing end to end. The arithmetic: 21 minutes of deploying and verifying plus 30 minutes of checks is 51 minutes in total, so the whole launch fits inside an hour once the code is tested and ready.

What are the common mistakes?

The most common deployment mistakes are deploying untested code, using the wrong network, and losing the build settings needed for verification.

  • Deploying untested code. A contract that was never deployed to testnet is a guess, and mainnet is an expensive place to find out it was wrong.
  • Wrong network. Deploying to Ethereum mainnet when you meant Base, or to Base Sepolia when you meant mainnet, wastes fees and confuses users.
  • Wrong constructor arguments. An address or limit entered wrong at deployment cannot be fixed without redeploying.
  • Lost build settings. If you do not record the compiler version and optimisation settings, verification on BaseScan will fail.
  • Skipping verification. An unverified contract looks untrustworthy to users, wallets and other developers.
  • Deployer wallet with real funds. A wallet used for deployment should hold only what the deployment needs.

For a broader comparison of deployment paths, deploying smart contracts on Ethereum covers the mainnet process these steps are based on.

Key takeaways

  • Base is an Ethereum Layer 2, so deployment settles on Ethereum
  • Always deploy to Base Sepolia testnet before mainnet
  • Record the compiler settings at deployment or verification fails
  • Verify on BaseScan so users can read what the contract does
  • Fees are paid in ETH and vary with contract size and demand

Frequently asked questions

What is Base in crypto?

Base is an Ethereum Layer 2 network built on the OP Stack. It runs transactions off the Ethereum mainnet and settles them back on Ethereum, which keeps fees lower and confirmations faster than mainnet while keeping Ethereum security. It was developed by Coinbase.

Do I need ETH to deploy on Base?

Yes. Deployment fees on Base are paid in ETH, the same currency used on Ethereum mainnet. For testing, use Base Sepolia testnet ETH from a faucet, which has no real value. For mainnet, the deployer wallet needs real ETH.

How long does deploying a smart contract on Base take?

The deployment transaction itself usually confirms in seconds to a few minutes. The full process, including testing on Base Sepolia, verification on BaseScan and live checks, takes longer, usually an hour or so for a small set of contracts once the code is ready.

What is BaseScan?

BaseScan is the block explorer for the Base network. It shows transactions, contract addresses, balances and token holdings, and it lets developers verify contract source code so anyone can read what a contract does.

Can I deploy a contract on Base with Remix?

Yes. Remix is a browser-based tool that compiles Solidity, connects to a wallet, and deploys to any EVM network including Base and Base Sepolia. It suits first deploys and learning, while Hardhat and Foundry suit repeatable scripted deployments.

What happens if my contract has a bug after deployment?

The deployed code cannot be changed. The usual fix is to deploy a corrected contract and migrate users and state to the new address. Some teams use upgradeable proxy patterns, but those add their own risks and should be designed in from the start, not added later.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Deploying a contract on Base and want it built for audit? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Smart Contract Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call