Verify: Custom Logic
Use this pattern for advanced or multi-step quests, or when you want to check on-chain metrics, NFT ownership, or other custom conditions.
When to Use
- The quest requires more than a simple boolean or list check (e.g., "User must have made 3 swaps and own a specific NFT").
Motoko Example
public query func verifyCustom(principal : Principal) : async Bool {
let swaps = getUserSwapCount(principal);
let ownsNFT = userOwnsNFT(principal, "special-nft-id");
return swaps >= 3 and ownsNFT;
}
Integration
- ICQuests will call this method and award XP if it returns
true
. - The method must be public and read-only (
query
).
Tip: Make sure your logic is deterministic and only depends on on-chain state.