Tinyman Docs
  • Tinyman V2 Overview
  • About Tinyman
  • Protocol Specification
    • Pool
      • Pool Creation
      • Adding Liquidity
      • Removing Liquidity
    • Swap
    • Fees
    • Flash Loan
    • Flash Swap
    • Additional Notes
  • FAQ
    • Migration FAQ
  • Fees
  • Permissioned Methods
    • Roles
    • Methods
    • Related Non-Permissioned Methods
  • Formulae
  • Disclaimer
  • Contracts
  • Audits & Security
  • Token and Governance
    • TINY Token Details
    • Governance Details
      • Overview
      • Governance Vault
      • Governance Rewards
      • Governance Process
      • TINY Farming
  • V2 Integration
    • Protocol Methods
      • Bootstrap
      • Add Initial Liquidity
      • Add Subsequent Liquidity
      • Remove Liquidity
      • Swap
      • Flash Loan
      • Flash Swap
    • State Data
    • Oracle Data
    • Calculating Quotes
    • Official SDKs
  • Swap Router
    • Transaction Specification
  • Swap Widget
    • Customization Preferences
    • How to export your Widget
  • Lending Pools
  • Trigger Orders & Recurring Orders
  • Liquid Staking
    • Liquid Staking
  • Tinyman V1
    • Overview
    • Tinyman AMM Basics
      • Creating Pools
      • Slippage & Excess
      • Farming
    • FAQ
    • Fees
    • Design Doc
    • Contracts
    • Tinyman Testnet
    • Disclaimer
    • Audits
    • Security
  • V1 Integration
    • Pool Lookup
    • Transaction Specifications
      • Bootstrap Pool
      • OptIn
      • Swap
      • Mint
      • Burn
      • Redeem
      • Create Validator App
      • Redeem Protocol Fees
    • Official SDKs
    • Community SDKs
  • Tinyman Presentations
  • Known Issues
    • 2021-11-12 - Pool overflow errors
Powered by GitBook
On this page
  • Overview
  • Version 1.1
  • Version 1.0

Was this helpful?

  1. Tinyman V1

Contracts

PreviousDesign DocNextTinyman Testnet

Last updated 3 years ago

Was this helpful?

Source code on Github:

Audit Report by :

Overview

The Tinyman contracts consist of a single stateful smart contract (the Validator App) and a template for a stateless smart contract for each Pool, the Pool LogicSig. The Validator app is created/deployed to the network by the Tinyman team. The Pool contract accounts are created from the Pool LogicSig template by the first Pooler who wishes to provide liquidity. Pool contract account addresses are discovered or verified by Swappers/Poolers using the Pool LogicSig template to generate a specific Pool LogicSig and retrieving the address.

Validator App

  • Stateful smart contract

  • Created by Tinyman core team

  • Fully immutable

    • No updates allowed

    • No deletion allowed

  • No global state

  • Local state in Pool, Pooler, Swapper accounts (16 ints, 0 bytes)

  • Contains validation and state manipulation logic for all operations

Pool Logic Signature Template

  • A stateless smart contract template

  • Template variables for asset 1 id, asset 2 id, and Validator App id

  • Pool contract account address retrieved by hashing the completed template

  • Contains logic to ensure only transactions part of expected transaction groups are signed

  • Delegates most logic responsibility to the Validator app by ensuring the transaction group contains a call to the Validator App with appropriate arguments

Version 1.1

Version 1.0

Source Code:

Mainnet Validator App ID:

Testnet Validator App ID:

Source Code:

Mainnet Validator App ID:

Testnet Validator App ID:

https://github.com/tinymanorg/tinyman-contracts-v1
Runtime Verification
https://github.com/runtimeverification/publications/blob/main/reports/smart-contracts/Tinyman.pdf
https://github.com/tinymanorg/tinyman-contracts-v1/tree/13acadd1a619d0fcafadd6f6c489a906bf347484
552635992
62368684
https://github.com/tinymanorg/tinyman-contracts-v1/tree/d1090f16d755b3898d2b8e03a2efa86133c30346
350338509
21580889