This guide covers how to set Reverse Resolution records for UD domains using smart contracts. This process requires using the ABIs built into the Unstoppable Domains UNS smart contract.
The UNS Registry smart contract is where domain owners store their data and is a map of domain namehashes to key-value dictionaries of records. Choose one of the Unstoppable Registry smart contracts to interact with (either mainnet or testnet).
Navigate to the
Contract tab in either the Etherscan or Polygonscan page of the Registry contract and click on the
Write as Proxy tab.
Click on the
Connect to Web3 button in the
Write as Proxy tab and connect the wallet associated with the domain:
The UNS contract has a
setReverse() ABI method that takes in the domain name split by labels and sets its reverse record to your wallet address.
example.nft will be formatted as
['example', 'nft'] in labels.
Add the domain labels of the domain you want to configure Reverse Resolution for in the
labels field of the
setReverse() method and click the
Write button to sign the transaction and execute the contract. After signing the transaction, you can view its details on the blockchain explorer, like so:
Now, applications that have integrated Reverse Resolution will be able to show the reverse record for your domains instead of your wallet address.
You have successfully configured Reverse Resolution for your domain using smart contracts. Happy hacking!