I am attempting to create a NFT with % royalties when NFT is re-sold.
My idea would be the following :
- The symbolic owner of the NFT is defined in the datum of the script e.g. datum = { owner : [ownerwallet] , ... }
- The following end points are available in the smart contract :
A) purchase : if someone want to purchase the NFT (i.e. rename the owner par of the datum) B) define_selling_price : to define at which selling price the purchase operation will work C) define_who_can_purchase: to ensure that if you want to sell it to someone, nobody else can purchase it (i.e. allowed purchased wallet)
- To ensure that the royalties are paid, the validation script verifies that there are only two resulting UTXO of the "purchase" endpoint, the first UTXO contains x% of ADA to hardwritten address (i.e. royalty ) , the second UTXO is copy of the exact same script (for future selling)
Could that be done in the described way above ? What is the exhaustive list of the parameters available for a smart validator to work?
Thank you in advance