Timeline for How can a validator script be used to mint native tokens, in addition to perform other checks?
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 6, 2022 at 17:07 | comment | added | Mitchell Turner | "make sure a corresponding output with ADA is created at the script address"--that's what I'm saying with "replaces the NFT + datum." Datums must exist on an output. If the validator is already checking that, it would be redundant to have the policy check it again. You could definitely have the minting policy check other things, but remember policies don't have any state, just tx context. There is no datum on the policy. So, if you ever want minting to rely on some state, you need need some validator to manage that state for you. I think it's best to keep all the logic in one spot. | |
Apr 6, 2022 at 15:34 | comment | added | Will | Hence, I'd almost say the minting policy could do most of the logic except for validating withdraw ownership based on simple pubkeyHash comparison. But it could certainly ensure deposits to be correct (output at script address with equal amount to minted native token). And also burns which check if a corresponding withdraw is done too... Please let me know if I misunderstand the context. | |
Apr 6, 2022 at 15:31 | comment | added | Will | Great explanation, I am a little confused why you'd put all the logic in the validator. In the case of depositing money at the contract address, I'd expect the minting policy to run as well + make sure a corresponding output with ADA is created at the script address or did I misunderstand? I don't see how else the validator script would run if there is no output spent in the case of a depositing action. | |
Apr 6, 2022 at 11:28 | vote | accept | Qin | ||
Apr 5, 2022 at 17:23 | history | answered | Mitchell Turner | CC BY-SA 4.0 |