deploying-contracts-on-base by base/skills
npx skills add https://github.com/base/skills --skill deploying-contracts-on-basesepolia.base.org,主网:mainnet.base.org)cast wallet import)${ENV_VAR} 引用的 foundry.toml.env 文件 — 将 .env 添加到 广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
.gitignore在构建 shell 命令之前,请验证所有用户提供的值:
^[a-zA-Z0-9_/.-]+\.sol:[a-zA-Z0-9_]+$。拒绝包含空格、分号、管道符或反引号的路径。^https://[^\s;|&]+$)。拒绝非 HTTPS 或格式错误的 URL。^[a-zA-Z0-9_-]+$)。^[a-zA-Z0-9]+$)。不要将未经验证的用户输入传递给 shell 命令。
在 Base Sepolia 上支付 gas 费需要测试网 ETH。使用 CDP 水龙头 来领取。支持的代币:ETH、USDC、EURC、cbBTC。ETH 每次领取上限为 0.0001 ETH,每 24 小时可领取 1000 次。
代理行为: 如果您有浏览器访问权限,请导航到门户并直接领取。否则,请要求用户完成这些步骤并提供已注资的钱包地址。
需要 CDP API 密钥 和 钱包密钥。
npm install @coinbase/cdp-sdk dotenv
import { CdpClient } from "@coinbase/cdp-sdk";
import dotenv from "dotenv";
dotenv.config();
const cdp = new CdpClient();
const account = await cdp.evm.createAccount();
const faucetResponse = await cdp.evm.requestFaucet({
address: account.address,
network: "base-sepolia",
token: "eth",
});
console.log(`Funded: https://sepolia.basescan.org/tx/${faucetResponse.transactionHash}`);
.env 中需要的环境变量:
CDP_API_KEY_ID=your-api-key-id
CDP_API_KEY_SECRET=your-api-key-secret
CDP_WALLET_SECRET=your-wallet-secret
要为现有钱包注资而不是创建新钱包,请将其地址直接传递给 requestFaucet。
--verify 标志需要在 BaseScan 上自动验证合约,这要求提供 BaseScan API 密钥。BaseScan 使用与 Etherscan 相同的账户系统。
代理行为: 如果您有浏览器访问权限,请导航到 BaseScan 网站并创建密钥。否则,请要求用户完成这些步骤并提供 API 密钥。
export ETHERSCAN_API_KEY=your-basescan-api-key
或者,直接将其传递给 forge:
forge create ... --etherscan-api-key <your-key>
或将其添加到 foundry.toml:
[etherscan]
base-sepolia = { key = "${ETHERSCAN_API_KEY}", url = "https://api-sepolia.basescan.org/api" }
base = { key = "${ETHERSCAN_API_KEY}", url = "https://api.basescan.org/api" }
forge create src/MyContract.sol:MyContract \
--rpc-url https://sepolia.base.org \
--account <keystore-account> \
--verify \
--etherscan-api-key $ETHERSCAN_API_KEY
forge create src/MyContract.sol:MyContract \
--rpc-url https://mainnet.base.org \
--account <keystore-account> \
--verify \
--etherscan-api-key $ETHERSCAN_API_KEY
<contract-path>:<contract-name>--verify 标志可在 BaseScan 上自动验证(需要 API 密钥)| 错误 | 原因 |
|---|---|
nonce has already been used | 节点同步未完成 |
| 交易失败 | gas 费 ETH 不足 — 从水龙头领取 |
| 验证失败 | 目标网络的 RPC 端点错误 |
| 验证 403/未授权 | 缺少或 BaseScan API 密钥无效 |
每周安装数
116
仓库
GitHub 星标数
39
首次出现
2026年2月24日
安全审计
安装于
codex113
github-copilot112
kimi-cli112
gemini-cli112
cursor112
amp112
sepolia.base.org, mainnet: mainnet.base.org)cast wallet import)foundry.toml with ${ENV_VAR} references.env files — add .env to .gitignoreBefore constructing shell commands, validate all user-provided values:
^[a-zA-Z0-9_/.-]+\.sol:[a-zA-Z0-9_]+$. Reject paths with spaces, semicolons, pipes, or backticks.^https://[^\s;|&]+$). Reject non-HTTPS or malformed URLs.^[a-zA-Z0-9_-]+$).^[a-zA-Z0-9]+$).Do not pass unvalidated user input into shell commands.
Testnet ETH is required to pay gas on Base Sepolia. Use the CDP Faucet to claim it. Supported tokens: ETH, USDC, EURC, cbBTC. ETH claims are capped at 0.0001 ETH per claim, 1000 claims per 24 hours.
Agent behavior: If you have browser access, navigate to the portal and claim directly. Otherwise, ask the user to complete these steps and provide the funded wallet address.
Requires a CDP API key and Wallet Secret.
npm install @coinbase/cdp-sdk dotenv
import { CdpClient } from "@coinbase/cdp-sdk";
import dotenv from "dotenv";
dotenv.config();
const cdp = new CdpClient();
const account = await cdp.evm.createAccount();
const faucetResponse = await cdp.evm.requestFaucet({
address: account.address,
network: "base-sepolia",
token: "eth",
});
console.log(`Funded: https://sepolia.basescan.org/tx/${faucetResponse.transactionHash}`);
Environment variables needed in .env:
CDP_API_KEY_ID=your-api-key-id
CDP_API_KEY_SECRET=your-api-key-secret
CDP_WALLET_SECRET=your-wallet-secret
To fund an existing wallet instead of creating a new one, pass its address directly to requestFaucet.
A BaseScan API key is required for the --verify flag to auto-verify contracts on BaseScan. BaseScan uses the same account system as Etherscan.
Agent behavior: If you have browser access, navigate to the BaseScan site and create the key. Otherwise, ask the user to complete these steps and provide the API key.
export ETHERSCAN_API_KEY=your-basescan-api-key
Alternatively, pass it directly to forge:
forge create ... --etherscan-api-key <your-key>
Or add it to foundry.toml:
[etherscan]
base-sepolia = { key = "${ETHERSCAN_API_KEY}", url = "https://api-sepolia.basescan.org/api" }
base = { key = "${ETHERSCAN_API_KEY}", url = "https://api.basescan.org/api" }
forge create src/MyContract.sol:MyContract \
--rpc-url https://sepolia.base.org \
--account <keystore-account> \
--verify \
--etherscan-api-key $ETHERSCAN_API_KEY
forge create src/MyContract.sol:MyContract \
--rpc-url https://mainnet.base.org \
--account <keystore-account> \
--verify \
--etherscan-api-key $ETHERSCAN_API_KEY
<contract-path>:<contract-name>--verify flag auto-verifies on BaseScan (requires API key)| Error | Cause |
|---|---|
nonce has already been used | Node sync incomplete |
| Transaction fails | Insufficient ETH for gas — claim from faucet |
| Verification fails | Wrong RPC endpoint for target network |
| Verification 403/unauthorized | Missing or invalid BaseScan API key |
Weekly Installs
116
Repository
GitHub Stars
39
First Seen
Feb 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex113
github-copilot112
kimi-cli112
gemini-cli112
cursor112
amp112
Azure RBAC 权限管理工具:查找最小角色、创建自定义角色与自动化分配
135,700 周安装