Skip to content

Instantly share code, notes, and snippets.

@nemanja-da
Created January 28, 2022 09:59
Show Gist options
  • Save nemanja-da/26f04cdb6d0c08a10661d0315c7cda5e to your computer and use it in GitHub Desktop.
Save nemanja-da/26f04cdb6d0c08a10661d0315c7cda5e to your computer and use it in GitHub Desktop.
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