iktok90-design/ai-smart-contract-auditor/pragma-and-addresses

Claude Code and agent skill by iktok90-design/ai-smart-contract-auditor

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Detect floating pragma, hardcoded addresses, missing zero-address checks, deprecated Solidity versions. Activate on every `pragma solidity` line, `constant ADDRESS = 0x...`, `immutable` address parameters, address comparisons.

Install

npx vskill@latest install iktok90-design/ai-smart-contract-auditor/pragma-and-addresses

SKILL.md

Pragma & address-hygiene detection

When this applies

  • Top of every Solidity file
  • Constants and immutables typed address
  • Constructor / initializer parameters typed address
  • mapping(address => …) updates
  • Any cross-chain deployment where addresses differ per chain

Detection patterns

Floating pragma (LOW-MEDIUM)
solidity
pragma solidity ^0.8.0; // ← floats to any 0.8.x

Production deployments should pin: pragma solidity 0.8.24;. Floating pragma means audited bytecode ≠ deployed bytecode.

Outdated Solidity version (MEDIUM)

<0.8.0 lacks built-in overflow checks. <0.8.20 lacks PUSH0 opcode handling for some L2s. Audit pin date vs known compiler bugs.

Hardcoded address tied to a single chain (HIGH)
solidity
address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // ← mainnet WETH, breaks on Base/Arbitrum

WETH/USDC/USDT all have different addresses per chain. Use a chain-configurable resolver.

Missing zero-address check (HIGH on key fields)
solidity
function setOwner(address newOwner) external onlyOwner {
owner = newOwner; // ← if 0x0, contract is bricked
}

Affects ownership, oracles, treasury, fee receiver, token addresses.

Address(0) as default sentinel (MEDIUM)

Using address(0) to mean "unset" works but is brittle — collides with default mapping values.

payable(0) as burn (LOW-MEDIUM)

Burning by sending to address(0)'s payable is legal but locks ether forever. Document intent.

address(this) in cross-chain context (HIGH for CREATE2 deployments)

address(this) differs unless deterministically deployed at same address across chains.

address public foo; instead of address public immutable foo; (LOW)

Mutable when it shouldn't be — gas cost + risk of accidental setter.

Chain-ID-dependent address resolution missing (HIGH)
solidity
if (block.chainid == 1) router = MAINNET_ROUTER;
else if (block.chainid == 42161) router = ARB_ROUTER;
else revert("unsupported chain"); // ← without this, unsupported chain silently uses mainnet address

Severity rubric

PatternSeverity
Hardcoded mainnet address in multi-chain deploymentHigh
Missing zero-address check on owner/admin setHigh
Chain-ID-based resolver missing for cross-chainHigh
Outdated Solidity version with known CVEHigh
Floating pragma (^0.8.0) in productionMedium
Mutable address that should be immutableLow
Outdated but CVE-free Solidity versionLow
Comment-only address documentation outdatedInfo

Remediation patterns

  • Pin exact Solidity version: pragma solidity 0.8.24; (or whatever you tested with).
  • Zero-address checks on every setter: require(newAddr != address(0), "zero address");.
  • Chain-aware address resolver:

``solidity function _weth() internal view returns (address) { if (block.chainid == 1) return MAINNET_WETH; if (block.chainid == 8453) return BASE_WETH; if (block.chainid == 42161) return ARB_WETH; revert UnsupportedChain(); } ``

  • Use OZ Ownable2Step so even a bad zero-address would require accept().
  • For immutable-when-possible, mark with immutable keyword.

False-positive notes

  • Test/mock files with hardcoded addresses are fine.
  • address(0) checks may be redundant if subsequent OZ library calls already validate.
  • Floating pragma in libraries (vs deployed contracts) is sometimes intentional.

Related

  • [[access-control]]
  • [[storage-layout]]
  • [[upgrade-safety]]

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
37
Repository forks
5
7-day trend score
18

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/iktok90-design/ai-smart-contract-auditor/pragma-and-addresses/badge)](https://verified-skill.com/skills/iktok90-design/ai-smart-contract-auditor/pragma-and-addresses)

Something wrong with this skill or its page? Tell us.