1.4: Add Rules
Now that we have created the gate and linked a product to it, we will create rules on the product gate. This is setting who will be on the allowlist to get the discount for your product
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.
Network, Contract Address and Audience Selection
First select the Network. Currently we support 3 networks (Ethereum Mainnet, Goerli, and Polygon)
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 and finding the Etherscan link for the project's contract.
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.
Discount Value
Lastly, select the Discount percentage or dollar amount you want to apply to this rule.
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.
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.
Last updated