# 1.4: Add Rules

Here we'll indicate *what* groups of NFT holders will get *what* discount or access for this gate.

Click on the green "Add Rule" button to add a rule.

![](https://268636785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8n4plerMUJrsrAiaKpc2%2Fuploads%2FK4sB7wBTSGz1sWYSRvVX%2FScreen%20Shot%202022-06-06%20at%205.04.46%20PM.png?alt=media\&token=f82a6f6b-cc1a-416d-94b0-50b616ed3914)

## Network, Contract Address and Audience Selection

<figure><img src="https://268636785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8n4plerMUJrsrAiaKpc2%2Fuploads%2F8nMRWDvVnkCYkfEfmSWS%2FScreen%20Shot%202023-07-20%20at%2011.42.05%20AM.png?alt=media&#x26;token=d2644d6d-2239-4091-9c27-298d25ea3d8a" alt=""><figcaption><p>First select the Network and then enter the contract address</p></figcaption></figure>

First select the Network. Currently **we support the following networks:**

* **Ethereum Mainnet**
* **Optimism**
* **Polygon**
* **Base**
* **Sepolia**

Then enter in the contract address of the NFT collection in the "Contract address" field. For example, I know I want to use Cool Cats for these Cool Hats! so I'm selecting   inputting `0x1A92f7381B9F03921564a437210bB9396471050C`into the form with `ethereum` (mainnet) as the network. Contract addresses can be obtained by finding the official collection pages for projects on marketplaces like [OpenSea](https://opensea.io/collection/cool-cats-nft) and finding the [Etherscan link](https://etherscan.io/address/0x1A92f7381B9F03921564a437210bB9396471050C) for the project's contract.

![You can create allowlist on a full contract, specific token IDs, or on NFT Attributes](https://268636785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8n4plerMUJrsrAiaKpc2%2Fuploads%2FxUiVKgzYPmULduTl4k1d%2FScreen%20Shot%202022-08-18%20at%205.27.12%20PM.png?alt=media\&token=e8439f55-3b16-4cb5-8a1b-a5bca41323b9)

Now that we've got the contract address loaded in we can select from the following:

* **All tokens:** Selecting this option will make holders of any token of the specified contract eligible for redemption. This is great for giving access to "all Cool Cats" or "all holders of my artwork".
* **Select individual token:** Selecting this option will make holders of a single specific token on the specified contract eligible for redemption. For example, I can specify that only token #11 from contract 0x123... is eligible.
* **Filter by token id range:** Selecting this option will allow you to specify a "Minimum" and "Maximum" token ID to indicate a range of eligible tokens. For example, if I were to put "1" and "100" as inputs for this contract, Cool Cats #1 - #100 would only be eligible (Token ID).
* **Filter by attribute:** Selecting this option will allow gating based on specific NFT attributes, even required sets of specific attributes. For example, with my Cool Hat! product I want to ensure only those Cool Cats NFTs that also wear the same hat have access to it (those with the attribute `hats: hat white`).

## Attribute Filtering Explained

To select an attribute (or a combination of attributes that must be necessary) click in the "Search attributes" box and the selection of available attributes will populate. For some projects with many attributes (like PFPs) the set of attributes might take a moment to load. If you are not seeing the correct set of attributes double check the submitted contract address. If that's correct try hitting the "Refresh metadata" button.

Check all the attributes you want to add to the rule. Note that if you select multiple attributes, then the NFT will need to have all of those attributes to receive the discount. (Ex: If I selected both `hats: hat white` AND `body: blue cat skin`) then only holders of Cool Cats with BOTH those attributes would get my discount.

If you want to provide the discount to Either holders of Cool Cats with attribute `hats: hat white` OR `body: blue cat skin` you will create 2 seperate rules.

![Select the attributes you want on the rule then hit "Add". Remember if multiple are selected only tokens that have all of the attributes selected will have access to your discount on this rule.](https://268636785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8n4plerMUJrsrAiaKpc2%2Fuploads%2FfuTQ0nWVIJfTLFj3ShC2%2FScreen%20Shot%202022-05-06%20at%209.24.45%20AM.png?alt=media\&token=a9794ac0-83d4-482e-b22c-45f4a83caf8f)

## Discount Value

Lastly, select the Discount percentage or dollar amount you want to apply to this rule.

![Make sure to set the discount (either as a percentage of the product's price or a fixed $ amount)](https://268636785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8n4plerMUJrsrAiaKpc2%2Fuploads%2Fp2TrVS6xU36zS5K17XgH%2FScreen%20Shot%202022-06-06%20at%205.08.38%20PM.png?alt=media\&token=2396b6f1-9bce-4914-85d0-873d9067e71a)

Click "Add" when complete to configure the rule!

### Completed Rule

You'll see the rule gets added as a line item to the "Rules" table with details of contract, restriction (all contract tokens, range, or attributes), restriction details, and the desired discount percent for this group of holders.

![What a configured rule will look like](https://268636785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8n4plerMUJrsrAiaKpc2%2Fuploads%2Fg6Us5svXs2AcGET87nsy%2FScreen%20Shot%202022-05-09%20at%2011.47.47%20AM.png?alt=media\&token=967f98f8-f4dd-4a8d-8e76-abf5001e0a14)

Congrats! You have setup all the behind the scenes data for your Product Gate. In the next step we will add App Blocks to your Store's Theme to provide the UX components that your customers will interact with.
