You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
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.
8
+
9
+
## Common Commands
10
+
11
+
### Build and Development
12
+
-`bun run build` - Compiles smart contracts using Foundry
13
+
-`bun run test` - Runs all tests using Foundry with forked environment (`--fork-url ${ETH_RPC_URL} -vv`)
14
+
-`bun run coverage` - Generates test coverage report and lcov file
15
+
-`forge test --match-path test/specific.t.sol` - Run specific test file
16
+
-`forge test --match-test testFunctionName` - Run specific test function
17
+
18
+
### Deployment
19
+
-`bun run deploy` - Deploy to mainnet using `${ETH_RPC_URL}`
20
+
-`bun run deploy:testnet` - Deploy to testnet using `${TESTNET_RPC_URL}`
21
+
-`bun run deploy:local` - Deploy to local anvil instance
22
+
-`bun run testnet` - Start local anvil fork on chain ID 8453
23
+
24
+
### ABI Generation
25
+
-`bun wagmi generate` - Generate TypeScript ABIs, actions, and React hooks from compiled contracts
26
+
27
+
## Architecture Overview
28
+
29
+
### Core Contracts
30
+
31
+
**EFPListRecordsV2** (`src/EFPListRecordsV2.sol`): The main list records contract that stores and manages list operations and metadata. Key features:
32
+
-**Slot-based access control**: Uses first 20 bytes of slot to match message sender address, preventing front-running of slot claims
33
+
-**List operations storage**: Maintains a history of operations applied to each list
34
+
-**Metadata management**: Key-value store for list metadata with manager-only access
35
+
-**Manager system**: Claims management through `onlyListManager` modifier
36
+
37
+
**EFPListMinterV2** (`src/EFPListMinterV2.sol`): Handles minting of new lists with improved validation. Key features:
38
+
-**Chain ID validation**: Ensures list records are stored on the intended chain when using native storage
39
+
-**List storage location decoding**: Validates encoded storage locations before minting
40
+
-**Primary list assignment**: Sets default lists for accounts via account metadata contract
41
+
42
+
### Contract Hierarchy
43
+
44
+
```
45
+
ListMetadata (abstract)
46
+
├── Manages metadata key-value pairs
47
+
├── Implements manager claiming and validation
48
+
└── Extends Pausable, Ownable
49
+
50
+
ListRecordsV2 (abstract)
51
+
├── Extends ListMetadata
52
+
├── Manages list operations history
53
+
└── Provides batch operations
54
+
55
+
EFPListRecordsV2 (concrete)
56
+
└── Final implementation with ENS reverse claiming
57
+
```
58
+
59
+
### Key Dependencies
60
+
61
+
-**External contracts**: Interfaces to EFPListRegistry, EFPAccountMetadata
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.
79
+
80
+
### Environment Setup
81
+
82
+
Requires `.env` file with:
83
+
-`PRIVATE_KEY` - Deployment private key
84
+
-`ETH_RPC_URL` - Mainnet RPC endpoint
85
+
-`TESTNET_RPC_URL` - Testnet RPC endpoint
86
+
-`ETHERSCAN_API_KEY` - For contract verification
87
+
88
+
### Important Security Features
89
+
90
+
1.**Slot validation**: EFPListRecordsV2 validates that the first 20 bytes of a slot match the caller's address
91
+
2.**Chain ID checks**: EFPListMinterV2 verifies chain ID matches current chain for native storage
92
+
3.**Manager-only operations**: All list modifications require manager privileges
93
+
4.**Pausable contracts**: Admin can pause operations in emergency situations
0 commit comments