Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Pragma And Addresses

ASecurity

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.

36 stars
0 votes
0 copies
0 views
Added 10/4/2026
blockchaindocumentation

Security Analysis

A100/100

Scanned 10/4/2026

$npx -y skills add iktok90-design/ai-smart-contract-auditor --skill pragma-and-addresses --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pragma And Addresses?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Pragma And Addresses
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/iktok90-design-pragma-and-addresses/badge)](https://www.skillsdirectory.com/skills/iktok90-design-pragma-and-addresses)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: pragma-and-addresses
description: 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.
---

# 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

| Pattern | Severity |
|---|---|
| Hardcoded mainnet address in multi-chain deployment | **High** |
| Missing zero-address check on owner/admin set | **High** |
| Chain-ID-based resolver missing for cross-chain | **High** |
| Outdated Solidity version with known CVE | **High** |
| Floating pragma (`^0.8.0`) in production | **Medium** |
| Mutable address that should be immutable | **Low** |
| Outdated but CVE-free Solidity version | **Low** |
| Comment-only address documentation outdated | **Info** |

## 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]]

Attribution

iktok90-designiktok90-design
View sourceSee grades on GitHubMore from iktok90-design →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Nft Standards

Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration. Use when creating NFT contracts, building NFT marketplaces, or implementing digital asset systems.

458250 votes

Nft Standards

Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration. Use when creating NFT contracts, building NFT marketplaces, or implementing digital asset systems.

401990 votes

vyper-compiler

Vyper smart contract compiler internals. Use when working on the Vyper compiler codebase — compilation pipeline, Venom IR, semantic analysis, code generation, testing, or contributing. Triggers on vyper compiler development, Venom passes, AST/semantics changes, codegen work, or test writing.

51840 votes

Flash Loan Simulator

Simulate flash loan arbitrage strategies and profitability across DeFi protocols. Use when performing crypto analysis. Trigger with phrases like "analyze crypto", "check blockchain", or "monitor market".

27190 votes

On Chain Analytics

Perform on-chain analysis including whale tracking, token flows, and network activity. Use when performing crypto analysis. Trigger with phrases like "analyze crypto", "check blockchain", or "monitor market".

27190 votes
View all in blockchain →