{"id":25298558,"url":"https://github.com/base/basenames","last_synced_at":"2025-04-05T20:08:59.183Z","repository":{"id":253300150,"uuid":"790433991","full_name":"base/basenames","owner":"base","description":"Base-native Identity","archived":false,"fork":false,"pushed_at":"2025-01-24T14:01:06.000Z","size":1220,"stargazers_count":76,"open_issues_count":23,"forks_count":45,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-29T19:07:46.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.base.org/names","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/base.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit/final-report-cantinacode-coinbase-sbr-usernames-review.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-22T21:47:37.000Z","updated_at":"2025-03-27T11:46:36.000Z","dependencies_parsed_at":"2024-11-04T14:22:45.483Z","dependency_job_id":"0320fa25-31af-4496-b7ae-1a3f7b81ab9b","html_url":"https://github.com/base/basenames","commit_stats":{"total_commits":86,"total_committers":5,"mean_commits":17.2,"dds":"0.10465116279069764","last_synced_commit":"28ac5044db6ce750a55f2312ab0f7c3bd888a8c8"},"previous_names":["base-org/basenames","base/basenames"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fbasenames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fbasenames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fbasenames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fbasenames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/base","download_url":"https://codeload.github.com/base/basenames/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393571,"owners_count":20931813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-13T04:15:31.567Z","updated_at":"2025-04-05T20:08:59.162Z","avatar_url":"https://github.com/base.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"![basenames-cover](https://github.com/user-attachments/assets/14f63206-5838-4938-9a84-f9165e431f96)\n# BASENAMES\n\n\nThis repository contains code for minting and managing [ENS](https://docs.ens.domains/) subdomains on the Base network as `base.eth` subdomains. \n\nIt supports:\n- Registering base.eth subdomains on Base natively\n- Managing the name with a public resolver, allowing an owner or operator to set address records, text records, dns records, etc.\n- ERC721 subdomain tokens [(Opensea)](https://opensea.io/collection/basenames)\n\n### OVERVIEW\n\nBasenames are a core onchain building block that enables anyone to establish their identity on Base by registering human-readable names for their address(es). They are a fully onchain solution which leverages ENS infrastructure deployed on Base.\n\n### CONTRACT ADDRESSES\n\n#### Ethereum Mainnet\n\n| Contract | Address | \n| -------- | ------- |\n| L1Resolver | [0xde9049636F4a1dfE0a64d1bFe3155C0A14C54F31](https://etherscan.io/address/0xde9049636F4a1dfE0a64d1bFe3155C0A14C54F31#code) |\n\n#### Base Mainnet\n\n| Contract | Address | \n| -------- | ------- | \n| Registry | [0xb94704422c2a1e396835a571837aa5ae53285a95](https://basescan.org/address/0xb94704422c2a1e396835a571837aa5ae53285a95) | \n| BaseRegistrar | [0x03c4738ee98ae44591e1a4a4f3cab6641d95dd9a](https://basescan.org/address/0x03c4738ee98ae44591e1a4a4f3cab6641d95dd9a) | \n| RegistrarController | [0x4cCb0BB02FCABA27e82a56646E81d8c5bC4119a5](https://basescan.org/address/0x4cCb0BB02FCABA27e82a56646E81d8c5bC4119a5) |\n| Launch Price Oracle | [0xd53b558e1f07289acedf028d226974abba258312](https://basescan.org/address/0xd53b558e1f07289acedf028d226974abba258312) |\n| Price Oracle | [0x508CFE43aa84b8048cB6d39037cE0dc96d8aDc75](https://basescan.org/address/0x508CFE43aa84b8048cB6d39037cE0dc96d8aDc75) | \n| ReverseRegistrar | [0x79ea96012eea67a83431f1701b3dff7e37f9e282](https://basescan.org/address/0x79ea96012eea67a83431f1701b3dff7e37f9e282) | \n| L2Resolver | [0xC6d566A56A1aFf6508b41f6c90ff131615583BCD](https://basescan.org/address/0xC6d566A56A1aFf6508b41f6c90ff131615583BCD) | \n\n#### Sepolia\n\n| Contract | Address | \n| -------- | ------- |\n| L1Resolver | [0x084D10C07EfEecD9fFc73DEb38ecb72f9eEb65aB](https://sepolia.etherscan.io/address/0x084D10C07EfEecD9fFc73DEb38ecb72f9eEb65aB) |\n\n#### Base Sepolia\n\n| Contract | Address | \n| -------- | ------- | \n| Registry | [0x1493b2567056c2181630115660963E13A8E32735](https://basescan.org/address/0xb94704422c2a1e396835a571837aa5ae53285a95) | \n| BaseRegistrar | [0x03c4738ee98ae44591e1a4a4f3cab6641d95dd9a](https://sepolia.basescan.org/address/0xa0c70ec36c010b55e3c434d6c6ebeec50c705794#code) | \n| RegistrarController | [0x49ae3cc2e3aa768b1e5654f5d3c6002144a59581](https://sepolia.basescan.org/address/0x49ae3cc2e3aa768b1e5654f5d3c6002144a59581) |\n| Launch Price Oracle | [0x2B73408052825e17e0Fe464f92De85e8c7723231](https://sepolia.basescan.org/address/0x2B73408052825e17e0Fe464f92De85e8c7723231) |\n| Price Oracle | NOT YET DEPLOYED | \n| ReverseRegistrar | [0xa0A8401ECF248a9375a0a71C4dedc263dA18dCd7](https://sepolia.basescan.org/address/0xa0A8401ECF248a9375a0a71C4dedc263dA18dCd7) | \n| L2Resolver | [0x6533C94869D28fAA8dF77cc63f9e2b2D6Cf77eBA](https://sepolia.basescan.org/address/0x6533C94869D28fAA8dF77cc63f9e2b2D6Cf77eBA) | \n\n## Functional Diagram\n\nThe system architecture can be functionally organized into three categories:\n1. An L1 resolver enabling cross-chain resolution for the `base.eth` 2LD.\n2. An ENS-like registry/registrar/resolver system deployed on Base enabling `*.base.eth` subdomains to be registered and managed.\n3. An off-chain gateway for serving CCIP requests required to comply with [ENSIP-10](https://docs.ens.domains/ensip/10). \n\n![Screenshot 2024-06-16 at 8 51 55 PM](https://github.com/base-org/usernames/assets/84420280/3689dd40-2be0-4a7d-8454-155741a1add0)\n\n### ARCHITECTURE\n\nThe core functionality of Base Usernames should look familiar to anyone that's looked under the hood  at the [ENS contracts](https://github.com/ensdomains/ens-contracts/tree/staging). We implement a slimmed down fork of the ENS contracts here.\n\n| Contract | Role | ENS Implementation | Base Usernames Implementation |\n| -------- | ----- | ------------------ | ----------------------------- | \n|[Registry](https://docs.ens.domains/registry/ens)  | Stores [Records](https://github.com/base-org/usernames/blob/c29119fd327b61f896440c317f3dd898e9fa570b/contracts/src/L2/Registry.sol#L7-L11) of subdomains in a flat structure |  [ENSRegistry.sol](https://github.com/ensdomains/ens-contracts/blob/staging/contracts/registry/ENSRegistry.sol) | [Registry.sol](https://github.com/base-org/basenames/blob/main/src/L2/Registry.sol) |\n| [BaseRegistrar](https://docs.ens.domains/registry/eth) | Tokenizes names,  manages ownership and stores expiry | [BaseRegistrarImplementation.sol](https://github.com/ensdomains/ens-contracts/blob/staging/contracts/ethregistrar/BaseRegistrarImplementation.sol) | [BaseRegistrar.sol](https://github.com/base-org/basenames/blob/main/src/L2/BaseRegistrar.sol) | \n| [ReverseRegistrar](https://docs.ens.domains/registry/reverse) | Manages the reverse lookup to allow the setting of \"primary\" names for an address | [ReverseRegistrar.sol](https://github.com/ensdomains/ens-contracts/blob/staging/contracts/reverseRegistrar/ReverseRegistrar.sol) | [ReverseRegistrar.sol](https://github.com/base-org/basenames/blob/main/src/L2/ReverseRegistrar.sol) |\n| [L1 Resolver](https://docs.ens.domains/resolvers/ccip-read) | Enables cross-chain, wildcard resolution from L1 | [OffchainResolver.sol](https://github.com/ensdomains/offchain-resolver/blob/main/packages/contracts/contracts/OffchainResolver.sol) | [L1Resolver.sol](https://github.com/base-org/basenames/blob/main/src/L1/L1Resolver.sol) | \n| [L2 Resolver](https://docs.ens.domains/resolvers/public) | A standard public resolver for storing records associated with namespaces | [PublicResolver.sol](https://github.com/ensdomains/ens-contracts/blob/staging/contracts/resolvers/PublicResolver.sol) | [L2Resolver.sol](https://github.com/base-org/usernames/blob/master/contracts/src/L2/L2Resolver.sol) | \n| Registrar Controller | A permissioned contract which manages registration payment | [ETHRegistrarController.sol](https://github.com/ensdomains/ens-contracts/blob/staging/contracts/ethregistrar/ETHRegistrarController.sol) | [RegistrarController.sol](https://github.com/base-org/usernames/blob/master/contracts/src/L2/RegistrarController.sol) |\n| Stable Price Oracle | The source of pricing based on name length and duration of registration | [StablePriceOracle.sol](https://github.com/ensdomains/ens-contracts/blob/staging/contracts/ethregistrar/StablePriceOracle.sol) | [StablePriceOracle.sol](https://github.com/base-org/usernames/blob/master/contracts/src/L2/StablePriceOracle.sol) |\n| Exponential Premium Oracle | A Dutch auction pricing mechanism for fairly pricing names after expiry | [ExponentialPremiumPricingOracle.sol](https://github.com/ensdomains/ens-contracts/blob/staging/contracts/ethregistrar/ExponentialPremiumPriceOracle.sol) | [ExponentialPremiumPricingOracle.sol](https://github.com/base-org/usernames/blob/master/contracts/src/L2/ExponentialPremiumPriceOracle.sol) | \n\nIn addition to replicating the base behavior of the ENS protocol, we are offering a series of promotional discounts associated with various Coinbase product integrations. As such, the Base Usernames Registrar Controller allows users to perform discounted registrations while passing along integration-specific `validationData`. Each discount leverages a common interface: \n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\n/// @title Discount Validator Interface\n///\n/// @notice Common interface which all Discount Validators must implement.\n///         The logic specific to each integration must ultimately be consumable as the `bool` returned from\n///         `isValidDiscountRegistration`.\ninterface IDiscountValidator {\n    /// @notice Required implementation for compatibility with IDiscountValidator.\n    ///\n    /// @dev Each implementation will have unique requirements for the data necessary to perform\n    ///     a meaningful validation. Implementations must describe here how to pack relevant `validationData`.\n    ///     Ex: `bytes validationData = abi.encode(bytes32 key, bytes32[] proof)`\n    ///\n    /// @param claimer the discount claimer's address.\n    /// @param validationData opaque bytes for performing the validation.\n    ///\n    /// @return `true` if the validation data provided is determined to be valid for the specified claimer, else `false`.\n    function isValidDiscountRegistration(address claimer, bytes calldata validationData) external returns (bool);\n}\n```\nThe various implementations can be found [in this directory](https://github.com/base-org/basenames/tree/main/src/L2/discounts). \n\n## Usage\n\n### Build\n\n```shell\n$ forge build\n```\n\n### Test\n\n```shell\n$ forge test\n```\n\n### Format\n\n```shell\n$ forge fmt\n```\n\n### Gas Snapshots\n\n```shell\n$ forge snapshot\n```\n\n### Help\n\n```shell\n$ forge --help\n$ anvil --help\n$ cast --help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Fbasenames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbase%2Fbasenames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Fbasenames/lists"}