Releases: icdevsorg/icrc2.mo
Releases · icdevsorg/icrc2.mo
ReRelease
[0.2.0] - 2026-02-24
Added
- Mixin pattern (
mo:icrc2-mo/ICRC2/mixin) for automatic endpoint generation usingpersistent actor classand Class+ - Inspect module (
mo:icrc2-mo/ICRC2/Inspect) for cycle drain protection with two-layer defense:inspect*functions (returnBool) for use insystem func inspect()guard*functions (trap on invalid) for inter-canister protection- Built-in guards in mixin for
icrc2_approve,icrc2_transfer_from,icrc2_allowance,icrc103_get_allowances,icrc130_get_allowances - Configurable limits via
Configtype andconfigWith()helper (includesmaxTakefor pagination)
- Interface module (
mo:icrc2-mo/ICRC2/Interface) with extensible before/after hooks for all ICRC-2 endpoints - ICRC-21 consent message support: consent builders for
icrc2_approveandicrc2_transfer_from - ICRC-130 alias endpoint that mirrors ICRC-103
get_allowancesfunctionality - Timer-based cleanup:
cleanup_intervalInitArgs option for automatic periodic removal of expired approvals - Balance-aware cleanup:
cleanup_on_zero_balanceInitArgs option removes approvals when account balance reaches zero - Configurable ICRC-103:
icrc103_max_take_value(default: 1000) andicrc103_public_allowances(default: true) options defaultMixinArgs()helper for ergonomic mixin configuration withwithsyntax- Complete README with mixin usage examples, inspect documentation, API reference tables, and migration guide
- Comprehensive Phase 2 test suite: 20 new PocketIC tests for concurrent approvals, expiration, boundaries, ICRC-103, fees, and cleanup
- Performance benchmarks for approval storage, lookup, and pagination operations
Fixed
- Index iterator bug:
getIndexnow properly handlesprevparameter by finding the correct starting position in the approval map - ICRC-103 access control bug:
getAllowances()was checkingisPrivate = icrc103_public_allowancesinstead ofnot icrc103_public_allowances, causing public mode to behave like private mode - Double fee collection bug in
transfer_from: the fee was being transferred to thefee_collectortwice — once viahandleFeeCollector()and again via an explicittransfer_balance()call
Changed
- Set all debug channels to false for production safety
- Removed
icrc2_trigger_cleanupfrom public mixin interface (still available vialib.mofor advanced users)