# Name Wrapper

[Source](https://github.com/pulsedomains/pns-contracts/tree/master/contracts/wrapper)

The **Name Wrapper** is a new contract for PNS that allows you to "wrap" any PNS name into a ERC-1155 NFT.

Before the Name Wrapper, only .pls 2LDs (second-level domains, like `pns.pls`) had ERC-721 NFTs associated with them, unless the owner created a separate custom contract.

With this new contract, you can wrap:

* Any .pls name or subname
  * Examples: `name.pls`, `sub.name.pls`
* Any DNS name or subname
  * Examples: `name.com`, `sub.name.com`

Unwrapped .pls 2LDs have the concept of a separate Owner (Registrant) and Manager (Controller). This changes after you wrap the name, because there is only a single account that serves as both the Owner and Manager for the wrapped name.

## Deployed NameWrapper addresses

* Mainnet: `0x4feFb26934705C1661aC04aF8303548b850d562F`.
* Testnet (v4): `0x8e96004dC52CdD1651dE1444d1557c7e879a5B9D`.

## Wrapping and Unwrapping

When wrapping a .pls 2LD, you transfer the Owner (Registrant) of the ERC-721 NFT to the Name Wrapper contract. The contract will then automatically take over the Manager (Controller) for the name as well. You can do this by calling the [`wrapETH2LD`](https://github.com/pulsedomains/pns-contracts/tree/master/contracts/wrapper#wrapeth2ld) method. Or, you can directly transfer the ERC-721 NFT to the Name Wrapper contract. In return, the contract issues you an ERC-1155 NFT.

When wrapping any other PNS name, you transfer the Manager (Controller) of the name to the Name Wrapper contract. You can do this by calling the [`wrap`](https://github.com/pulsedomains/pns-contracts/tree/master/contracts/wrapper#wrap) method. In return, the contract issues you an ERC-1155 NFT.

As the owner of the wrapped name, you can unwrap at any time by calling either [`unwrapETH2LD`](https://github.com/pulsedomains/pns-contracts/tree/master/contracts/wrapper#unwrapeth2ld) or [`unwrap`](https://github.com/pulsedomains/pns-contracts/tree/master/contracts/wrapper#unwrap). You can do this as long as the permission to unwrap has not been revoked.

<br>

<br>
