Created
January 28, 2022 09:59
-
-
Save nemanja-da/26f04cdb6d0c08a10661d0315c7cda5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template RockBandNFT | |
with | |
uniqueNFTId: Text | |
band : Party | |
fan : Party | |
numConcerts : Integer | |
issuedDate: Date | |
where | |
signatory band | |
observer fan | |
controller band can | |
IssueConcertPass : ContractId ConcertPass | |
with | |
concertName: Text | |
do -- check # of concerts allowed and issue Concert Pass | |
if numConcerts > 0 | |
then | |
do | |
create this with numConcerts = numConcerts - 1 | |
create ConcertPass with .. | |
else do | |
abort "Insufficient benefits" | |
controller band can | |
AddBenefits : ContractId RockBandNFT | |
with | |
numConcertsToAdd : Integer | |
do | |
create this with numConcerts = numConcerts + numConcertsToAdd | |
template ConcertPass | |
with | |
uniqueNFTId: Text | |
band: Party | |
fan: Party | |
concertName: Text | |
where | |
signatory band | |
observer fan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment