deploying-contracts-on-base

Deploy Solidity contracts to the Base network with Foundry and verify on BaseScan.

3|2|Updated May 6, 2020
One-click install
npx skills add https://github.com/Dargon789/coinbase-ethereum-smartcontracts --skill deploying-contracts-on-base-dargon789
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deploying-contracts-on-base
Source: https://github.com/Dargon789/coinbase-ethereum-smartcontracts/tree/main/.agents/skills/deploying-contracts-on-base
Command: npx skills add https://github.com/Dargon789/coinbase-ethereum-smartcontracts --skill deploying-contracts-on-base-dargon789

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires foundry, base network connection, basescan api key, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of deploying smart contracts to the Base network using Foundry, ensuring contract verification and handling testnet setup for efficient contract deployment.

Core Features & Use Cases

  • Foundry Deployment: Deploy Solidity contracts to Base Mainnet or Sepolia testnet using Foundry.
  • Contract Verification: Automate contract verification on BaseScan to maintain code transparency.
  • Testnet Setup: Assist with obtaining testnet ETH and setting up BaseScan API keys for testnet deployment.

Quick Start

Deploy your contract to Base testnet by running: forge create src/MyContract.sol:MyContract --rpc-url https://sepolia.base.org --account <keystore-account> --verify --etherscan-api-key $ETHERSCAN_API_KEY.

Frequently Asked Questions about deploying-contracts-on-base

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a smart contract to the Base network using Foundry?

Deploy a smart contract to the Base network using Foundry by executing `forge create` with the Base Sepolia RPC URL, specifying your keystore account, and enabling the `--verify` flag to automatically verify the contract on BaseScan.

What is needed to verify a smart contract on BaseScan after deployment?

Verifying a smart contract on BaseScan requires a valid BaseScan API key passed via the `--etherscan-api-key` flag, along with the correct contract source code and compiler settings used during the Base network deployment.

Do I need a BaseScan API key to deploy contracts to the Base Sepolia testnet?

A BaseScan API key is not strictly required for the deployment itself, but it is necessary if you want to automate contract verification on BaseScan or interact with the testnet API for contract transparency.

Can I use Foundry to deploy Solidity contracts to both Base Mainnet and Sepolia testnet?

Yes, you can use Foundry to deploy Solidity contracts to both Base Mainnet and the Sepolia testnet by simply changing the `--rpc-url` parameter to target the specific Base network endpoint during the `forge create` execution.

What's the best way to automate contract verification when deploying to Base?

The best way to automate contract verification when deploying to Base is to include the `--verify` flag and provide your `--etherscan-api-key` directly in the Foundry `forge create` command to ensure immediate code transparency.