| name | solidity-development |
| description | Master Solidity smart contract development with patterns, testing, and best practices |
| sasmp_version | 1.3.0 |
| version | 2.0.0 |
| updated | 2025-01 |
| bonded_agent | 03-solidity-expert |
| bond_type | PRIMARY_BOND |
| atomic | true |
| single_responsibility | solidity_development |
| parameters | {"topic":{"type":"string","required":true,"enum":["syntax","patterns","testing","upgrades","security"]},"solidity_version":{"type":"string","default":"0.8.24"}} |
| retry_config | {"max_attempts":3,"backoff":"exponential","initial_delay_ms":1000} |
| logging | {"level":"info","include_timestamps":true,"track_usage":true} |
Solidity Development Skill
Master Solidity smart contract development with design patterns, testing strategies, and production best practices.
Quick Start
Skill("solidity-development", topic="patterns", solidity_version="0.8.24")
Topics Covered
1. Language Features (0.8.x)
Modern Solidity essentials:
- Data Types: Value, reference, mappings
- Functions: Visibility, modifiers, overloading
- Inheritance: Diamond problem, C3 linearization
- Custom Errors: Gas-efficient error handling
2. Design Patterns
Battle-tested patterns:
- CEI: Checks-Effects-Interactions
- Factory: Contract deployment patterns
- Proxy: Upgradeable contracts
- Access Control: RBAC, Ownable
3. Testing
Comprehensive test strategies:
- Unit Tests: Foundry, Hardhat
- Fuzz Testing: Property-based testing
- Invariant Testing: System-wide properties
- Fork Testing: Mainnet simulation
4. Upgradability
Safe upgrade patterns:
- UUPS: Self-upgrading proxy
- Transparent: Admin separation
- Beacon: Shared implementation
- Diamond: Multi-facet
Code Examples
CEI Pattern
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract SecureVault {
mapping(address => uint256) public balances;
error InsufficientBalance();
error TransferFailed();
function withdraw(uint256 amount) external {
// 1. CHECKS
if (balances[msg.sender] < amount) revert InsufficientBalance();
// 2. EFFECTS
balances[msg.sender] -= amount;
// 3. INTERACTIONS
(bool ok,) = msg.sender.call{value: amount}("");
if (!ok) revert TransferFailed();
}
}
Factory Pattern
contract TokenFactory {
event TokenCreated(address indexed token, address indexed owner);
function createToken(
string memory name,
string memory symbol
) external returns (address) {
Token token = new Token(name, symbol, msg.sender);
emit TokenCreated(address(token), msg.sender);
return address(token);
}
}