Skip to content

feat: group subscriptions#16

Merged
lumoswiz merged 12 commits intomainfrom
feat/group-subscriptions
Jul 5, 2025
Merged

feat: group subscriptions#16
lumoswiz merged 12 commits intomainfrom
feat/group-subscriptions

Conversation

@lumoswiz
Copy link
Contributor

@lumoswiz lumoswiz commented Jun 13, 2025

Single entry point via: redeem(bytes32 id, bytes calldata data)

Three redemption types:

Groups

Internal call: _redeemGroup(bytes32 id)
External calls via multisend

  • ERC1155.safeTransferFrom (transfer subscribers tokens to the module)
  • IHubV2.groupMint (mint group tokens using subscriber CRC to the module)
  • ERC1155.safeTransferFrom (transfer group tokens to the subscriber)

Redeeming occurs via this route if the recipient address is a group address.

Group minting locks tokens from the msg.sender and mints group tokens to the msg.sender, so fairly sure three calls are required in a pull-based setup.

Personal Trusted

  • Via operateFlowMatrix

Personal Untrusted

  • Via safeTransferFrom

Refactor Notes

  • Replaced use of periods with transient storage (T_REDEEMABLE_AMOUNT), set once in redeem using LibTransient
  • _redeemGroup, _redeemTrusted, and _redeemUntrusted now consume the redeemable amount from transient storage.
  • Explicit clear calls clean up the slot after redemption

@lumoswiz lumoswiz force-pushed the feat/group-subscriptions branch from 59cb266 to 751c702 Compare June 14, 2025 19:30
@lumoswiz lumoswiz marked this pull request as ready for review July 3, 2025 09:06
@lumoswiz lumoswiz requested review from 0xpantera and bh2smith July 3, 2025 09:06
Copy link

@0xpantera 0xpantera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lumoswiz lumoswiz merged commit 71d1b05 into main Jul 5, 2025
2 checks passed
@lumoswiz lumoswiz deleted the feat/group-subscriptions branch July 5, 2025 19:17
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.

2 participants