In this post I’ll provide two examples of DL logics. They are not meant to describe the most common use cases, these are just two examples that are meant to highlight the programmability features of the kudos application.
Example one: named token
Function | Condition |
---|---|
Issue/Burn | Can only be done by a certain entity |
Transfer/Swap | Allowed only if 2% of the transferred value is sent to the issuer, i.e., if the sender and receiver are not issuer, then there must be another resource with quantity 0.02q that is sent by the same owner and received by the receiver |
Example two: Loyalty Points
Function | Condition |
---|---|
Issue | Can only be issued by a certain entity. Each token has an associated expiration date |
Burn | No extra constraints |
Burn for reward | The owner can issue a burn intent claiming reward from the issuer for burning their loyalty points. Only for non-expired tokens. |
Transfer/Swap | No extra constraints |
A note on burn-for-reward mechanics
While working on this example, I came up with an idea of burn/issue-for-reward mechanics. I described my thoughts in more details here. This is not a crucial question for this example, so I don’t want to think too much on how to implement it the best way. A simple option to implement it on the DL side is to always verify that there is some extra logic (intent) associated with the burn. For “simple” burns, the intent is always satisfied.