Glittr
  • Introduction
  • Protocol Overview
  • Contract Primitives
    • MOAs - Mint Only Assets
    • MBAs - Mint and Burn Assets
      • Vaults
    • Spec Contracts
    • Oracle Commitments
  • Building on Glittr
    • Setup
    • Faucet
    • Glittr SDK
    • Glittr Transactions
    • Glittr Contracts
    • Installing Glittr Wallet
    • Local Development Guide
  • GLIP
  • Node
    • Run a Bitcoin Node
    • Run a Glittr Node
  • Examples & Guide
    • Creating Tokens
    • Contract Custody
    • Complex Tokens
    • Vesting and Freemint Contract
    • Wrapped BTC Contract
    • USD Contract
    • Oracle Implementation Guide
    • Glittr Output Structure
    • AMM Contract
  • API Reference
    • Getting Assets API
  • APP EXAMPLES
    • Freemint App (NextJS)
    • Freemint App (React + Vite)
    • NFT App (React + Vite)
Powered by GitBook
On this page
  1. Contract Primitives

Spec Contracts

Spec Contracts do not have independent functionality, but provide a specification for further contracts. Specs can be thought of like an interface in traditional object oriented programming. Specs are useful for allowing contracts to have more flexibility and non-determinism by specifying rules for contracts instead of needing to hardcode exhaustive lists of eligible contracts and assets.

As an example, say we wish to issue an over-collateralized stable coin. As discussed previously, it is greatly preferable to mint against vault shares as opposed to collateralizing assets directly because it distributes state management across many contracts. The creator of the stable coin contract could also issue a Spec Contract which outlined the allowable assets for collateral. Then, in the stable coin's MBA Contract, they can list this Spec Contract as the allowable collateral.

Specs also allow for better interoperability, for example a spec could designate all strongly-pegged Glittr native stable coins, and be updated regularly. Other contracts - both MOAs and MBAs - can allow for 'designated stable coins' to be used as payment or collateral, and future proof the emergence of new stables.

PreviousVaultsNextOracle Commitments

Last updated 6 months ago