Skip to content

Review Contracts Implementation #9

Description

@toruguera

Channel Contract

  • Administrable Trait
    • Initialize with Admin
    • Can set Admin
    • Can change Admin
    • Require admin for safe function
  • Upgradable trait
    • Only admin can upgrade
    • Can upgrade the wasm
  • Implements UTXOHandler trait
  • Implements Asset integration
    • Initialize with asset
    • Cannot change asset
    • Can read asset
    • Supports transfer from/to asset
  • Integrates Auth
    • Check utxo module
  • Implements Moonlight Transact
    • Receives a mixed operation/transaction
    • Handles Deposit with conditions
    • Handles withdraw with conditions
    • Handles spend with conditions
    • Handles create
    • Ensures no conflicting conditions
  • Standardized Errors

Auth Contract

  • Administrable Trait
    • Initialize with Admin
    • Can set Admin
    • Can change Admin
    • Require admin for safe function
  • Upgradable trait
    • Only admin can upgrade
    • Can upgrade the wasm
  • Manages Providers
    • Admin can add providers
    • Admin can remove providers
  • Implement UTXOAuthorizable
    • Verifies internal UTXO operations (Spend and Create)
  • Implement ProviderAuthorizable
    • Verifies Provider authorization (needs to have a registered provider)
  • Implement Custom auth interface
  • Standardized Errors

Modules

Auth

  • Implement Auth errors for traits
  • Implement UTXOAuthorizable trait
  • Implement ProviderAuthorizable trait
  • Implements signature verification functions
  • Test Utils
    • Implements a minimal test contract with the UTXOAuthorizable trait and ProviderAuthorizable trait

Helpers

  • Implement G address parsers to/from bytes
  • Test Utils
    • Implements Ed25519Account helper for tests
    • Implements P256Keypair helper for tests
    • Implements a Snapshot util for loading a test ledger with G accounts registered

Primitives

  • Implements common shared code that has no dependency on other modules

UTXO Core

  • Implements the UTXOHandler trait
    • Integrates Auth contract
    • process inner bundles
    • requires auth for inner UTXO operations (Spend and Create)
    • Manages bundle supply/liquidity so it matches the outer invocation. The contract implementing the trait must specify how much liquidity is coming in versus how much is expect to leave the system so the core processing must ensure the values match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions