Durin is an opinionated approach to ENS L2 subnames. Durin consists of:
- Registry factory on supported chains
- Registrar template
- Gateway server
This repo is meant to be used in conjuction with Durin.dev, which provides a frontend for deploying the registry & enabling name resolution.
Go to Durin.dev. Choose Sepolia or Mainnet ENS name resolution. Pick a supported L2 -- either mainnet or sepolia. Deploy.
Once complete note the deployed registry address on the L2.
To enable name resolution, change the resolver on the ENS name.
sepolia: 0x00f9314C69c3e7C37b3C7aD36EF9FB40d94eDDe1
mainnet: 0x2A6C785b002Ad859a3BAED69211167C7e998aAeC
After switching the resolver, add the following text record:
key: registry
value: {chain_id}:{registry_contract}
Both switching the resolver and adding the text record can be done via durin.dev or the ENS manager app.
Durin provides a registrar template designed for customization. Common customizations include adding pricing, implementing allow lists, and enabling token gating.
To get started clone this repo:
git clone git@github.com:resolverworks/durin.git
cd durinOnce cloned modify L2Registrar.sol as need it.
Durin uses foundry, to install follow the instructions.
cp example.env .env# Required: RPC URL for the chain where the registry is deployed
RPC_URL=
# Required: Private key of the deployer exclude "0x"
PRIVATE_KEY=
# Required: Etherscan API key for contract verification
ETHERSCAN_API_KEY=
# Required for L2Registrar contract deployment
REGISTRY_ADDRESS=
# Required to configure the deployed registry from durin.dev website. Add this after deploying the Registrar.
REGISTRAR_ADDRESS=Blank until step 5bash deploy/deployL2Registrar.shUpdate Registrar address in .env
Only the Registrar can call register() on the Registry. The owner of the registry can add a registrar thus enabling minting. The configureRegistry.sh script adds the Registrar to the Registry by calling the addRegistrar()
bash deploy/configureRegistry.shThis repo includes the L2 contracts required to enable subname issuance.
- L2RegistryFactory: L2 contract for creating new registries.
- L2Registry: L2 contract that stores subnames as ERC721 NFTs. It's responsible for storing subname data like address and text records.
- L2Registrar: An example registrar contract that can mint subnames. This is meant to be customized.
| L2 | Registry Factory |
|---|---|
| Base | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Base Sepolia | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Optimism | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Optimism Sepolia | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Scroll | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Scroll Sepolia | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Arbitrum | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Arbitrum Sepolia | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Linea | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |
| Linea Sepolia | 0xA59eF1DCc0c4bcbDC718b95c0680b6B97Bb451eb |

