A smart contract for batch-registering ENS .eth names in a single transaction. Targets the current wrapped ETHRegistrarController and supports mixed-length names (3, 4, 5+ chars) with different prices.
- Batch registration — register multiple
.ethnames in one transaction - Mixed-length support — no same-price restriction; each name is priced individually
- Referral tracking — emits
NameRegisteredevents with an immutable referrer - Automatic refunds — excess ETH is returned in the same transaction
- Batch utilities — bulk availability checks, price quotes, commitment generation
| Contract | Description |
|---|---|
src/BulkRegistration.sol |
Main contract with batch commit, register, and view functions |
src/IETHRegistrarController.sol |
Interface for the wrapped ETHRegistrarController |
script/Deploy.s.sol |
Deployment script (mainnet + sepolia) |
git clone <repo-url>
cd contracts
forge install
cp .env.example .env
# Fill in MAINNET_RPC_URL, SEPOLIA_RPC_URL, ETHERSCAN_API_KEYforge buildTests run against a mainnet fork:
forge test --fork-url $MAINNET_RPC_URL -vvvREFERRER=0x000000000000000000000000<your-address> \
forge script script/Deploy.s.sol --rpc-url $MAINNET_RPC_URL --broadcast --verify- Check availability — call
available(names)to verify names are open - Get pricing — call
totalPrice(names, duration)for the required ETH - Commit — call
makeCommitments(...)thenmultiCommit(commitments) - Wait — wait at least 60 seconds for the commitment to mature
- Register — call
multiRegister{value: totalPrice}(...)with sufficient ETH; excess is refunded automatically