unused-variables

Detect unused variables, parameters, and discarded return values in Solidity contracts.

1|1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/Apegurus/solidity-argus --skill unused-variables
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unused-variables
Source: https://github.com/Apegurus/solidity-argus/tree/main/skills/vulnerability-patterns/unused-variables
Command: npx skills add https://github.com/Apegurus/solidity-argus --skill unused-variables

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill identifies and helps remove unused variables, parameters, and imports in Solidity smart contracts, reducing code bloat and potential confusion.

Core Features & Use Cases

  • Unused Variable Detection: Flags state variables, local variables, and function parameters that are declared but never referenced.
  • Return Value Check: Identifies instances where return values from function calls are silently discarded, which might indicate missing error handling.
  • Use Case: Improve code quality and security by cleaning up dead code and ensuring all function inputs and outputs are handled as intended.

Quick Start

Analyze the attached file 'VaultContract.sol' for unused variables.

Frequently Asked Questions about unused-variables

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

FAQPage Schema
How do I detect unused variables in Solidity smart contracts?

To detect unused variables in Solidity smart contracts, you need static analysis to pinpoint unreferenced state variables, local variables, and function parameters. This Skill performs that code analysis to identify dead code and reduce maintainability issues.

What happens if a return value from a Solidity function call is silently discarded?

When a return value from a Solidity function call is silently discarded, it often indicates missing error handling and potential logic flaws. This Skill identifies instances of discarded return values during static analysis to ensure all function outputs are handled as intended.

Can I use this to audit Solidity code for dead code and unreferenced imports?

Yes, you can use this to audit Solidity code for dead code and unreferenced imports. The Skill flags declared but unreferenced elements and identifies unused imports to reduce code bloat and potential confusion in smart contracts.

What is the best way to check for unused function parameters in a smart contract?

The best way to check for unused function parameters in a smart contract is running static analysis on the contract code. This Skill identifies and reports function parameters that are declared but never referenced to address maintainability.

How do I analyze an attached Solidity file for unused variables?

To analyze an attached Solidity file for unused variables, provide the file such as 'VaultContract.sol' to the Skill. It requires static analysis of the contract code to pinpoint undeclared or unreferenced elements and reports them directly.