Edit this page

CNS L1 to UNS L2: Domain Deposit Guide

This guide covers the process for depositing a domain from CNS Layer 1 to UNS Layer 2. This process requires use of the safeTransferFrom function using the abi.encode(['bool'], [true]) parameter.

Prerequisites

  • Token ID of minted domain on Layer 1 (Ethereum)
  • Owner’s wallet address
  • abiCoder.encode( ['bool'] , [true] ) = 0x0000000000000000000000000000000000000000000000000000000000000001

Step 1: Verify Contract Info for Each Registry

For CNS Layer 1

  • contract address should be: 0xD1E5b0FF1287aA9f9A268759062E4Ab08b9Dacbe
  • tocken tracker should read: .crypto (UD)

CNS Layer 1 contract address and tracker info

CNS Layer 1 contract address and tracker info

For UNS Layer 1

  • contract address should be: 0x049aba7510f45BA5b64ea9E658E342F904DB358D
  • token tracker should read: Unstoppable Domains (UD)

UNS Layer 1 contract address and tracker info

UNS Layer 1 contract address and tracker info

For UNS Layer 2

  • contract address should be: 0xa9a6A3626993D487d2Dbda3173cf58cA1a9D9e9f
  • token tracker should read: Unstoppable Domains (UD)

UNS Layer 2 contract address and tracker info

UNS Layer 2 contract address and tracker info

Step 2: Verify Domain Ownership on CNS L1

  • Retrieve the token ID of the domain you want to transfer.
  • On the CNS Layer 1 Contract page, select Contract -> Read Contract -> and scroll down to complete the OwnerOf function.
  • Paste the token ID into the ‘ownerOf’ field.
  • Select the Query button to check the ownership and confirm the location of the domain.
  • Verify the wallet address returned by the OwnerOf query to ensure it is an exact match to your wallet address.
info

You will receive the owner’s wallet address in response to the ownerOfquery if the domain is located on the CNS registry. Otherwise, you will receive the ER721 error: "owner query for nonexistent token.”

Image showing how to use the ownerOf function

Image showing how to use the ownerOf function

Step 3: Rewrite the Domain to UNS Registry

  • At the top of the CNS Layer 1 Contract page, select Contract -> Write Contract -> Connect to Web3 to connect your wallet.
  • Then, select Contract -> Write Contract -> and scroll down to complete the second safeTransferFrom function.

safeTransferFrom function with 4 fields to complete

safeTransferFrom function with 4 fields to complete
  • Complete the safeTransferFrom fields: from, to, tokenId, _data.
    • from (address): Enter the owner’s wallet address
    • to (address): Enter the UNS contract address
    • tokenId: Enter the tokenId of the domain you want to rewrite to the UNS registry (i.e., the same tokenID that you verified in Step 2 above)
    • _data: enter the true boolean parameter required for this function, 0x0000000000000000000000000000000000000000000000000000000000000001
  • Select the Write button to rewrite or transfer the domain to the UNS registry.
info

If the ‘write’ button is grayed out, then scroll to the top of the page and select the Connect to Web3 button. Then, return to this section to write the contract.

  • Sign the transaction with your wallet address.
  • Click the View your transaction button to verify the transaction, such as status, from, to, and tokens transferred fields.

Step 4: Verify Domain Transfer to Custody Contract

info

It is recommended that you double-check the transaction status by verifying domain ownership on the UNS L1 Registry.

  • On the UNS Layer 1 Contract page, select Contract -> Read as Proxy -> and scroll down to complete the OwnerOf function.

Verify domain transfer to UNS L1 using Contract -> Read as Proxy

Verify domain transfer to UNS L1 using Contract -> Read as Proxy
  • Paste the token ID into the ‘ownerOf’ field.
  • Select the Query button to check the ownership and confirm the location of the domain.
  • Verify the wallet address returned by the OwnerOf query to ensure it matches the following predicate address:
Copy
Copied
"MintableERC721Predicate": {
    "address": "0x56E14C1748a818a5564D33cF774c59EB3eDF59",
    "legacyAddresses": [],
    "deploymentBlock": "0x2fc240"
},
info

When tokens are transferred to UNS L2, they will appear as owned by a custody contract called MintableERC721Predicate. This process locks the contract for all tokens in the process of bridging to UNS L2.

Step 5: Verify Domain Bridging is Complete

  • On the UNS Layer 2 Contract page, select Contract -> Read as Proxy -> and scroll down to complete the OwnerOf function.
  • Paste the token ID into the ‘ownerOf’ field.
  • Select the Query button to check the ownership and confirm the location of the domain.
  • Verify the wallet address returned by the OwnerOf query to ensure it matches your wallet address. If your wallet address is showing, then it means that your domain was successfully deposited on UNS Layer 2.
success

Congratulations! You just deposited your domain from CNS L1 to UNS L2!