| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Agora.AuthorityToken
Description
This module was copied from the Liqwid-Labs/agora repo, and updated to work with Plutus V3 and Plutarch 1.10.1
Since: 1.0.0
Synopsis
- singleAuthorityTokenBurned :: forall (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S). Term s PCurrencySymbol -> Term s (PBuiltinList (PAsData PTxInInfo)) -> Term s (PValue keys amounts) -> Term s PBool
- authorityTokensValidIn :: forall (s :: S). Term s (PCurrencySymbol :--> (PTxOut :--> PBool))
Documentation
singleAuthorityTokenBurned :: forall (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S). Term s PCurrencySymbol -> Term s (PBuiltinList (PAsData PTxInInfo)) -> Term s (PValue keys amounts) -> Term s PBool Source #
Assert that a single authority token has been burned.
Since: 1.0.0
authorityTokensValidIn :: forall (s :: S). Term s (PCurrencySymbol :--> (PTxOut :--> PBool)) Source #
Check that all GATs are valid in a particular TxOut.
WARNING: As of version 1.0.0, this has been weakened in order to be
compatible with RATs. The token name is no longer checked, meaning that a
GAT can escape from its effect script, if the effect script is vulnerable.
In order to prevent this, all effect scripts should be implemented carefully,
and ideally use the trusted effect base. See also Effect.
(before 1.0.0) How this is checked: an AuthorityToken should never leave the Effect it was initially sent to, so we simply check that the script address the token resides in matches the TokenName. Since the TokenName was tagged upon mint with the Effect script it was sent to, this is enough to prove validity. In other words, check that all assets of a particular currency symbol are tagged with a TokenName that matches where they live.
Since: 1.0.0