Skip to content

ENS resolver using CCIP for secure offchain data retrieval

License

Notifications You must be signed in to change notification settings

3numdao/ens-ccip-resolver

 
 

Repository files navigation

ENS Offchain Resolver

This repo was forked from Coinbase. The contract was renamed to ENSResolver to make it clear it is a generic ENS resolver and not specific to Coinbase names.

Client                             Offchain Resolver Contract          Gateway
  |                    resolve(dnsname, lookup) |                         |
  |-------------------------------------------->|                         |
  |                                             |                         |
  | error: OffchainLookup(addr, url, data, ...) |                         |
  |<--------------------------------------------|                         |
  |                                             |                         |
  |                                             |      GET /{addr}/{data} |
  |---------------------------------------------------------------------->|
  |                                             |                         |
  | response: (result, expires, sig)            |                         |
  |<----------------------------------------------------------------------|
  |                                             |                         |
  |            resolveWithProof(response, data) |                         |
  |-------------------------------------------->|                         |
  |                                             |                         |
  | result (or an error if invalid)             |                         |
  |<--------------------------------------------|                         |
  |                                             |                         |

Please refer to the tests for .resolve and .resolveWithProof in ENSResolver.test.ts to learn more about how this works.

Requirements

  • Node.js v16
  • Yarn v1.22.x

Usage

Install dependencies

$ yarn install

Compile

Compile the smart contracts with Hardhat:

$ yarn compile

TypeChain

Compile the smart contracts and generate TypeChain artifacts:

$ yarn typechain

Format

$ yarn prettier

Lint

$ yarn lint

Test

$ yarn test

Test Coverage

Ensure test coverage is at 100%

$ yarn coverage

$ open coverage/index.html

Deployment

$ yarn deploy-resolver --network <NETWORK> --url https://youendpoint/path/{sender}/{data} [--owner addr | --smanager addr | --gwmanager addr | --signer addr]

About

ENS resolver using CCIP for secure offchain data retrieval

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 56.5%
  • Solidity 42.9%
  • Other 0.6%