Skip to content

feat: SIP-010 fungible token support for multi-asset tipping#190

Merged
Mosas2000 merged 2 commits intomainfrom
feature/sip010-token-tipping
Feb 26, 2026
Merged

feat: SIP-010 fungible token support for multi-asset tipping#190
Mosas2000 merged 2 commits intomainfrom
feature/sip010-token-tipping

Conversation

@Mosas2000
Copy link
Copy Markdown
Owner

Closes #87

Changes

Contract (tipstream.clar)

  • Import SIP-010 trait from tipstream-traits
  • Add send-token-tip function accepting any SIP-010 compliant token via trait reference
  • Add whitelist-token admin function for token approval/revocation
  • Add token-tips map and total-token-tips counter for tracking
  • Add read-only functions: get-token-tip, is-token-whitelisted, get-total-token-tips
  • New error codes: err-token-transfer-failed (u112), err-token-not-whitelisted (u113)

Tests

  • 5 new integration tests covering:
    • Rejection of non-whitelisted token tips
    • Admin whitelist management
    • Non-admin whitelist rejection
    • Successful token tip with TIPS token
    • Token tip counter tracking
  • All 42 tests passing (37 existing + 5 new)

Security

  • Admin-only token whitelisting prevents malicious token contracts
  • Blocked user enforcement carries over to token tips
  • Contract pause applies to token tipping

Add send-token-tip function accepting any SIP-010 compliant token
via trait reference. Includes token whitelist system controlled by
admin, separate token-tips map for tracking, and token tip counter.

New contract functions:
- send-token-tip: Transfer SIP-010 tokens as tips with whitelisting
- whitelist-token: Admin-only token approval/revocation
- get-token-tip: Read token tip data by ID
- is-token-whitelisted: Check token approval status
- get-total-token-tips: Read total token tips count

New error codes: err-token-transfer-failed (u112),
err-token-not-whitelisted (u113)
Cover token whitelist enforcement, admin whitelist management,
non-admin rejection, successful token tip via TIPS token, and
token tip counter tracking. 5 new tests, 42 total passing.
@Mosas2000 Mosas2000 merged commit 698a794 into main Feb 26, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add SIP-010 fungible token support for multi-asset tipping beyond STX

1 participant