Learn-skills.dev solidity-deploy
[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
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/0xlayerghost/solidity-agent-kit/solidity-deploy" ~/.claude/skills/neversight-learn-skills-dev-solidity-deploy && rm -rf "$T"
manifest:
data/skills-md/0xlayerghost/solidity-agent-kit/solidity-deploy/SKILL.mdsource content
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)
| Step | Command / Action |
|---|---|
| Format code | |
| Run all tests | — zero failures required |
| Check gas report | — review critical functions |
| Verify config | Manually check parameters |
| Dry-run | (no ) |
| Check balance | — sufficient gas? |
| Gas limit set | Deployment command must include |
Deployment Decision Rules
| Situation | Rule |
|---|---|
| Default deployment | No — contracts are not verified on block explorers by default |
| User requests verification | Add and to the command |
| Post-deploy verification | Use as a separate step |
| Multi-chain deploy | Separate scripts per chain, never batch multiple chains in one script |
| Proxy deployment | Deploy implementation first, then proxy — verify both separately |
Post-deployment Operations (all required)
- Update addresses in
andconfig/*.jsondeployments/latest.env - Test critical functions:
/cast call
to verify on-chain behaviorcast send - Record changes in
docs/CHANGELOG.md - Submit PR with deployment transaction hash link
- If verification needed, run
separatelyforge verify-contract
Command Templates
# Load environment source .env # Standard deployment (no verification by default) forge script script/Deploy.s.sol:DeployScript \ --rpc-url $RPC_URL \ --private-key $PRIVATE_KEY \ --broadcast \ --gas-limit 5000000 \ -vvvv # Deployment with verification (only when explicitly requested) forge script script/Deploy.s.sol:DeployScript \ --rpc-url $RPC_URL \ --private-key $PRIVATE_KEY \ --broadcast \ --verify \ --etherscan-api-key $ETHERSCAN_API_KEY \ --gas-limit 5000000 \ -vvvv # Verify existing contract separately forge verify-contract <ADDRESS> <CONTRACT> \ --chain-id <CHAIN_ID> \ --etherscan-api-key $ETHERSCAN_API_KEY \ --constructor-args $(cast abi-encode "constructor(address)" <ARG>) # Quick on-chain function test after deployment cast call <CONTRACT_ADDRESS> "functionName()" --rpc-url $RPC_URL cast send <CONTRACT_ADDRESS> "functionName(uint256)" 100 \ --rpc-url $RPC_URL --private-key $PRIVATE_KEY