I am trying to create a function which mints a token and charges 20CCD for it. Different documentation seems to describe the process differently and I cannot quite get any of them to work. Do I need to do anything other than simply record the tokenID and owner inside my smart contract? Or do I need to call an external minting function? I have seen both done and am not sure if I am misreading things.
Also, when charging the sender 20 CCDs: what is the code required to convert the Account parameter (20) to an actual CCD value? Which example I follow seems to result in compiler errors. I am assuming these basics are well established and cannot be complicated but I do not seem to be able to find the correct information (or I am just reading it wrong!)
They explain that the blockchain keeps track of the CCD and there is no need to explicitly reference it in the contract. Is the idea that in situations where, for example, I wanted a function which cost 20 CCD to run I would check that the amount was exactly 20CCD, reject any other amount and let the blockchain handle what would happen if the sender did not have enough in their wallet etc?