# What is Smol Domains?

Smol Domains are your Your Smolverse indenitity&#x20;

### Get your domain

Follow these guides to help you get set up with a Smol Domain&#x20;

{% content-ref url="/pages/bSgADF5xMdqY3npjMUAh" %}
[Minting your .smol](/your-domain/minting-your-.smol)
{% endcontent-ref %}

{% content-ref url="/pages/WsHOjRuWeEpAMAK0fQrW" %}
[Customizing Your Domain](/your-domain/customizing-your-domain)
{% endcontent-ref %}

{% content-ref url="/pages/OUriCvNfVawDTXzZPG2p" %}
[Using your domain](/your-domain/using-your-domain)
{% endcontent-ref %}

### Contract info

{% content-ref url="/pages/P2FxAibW1HlHcTGZDUpi" %}
[Whitelisted Contracts](/contract-info/whitelisted-contracts)
{% endcontent-ref %}

{% content-ref url="/pages/P2FxAibW1HlHcTGZDUpi" %}
[Whitelisted Contracts](/contract-info/whitelisted-contracts)
{% endcontent-ref %}


# Minting your .smol

{% hint style="info" %}
.smol domains are your customizable smolverse identity, Lets help you get set up
{% endhint %}

## Minting your domain

To mint your own domain you want to head over to [smol.domains](https://smol.domains/#/), Once you are there you want to connect your wallet, than choose your wallet provider and follow the steps to connect.&#x20;

Now you want to type your desired domain, If you want "smol.smol" you would write smol in the text field. If its already been claimed it wont let you mint or your TX will fail

The cost to mint a domain is a One-Time fee of 39.99 $MAGIC (This will be adjusted with price action to keep domains around $30) (As of Jul 29th 2022 the price per domain is 39.99 $MAGIC)

Once you have filled in the fields you can click "Mint" and a transaction will pop up in metamask to mint that domain. Thats it! Congrats you have just minted your smol identity

#### Learn how to Customise and Use your domain

{% content-ref url="/pages/WsHOjRuWeEpAMAK0fQrW" %}
[Customizing Your Domain](/your-domain/customizing-your-domain)
{% endcontent-ref %}

{% content-ref url="/pages/OUriCvNfVawDTXzZPG2p" %}
[Using your domain](/your-domain/using-your-domain)
{% endcontent-ref %}


# Customizing Your Domain

{% hint style="info" %}
You need to own a .smol domain in order to customize it
{% endhint %}

Once you have a domain, head over to <https://smol.domains/profile> to start customizing your domain. (Make sure your wallet is connected)

![Screenshot of Smol Domains profile page for reference](https://3350555185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F36maqgFOoOJ6XLthHHQ9%2Fuploads%2FgkUhEGLMJ8Z0k20jxENh%2FScreen%20Shot%202022-05-03%20at%203.20.37%20PM.png?alt=media\&token=54416dd1-5d46-455a-8a40-3335dfa23cb0)

On the Smol domains profile page go to "Domains" and click "edit domain data" for the domain you wish to customize.&#x20;

![Current domain data for a non customized domain](https://3350555185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F36maqgFOoOJ6XLthHHQ9%2Fuploads%2FV3hkmDCHlhUtxpfObBSJ%2FScreen%20Shot%202022-05-03%20at%203.29.42%20PM.png?alt=media\&token=5eb1fab4-55b5-419e-bdb3-e6c3d51a5ee0)

It will bring up your domains profile, It should show as Above. You want to click on the "Edit data" button. (Alternatively if your domain isnt showing up you can go to [https://smol.domains/search](https://www.smol.domains/search) and search for your domain than edit the data there)

![Customize domain page](https://3350555185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F36maqgFOoOJ6XLthHHQ9%2Fuploads%2FYheizHzN2zCxnAOTipoh%2FScreen%20Shot%202022-05-03%20at%205.23.39%20PM.png?alt=media\&token=12507d11-3134-42d5-88ec-1708aa1fdd0c)

The following goes over the specific functions of the Domain Data Customization. You dont need to fill out the fields and you are free to skip them.&#x20;

#### imgAddress

This lets you set an NFT as your Domain Profile Picture, You want to find the NFTs Contract Address and paste it in there. You also need to set imgTokenId (Below)

#### imgTokenId

This is your Token id of your NFT from the contract in the imgAddress Field.

#### url

You can set any url here you wish. This can be a linktree, Personal site, A link to a gallery with your nfts. Anything!

#### twitter

This lets you set your twitter profile, enter your username. Example: smoldomains .(Do not add an @ just the username.)

#### Add new field

This lets you add more links to your domain profile, again this can be any link you wish. You are free to add as many more as you wish


# Using your domain

{% hint style="info" %}
Smol Domains is not yet supported on MetaMask or other wallet providers, but we're already in talks with some of them to integrate Smol Domains.

In the mean time, you can use domains to send tokens through the Send Tokens page on the Smol Domains website. We are also working on a Metamask plugin that lets you send and receive tokens like a normal wallet
{% endhint %}

### Sending tokens

We have a feature on our website that lets anyone send tokens to other .smol domains, Heres how to use it:

Go to [https://smol.domains/send ](https://www.smol.domains/send)and connect your wallet.

![](https://3350555185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F36maqgFOoOJ6XLthHHQ9%2Fuploads%2FjFEgEll75THYuOcqUPGD%2FScreen%20Shot%202022-05-03%20at%206.06.29%20PM.png?alt=media\&token=3362e6d4-acae-472b-8570-1bba66d018af)

In the "Enter the receiver's domain name" box type the receivers .smol, for example if i wanted to send to test.smol i would put that there.

We currently support ETH MAGIC USDT USDC WBTC DAI LINK UNI token transfers with more on the way, Put in however much you wish to send to the receiver of the token.

{% hint style="info" %}
NFT support will be added with our Metamask Plug-in&#x20;
{% endhint %}

Than click "Send Tokens" And a transaction will pop up for the transfer

### Receiving tokens

Your address is linked to the domain so when its sent from <https://smol.domains/#/send-tokens> it sends straight to your wallet, no extra steps just start receiving!


# Contracts

{% hint style="info" %}
These contracts are deployed and are for Arbitrum
{% endhint %}

.smol TLD: 0xE0d972817e94c5FF9BDc49a63d8927A0bA833E4f

Wrapper Contract: 0x3616d477302587C64Bb8aa7abfc8258c05f75C0E

Resolver Contract: 0xd64A2DF9d73CD1Cb50139A3eC3176070e00C67cA


# Whitelisted Contracts

{% hint style="info" %}
**Smol domains are only available to the holders of the following contracts.** If you would like to partner your project message @0x\_Astro on twitter
{% endhint %}

#### Smolverse NFTs

Smol Brains: 0x6325439389E0797Ab35752B4F43a14C004f22A9c

Smol Bodies: 0x17DaCAD7975960833f374622fad08b90Ed67D1B5

Smol Car: 0xB16966daD2B5a5282b99846B23dcDF8C47b6132C

Smol Brain Pets: 0xF6Cc57C45CE730496b4d3Df36b9A4E4C3a1B9754

Smol Body Pets: 0xAe0d0C4Cc3335FD49402781E406ADF3f02D41bcA

Swolercycles: 0xdf32aED1eB841A174Cb637eAa1707026319fb563

#### Partner NFTs

Lost Donkeys: 0x5e84c1A06E6AD1a8ED66Bc48dBe5eB06BF2Fe4aA

Imbued Souls (Life Dao): 0xDc758b92c7311280aeeB48096a3bf4D1C1f936d4

Battlefly: 0x0aF85A5624D24E2C6e7Af3c0a0b102a28E36CeA3


# Links

{% hint style="info" %}
Only use the links here
{% endhint %}

Website: [https://smol.domains/](https://smol.domains/#/)

Minting Page: [https://smol.domains/#](https://smol.domains/#/)/

Profile Page: <https://smol.domains/#/profile>

Twitter: <https://twitter.com/smoldomains>

Discord: Soon


# Integrating Smol Domains

## How to integrate Smol Domains

If you'd like to integrate Smol Domains into your web3 app, chances are the only smart contract you'll need to interact with is the [Resolver Contract](/contract-info/contracts)

Each network has their own copy of the Resolver contract. Find addresses here (proxy adddresses): <https://docs.punk.domains/addresses/resolver-addresses/>

### Usecases

Let's see some common usecases.

#### A) Show user's domain name instead of their address

When user connects their wallet, a web3 app usually shows their address in the navigation bar:

![](https://raw.githubusercontent.com/tempe-techie/images/main/wallet-no-domain.png)

You can check if user owns a punk domain and show that instead:

<img src="https://raw.githubusercontent.com/tempe-techie/images/main/wallet-with-domain.png" alt="" data-size="original">

To do that, you have a few different options in the Resolver contract:

1. `getDefaultDomain(address, tld)`: Get user's default domain for a specific top-level domain, Ours is .smol
2. `getDefaultDomains(address)`: Get user's default domains across all TLDs (multiple domains)
3. `getFirstDefaultDomain(address)`: Get the first available user's domain, no matter of which TLD it is

With options A and C you always receive at most 1 domain name back (or none). With option B, you may receive multiple user's domains, so you can then ask the user to choose the preferred one.

#### B) Fetch domain metadata

To get domain's metadata, call this function in the Resolver contract:

* `getDomainTokenUri(domainName, tld)`

Note that most punk domains have metadata stored onchain, which means it's base64 encoded. In order to decode it, you can use the standard Node library called Buffer (something like `Buffer.from(metadata.substring(29), "base64")`).

See an [example here](https://github.com/punk-domains/punk-contracts/blob/f489dbd785005a2ea590d14a1c6b23e1ab6bf98e/test/resolver/proxy.test.js#L456).

#### C) Show domain image

Every domain has a default image set in its metadata. Most domains have a default image stored onchain, which means that it's in the SVG format.

In that case the image data will look something like this: `data:image/svg+xml;base64,PHN2Zy...FTkSuQmCC` (a long string).

What to do with it? The same as you do with http image links: add it into the `src` attribute of the `<img>`:

```markup
<img src="data:image/svg+xml;base64,PHN2Zy...FTkSuQmCC">
```

Easy peasy. 😀

#### D) Show user's Profile image

Domain holder's can set up a custom image in the domain data (not metadata, but separate [custom data](/integreation-docs/custom-data)!)

The custom image does not replace the default domain image in the metadata. Instead it just provides an option for domain holder to provide their custom profile picture.

This custom image resides in the custom data, which you can fetch through the Resolver contract like this:

* `getDomainData(domainName, tld)`

This call returns a JSON object, inside which you need to find the `imgAddress` key.

The `imgAddress` value can be either an `http...` URL, an `ipfs://...` link, or NFT address (`0x...`).

Which means that user's custom image can either be:

* Image stored on a web2 server (`http` URL)
* Image stored on IPFS (`ipfs` URL)
* PFP NFT stored on blockchain (`0x` address), like for example a Bored Ape NFT

If it's an http/ipfs URL, you don't need to do anything else - this URL is the custom image link.

In case it's an NFT address (meaning it starts with `0x`), you'll need to do some additional work. First check for `imgTokenId` and `imgChainId` in the custom data. Then call the `tokenURI` function of that PFP NFT contract and parse its metadata to get the image link. In addition you can also check if the user actually owns this PFP NFT (`ownerOf(tokenId)` function in the PFP NFT contract).

#### E) Search by domain

Let's say you want to allow users to search by domain. Meaning that a user enters a domain name, and then your web3 app needs to find out what's the address behind that domain (the owner address).

In this case you need to call this function in the Resolver contract:

* `getDomainHolder(domainName, tld)`

The response is the address that owns the submitted domain.

### Support

If you have a question, don't hesitate to ask us [on twitter](https://twitter.com/smolsdomains)


# Custom Data

Custom data is not a separate contract. It's a string field within the Domains struct in the [TLD contract](https://docs.punk.domains/contracts/tld-contract/) (Explained by punk domains):

```solidity
struct Domain {
	string name;
	uint256 tokenId;
	address holder;
	string data; // <-- CUSTOM DATA
}
```

The purpose of custom data is to hold an arbitrary amount of various data (stored as a stringified JSON object).

Because the custom data field is unstructured, the Punk Domains community has to define a common standard for structuring JSON data in order to avoid parsing issues.

### [#](https://docs.punk.domains/contracts/custom-data/#custom-data-standard)Custom data standard

This section holds the official standard for structuring the custom data JSON object. Note that the standard may change over time, but we'll try to make sure that changes are always backward compatible.

**Custom data JSON structure** (example for `astro.smol`):

```json
{
  "imgAddress": "url-or-nft-address", // either an HTTP url (e.g. "http://hey.com/me.jpg") or an NFT address (0xa12B3...)
  "imgTokenId": 0, // in case of NFT address, tokenID is mandatory, otherwise it is not
  "imgChainId": 137, // the chain where NFT exists on
  
  "url": "https://smol.domains",
  "emails": ["user@example.com"], // possible to add multiple emails
  "twitter": ["smoldomains"], // possible to add multiple twitter handles
  
  "subdomains": {
    "sandbox": { // sandbox.techie.smol - in case I want to have a username with different data (like PFP) in the Sandbox metaverse
      "address": "0x123...",
      "pfpTokenAddress": "0x098...",
      "pfpTokenId": 22 // PFP ownership needs to be verified on front-end
    }
  },
  
  "chainAddresses": { // if user wants to define different addresses on different chains (only one address per chain)
    "10": "0xa5b6...",
    "100": "0xc8d9...",
    "42161": "0xe2f3...",
  }
}
```

Note that **comments should be excluded** from your custom data. They are present in the above example just to provide some more information on the structure.

[<br>](https://docs.punk.domains/contracts/tld-contract/)


# Testnet Guide

**This is a guide to integrate and test smol domains on arbitrum testnet with .smoltest**&#x20;

## **Minting a Domain**

First you will need to obtain testnet ETH, Learn more on how get some here <https://docs.infura.io/infura/networks/arbitrum/how-to/get-testnet-eth>

Once you have done that head over to the[ .smoltest contract](https://testnet.arbiscan.io/address/0x0eB60B697428597CE58650173eFEd2F32ADD7E93#writeContract), and navigate to function **#9 Mint**

![What to fill in to mint a domain](https://3350555185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F36maqgFOoOJ6XLthHHQ9%2Fuploads%2FKC8f8LMUhl3Lw3a7sOtl%2FScreen%20Shot%202022-08-14%20at%2010.00.29%20AM.png?alt=media\&token=c2da1855-c2c5-4d97-9e26-30e344d47f59)

In **domainName** input the domain you want to mint, in this case i would get **astro.smoltest**, in the **\_domainHolder** and **\_referrer** fields input the address you want to mint the domain to than click "**Write**"

## **Integrating onto your site**

To get a users default domain you want to call function 2 on this resolver contract: <https://testnet.arbiscan.io/address/0xe2b9bC4c1d65B5F5583144d9d5c5F0683158C372#readProxyContract>

![](https://3350555185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F36maqgFOoOJ6XLthHHQ9%2Fuploads%2FazMrtUnGZ45T8kEI4yO9%2FScreen%20Shot%202022-08-14%20at%2010.11.34%20AM.png?alt=media\&token=3fa7f89f-48f3-4920-a405-ac54064d7a11)

In the **\_addr** field input the users address than put **.smoltest in the \_tld** field and click "**Query**" to get the users default domain


