This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
The Ethereum Follow Protocol (EFP) ListRecordsV2 repository contains updated smart contracts for EFP's list minting and record management system. This is a Solidity project using the Foundry framework for smart contract development, with TypeScript tooling for ABI generation and testing.
bun run build- Compiles smart contracts using Foundrybun run test- Runs all tests using Foundry with forked environment (--fork-url ${ETH_RPC_URL} -vv)bun run coverage- Generates test coverage report and lcov fileforge test --match-path test/specific.t.sol- Run specific test fileforge test --match-test testFunctionName- Run specific test function
bun run deploy- Deploy to mainnet using${ETH_RPC_URL}bun run deploy:testnet- Deploy to testnet using${TESTNET_RPC_URL}bun run deploy:local- Deploy to local anvil instancebun run testnet- Start local anvil fork on chain ID 8453
bun wagmi generate- Generate TypeScript ABIs, actions, and React hooks from compiled contracts
EFPListRecordsV2 (src/EFPListRecordsV2.sol): The main list records contract that stores and manages list operations and metadata. Key features:
- Slot-based access control: Uses first 20 bytes of slot to match message sender address, preventing front-running of slot claims
- List operations storage: Maintains a history of operations applied to each list
- Metadata management: Key-value store for list metadata with manager-only access
- Manager system: Claims management through
onlyListManagermodifier
EFPListMinterV2 (src/EFPListMinterV2.sol): Handles minting of new lists with improved validation. Key features:
- Chain ID validation: Ensures list records are stored on the intended chain when using native storage
- List storage location decoding: Validates encoded storage locations before minting
- Primary list assignment: Sets default lists for accounts via account metadata contract
ListMetadata (abstract)
├── Manages metadata key-value pairs
├── Implements manager claiming and validation
└── Extends Pausable, Ownable
ListRecordsV2 (abstract)
├── Extends ListMetadata
├── Manages list operations history
└── Provides batch operations
EFPListRecordsV2 (concrete)
└── Final implementation with ENS reverse claiming
- External contracts: Interfaces to EFPListRegistry, EFPAccountMetadata
- OpenZeppelin: Uses Ownable, Pausable, Context
- ENS integration: ENSReverseClaimer for reverse name resolution
- Foundry libraries: forge-std for testing and deployment
src/- Main contract source filessrc/interfaces/- Contract interfacessrc/lib/- Shared libraries (ENSReverseClaimer)script/- Deployment scripts and utilitiestest/- Foundry test filesout/- Compiled contract artifactslib/- Git submodules (forge-std, openzeppelin-contracts)
Tests use Foundry's testing framework with mainnet forking. Test files follow the pattern *.t.sol and are located in the test/ directory. Coverage reports are generated using forge coverage with lcov output.
Requires .env file with:
PRIVATE_KEY- Deployment private keyETH_RPC_URL- Mainnet RPC endpointTESTNET_RPC_URL- Testnet RPC endpointETHERSCAN_API_KEY- For contract verification
- Slot validation: EFPListRecordsV2 validates that the first 20 bytes of a slot match the caller's address
- Chain ID checks: EFPListMinterV2 verifies chain ID matches current chain for native storage
- Manager-only operations: All list modifications require manager privileges
- Pausable contracts: Admin can pause operations in emergency situations