📖
Pulse Domains
  • 👋Introduction
  • đŸŸĸRegistration FAQ
  • 📒Terminology
  • Guides
    • đŸĒ„Domain Registration
    • đŸ§â€â™€ī¸Updating Your Profile
    • đŸĨˇPreserving Your Privacy
    • đŸ‘ĨCreating Subdomains
    • đŸ›Šī¸Domain Transfer
    • 🤝DNS Domain Setup
    • 🍭Brand Guidelines
    • 💸Referrals
    • 📜Whitelist & Claims
    • 🌟Registration Widget
    • đŸĒ…CCIP & PNS
    • đŸĒ…Name Renewal
  • Deep Dives
    • đŸŦName Wrapper
      • đŸ”ĨFuses
      • âŗExpiry
      • ✅Approved Operators
    • 👨‍🔧Managing a Name
    • 🔤Homoglyphs
  • pls.fyi Profile
    • ✨Your Web3 Profile
  • PLS.TO dWeb
    • đŸĒInterPlanetary FileSystem (IPFS)
    • 🌐Your Decentralized Website
    • đŸ’ģIPFS & PLS.TO Guide
  • Partner Sites
    • 📈PulseCoinList.com
    • 💱PulseSwap.io: The Aggregator of Aggregators
      • 📈 Integration for Developers and Projects
  • Dapp Developer Guide
    • đŸ› ī¸Getting Started
      • PNS Enabling your DApp
      • PNS Libraries
      • Working with PNS
      • Resolving Names
      • Managing Names
      • Registering & Renewing Names
      • PNS Front-End Design Guidelines
      • PNS as NFT
      • PNS Data guide
    • 🐛Bug Bounty Program & Audit
  • âš™ī¸Contract Api Reference
    • 📜Deployed Contracts
    • Name Processing
    • Registry
    • ReverseRegistrar
    • TestRegistrar
    • PublicResolver
    • .pls Permanent Registrar
      • Registrar
      • Controller
    • DNS Registrar
    • Name Wrapper
      • Expiry
      • Fuses
      • Wrapped States
    • Subgraph
      • Entities
      • Queries
  • 📙Contract Developer Guide
    • Resolving Names On-chain
    • Writing a Resolver
    • Writing a Registrar
  • đŸĻ¸â€â™‚ī¸Community
    • Community Dev Resources
  • Links
    • đŸ•šī¸PNS App
    • đŸĻTwitter
    • âœˆī¸Telegram
    • 💡PNS Name Ideas (Community Site)
Powered by GitBook
On this page

Was this helpful?

  1. Contract Developer Guide

Writing a Resolver

PreviousResolving Names On-chainNextWriting a Registrar

Last updated 1 year ago

Was this helpful?

Resolvers are specified in . A resolver must implement the following method:

function supportsInterface(bytes4 interfaceID) constant returns (bool);

supportsInterface is defined in , and allows callers to determine if a resolver supports a particular record type. Record types are specified as a set of one or more methods that a resolver must implement together. Currently defined record types include:

Record type
Function(s)
Interface ID
Defined in

PulseChain address

addr

0x3b3b57de

PNS Name

name

0x691f3431

ABI specification

ABI

0x2203ab56

Public key

pubkey

0xc8690233

Text records

text

0x59d1d43c

Content hash

contenthash

0xbc1c58d1

supportsInterface must also return true for the interfaceID value 0x01ffc9a7, which is the interface ID of supportsInterface itself.

Additionally, the content interface was used as a defacto standard for Swarm hashes, and has an interface ID of 0xd8389dc5. New implementations should use contenthash instead.

Example Resolver

A simple resolver that supports only the addr type might look something like this:

contract SimpleResolver {
    function supportsInterface(bytes4 interfaceID) constant returns (bool) {
        return interfaceID == 0x3b3b57de;
    }

    function addr(bytes32 nodeID) constant returns (address) {
        return address(this);
    }
}

This trivial resolver always returns its own address as answer to all queries. Practical resolvers may use any mechanism they wish to determine what results to return, though they should be constant, and should minimize gas usage wherever possible.

📙
EIP137
EIP165
EIP137
EIP181
EIP205
EIP619
EIP634