Code Monkey home page Code Monkey logo

ens-contracts's Introduction

ENS

Build Status

For documentation of the ENS system, see docs.ens.domains.

npm package

This repo doubles as an npm package with the compiled JSON contracts

import {
  BaseRegistrar,
  BaseRegistrarImplementation,
  BulkRenewal,
  ENS,
  ENSRegistry,
  ENSRegistryWithFallback,
  ETHRegistrarController,
  FIFSRegistrar,
  LinearPremiumPriceOracle,
  PriceOracle,
  PublicResolver,
  Resolver,
  ReverseRegistrar,
  StablePriceOracle,
  TestRegistrar,
} from '@ensdomains/ens-contracts'

Importing from solidity

// Registry
import '@ensdomains/ens-contracts/contracts/registry/ENS.sol';
import '@ensdomains/ens-contracts/contracts/registry/ENSRegistry.sol';
import '@ensdomains/ens-contracts/contracts/registry/ENSRegistryWithFallback.sol';
import '@ensdomains/ens-contracts/contracts/registry/ReverseRegistrar.sol';
import '@ensdomains/ens-contracts/contracts/registry/TestRegistrar.sol';
// EthRegistrar
import '@ensdomains/ens-contracts/contracts/ethregistrar/BaseRegistrar.sol';
import '@ensdomains/ens-contracts/contracts/ethregistrar/BaseRegistrarImplementation.sol';
import '@ensdomains/ens-contracts/contracts/ethregistrar/BulkRenewal.sol';
import '@ensdomains/ens-contracts/contracts/ethregistrar/ETHRegistrarController.sol';
import '@ensdomains/ens-contracts/contracts/ethregistrar/LinearPremiumPriceOracle.sol';
import '@ensdomains/ens-contracts/contracts/ethregistrar/PriceOracle.sol';
import '@ensdomains/ens-contracts/contracts/ethregistrar/StablePriceOracle.sol';
// Resolvers
import '@ensdomains/ens-contracts/contracts/resolvers/PublicResolver.sol';
import '@ensdomains/ens-contracts/contracts/resolvers/Resolver.sol';

Accessing to binary file.

If your environment does not have compiler, you can access to the raw hardhat artifacts files at node_modules/@ensdomains/ens-contracts/artifacts/contracts/${modName}/${contractName}.sol/${contractName}.json

Contracts

Registry

The ENS registry is the core contract that lies at the heart of ENS resolution. All ENS 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.

ENS.sol

Interface of the ENS Registry.

ENSRegistry

Implementation of the ENS Registry, the central contract used to look up resolvers and owners for domains.

ENSRegistryWithFallback

The new implementation of the ENS Registry after the 2020 ENS Registry Migration.

FIFSRegistrar

Implementation of a simple first-in-first-served registrar, which issues (sub-)domains to the first account to request them.

ReverseRegistrar

Implementation of the reverse registrar responsible for managing reverse resolution via the .addr.reverse special-purpose TLD.

TestRegistrar

Implementation of the .test registrar facilitates easy testing of ENS 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.

EthRegistrar

Implements an ENS registrar intended for the .eth TLD.

These contracts were audited by ConsenSys Diligence; the audit report is available here.

BaseRegistrar

BaseRegistrar is the contract that owns the TLD in the ENS registry. This contract implements a minimal set of functionality:

  • The owner of the registrar may add and remove controllers.
  • 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.
  • Name owners may transfer ownership to another address.
  • Name owners may reclaim ownership in the ENS registry if they have lost it.
  • 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.

This 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.

EthRegistrarController

EthRegistrarController is the first implementation of a registration controller for the new registrar. This contract implements the following functionality:

  • 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.
  • The owner of the registrar may withdraw any collected funds to their account.
  • Users can register new names using a commit/reveal process and by paying the appropriate registration fee.
  • Users can renew a name by paying the appropriate fee. Any user may renew a domain, not just the name's owner.

The commit/reveal process is used to avoid frontrunning, and operates as follows:

  1. A user commits to a hash, the preimage of which contains the name to be registered and a secret value.
  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.

The minimum delay and expiry for commitments exist to prevent miners or other users from effectively frontrunning registrations.

SimplePriceOracle

SimplePriceOracle 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.

StablePriceOracle

StablePriceOracle 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.

Resolvers

Resolver implements a general-purpose ENS resolver that is suitable for most standard ENS use cases. The public resolver permits updates to ENS records by the owner of the corresponding name.

PublicResolver includes the following profiles that implements different EIPs.

  • ABIResolver = EIP 205 - ABI support (ABI()).
  • AddrResolver = EIP 137 - Contract address interface. EIP 2304 - Multicoin support (addr()).
  • ContentHashResolver = EIP 1577 - Content hash support (contenthash()).
  • InterfaceResolver = EIP 165 - Interface Detection (supportsInterface()).
  • NameResolver = EIP 181 - Reverse resolution (name()).
  • PubkeyResolver = EIP 619 - SECP256k1 public keys (pubkey()).
  • TextResolver = EIP 634 - Text records (text()).
  • DNSResolver = Experimental support is available for hosting DNS domains on the Ethereum blockchain via ENS. The more detail is on the old ENS doc.

Developer guide

Prettier pre-commit hook

This repo runs a husky precommit to prettify all contract files to keep them consistent. Add new folder/files to prettier format script in package.json. If you need to add other tasks to the pre-commit script, add them to .husky/pre-commit

How to setup

git clone https://github.com/ensdomains/ens-contracts
cd ens-contracts
yarn

How to run tests

yarn test

How to publish

yarn pub

Release flow

  1. Create a feature branch from staging branch
  2. Make code updates
  3. Ensure you are synced up with staging
  4. Code should now be in a state where you think it can be deployed to production
  5. Create a "Release Candidate" release on GitHub. This will be of the form v1.2.3-RC0. This tagged commit is now subject to our bug bounty.
  6. Have the tagged commit audited if necessary
  7. If changes are required, make the changes and then once ready for review create another GitHub release with an incremented RC value v1.2.3-RC0 -> v.1.2.3-RC1. Repeat as necessary.
  8. Deploy to testnet. Open a pull request to merge the deploy artifacts into the feature branch. Create GitHub release of the form v1.2.3-testnet from the commit that has the new deployment artifacts.
  9. Get someone to review and approve the deployment and then merge. You now MUST merge this branch into staging branch.
  10. If any further changes are needed, you can either make them on the existing feature branch that is in sync or create a new branch, and follow steps 1 -> 9. Repeat as necessary.
  11. Make a deployment to ethereum mainnet from staging. Create a GitHub release of the form v1.2.3 from the commit that has the new deployment artifacts.
  12. Open a PR to merge into main. Have it reviewed and merged.

Cherry-picked release flow

Certain changes can be released in isolation via cherry-picking, although ideally we would always release from staging.

  1. Create a new branch from mainnet.
  2. Cherry-pick from staging into new branch.
  3. Deploy to ethereum mainnet, tag the commit that has deployment artifacts and create a release.
  4. Merge into mainnet.

Emergency release process

  1. Branch from main, make fixes, deploy to testnet (can skip), deploy to mainnet
  2. Merge changes back into main and staging immediately after deploy
  3. Create GitHub releases, if you didn't deploy to testnet in step 1, do it now

Notes

  • Deployed code should always match source code in mainnet releases. This may not be the case for staging.
  • staging branch and main branch should start in sync
  • staging is intended to be a practice main. Only code that is intended to be released to main can be merged to staging. Consequently:
    • Feature branches will be long-lived
    • Feature branches must be kept in sync with staging
    • Audits are conducted on feature branches
  • All code that is on staging and main should be deployed to testnet and mainnet respectively i.e. these branches should not have any undeployed code
  • It is preferable to not edit the same file on different feature branches.
  • Code on staging and main will always be a subset of what is deployed, as smart contracts cannot be undeployed.
  • Release candidates, staging and main branch are subject to our bug bounty
  • Releases follow semantic versioning and releases should contain a description of changes with developers being the intended audience

ens-contracts's People

Contributors

0xc0de4c0ffee avatar 0xcharchar avatar adu-web3 avatar arachnid avatar axic avatar chriseth avatar gopi-gith avatar hodlthedoor avatar jefflau avatar lcfr-eth avatar leonmanrolls avatar makoto avatar malfurionwhitehat avatar mdtanrikulu avatar mkhalesi avatar nxt3d avatar omahs avatar pana avatar rodrigoherrerai avatar royalfork avatar serenae-fansubs avatar tarekkma avatar tateb avatar tlammens avatar wechman avatar wgb5445 avatar zhangzhuosjtu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ens-contracts's Issues

Exponential price decay

Premium currently decays linearly. We need to write a function so decay exponentially with the formula:

P = SP ^ 0.5 ^ T, where P = Price, SP = Starting Price, T = Time since expiry.

Refactor .eth registrar controller for gas efficiency

We have a number of static calls to other contracts such as the registrar that fetch well known data like the base node or ENS contract address that we can remove.

There are also more sophisticated options we can take:

  • We can ask the user to approve the controller to act on their behalf with the registry, which would mean it could register the domain directly to the eventual owner but still call setResolver on the registry, instead of the current solution which requires temporarily transferring ownership to the controller during the registration process.
  • For registering wrapped domains, we could ask the user to authorise the controller on the wrapper, so it could do the same as the above.

Why use ERC-1155 instead of ERC-721 for Name Wrapper?

There is only one (not many) token for each token id in Name Wrapper contract, why use ERC-1155 instead of ERC-721 for Name Wrapper?

ERC-721 is simpler than ERC-1155, and I think using ERC-721 is enough for Name Wrapper.

An error occurred when yarn start:test

Does anybody know what is the problem?

in /ens-app/

ganache-cli -> ok
yarn run preTest -> ok
yarn start:test -> error:

/ens-app/node_modules/deepmerge/dist/cjs.js:67
	} cat
	^

SyntaxError: Missing catch or finally after try
    at new Script (node:vm:100:7)
    at createScript (node:vm:257:10)
    at Object.runInThisContext (node:vm:305:10)
    at wrapSafe (node:internal/modules/cjs/loader:1020:15)
    at Module._compile (node:internal/modules/cjs/loader:1069:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
error Command failed.
Exit code: 1
Command: /usr/local/bin/node
Arguments: scripts/serve.js start
Directory: /Users/one/vue3/ens/ens-app
Output:

info Visit https://yarnpkg.com/en/docs/cli/node for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.

Issue in index.js

Hi,

New version available on npm is 0.0.12 has index.js which is exporting baseRegistrar and PriceOracle but there is not such contract exists. If person try to use this version, application never run.

Compiler warnings: contracts license is not set

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> @ensdomains/buffer/contracts/Buffer.sol


Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> @ensdomains/ens-contracts/contracts/dnssec-oracle/BytesUtils.sol


Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> @ensdomains/ens-contracts/contracts/dnssec-oracle/RRUtils.sol


Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> @ensdomains/ens-contracts/contracts/registry/ENS.sol


Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> @ensdomains/ens-contracts/contracts/resolvers/OwnedResolver.sol

Allow multiple text entries with the same key

In DNS services it is possible to use multiple TXT entries with the same key. This is useful to implement an array-like structure for text records. It would be very helpful if ens would also support multiple Text entries per key.

Need to update node version in .nvmrc

ISSUE
The node version in .nvmrc does not work on Mac OS. Error ( package [email protected] requires node >= 14.16.0) is thrown while trying to install packages with yarn.
SOLUTION
I would suggest updating the node version in .nvmrc to v16.15.1.

Full cli trace:

ens-contracts ➀  yarn install
yarn install v1.22.19
warning ../../../../../package.json: No license field
[1/4] πŸ”  Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "js-sha3@^0.5.7"
warning Resolution field "[email protected]" is incompatible with requested version "js-sha3@^0.5.7"
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "js-sha3@^0.5.7"
warning Resolution field "[email protected]" is incompatible with requested version "js-sha3@^0.5.7"
[2/4] 🚚  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=14.16". Got "14.15.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Wrapped domain expiry date mismatched

I wrapped my domain to the wrapper, then extend the domain's expiry date on ens.domains, but the expiry date in the wrapper is not updated. When will the expiry date be updated? Or must I renew the domain on wrapper?

`_consumeCommitment` in `ETHRegistrarController` need logic improvement

function _consumeCommitment(
        string memory name,
        uint256 duration,
        bytes32 commitment
    ) internal {
        // Require a valid commitment (is old enough and is committed)
        require(
            commitments[commitment] + minCommitmentAge <= block.timestamp,
            "ETHRegistrarController: Commitment is not valid"
        );

        // If the commitment is too old, or the name is registered, stop
        require(
            commitments[commitment] + maxCommitmentAge > block.timestamp,
            "ETHRegistrarController: Commitment has expired"
        );
.....

Apparently, the first require assertion can not check whether the commitment is committed or not because the solidity map ping supposes that every key of the mapping exists with the default zero value.
Luckily, the maxCommitmentAge in the second require assertion is small enough so that if a commitment is not committed it will always throw the error.
If other projects forked ens and initialized maxCommitmentAge with a very big value, then the _consumeCommitment validation is escaped.

Return owner address in public resolver if ETH address isn't set

Public resolver should return address of node owner from ENS contract if it's not already set.
That'll save users from one tx/gas, and users can change their addr anytime.

function addr(bytes32 node) virtual override public view returns (address payable) {
bytes memory a = addr(node, COIN_TYPE_ETH);
if(a.length == 0) {
return payable(0);
}
return bytesToAddress(a);
}

I'd send a PR but ENS isn't available in resolver base && I don't want to make a mess around. πŸ™

     function addr(bytes32 node) virtual override public view returns (address payable) {
        bytes memory a = _addresses[node][COIN_TYPE_ETH];
        if(a.length == 0) {
            return payable(ENS.owner(node));
        }
        return bytesToAddress(a);
    }

Adding Multiple TLDS

I am working on a fork of ens-contracts and the goal is to support multiple TLDs like .eth, .btc, etc can this be done on the current version of contract and is there any guide to do so

Unhandled failure in `OffchainDNSResolver` for invalid addresses in DNS records

I was just checking the newish OffchainDNSResolver contract, and there seems to be an unhandled failure in the OffchainDNSResolver when a user includes an invalid resolver address as part of their DNS record.

As far as I understand, the root problem is in the way OffchainDNSResolver::parseAndResolve attempts to parse the user-provided value to an address.
Whatever value is passed in the nameOrAddress parameter, as long as it starts with 0x, it will be passed down to the HexUtils::hexToAddress function. Where it will attempt to cast it to an Ethereum address. Internally, this function never checks whether the length of the supplied data is longer than an address. It just casts it to a bytes32 value, and then to address.

As an example, the string 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 would be considered to be the address 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00. This means that OffchainDNSResolver::parseRR would return a non-zero address (which is interpreted as a signal for a valid record found) and the name would try to be resolved calling the 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 account.

If the called account happens to be empty (most likely the case if the record was just set incorrectly due to a user's oversight), then execution is reverted with error "function returned an unexpected amount of data" instead of the more gracious CouldNotResolve(bytes) error. This is because the call to IERC165(dnsresolver).supportsInterface(...) is using the explicit cast to the IERC165 interface, which is always expecting a boolean in return - reverting otherwise.

Perhaps the code could be changed to fail earlier. Non-addresses shouldn't be silently parsed as addresses.

Once that's fixed, we'd be left with the scenario where the user sets a valid address in the record, but that address corresponds to a custom resolver that does not follow IERC165. If you want to support that case (which appears to be so, given this fallback-like staticcall), then instead of explicitly casting to IERC165 you might want to consider using the ERC165Checker lib or anything similar that does not revert, but instead allows you to explicitly handle errors when querying unsupported interfaces.

Why not check ownership in setName of Reverse Registrar ?

hello.

I am a junior developer interested in ens.
Also, I apologize for writing the email through a translator because I am not good at English.

While analyzing the ens contract, I am making issue because I have a question.

When using reverseRegistrar 's setName , is it intended to be able to change the primary name without checking ownership of Name ?

If it's not intended, I think it can cause confusion in reverse lookups. (Even if it's handled by the frontend.)

Links to related transaction hashes are noted below.
https://etherscan.io/tx/0xd7259c295158bdeff065b12587cba4283630754de6d9808e98605d6361f20fcd

IDNSZoneResolver interfaceId does not match tests

In /test/resolvers/TestPublicResolver.js the interfaceId for IDNSZoneResolver is '0x5c98042b'

  assert.equal(await resolver.supportsInterface('0x5c98042b'), true) // IDNSZoneResolver

But in /deployments/mainnet/solcInputs, the interfaceId is '0x5c47637c'

DNS_ZONE_INTERFACE_ID = 0x5c47637c;

Also when checking if the resolver contract supports the interface the following addresses fail for both '0x5c98042b' and '0x5c47637c'

  • '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'
  • '0xdaaf96c344f63131acadd0ea35170e7892d3dfba'
  • '0x226159d592e2b063810a10ebf6dcbada94ed68b8'
  • '0x1da022710df5002339274aadee8d58218e9d6ab5'

Add tests for OwnedResolver

OwnedResolver currently has no tests. We could have tests to make sure

  • Test that the owner can change records
  • Test that no other account can change records

Allow preconfiguring arbitrary resolver values

When registering a name, it should be possible to preconfigure any key at all.

This will require either deploying individual resolver proxies for each user, or doing access-control by checking the node on each nested call is one the caller controls.

Broken dependency tree

Looks as if there's a problem with this hardhat-waffle package.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @ensdomains/[email protected]
npm ERR! Found: @nomiclabs/[email protected]
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   dev @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.13" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomiclabs/[email protected]
npm ERR! node_modules/@nomiclabs/hardhat-waffle
npm ERR!   dev @nomiclabs/hardhat-waffle@"^2.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Deploy ens follow official failed

Hello, I tried to use ENSDeployer.sol in https://docs.ens.domains/deploying-ens-on-a-private-chain to deploy but got an error:
TypeError: Wrong argument count for function call: 2 arguments given but expected 4. --> contracts/ENSDeployer.sol:25:22: | 25 | publicResolver = new PublicResolver(ens, INameWrapper(address(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Then I check this contract in your npm repo, the construct of PublicResolver is :
constructor( ENS _ens, INameWrapper wrapperAddress, address _trustedETHController, address _trustedReverseRegistrar )
I wish I could use ENSDeployer.sol to deploy ens .Txs

Write and deploy universal resolver

Here's an outline:

interface ENS {
    function resolver(bytes32 node) external view returns(address);
}

contract UniversalResolver {
    ENS ens;
    
    constructor(ENS _ens) {
        ens = _ens;
    }
    
    function multicall(bytes[] calldata inputs) external returns (bytes[] memory ret) {
        ret = new bytes[](inputs.length);
        for(uint256 i = 0; i < inputs.length; i++) {
            (, bytes memory result) = _resolve(inputs[i]);
            ret[i] = result;
        }
        return ret;
    }
    
    fallback (bytes calldata input) external returns (bytes memory _output) {
        (bool success, bytes memory result) = _resolve(input);
        if(success) {
            return result;
        } else {
            assembly {
                revert(add(result, 32), mload(result))
            }
        }
    }
    
    function _resolve(bytes memory input) internal returns (bool, bytes memory) {
        require(input.length >= 36, "Input too short");
        bytes32 node;
        assembly {
            node := calldataload(add(input, 36))
        }
        address resolver = ens.resolver(node);
        return resolver.call(input);
    }
}

We should deploy this using some kind of CALL2 deployment stub that ensures the same address on all chains - need to check if there is already one in widespread use. We can then give the contract a name such as universalresolver.ens.eth.

Fix dependencies

This package depends on @ensdomains/ens-buffer which seems to accidentally depend on @nomiclabs/hardhat-truffle5: this should be a dev dependency but is installed as a normal dependency. As a result, a huge number of dependencies gets installed, totalling 200MB on disk.

I opened ensdomains/buffer#21 but I'm raising this here because this package is affected and it should be fixed asap.

Update .ETH registrar controller with new functionality

  • Reverse record auto set as a parameter
  • Name wrapped automatically on registration
  • Allow arbitrary records to be set on registration
  • Registration event split between premium/base cost
  • Remove refund and adjust registration to ether given
  • Make all config variables immutable and compare gas cost

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.