trustless-sidechain-8.0.0: Smart contract code used by the partner-chains project.
Safe HaskellSafe-Inferred
LanguageHaskell2010

TrustlessSidechain.IlliquidCirculationSupply

Description

 
Synopsis

Illiquid Circulation Supply (ICS) validator

There can be multiple ICS UTXOs at the validator address; they are identified by having the ICS Auth token.

Redeemers:

  1. DepositMoreToSupply allows depositing native tokens into a single continuing ICS UTXO.

  2. WithdrawFromSupply allows withdrawing native tokens from the ICS.

    • May spend and output one or more ICS UTXOs.
    • Only outputs at the ICS validator address may receive an ICS Auth token.
    • Conditions of withdrawing tokens are encoded in the ICS supply withdrawal policy, which must exist in the versioning system; one withdrawal token must be minted to prove the conditions are fulfilled.
    • Required reference inputs:

Error codes:

  • ERROR-ILLIQUID-CIRCULATION-SUPPLY-01: Output UTxO doesn't have exactly one ICS Authority Token or ICS auth tokens leak from the ICS validator
  • ERROR-ILLIQUID-CIRCULATION-SUPPLY-02: Assets of the supply UTxO decreased
  • ERROR-ILLIQUID-CIRCULATION-SUPPLY-03: Single illiquid circulation supply token is not minted
  • ERROR-ILLIQUID-CIRCULATION-SUPPLY-04: No unique output UTxO at the supply address
  • ERROR-ILLIQUID-CIRCULATION-SUPPLY-05: No own input UTxO at the supply address

ICS Auth token minting policy

Tokens minted with this policy are used for identifying authorized ICS UTXOs at the ICS validator address.

Error codes:

  • ERROR-ICS-AUTH-TOKEN-01: No authority signature.