{"id":15061699,"url":"https://github.com/fildomains/fns-contracts","last_synced_at":"2026-02-14T14:06:59.548Z","repository":{"id":168035510,"uuid":"638750211","full_name":"fildomains/fns-contracts","owner":"fildomains","description":"https://app.fildomains.com/","archived":false,"fork":false,"pushed_at":"2023-05-10T09:08:52.000Z","size":3183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-04T19:36:01.558Z","etag":null,"topics":["contracts","fevm","fildomains","filecoin","fns","fvm","ipfs"],"latest_commit_sha":null,"homepage":"https://app.fildomains.com/","language":"JavaScript","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/fildomains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-10T02:57:38.000Z","updated_at":"2023-05-10T03:16:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"7261d6e1-bed7-498c-8df1-ee2753b6ddd5","html_url":"https://github.com/fildomains/fns-contracts","commit_stats":{"total_commits":671,"total_committers":28,"mean_commits":"23.964285714285715","dds":0.5812220566318926,"last_synced_commit":"b71fa95e3e38fe5f66a45f5024bb0ca72702b70f"},"previous_names":["fildomains/fns-contracts"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/fildomains/fns-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fildomains%2Ffns-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fildomains%2Ffns-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fildomains%2Ffns-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fildomains%2Ffns-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fildomains","download_url":"https://codeload.github.com/fildomains/fns-contracts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fildomains%2Ffns-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29446423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T12:43:28.304Z","status":"ssl_error","status_checked_at":"2026-02-14T12:43:14.160Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["contracts","fevm","fildomains","filecoin","fns","fvm","ipfs"],"created_at":"2024-09-24T23:23:53.382Z","updated_at":"2026-02-14T14:06:59.534Z","avatar_url":"https://github.com/fildomains.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## npm package\n\nThis repo doubles as an npm package with the compiled JSON contracts\n\n```js\nimport {\n  BaseRegistrar,\n  BaseRegistrarImplementation,\n  BulkRenewal,\n  FNS,\n  Registry,\n  RegistrarController,\n  FIFSRegistrar,\n  LinearPremiumPriceOracle,\n  PriceOracle,\n  PublicResolver,\n  Resolver,\n  ReverseRegistrar,\n  StablePriceOracle,\n  TestRegistrar\n} from '@fildomains/fns-contracts'\n```\n\n## Importing from solidity\n\n```\n// Registry\nimport '@fildomains/fns-contracts/contracts/registry/FNS.sol';\nimport '@fildomains/fns-contracts/contracts/registry/Registry.sol';\nimport '@fildomains/fns-contracts/contracts/registry/ReverseRegistrar.sol';\nimport '@fildomains/fns-contracts/contracts/registry/TestRegistrar.sol';\n// Registrar\nimport '@fildomains/fns-contracts/contracts/registrar/BaseRegistrar.sol';\nimport '@fildomains/fns-contracts/contracts/registrar/BaseRegistrarImplementation.sol';\nimport '@fildomains/fns-contracts/contracts/registrar/BulkRenewal.sol';\nimport '@fildomains/fns-contracts/contracts/registrar/RegistrarController.sol';\nimport '@fildomains/fns-contracts/contracts/registrar/LinearPremiumPriceOracle.sol';\nimport '@fildomains/fns-contracts/contracts/registrar/PriceOracle.sol';\nimport '@fildomains/fns-contracts/contracts/registrar/StablePriceOracle.sol';\n// Resolvers\nimport '@fildomains/fns-contracts/contracts/resolvers/PublicResolver.sol';\nimport '@fildomains/fns-contracts/contracts/resolvers/Resolver.sol';\n```\n\n##  Accessing to binary file.\n\nIf your environment does not have compiler, you can access to the raw hardhat artifacts files at `node_modules/@fildomains/fns-contracts/artifacts/contracts/${modName}/${contractName}.sol/${contractName}.json`\n\n\n## Contracts\n\n## Registry\n\nThe FNS registry is the core contract that lies at the heart of FNS resolution. All FNS lookups start by querying the registry. The registry maintains a list of domains, recording the owner, resolver, and TTL for each, and allows the owner of a domain to make changes to that data. It also includes some generic registrars.\n\n### FNS.sol\n\nInterface of the FNS Registry.\n\n### Registry\n\nImplementation of the FNS Registry, the central contract used to look up resolvers and owners for domains.\n\n### FIFSRegistrar\n\nImplementation of a simple first-in-first-served registrar, which issues (sub-)domains to the first account to request them.\n\n### ReverseRegistrar\n\nImplementation of the reverse registrar responsible for managing reverse resolution via the .addr.reverse special-purpose TLD.\n\n\n### TestRegistrar\n\nImplementation of the `.test` registrar facilitates easy testing of FNS on the Filecoin test networks. Currently deployed on Hyperspace network, it provides functionality to instantly claim a domain for test purposes, which expires 28 days after it was claimed.\n\n## Registrar\n\nImplements an [FNS](https://fildomains.com/) registrar intended for the .fil TLD.\n\n### BaseRegistrar\n\nBaseRegistrar is the contract that owns the TLD in the FNS registry. This contract implements a minimal set of functionality:\n\n - The owner of the registrar may add and remove controllers.\n - Controllers may register new domains and extend the expiry of (renew) existing domains. They can not change the ownership or reduce the expiration time of existing domains.\n - Name owners may transfer ownership to another address.\n - Name owners may reclaim ownership in the FNS registry if they have lost it.\n - Owners of names in the interim registrar may transfer them to the new registrar, during the 1 year transition period. When they do so, their deposit is returned to them in its entirety.\n\nThis separation of concerns provides name owners strong guarantees over continued ownership of their existing names, while still permitting innovation and change in the way names are registered and renewed via the controller mechanism.\n\n### RegistrarController\n\nRegistrarController is the first implementation of a registration controller for the new registrar. This contract implements the following functionality:\n\n - The owner of the registrar may set a price oracle contract, which determines the cost of registrations and renewals based on the name and the desired registration or renewal duration.\n - The owner of the registrar may withdraw any collected funds to their account.\n - Users can register new names using a commit/reveal process and by paying the appropriate registration fee.\n - Users can renew a name by paying the appropriate fee. Any user may renew a domain, not just the name's owner.\n\nThe commit/reveal process is used to avoid frontrunning, and operates as follows:\n\n 1. A user commits to a hash, the preimage of which contains the name to be registered and a secret value.\n 2. After a minimum delay period and before the commitment expires, the user calls the register function with the name to register and the secret value from the commitment. If a valid commitment is found and the other preconditions are met, the name is registered.\n\nThe minimum delay and expiry for commitments exist to prevent miners or other users from effectively frontrunnig registrations.\n\n### SimplePriceOracle\n\nSimplePriceOracle is a trivial implementation of the pricing oracle for the RegistrarController that always returns a fixed price per domain per year, determined by the contract owner.\n\n### StablePriceOracle\n\nStablePriceOracle is a price oracle implementation that allows the contract owner to specify pricing based on the length of a name, and uses a fiat currency oracle to set a fixed price in fiat per name.\n\n## Resolvers\n\nResolver implements a general-purpose FNS resolver that is suitable for most standard FNS use-cases. The public resolver permits updates to FNS records by the owner of the corresponding name.\n\nPublicResolver includes the following profiles that implements different EIPs.\n\n- ABIResolver = EIP 205 - ABI support (`ABI()`).\n- AddrResolver = EIP 137 - Contract address interface. EIP 2304 - Multicoin support (`addr()`).\n- ContentHashResolver = EIP 1577 - Content hash support (`contenthash()`).\n- InterfaceResolver = EIP 165 - Interface Detection (`supportsInterface()`).\n- NameResolver = EIP 181 - Reverse resolution (`name()`).\n- PubkeyResolver = EIP 619 - SECP256k1 public keys (`pubkey()`).\n- TextResolver = EIP 634 - Text records (`text()`).\n- DNSResolver = Experimental support is available for hosting DNS domains on the Filecoin blockchain via FNS.\n\n## Developer guide\n\n### How to setup\n\n```\ngit clone https://github.com/fildomains/fns-contracts\ncd fns-contracts\nyarn\n```\n\n### How to run tests\n\n```\nyarn test\n```\n\n### How to publish\n\n```\nyarn pub\n```\n\n### Release flow\n\nSmart contract development tends to take a long release cycle. To prevent unnecesarily dependency conflicts, please create a feature branch (`features/$BRNACH_NAME`) and raise a PR against the feature branch. The feature branch must be merged into master only after the smart contracts are deployed to the Filecoin mainnet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffildomains%2Ffns-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffildomains%2Ffns-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffildomains%2Ffns-contracts/lists"}