Structure for lesson:
ERC721
from OpenZeppelinconstructor
(only set the number of tiers we want) and maxTiers
state varstruct Tier
: data in a struct - introduce complex data structures in soliditytokenTier
and tiers
)setTierData
so we can define/update our Tiers once we created our contract
require
here so, the values of the tiers are correctevent TierValuesUpdated
so we have a history of the changes to the Tiers, in case the subscription prices changemint
function: how to select Tiers with the msg.value
the user sent to the contract (first and hopefully last use of a cycle in the lessons)tokenURI
overriding function to create the json on-the-fly (and also maybe an SVG ?? so it's all on-chain) - imports Strings
and Base64
from OpenZeppelinwithdraw
function
transfer
vs. send
vs. call
Ownable
pattern importing Ownable
from OpenZeppelinVersion 01
Version 02