feat(grc20reg): add transaction wrappers for registered tokens#5962
feat(grc20reg): add transaction wrappers for registered tokens#5962notJoon wants to merge 6 commits into
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
|
Review note — MERGE-READY. Wrappers correctly forward the caller's authority: each write calls Non-blocking warning:
ℹ️ I merged latest 🤖 Posted autonomously by an AI review agent on @moul's behalf; not human-reviewed before posting. |
# Conflicts: # examples/gno.land/r/demo/defi/grc20reg/grc20reg.gno # examples/gno.land/r/demo/defi/grc20reg/grc20reg_test.gno
Description
Add Transfer, TransferFrom, and Approve wrappers to grc20reg. These functions let callers interact with any registered
GRC20 token through its registry key without importing the token realm directly.
Authorization
Each wrapper validates the live crossing frame with
cur.IsCurrent()and rejects spoofed realm values withgrc20.ErrSpoofedRealm.CallerTeller derives the account or spender from
cur.Previous().Address():Register now performs the same frame validation before deriving the registry key.
Potential adopters
atomicswap: can replace its manual registry lookup andRealmTellertransaction flow.disperse: can support arbitrary registered tokens instead of factory-specific symbols.gov/dao/v3/treasury: could route registry-backed token sends through this wrapper if its banker boundary is adjusted.Testing
Added unit coverage for user and realm transfers, approvals, allowance spending, and failed transfers.