Skip to content

feat: loyalty unlock example#31

Open
chariskms wants to merge 3 commits intomainfrom
ck/loyalty-token-example
Open

feat: loyalty unlock example#31
chariskms wants to merge 3 commits intomainfrom
ck/loyalty-token-example

Conversation

@chariskms
Copy link
Collaborator

Adds a loyalty points example demonstrating PAS assets redemption (unlock) from the PAS closed loop framework for eligible addresses.

Copy link
Collaborator

@manolisliolios manolisliolios left a comment

Choose a reason for hiding this comment

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

Looks great

ctx: &mut TxContext,
) {
// Check eligibility and approve the redemption
loyalty_manager::approve_redeem(registry, &mut request);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to instead return a witness from the loyalty manager since we're acutally doing the unlock here?

policy: &Policy<Balance<LOYALTY_COIN>>,
mut request: Request<UnlockFunds<Balance<LOYALTY_COIN>>>,
ctx: &mut TxContext,
) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be better to return ): Balance<LOYALTY_COIN> to keep it composable?

/// Issuers should carefully consider whether enabling `unlock_funds`
/// is appropriate for their token's compliance requirements.
#[allow(lint(self_transfer))]
public fun redeem(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since approve_redeem is public, why do we need this function at all? I'd expect thjis to be called from a PTB

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