{"_id":"@daouniverse/dns-contracts","name":"@daouniverse/dns-contracts","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@daouniverse/dns-contracts","version":"1.0.0","description":"A Decentralized Autonomous Organization Name Service contracts","scripts":{"test":"hardhat test","test:local":"hardhat --network localhost testnet","lint":"hardhat check","deploy":"npx hardhat deploy --network goerli","verify":"npx hardhat verify --network goerli","pub":"yarn publish --access public"},"main":"index.js","devDependencies":{"@ensdomains/dnsprovejs":"^0.3.7","@ensdomains/test-utils":"^1.3.0","@nomiclabs/hardhat-ethers":"npm:hardhat-deploy-ethers@^0.3.0-beta.13","@nomiclabs/hardhat-solhint":"^2.0.0","@nomiclabs/hardhat-truffle5":"^2.0.0","@nomiclabs/hardhat-waffle":"^2.0.1","@nomiclabs/hardhat-web3":"^2.0.0","@openzeppelin/test-helpers":"^0.5.11","@types/keyv":"^4.2.0","@types/mocha":"^9.1.1","@types/node":"^18.0.0","chai":"^4.3.4","dotenv":"^10.0.0","elliptic-solidity":"^1.0.0","ethereum-waffle":"^3.3.0","ethers":"^5.6.1","hardhat":"^2.9.9","hardhat-abi-exporter":"^2.9.0","hardhat-deploy":"^0.11.10","hardhat-gas-reporter":"^1.0.4","keyv":"4.5.2","prettier":"^2.6.2","prettier-plugin-solidity":"^1.0.0-beta.24","rfc4648":"^1.5.0","ts-node":"^10.8.1","typescript":"^4.7.3"},"resolutions":{"ethereum-ens":"0.8.0","js-sha3":"0.8.0"},"dependencies":{"@ensdomains/buffer":"^0.0.13","@ensdomains/solsha1":"0.0.3","@nomiclabs/hardhat-etherscan":"^3.1.0","@openzeppelin/contracts":"^4.1.0","dns-packet":"^5.3.0"},"repository":{"type":"git","url":"git+https://github.com/Dao-Universeorg/dns-contracts.git"},"author":{},"license":"MIT","bugs":{"url":"https://github.com/Dao-Universeorg/dns-contracts/issues"},"homepage":"https://github.com/Dao-Universeorg/dns-contracts#readme","licenseText":"Copyright (c) 2018, True Names Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"@daouniverse/dns-contracts@1.0.0","dist":{"shasum":"56d100949c10389edff2a45287f76fb1fd90a34e","integrity":"sha512-YUY2L8dkK0aSAXZpEfhEZU89YYG5KM0q/g277VBjG7lh/khsCuAE1kMJzRtPfoER5xdFZjl4TudcsOg/sdPdpw==","tarball":"https://registry.npmjs.org/@daouniverse/dns-contracts/-/dns-contracts-1.0.0.tgz","fileCount":688,"unpackedSize":39553279,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXUc/J85R0mF78I6gcCjVFjcSIA2UqDaRDeKoE0yJFkwIhAIDPOgY+MVIMiYEdRm1e4ko7/Uuk2CSA3P9H6zbLHeGx"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyAidACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4VRAAk+E2xMD9WUFzMgzA41kv/WvA35seatoMsOK1EnISJphIGAkc\r\n2P8kKqifDSeDKOwh/pgD1qoEF/lha855GjcpgMcUx1wDUEfWxzyCpvGDq6GJ\r\nezX9S2WFKHJZaE/8IrmH0ftY5sXtevZ9NkTrqeCyMX3oojbqHksLMC60eM/8\r\nOIm4viv2nzq4s5D2b8x54LNFbqv1IK6S2SH44yYTQDv6EGseSzAJSPQX9noU\r\naltR5XSka+3ml/MZeuSgEdcgMfq0qhXH8l2vPe9qpCJlhao5X/QeatMnPD8p\r\nJPV9+NhnCnKi5X4hevXQ5PAG9IKGJ3FczvjiDdPgUjN+k0NYi1Dv1ibDEQA4\r\nlpBNQVLCSSl25fZC6fLgCupLBq666LFwxkvEn2KVRJVjTMzhH+yym1S6DccJ\r\n/OGsk7CwLhCW1tRQbzGIz7A+rDJpV5T/yTnl89/s/ezjGwQVjJiZV7Wtm2W9\r\nkrwJvNCXrOz0Eswb45UNJ4Qg2EWBdSZsF1w7TeIYHreUp+ZZ4HYW4m6H2HB1\r\nbNIc2Z6zA6EEfUGBbXQ6joKqG+tlpubSa5col0TonJw8setZoiS4J0fr40pH\r\nC9jgO9x07wJjjcKK6uvzK4nk+dQRgCAL+Hxp118OFoLb5Eb59vf2Wrq1v7oZ\r\nHyyjdPs7bkT4d6rJGS+26kJA3grpKzNzQMY=\r\n=bM5y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"devaliens","email":"stepnalien@gmail.com"},"directories":{},"maintainers":[{"name":"devaliens","email":"stepnalien@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dns-contracts_1.0.0_1674053789180_0.5609455117745175"},"_hasShrinkwrap":false}},"time":{"created":"2023-01-18T14:56:29.101Z","1.0.0":"2023-01-18T14:56:29.498Z","modified":"2023-01-18T14:56:29.750Z"},"maintainers":[{"name":"devaliens","email":"stepnalien@gmail.com"}],"description":"A Decentralized Autonomous Organization Name Service contracts","homepage":"https://github.com/Dao-Universeorg/dns-contracts#readme","repository":{"type":"git","url":"git+https://github.com/Dao-Universeorg/dns-contracts.git"},"author":{},"bugs":{"url":"https://github.com/Dao-Universeorg/dns-contracts/issues"},"license":"MIT","readme":"# DNS\n\n[![Build Status](https://travis-ci.org/daouniverse/dns-contracts.svg?branch=master)](https://travis-ci.org/daouniverse/dns-contracts)\n\nFor documentation of the DNS system, see [docs.dns.domains](https://docs.dns.domains/).\n\n## 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  DNS,\n  DNSRegistry,\n  DNSRegistryWithFallback,\n  ETHRegistrarController,\n  FIFSRegistrar,\n  LinearPremiumPriceOracle,\n  PriceOracle,\n  PublicResolver,\n  Resolver,\n  ReverseRegistrar,\n  StablePriceOracle,\n  TestRegistrar\n} from '@daouniverse/dns-contracts'\n```\n\n## Importing from solidity\n\n```\n// Registry\nimport '@daouniverse/dns-contracts/contracts/registry/DNS.sol';\nimport '@daouniverse/dns-contracts/contracts/registry/DNSRegistry.sol';\nimport '@daouniverse/dns-contracts/contracts/registry/DNSRegistryWithFallback.sol';\nimport '@daouniverse/dns-contracts/contracts/registry/ReverseRegistrar.sol';\nimport '@daouniverse/dns-contracts/contracts/registry/TestRegistrar.sol';\n// EthRegistrar\nimport '@daouniverse/dns-contracts/contracts/ethregistrar/BaseRegistrar.sol';\nimport '@daouniverse/dns-contracts/contracts/ethregistrar/BaseRegistrarImplementation.sol';\nimport '@daouniverse/dns-contracts/contracts/ethregistrar/BulkRenewal.sol';\nimport '@daouniverse/dns-contracts/contracts/ethregistrar/ETHRegistrarController.sol';\nimport '@daouniverse/dns-contracts/contracts/ethregistrar/LinearPremiumPriceOracle.sol';\nimport '@daouniverse/dns-contracts/contracts/ethregistrar/PriceOracle.sol';\nimport '@daouniverse/dns-contracts/contracts/ethregistrar/StablePriceOracle.sol';\n// Resolvers\nimport '@daouniverse/dns-contracts/contracts/resolvers/PublicResolver.sol';\nimport '@daouniverse/dns-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/@daouniverse/dns-contracts/artifacts/contracts/${modName}/${contractName}.sol/${contractName}.json`\n\n\n## Contracts\n\n## Registry\n\nThe DNS registry is the core contract that lies at the heart of DNS resolution. All DNS 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### DNS.sol\n\nInterface of the DNS Registry.\n\n### DNSRegistry\n\nImplementation of the DNS Registry, the central contract used to look up resolvers and owners for domains.\n\n### DNSRegistryWithFallback\n\nThe new impelmentation of the DNS Registry after [the 2020 DNS Registry Migration](https://docs.dns.domains/dns-migration-february-2020/technical-description#new-dns-deployment).\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 DNS on the Ethereum test networks. Currently deployed on Ropsten network, it provides functionality to instantly claim a domain for test purposes, which expires 28 days after it was claimed.\n\n\n## EthRegistrar\n\nImplements an [DNS](https://dns.domains/) registrar intended for the .dao TLD.\n\nThese contracts were audited by Consdnsys dilligence; the audit report is available [here](https://github.com/Consdnsys/dns-audit-report-2019-02).\n\n### BaseRegistrar\n\nBaseRegistrar is the contract that owns the TLD in the DNS 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 DNS 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### EthRegistrarController\n\nEthRegistrarController 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 EthRegistrarController 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 DNS resolver that is suitable for most standard DNS use-cases. The public resolver permits updates to DNS 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 Ethereum blockchain via DNS. [The more detail](https://veox-dns.readthedocs.io/en/latest/dns.html) is on the old DNS doc.\n\n## Developer guide\n\n### How to setup\n\n```\ngit clone https://github.com/daouniverse/dns-contracts\ncd dns-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 Ethereum mainnet.\n\n### Deploy\n```bash\n./node_modules/.bin/hardhat deploy --network testnet --tags DNSRegistry\n./node_modules/.bin/hardhat deploy --network testnet --tags Root\n./node_modules/.bin/hardhat deploy --network testnet --tags StaticMetadataService\n./node_modules/.bin/hardhat deploy --network testnet --tags BaseRegistrarImplementation\n./node_modules/.bin/hardhat deploy --network testnet --tags NameWrapper\n./node_modules/.bin/hardhat deploy --network testnet --tags ReverseRegistrar\n./node_modules/.bin/hardhat deploy --network testnet --tags UniversalResolver\n./node_modules/.bin/hardhat deploy --network testnet --tags ExponentialPremiumPriceOracle\n./node_modules/.bin/hardhat deploy --network testnet --tags ETHRegistrarController\n./node_modules/.bin/hardhat deploy --network testnet --tags PublicResolver\n./node_modules/.bin/hardhat deploy --network testnet --tags BulkRenewal\n./node_modules/.bin/hardhat deploy --network testnet --tags FinalSetup\n```","readmeFilename":"README.md"}