Tooluck logoTooluck
SKILL.md

solidity-security

Agent skill fromwshobson/agents

Master smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditing existing contracts, or implementing security measures for blockchain applications.

How to install solidity-security

install solidity-security
# install the agents pack with the skills CLI
npx skills add wshobson/agents

# or add only this skill to Claude Code: copy the folder

plugins/blockchain-web3/skills/solidity-security/

# into

~/.claude/skills/solidity-security/ (all projects)

.claude/skills/solidity-security/ (one project)

plugins/blockchain-web3/skills/solidity-security/SKILL.md

MITFull file
1# Solidity Security
2
3Master smart contract security best practices, vulnerability prevention, and secure Solidity development patterns.
4
5## When to Use This Skill
6
7- Writing secure smart contracts
8- Auditing existing contracts for vulnerabilities
9- Implementing secure DeFi protocols
10- Preventing reentrancy, overflow, and access control issues
11- Optimizing gas usage while maintaining security
12- Preparing contracts for professional audits
13- Understanding common attack vectors
14
15## Detailed patterns and worked examples
16
17Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.
18
19## Testing for Security
20
21```javascript
22// Hardhat test example
23const { expect } = require("chai");
24const { ethers } = require("hardhat");
25
26describe("Security Tests", function () {
27 it("Should prevent reentrancy attack", async function () {
28 const [attacker] = await ethers.getSigners();
29
30 const VictimBank = await ethers.getContractFactory("SecureBank");
31 const bank = await VictimBank.deploy();
32
33 const Attacker = await ethers.getContractFactory("ReentrancyAttacker");
34 const attackerContract = await Attacker.deploy(bank.address);
35
36 // Deposit funds
37 await bank.deposit({ value: ethers.utils.parseEther("10") });
38
39 // Attempt reentrancy attack
40 await expect(
41 attackerContract.attack({ value: ethers.utils.parseEther("1") }),
42 ).to.be.revertedWith("ReentrancyGuard: reentrant call");
43 });
44…

Excerpt shown under the repository's MIT license.

More skills in agents

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates