cooked-validators-4.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Attack.DupToken

Description

This module provides an automated attack to duplicate tokens minted in a transaction.

Synopsis

Documentation

dupTokenAttack Source #

Arguments

:: MonadTweak m 
=> (AssetClass -> Integer -> Integer)

A function describing how the amount of tokens specified by a Mints 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* increase the minted amount, the amount will be left unchanged.

-> Wallet

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

-> m Value 

A token duplication attack increases values in Mints-constraints of a TxSkel according to some conditions, and pays the extra minted value to a given recipient wallet. This adds a DupTokenLbl to the labels of the transaction using addLabel. Returns the Value by which the minted value was increased.