.claude/skills/solidity-guard/skills/fuzz-generator/SKILL.md
Generates Foundry invariant tests and Echidna property-based fuzz tests for Solidity contracts. Creates handler contracts, invariant assertions, and fuzzing configurations.
npx skillsauth add alt-research/solidityguard fuzz-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate comprehensive fuzz tests using Foundry and Echidna. Fuzz testing finds edge cases and invariant violations that manual review and static analysis miss.
contract Handler is Test {
MyContract target;
uint256 public ghost_totalDeposited;
constructor(MyContract _target) {
target = _target;
}
function deposit(uint256 amount) public {
amount = bound(amount, 1, 1e24);
deal(address(this), amount);
target.deposit{value: amount}();
ghost_totalDeposited += amount;
}
function withdraw(uint256 amount) public {
uint256 balance = target.balanceOf(address(this));
amount = bound(amount, 0, balance);
if (amount == 0) return;
target.withdraw(amount);
ghost_totalDeposited -= amount;
}
}
contract InvariantTest is Test {
MyContract target;
Handler handler;
function setUp() public {
target = new MyContract();
handler = new Handler(target);
targetContract(address(handler));
}
function invariant_solvency() public {
assertGe(
address(target).balance,
target.totalDeposits(),
"Contract must be solvent"
);
}
function invariant_totalSupply() public {
assertEq(
target.totalSupply(),
handler.ghost_totalDeposited(),
"Supply must match deposits"
);
}
}
contract EchidnaTest is MyContract {
constructor() MyContract() {}
function echidna_solvency() public view returns (bool) {
return address(this).balance >= totalDeposits;
}
function echidna_no_overflow() public view returns (bool) {
return totalSupply <= type(uint256).max / 2;
}
}
testMode: "property"
testLimit: 50000
seqLen: 100
shrinkLimit: 5000
deployer: "0x30000"
sender: ["0x10000", "0x20000", "0x30000"]
# Foundry invariant tests
forge test --match-test "invariant" -vvv --fuzz-runs 1000
# Echidna
echidna . --contract EchidnaTest --config echidna.yaml
# With corpus
echidna . --contract EchidnaTest --corpus-dir corpus/
tools
Advanced Solidity/EVM smart contract security auditor with 104 vulnerability patterns, multi-tool integration, and professional report generation.
development
Comprehensive Solidity contract security scanner detecting 104 vulnerability patterns across reentrancy, access control, arithmetic, DeFi, proxy, and token categories. Integrates Slither, Aderyn, and Mythril with manual analysis.
testing
Analyzes storage layout, proxy patterns, and state variable security in Solidity contracts. Detects storage collisions, uninitialized pointers, and upgrade risks. Use when auditing proxy/upgradeable contracts.
development
Validates Solidity implementation against specification documents. Extracts behavior from docs (README, specs, NatSpec) and verifies code matches documented intent. Uses Trail of Bits methodology for divergence detection.