CronNFT
ERC-721 subscription identity token — optional proof-of-subscription NFT.
Overview
When a subscriber calls subscribe(planId, mintNFT: true), a CronNFT is minted to their wallet. The token represents an active subscription and can be used for:
- Token-gating content or features on-chain
- Wallet-based access verification without an API call
- Display in wallet UIs as proof of membership
On-chain metadata
Token metadata is generated on-chain as a base64-encoded SVG. No IPFS dependency. The SVG shows plan name, subscriber address, and creation date.
Token lifecycle
The NFT is non-transferable by default. If a subscription expires or is cancelled, the token remains in the wallet but the subscription status changes in CronRegistry — token-gating should verify against the registry, not just token ownership.
Key functions
| Function | Description |
|---|---|
mint(to, planId) | Called by CronRegistry during subscribe. Not callable externally. |
tokenURI(tokenId) | Returns base64-encoded JSON with SVG image. No external calls. |
tokenOfOwner(address) | Returns all token IDs owned by an address. |
Token-gating example
// Verify on-chain (Solidity)
ICronRegistry registry = ICronRegistry(REGISTRY_ADDRESS);
SubscriptionStatus status = registry.subscriptionStatus(planId, msg.sender);
require(status == SubscriptionStatus.Active, "No active subscription");