input-arithmetic-safety

Analyze Solidity smart contracts for input validation and arithmetic vulnerabilities.

1|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/Ramprasad4121/srp --skill input-arithmetic-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: input-arithmetic-safety
Source: https://github.com/Ramprasad4121/srp/tree/main/skills-repos/quillai/plugins/input-arithmetic-safety/skills/input-arithmetic-safety
Command: npx skills add https://github.com/Ramprasad4121/srp --skill input-arithmetic-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill identifies critical input validation failures and subtle arithmetic vulnerabilities in smart contracts that can lead to exploits, even in Solidity 0.8+.

Core Features & Use Cases

  • Input Validation: Detects missing checks for zero addresses, zero amounts, array lengths, and bounds.
  • Arithmetic Safety: Finds precision loss from division-before-multiplication, rounding exploitation, ERC4626 inflation risks, unsafe casting, and unchecked block edge cases.
  • Use Case: When auditing a DeFi protocol's core token logic, use this Skill to ensure that all user-supplied amounts are validated and that fee calculations do not suffer from precision loss or dust attacks.

Quick Start

Analyze the provided smart contract code for input validation and arithmetic vulnerabilities.

Frequently Asked Questions about input-arithmetic-safety

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

FAQPage Schema
How do I find arithmetic vulnerabilities in Solidity smart contracts?

To find arithmetic vulnerabilities in Solidity smart contracts, analyze the code for division-before-multiplication precision loss, unsafe integer casting, and unchecked block edge cases. This process requires detailed code review and pattern matching against known vulnerability types to identify subtle flaws.

What input validation checks are missing in my DeFi protocol's token logic?

Missing input validation checks in DeFi token logic often include zero-address parameters, zero amounts, array lengths, and bounds checks. Analyzing the smart contract code reveals these missing validations to prevent exploits related to unverified user-supplied data.

How does an ERC4626 inflation attack work and can I detect it?

An ERC4626 inflation attack exploits rounding and precision mechanics in token vaults. You can detect this risk by analyzing the smart contract code for rounding exploitation and precision loss patterns that leave vault shares vulnerable to inflation manipulation.

Does Solidity 0.8+ automatically prevent all arithmetic overflow and underflow vulnerabilities?

Solidity 0.8+ does not automatically prevent all arithmetic vulnerabilities because unchecked blocks and subtle precision loss still occur. Analyzing the code for unchecked block edge cases and dust amount exploitation is required to secure calculations.

What is the best way to audit a smart contract for dust amount exploitation and precision loss?

The best way to audit for dust amount exploitation and precision loss is through detailed code review focusing on fee calculations and division-before-multiplication patterns. This ensures user-supplied amounts are validated and calculations do not suffer from rounding exploitation.

Can I use this to check for unsafe integer casting in my smart contract audit?

Yes, you can check for unsafe integer casting by analyzing the smart contract code against known vulnerability types. The review identifies unsafe casting alongside zero-address checks and unchecked block edge cases to secure the contract.