EngagementOracle accumulates pending YCR for the actor. Users claim it from YCRRewards whenever they want.
Standard ERC-20
All standard methods work as expected:Claim flow
The interesting bit is the pending YCR mechanism. Engagement actions don’t mint YCR immediately — they accumulate intopendingByAction[user][type]. The user claims it at their convenience:
previewClaim(address user, uint8 activeActionTypes) view returns (uint256)
How much YCR the user would receive if they called claim right now. activeActionTypes is a bitmask: include action n by setting bit n.
claim(uint8 activeActionTypes) returns (uint256)
User burns their pending into a real YCR balance. Call from the user’s own wallet.
claimFor(address user, uint8 activeActionTypes) returns (uint256)
Same as claim but called by an authorized minter on behalf of the user. The EngagementOracle is typically the minter for batch claim flows.
Indexer convenience endpoints
Instead of callingpreviewClaim directly, mobile apps can use:
GET /api/mobile/rewards/:address— returns YCR balance + pending breakdown by action typePOST /api/mobile/claim— server-side claim helper (testnet convenience)
Integration tip
If you’re showing the user “today’s earnings” in the app UI, don’t trigger an on-chainclaim on every page load. Instead:
- Read
previewClaim()to display “Your pending YCR: X” - Show a “Claim now” button
- Only call
claim()when the user taps the button