| name | add-solver |
| description | Add a solver address to Settlement contracts across multiple chains (ETH, Arb, Base, BSC). Uses ADMIN_PK from .env to call Settlement.addSolver() via cast send. Supports adding one or more solvers in a single invocation. |
Add Solver Skill
Overview
Adds solver addresses to the Settlement contract's allowlist on staging/production chains. The Settlement contract uses an onlyOwner modifier on addSolver(), so the admin private key is required.
Trigger Words
add-solver, add solver, addSolver, register solver
Prerequisites
.env file must contain ADMIN_PK (owner private key for 0x399EfA78cAcD7784751CD9FBf2523eDf9EFDf6Ad)
cast (from Foundry) must be available
Chain Configuration
| Chain | Chain ID | Settlement Address | RPC URL |
|---|
| ETH | 1 | 0x1a34E1e604D8a55405172C0717B17F7631d5f265 | https://eth.llamarpc.com |
| Arbitrum | 42161 | 0x2889B9b5Bbb92ecF1bCf9E1D29EBb211b147b6E6 | https://arb1.arbitrum.io/rpc |
| Base | 8453 | 0xb18792Ba1dbd677EB300660304E9E71E372DA421 | https://mainnet.base.org |
| BSC | 56 | 0xF81805E9034f4F6B3D639517Cf4760D2e924Fc39 | https://bsc-dataseed1.defibit.io |
Workflow
When invoked with /add-solver <name>:<address> (or multiple <name>:<address> pairs):
Step 1: Parse Arguments
Extract solver name(s) and address(es) from the arguments. Expected format:
/add-solver SolverName:0x1234...abcd
/add-solver Solver1:0x1234...abcd Solver2:0x5678...efgh
If only an address is provided without a name, use "Unknown" as the name.
Step 2: Validate
- Load
ADMIN_PK from .env using source .env
- Verify each solver address is a valid Ethereum address (40 hex chars)
- For each chain, check if the solver is already registered:
cast call <settlement> "isSolver(address)(bool)" <solver> --rpc-url <rpc>
- Skip chains where the solver is already registered
Step 3: Execute
For each solver on each chain where it's not yet registered, run:
source .env && cast send <settlement> "addSolver(address)" <solver> \
--private-key $ADMIN_PK --rpc-url <rpc>
Run all 4 chains in parallel for each solver to maximize speed.
Step 4: Report
Print a summary table with:
- Solver name and address
- Chain name
- Transaction hash
- Status (success/failed/skipped)
Format:
### <SolverName> (<address>)
| Chain | Status | Tx Hash |
|----------|---------|------------|
| ETH | success | 0x1234... |
| Arbitrum | success | 0x5678... |
| Base | skipped | already registered |
| BSC | success | 0xabcd... |
Alternative: Forge Script
For batch operations or dry-run simulation, use the Forge script:
source .env && ADMIN_PK=$ADMIN_PK SETTLEMENT_ADDR=<addr> SOLVER_TO_ADD=<solver> \
forge script script/AddSolvers.s.sol --rpc-url <rpc> --broadcast
Usage Examples
/add-solver Fractal:0xe374945aEA24CE83D20150846202AD343D906810
/add-solver Liquorice:0xDbB1699cC7DfBDB8Cc860E34C0a7EbA5F3510aFf Arctic:0x5ABf80d2CB8F842EE536169818E1B8Cd361949DF
/add-solver 0xe374945aEA24CE83D20150846202AD343D906810
Safety
- Always checks
isSolver() before calling addSolver() to avoid wasted gas
- Requires explicit user confirmation before broadcasting transactions (dangerous operation)
- Logs all transaction hashes for audit trail