Hi, I want to implement a system like this: customer will earn some loyalty points every time when they purchase something on our website. While the loyalty points can be used to redeem some goods on our website, it is not transferable between customers.
So my question is, what would be the best way to implement this using ASA?
Here are 2 problems I am considering:
1, If I create this “loyalty points” as fungible ASA, seems the total supply should be infinite, because as customer purchase more and more things, they can earn more and more points, there is no need to put a “total loyalty points” ceiling number. But I don’t think the “total” parameter support “infinite” in the creating ASA SDK
2, As a fungible ASA, if 2 customers opt-in this asset, by default they will be able to transfer between each other. How would I make it non-transferable? I noticed the document says:
There is also optional functionality to place transfer restrictions on an asset that help support securities, compliance, and certification use cases.
Does the “transfer restriction” here mean utilizing the “freeze” feature?
For example, to issue a customer some points initially, the manager account will transfer some points to the customer, then use the freeze account to freeze it (I can put those 2 transactions in a transaction group with the atomic transfer feature), such that the customer won’t be able to send/receive the points further.
Next time, if system wants to put more points to this customer again, 1) freeze account first unfree this customer 2) manager account transfer more points to this customer 3) freeze account freeze it again. I can put these 3 transactions in a transaction group.
When customers want to redeem something on our website, 1) freeze account first unfree this customer, 2) transfer some points from customer to either our sink account or our manager account address 3) use freeze account to freeze the customer’s points again
This is just a rough idea, but I am not sure if I am in the right direction.
Any suggestions on those 2 problems? Thank you in advance.