check that all GATs burned in treasury validator are valid

This commit is contained in:
Emily Martins 2022-03-08 13:17:29 +01:00
parent 909416df5a
commit 92b3375f5e
3 changed files with 75 additions and 8 deletions

View file

@ -32,7 +32,7 @@ import Prelude
--------------------------------------------------------------------------------
import Agora.Utils (passert, passetClassValueOf, passetClassValueOf', plookup)
import Agora.Utils (allOutputs, passert, passetClassValueOf, passetClassValueOf', plookup)
--------------------------------------------------------------------------------
@ -113,5 +113,13 @@ authorityTokenPolicy params =
let mintedATs = passetClassValueOf # ownSymbol # pconstant "" # mintedValue
pif
(0 #< mintedATs)
(passert "Authority token did not move in minting GATs" tokenMoved (pconstant ()))
( P.do
passert "Parent token did not move in minting GATs" tokenMoved
passert "All outputs only emit valid GATs" $
allOutputs @PUnit # pfromData ctx.txInfo #$ plam $ \txOut _value _address _datum ->
authorityTokensValidIn
# ownSymbol
# txOut
pconstant ()
)
(pconstant ())