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
Copy file name to clipboardExpand all lines: CLAUDE.md
+9-85Lines changed: 9 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,13 @@ Across uses a **hub-and-spoke** model with optimistic verification to enable fas
14
14
15
15
### Key Roles
16
16
17
-
| Role | Description |
18
-
|------|-------------|
19
-
|**Depositor**| End user (non-technical) who initiates a cross-chain transfer via one of multiple entry points (deposit, sponsored, gasless flows) on the origin SpokePool |
20
-
|**Relayer**| Fills deposits on destination chain by fronting tokens, later reimbursed via merkle proof. Relayers compete on speed and cross-chain inventory management to determine if a deposit is profitable based on the fees offered |
|**Depositor**| End user (non-technical) who initiates a cross-chain transfer via one of multiple entry points (deposit, sponsored, gasless flows) on the origin SpokePool|
20
+
|**Relayer**| Fills deposits on destination chain by fronting tokens, later reimbursed via merkle proof. Relayers compete on speed and cross-chain inventory management to determine if a deposit is profitable based on the fees offered|
21
21
|**Data Worker**| Off-chain agent that validates and aggregates deposits/fills across multiple chains, constructs merkle trees, and calls `proposeRootBundle()` on HubPool (stakes a bond). Unlike relayers, data workers are RPC-intensive and maintain a longer lookback window; speed is less critical |
22
-
|**Disputer**| Monitors proposed bundles; can call `disputeRootBundle()` during the challenge period if a bundle is invalid |
23
-
|**LP**| Deposits L1 tokens into HubPool to earn relay fees |
22
+
|**Disputer**| Monitors proposed bundles; can call `disputeRootBundle()` during the challenge period if a bundle is invalid|
23
+
|**LP**| Deposits L1 tokens into HubPool to earn relay fees|
24
24
25
25
### Protocol Flow
26
26
@@ -40,7 +40,6 @@ HubPool on L1 owns all L2 SpokePools. Admin functions are relayed cross-chain vi
40
40
41
41
SpokePool is deployed on many chains. For the list of all available chains, see `broadcast/deployed-addresses.md`.
42
42
43
-
44
43
## Development Frameworks
45
44
46
45
-**Foundry** (primary) - Used for new tests and deployment scripts
@@ -99,36 +98,12 @@ Use `FOUNDRY_PROFILE=local-test` (or `yarn test-evm-foundry`) for local Foundry
99
98
100
99
### Deployment Scripts
101
100
102
-
-Numbered with `.s.sol` suffix: `001DeployHubPool.s.sol`, `004DeployArbitrumAdapter.s.sol`
101
+
-`.s.sol` suffix, see `script/` for examples (e.g. `script/DeployArbitrumAdapter.s.sol`)
103
102
- Script contracts: `contract Deploy<ContractName> is Script, Test, Constants`
104
103
105
104
## Writing Tests
106
105
107
-
```solidity
108
-
// SPDX-License-Identifier: BUSL-1.1
109
-
pragma solidity ^0.8.0;
110
-
111
-
import { Test } from "forge-std/Test.sol";
112
-
import { MyContract } from "../contracts/MyContract.sol";
113
-
114
-
contract MyContractTest is Test {
115
-
MyContract public myContract;
116
-
117
-
function setUp() public {
118
-
myContract = new MyContract();
119
-
}
120
-
121
-
function testBasicFunctionality() public {
122
-
// Test implementation
123
-
assertEq(myContract.value(), expected);
124
-
}
125
-
126
-
function testRevertOnInvalidInput() public {
127
-
vm.expectRevert();
128
-
myContract.doSomething(invalidInput);
129
-
}
130
-
}
131
-
```
106
+
See `test/evm/foundry/local/` for examples (e.g. `Router_Adapter.t.sol`).
132
107
133
108
### Test Gotchas
134
109
@@ -142,60 +117,9 @@ contract MyContractTest is Test {
142
117
```
143
118
-**Delegatecall context**: Adapter tests via HubPool emit events from HubPool's address; `vm.expectRevert()` may lose error data
144
119
145
-
## Deployment Scripts
146
-
147
-
Scripts follow a numbered pattern and use shared utilities from `script/utils/`.
148
-
149
-
```solidity
150
-
// SPDX-License-Identifier: BUSL-1.1
151
-
pragma solidity ^0.8.0;
152
-
153
-
import { Script } from "forge-std/Script.sol";
154
-
import { Test } from "forge-std/Test.sol";
155
-
import { console } from "forge-std/console.sol";
156
-
import { Constants } from "./utils/Constants.sol";
157
-
import { MyContract } from "../contracts/MyContract.sol";
158
-
159
-
// How to run:
160
-
// 1. `source .env` where `.env` has MNEMONIC="x x x ... x" and ETHERSCAN_API_KEY="x"
0 commit comments