cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Attack.AddToken

Description

This module provides two automated attacks to mint and give extra tokens to a certain target.

Synopsis

Documentation

addTokenAttack Source #

Arguments

:: (MonadTweak m, IsTxSkelOutAllowedOwner o) 
=> (VScript -> [(TokenName, Integer)])

For each policy that occurs in some Mint constraint, return a list of token names together with how many tokens with that name should be minted.

-> o

The attacker, who receives the extra tokens.

-> m Value 

This attack adds extra tokens of any kind for minting policies already present in the minted value. The additional minted value is redirected to a certain owner in a dedicated output.

This attack adds an AddTokenLbl label.

dupTokenAttack Source #

Arguments

:: (MonadTweak m, IsTxSkelOutAllowedOwner o) 
=> (VScript -> TokenName -> Integer -> Integer)

A function describing how the amount of tokens specified by a Mint constraint should be changed, depending on the asset class and the amount specified by the constraint. The given function f should probably satisfy f ac i > i for all ac and i, i.e. it should increase the minted amount. If it does not, the tweak will still succeed but this might result in negative portions in the value paid to the attacker.

-> o

The target of the extra tokens. Any additional tokens that are minted by the modified transaction but were not minted by the original transaction are paid to this target.

-> m Value 

This attack is similar to addTokenAttack with the exception that it only tampers with token names already present.

This attack adds an DupTokenLbl label