0xlayerghost/solidity-agent-kit/solidity-deploy

Claude Code and agent skill by 0xlayerghost/solidity-agent-kit

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

[AUTO-INVOKE] MUST be invoked BEFORE deploying contracts or writing deployment scripts (*.s.sol). Covers pre-flight checks, forge script commands, post-deployment validation, and verification. Trigger: any task involving forge script, contract deployment, or block explorer verification.

Install

npx vskill@latest install 0xlayerghost/solidity-agent-kit/solidity-deploy

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Deployment Workflow

Language Rule

  • Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.

Pre-deployment Checklist (all must pass)

StepCommand / Action
Format codeforge fmt
Run all testsforge test — zero failures required
Check gas reportforge test --gas-report — review critical functions
Verify configManually check config/*.json parameters
Dry-runforge script <Script> --fork-url <RPC_URL> -vvvv (no --broadcast)
Check balancecast balance <DEPLOYER> --rpc-url <RPC_URL> — sufficient gas?
Gas limit setDeployment command must include --gas-limit

Deployment Decision Rules

SituationRule
Default deploymentNo `--verify` — contracts are not verified on block explorers by default
User requests verificationAdd --verify and --etherscan-api-key to the command
Post-deploy verificationUse forge verify-contract as a separate step
Multi-chain deploySeparate scripts per chain, never batch multiple chains in one script
Proxy deploymentDeploy implementation first, then proxy — verify both separately
Upgradeable contractUse OpenZeppelin Upgrades Plugin (see below) — never hand-roll proxy deployment

Post-deployment Operations (all required)

  1. Update addresses in config/*.json and deployments/latest.env
  2. Test critical functions: cast call to verify on-chain state is correct
  3. Record changes in docs/CHANGELOG.md
  4. Submit PR with deployment transaction hash link
  5. If verification needed, run forge verify-contract separately

Key Security Rule

  • Before broadcasting, let the developer choose the signing method:
  • Foundry Keystore (recommended): use --account <KEYSTORE_NAME>.
  • Environment file: keep PRIVATE_KEY in a gitignored .env, run source .env, then use --private-key "$PRIVATE_KEY".
  • Never put a literal private key in a command, script, log, conversation, or committed file. Never read or print the developer's .env.
  • Never include `--broadcast` in templates. The user must explicitly add it when ready to deploy.

Command Templates

bash
# Dry-run (simulation only, no on-chain execution)
forge script script/Deploy.s.sol:DeployScript \
--rpc-url <RPC_URL> \
--gas-limit 5000000 \
-vvvv
# When the developer is ready to deploy, ask them to choose one signer:
# Keystore (recommended): add --account <KEYSTORE_NAME> --broadcast
# .env: source .env, then add --private-key "$PRIVATE_KEY" --broadcast
# Verify existing contract separately
forge verify-contract <ADDRESS> <CONTRACT> \
--chain-id <CHAIN_ID> \
--etherscan-api-key <API_KEY> \
--constructor-args $(cast abi-encode "constructor(address)" <ARG>)
# Quick on-chain read test after deployment
cast call <CONTRACT_ADDRESS> "functionName()" --rpc-url <RPC_URL>

Upgradeable Contract Deployment (OpenZeppelin Upgrades Plugin)

For any upgradeable contract (UUPS, Transparent, Beacon), use the OpenZeppelin Foundry Upgrades Plugin instead of hand-rolling proxy deployment scripts.

Why Use the Plugin
Manual ApproachWith Plugin
~30 lines: deploy impl → deploy proxy → encode initializer → wire up1 line: Upgrades.deployUUPSProxy(...)
~20 lines: deploy new impl → validate storage → upgrade proxy1 line: Upgrades.upgradeProxy(...)
Storage layout compatibility: check by eyeAuto-checked, incompatible layouts are rejected
Forgot _disableInitializers()? No warningAuto-validated
Installation
bash
forge install OpenZeppelin/openzeppelin-foundry-upgrades
forge install OpenZeppelin/openzeppelin-contracts-upgradeable@v5.0.2

Add to remappings.txt:

@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
Deploy Script Template (UUPS)
solidity
// script/Deploy.s.sol
import {Script, console} from "forge-std/Script.sol";
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
import {MyContract} from "../src/MyContract.sol";
contract DeployScript is Script {
function run() public {
vm.startBroadcast();
// One line: deploys impl + proxy + calls initialize
address proxy = Upgrades.deployUUPSProxy(
"MyContract.sol",
abi.encodeCall(MyContract.initialize, (msg.sender))
);
console.log("Proxy:", proxy);
console.log("Impl:", Upgrades.getImplementationAddress(proxy));
vm.stopBroadcast();
}
}
Upgrade Script Template
solidity
// script/Upgrade.s.sol
import {Script, console} from "forge-std/Script.sol";
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";
contract UpgradeScript is Script {
function run() public {
address proxy = vm.envAddress("PROXY_ADDRESS");
vm.startBroadcast();
// One line: validates storage layout + deploys new impl + upgrades proxy
Upgrades.upgradeProxy(proxy, "MyContractV2.sol", "");
console.log("Upgraded. New impl:", Upgrades.getImplementationAddress(proxy));
vm.stopBroadcast();
}
}

Add @custom:oz-upgrades-from MyContract annotation to V2 contract for automatic reference:

solidity
/// @custom:oz-upgrades-from MyContract
contract MyContractV2 is Initializable, OwnableUpgradeable, UUPSUpgradeable {
// ...
}
Commands
bash
# Deploy proxy (dry-run) — --ffi is required for storage layout checks
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --ffi -vvvv
# Deploy proxy (broadcast) with Foundry Keystore
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --ffi --account <KEYSTORE_NAME> --broadcast
# Or deploy with PRIVATE_KEY from a gitignored .env
source .env
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --ffi --private-key "$PRIVATE_KEY" --broadcast
# Upgrade proxy (dry-run)
PROXY_ADDRESS=0x... forge script script/Upgrade.s.sol --rpc-url <RPC_URL> --ffi -vvvv
# Upgrade proxy (broadcast) with Foundry Keystore
PROXY_ADDRESS=0x... forge script script/Upgrade.s.sol --rpc-url <RPC_URL> --ffi --account <KEYSTORE_NAME> --broadcast
# Or upgrade with PRIVATE_KEY from a gitignored .env
source .env
PROXY_ADDRESS=0x... forge script script/Upgrade.s.sol --rpc-url <RPC_URL> --ffi --private-key "$PRIVATE_KEY" --broadcast
# Validate upgrade without deploying (useful for CI)
# Use Upgrades.validateUpgrade("MyContractV2.sol", opts) in a test
Plugin API Quick Reference
FunctionPurpose
Upgrades.deployUUPSProxy(contract, data)Deploy UUPS proxy + impl + initialize
Upgrades.deployTransparentProxy(contract, admin, data)Deploy Transparent proxy + impl + initialize
Upgrades.upgradeProxy(proxy, newContract, data)Validate + deploy new impl + upgrade
Upgrades.validateUpgrade(contract, opts)Validate only, no deploy (for CI/tests)
Upgrades.getImplementationAddress(proxy)Get current implementation address
Upgrades.prepareUpgrade(contract, opts)Validate + deploy new impl, return address (for multisig)
Key Rules
  • Always use `--ffi` flag — the plugin needs it for storage layout validation
  • Always add `--sender <ADDRESS>` for upgrades — must match proxy owner, otherwise OwnableUnauthorizedAccount
  • Use `Upgrades` in scripts, `UnsafeUpgrades` only in tests — UnsafeUpgrades skips all safety checks
  • Keep V1 source code in project when upgrading — plugin needs it for storage comparison. Or use @custom:oz-upgrades-from annotation
  • Never hand-roll proxy deployment when this plugin is available — the storage layout check alone prevents critical bugs

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
3

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 1 Apr 2026, 7 months ago.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/0xlayerghost/solidity-agent-kit/solidity-deploy/badge)](https://verified-skill.com/skills/0xlayerghost/solidity-agent-kit/solidity-deploy)

Something wrong with this skill or its page? Tell us.