| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cooked.Attack.DatumHijacking
Description
This module provides an automated attack to try and redirect outputs to a certain target with a similar datum type.
Synopsis
- redirectOutputTweakAll :: (Member Tweak effs, IsTxSkelOutAllowedOwner owner) => (TxSkelOut -> Maybe owner) -> (Integer -> Bool) -> Sem effs [TxSkelOut]
- data DatumHijackingParams where
- DatumHijackingParams :: IsTxSkelOutAllowedOwner owner => {..} -> DatumHijackingParams
- newtype DatumHijackingLabel = DatumHijackingLabel [TxSkelOut]
- redirectOutputTweakAny :: (Members '[Tweak, NonDet] effs, IsTxSkelOutAllowedOwner owner) => (TxSkelOut -> Maybe owner) -> (Integer -> Bool) -> Sem effs [TxSkelOut]
- datumHijackingAttack :: Members '[Tweak, NonDet] effs => DatumHijackingParams -> Sem effs [TxSkelOut]
- typedByDatumHijackingParams :: forall (oldOwner :: Type) owner. (IsTxSkelOutAllowedOwner owner, Typeable oldOwner) => owner -> DatumHijackingParams
- ownedByDatumHijackingParams :: forall oldOwner owner. (IsTxSkelOutAllowedOwner owner, Typeable oldOwner, Eq oldOwner) => oldOwner -> owner -> DatumHijackingParams
- scriptsDatumHijackingParams :: IsTxSkelOutAllowedOwner owner => owner -> DatumHijackingParams
- defaultDatumHijackingParams :: (IsTxSkelOutAllowedOwner owner, Is k An_AffineFold) => Optic' k is TxSkelOut x -> owner -> DatumHijackingParams
- datumOfDatumHijackingParams :: forall dat owner. (IsTxSkelOutAllowedOwner owner, DatumConstrs dat) => owner -> DatumHijackingParams
- outPredDatumHijackingParams :: IsTxSkelOutAllowedOwner owner => (TxSkelOut -> Bool) -> owner -> DatumHijackingParams
Documentation
redirectOutputTweakAll :: (Member Tweak effs, IsTxSkelOutAllowedOwner owner) => (TxSkelOut -> Maybe owner) -> (Integer -> Bool) -> Sem effs [TxSkelOut] Source #
Redirects, in the same transaction, all the outputs targetted by an output
and an index predicates. See DatumHijackingParams for more information on
those predicates. Returns the list of outputs that were successfully
modified, before the modification is applied.
data DatumHijackingParams where Source #
Parameters of the datum hijacking attacks. They state precisely which outputs should have their owner changed, wich owner should be assigned, to each of these outputs, and whether several modified outputs should be combined in a single transaction, or instead spread out multiple branches.
Constructors
| DatumHijackingParams | |
Fields
| |
newtype DatumHijackingLabel Source #
The DatumHijackingLabel stores the outputs that have been redirected,
before their destination were changed.
Constructors
| DatumHijackingLabel [TxSkelOut] |
Instances
redirectOutputTweakAny :: (Members '[Tweak, NonDet] effs, IsTxSkelOutAllowedOwner owner) => (TxSkelOut -> Maybe owner) -> (Integer -> Bool) -> Sem effs [TxSkelOut] Source #
Redirects, each in their own transaction, all the outputs targetted by an
output and an index predicates. See DatumHijackingParams for more
information on those predicates.
datumHijackingAttack :: Members '[Tweak, NonDet] effs => DatumHijackingParams -> Sem effs [TxSkelOut] Source #
The datum hijacking tries to substitute a different recipient on certain
outputs based on a DatumHijackingParams.
A DatumHijackingLabel is added to the labels of the TxSkel. It contains
the outputs that have been redirected, which also corresponds to the returned
value of this tweak. The tweak fails if no such outputs have been redirected.
typedByDatumHijackingParams :: forall (oldOwner :: Type) owner. (IsTxSkelOutAllowedOwner owner, Typeable oldOwner) => owner -> DatumHijackingParams Source #
Datum hijacking parameters targetting all the outputs owned by a certain type of owner, and redirecting each of them in a separate transaction.
ownedByDatumHijackingParams :: forall oldOwner owner. (IsTxSkelOutAllowedOwner owner, Typeable oldOwner, Eq oldOwner) => oldOwner -> owner -> DatumHijackingParams Source #
Datum hijacking parameters targetting all the outputs owner by a given user, and redirecting each of them in a separate transaction.
scriptsDatumHijackingParams :: IsTxSkelOutAllowedOwner owner => owner -> DatumHijackingParams Source #
Datum hijacking parameters targetting all the outputs owned by a script, and redirecting each of them in a separate transaction.
defaultDatumHijackingParams :: (IsTxSkelOutAllowedOwner owner, Is k An_AffineFold) => Optic' k is TxSkelOut x -> owner -> DatumHijackingParams Source #
Targets all the outputs for which the focus of a given optic exists, and redirects each of them in a separate transaction.
datumOfDatumHijackingParams :: forall dat owner. (IsTxSkelOutAllowedOwner owner, DatumConstrs dat) => owner -> DatumHijackingParams Source #
Datum hijacking parameters targetting all the outputs with a certain type of datum, and redirecting each of them in a separate transaction.
outPredDatumHijackingParams :: IsTxSkelOutAllowedOwner owner => (TxSkelOut -> Bool) -> owner -> DatumHijackingParams Source #
Targets all the outputs satisfying a given predicate, and redirects each of them in a separate transaction.