# Solidity

> Solidity smart contract development for Ethereum and EVM chains. Use for .sol files. Use when this capability is needed.

- Skill: `tomevault-io/solidity` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/solidity`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/solidity/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/solidity

---


# Solidity

Solidity is the primary language for the **Ethereum Virtual Machine (EVM)**. v0.8.28 (2025) focuses on transient storage (`tstore`) and gas optimization via IR.

## When to Use

- **Ethereum/L2s**: Developing for Optimism, Arbitrum, Base.
- **DeFi**: Writing logic for tokens, AMMs, and lending.
- **NFTs**: ERC-721 and ERC-1155 contracts.

## Core Concepts

### Gas

Every operation costs ETH. Optimization is critical.

### Modifiers

Reusable checks. `modifier onlyOwner { ... }`.

### Events

Logging on the blockchain. `emit Transfer(from, to, value)`.

## Best Practices (2025)

**Do**:

- **Use Foundry**: The 2025 standard for testing (Solidity-based tests).
- **Use Custom Errors**: `error InsufficientBalance();` is cheaper than string requires.
- **Use OpenZeppelin**: Don't roll your own crypto/auth logic.

**Don't**:

- **Don't ignore reentrancy**: Use `ReentrancyGuard` or Checks-Effects-Interactions pattern.

## References

- [Solidity Documentation](https://docs.soliditylang.org/)

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/g1joshi) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

