Gating with Superfluid Subscriptions & Guild.xyz
Last updated
Last updated
This guide will thoroughly explain how to utilize Superfluid Subscriptions with Guild.xyz. Using the two, you can control access through Guild based on the existence of a Superfluid subscription stream to a desired receiving address.
Checkout Builder | Console | Flow Rate Converter | Dashboard | Guild.xyz
Head to the Checkout Builder
Delete the initial payment option set in Payment Details Summary at the bottom of the Product section.
Begin customizing your widget payment info on Product and aesthetic on UI
On Export, one-click deploy to IPFS and get the payment URL (or save the JSON for later if you want to embed in your site directly)
Copy down the CFAv1 Address for your intended network of choice from the Console
Copy down the address of the Super Token you're seeking payment in from the Console. You can look through the list or search the token symbol on the search bar at the top of the page.
Head to our Flow Rate Calculator to convert the monthly rate you elected for your Checkout Widget Payment Option into a wei/sec rate. Copy it down.
Head to Guild.xyz, select what you're looking to gate, and create a role.
Select the requirement as "Contract query"
Select the intended network and put in the CFAv1 address copied down from earlier as the Contract Address
In the Method dropdown, select the getFlow
method
Input the following:
receiver
- the address to receive the subscription payments (same receiver you set in Payment Options on the Checkout Widget)
token
- the address of the Super Token you're accepting payment in (which you copied down earlier)
sender
- leave the sender address as USER_ADDRESS
Select flowRate in the final drop down and make the qualifier >=
Input the wei/sec flow rate that you copied down earlier
Share your Checkout Widget with anyone - people who subscribe with it will be able to access the whatever it is you have gated with Guild.xyz.
Additional Considerations:
You can layer on access levels and pricing tiers by adding payment options to your widget and configuring various roles.