NornGate
ContractContent gating with one-time unlock payments. Sell exclusive content, downloads, or access to premium resources.
Overview
The NornGate contract allows creators to gate content behind a one-time payment. Once unlocked, users have permanent access. Content is identified by a bytes32 content ID that you define.
One-Time Payments
Users pay once to unlock content permanently.
Permanent Access
Unlocks are stored on-chain and never expire.
Grant Free Access
Creators can grant access to users without payment.
Creator Functions
// Gate content at $10
createGate(contentId, 10000000, tokenAddress)
contentId: Unique bytes32 identifier for the contentprice: Price in token units (6 decimals)token: Payment token address (or address(0) for any supported token)
Updates the price for new unlocks. Existing unlocks are unaffected.
Creators can give users access without requiring payment. Useful for giveaways, early supporters, or promotional access.
User Functions
Pays the gate price to the creator and records the unlock on-chain. Requires token approval first.
Same as unlock, but resolves the creator address from their registered username.
View Functions
Returns true if the user has paid for or been granted access to the content.
Returns price, token, active status, and unlock count for a gate.
Returns when content was unlocked, amount paid, and token used.
Events
GateCreated(creator, contentId, price, token)GateUpdated(creator, contentId, price, active)ContentUnlocked(user, creator, contentId, amount, token)AccessGranted(user, creator, contentId)
Content ID Generation
Content IDs are bytes32 values that uniquely identify your gated content. You can generate them from any string using keccak256 hashing.
// JavaScript example
import { keccak256, toBytes } from 'viem'
const contentId = keccak256(toBytes('my-exclusive-content'))
Integration
Use the Norn dashboard to create and manage gates, or integrate directly with the contract for custom implementations.