security

Apply defensive Solidity patterns and checklist-based validations to prevent smart-contract vulnerabilities.

1|Updated Apr 25, 2026
One-click install
npx skills add https://github.com/collat-labs/collat --skill security-collat-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security
Source: https://github.com/collat-labs/collat/tree/main/.agents/skills/ethskills/security
Command: npx skills add https://github.com/collat-labs/collat --skill security-collat-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you avoid costly smart-contract failures by teaching practical defensive Solidity patterns for common, high-impact vulnerability classes that still slip through “it compiles and tests pass” checks.

Core Features & Use Cases

  • Prevent token accounting mistakes by enforcing correct decimals handling and safe cross-token math normalization (e.g., USDC 6 decimals vs 18-decimal assumptions).
  • Block common onchain exploit paths with Checks-Effects-Interactions, reentrancy guards, and safe handling of external calls.
  • Reduce operational and integration risk using SafeERC20 for non-standard tokens, oracle safety (no DEX spot-price manipulation), bounded approvals, and a pre-deploy security checklist for production readiness.
  • Use case: Before deploying a Collateral/borrowing vault-like contract, apply the defensive patterns for reentrancy, oracle staleness/sanity, safe token transfers, and upgrade/proxy storage layout so value-moving code doesn’t fail in unexpected ways.

Quick Start

Apply the pre-deploy security checklist to your Solidity codebase and fix each flagged issue using the defensive patterns described in this Skill.

Frequently Asked Questions about security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent reentrancy attacks in Solidity smart contracts?

Prevent reentrancy in Solidity smart contracts by applying the Checks-Effects-Interactions pattern and using nonReentrant guards. These defensive patterns ensure state changes occur before external calls, blocking common exploit paths that drain contract balances.

What is a pre-deploy security checklist for smart contracts?

A pre-deploy security checklist for smart contracts validates token decimals, SafeERC20 usage, oracle staleness checks, bounded approvals, and strict access control before production launch. It ensures automated tooling verifies upgradeability and proxy storage layout correctness.

How do I handle different token decimals in cross-token Solidity math?

Handle different token decimals in cross-token Solidity math by enforcing explicit decimal normalization, accounting for USDC's 6 decimals versus standard 18-decimal assumptions. This prevents token accounting mistakes that cause critical financial losses during transfers.

How do I secure oracle price feeds against manipulation in smart contracts?

Secure oracle price feeds against manipulation by implementing staleness and sanity checks, avoiding raw DEX spot-price reliance. This oracle safety approach prevents MEV and sandwich attacks from exploiting stale or artificially manipulated pricing data.

Does SafeERC20 protect against non-standard token behavior in Solidity?

SafeERC20 protects against non-standard token behavior in Solidity by wrapping token transfers and approvals to handle non-standard return values. This reduces operational and integration risk when interacting with tokens that deviate from the ERC20 specification.

What are the limitations of relying on compile-time checks for smart contract security?

Relying on compile-time checks for smart contract security misses high-impact vulnerability classes like proxy storage collisions, delegatecall risks, and signature replay attacks. These production risks require explicit defensive patterns and checklist-based validations beyond standard compilation.