Kolektivo Docs
  • 🏁Getting Started
  • 🌱Introduction
    • The Kolektivo Framework
    • The Kolektivo Network
    • Kolektivo Curaçao
  • 🛠️Tools
    • Live Tools
      • Wallet
      • Reserve
      • Community Currency
    • Upcoming Tools
      • Treasury
      • BADGER Governance Tools
      • Ecological Tools
        • Geospatial Non-Fungible Token
        • The Impact Map
    • Framework Tokens
      • Network Token
      • Treasury Token
      • Reserve Token
      • Community Currency
      • Geospatial Non-Fungible Token
      • Ecological Tokens
  • 💻Advanced
    • Smart Contracts
      • Monetary System
        • Reserve
        • Mento
        • Treasury
        • Liquidity Pools
      • BADGER Governance System
    • Wallet Code
    • Developer Guides
    • Deployment Addresses
  • 📑Resources
  • 🔖Glossary
Powered by GitBook
On this page
  • Summary
  • Module Details
  • Treasury
  • Error Messages
  • Treasury Token
  • Error Messages
  • Failure Modes

Was this helpful?

  1. Advanced
  2. Smart Contracts
  3. Monetary System

Treasury

PreviousMentoNextLiquidity Pools

Last updated 2 years ago

Was this helpful?

As of April 2023, those contracts have not been deployed, and there is no front-end for this module.

  • Module Name: Treasury Module

  • Contract Sources:

    • Oracles

Table of Contents

Summary

This module is a custom creation made of two smart contracts: The first one, the Kolektivo Treasury, holds the natural capital assets (or their indexes) and creates the Kolektivo Treasury Token (KTT) which directly represents the treasury’s value. KTT is a rebase token, influenced by . Through its elastic supply and the rebasing mechanics, the aim is to keep the token value close to a certain ratio. The treasury is comprised of the various LP index tokens as well as other currencies.

Module Details

The Treasury Module has 2 core components consisting of the Treasury.sol, and ElasticReceiptToken.sol contracts.

Treasury

The Treasury.sol contract allows to:

  • Hold multiple tokens: ERC20, Index/Liquidity Tokens from Balancer, Stable Coins such as cUSD or cEUR, ERC721, and GeoNFTs.

  • Withdraw certain tokens up to a certain amount (limited to certain addresses and revokable). For example: A mapping of address => address => uint256, where we can define “Address X can withdraw Token Y up to a limit of 123”.

  • Send treasury assets to arbitrary addresses. For example, the Treasury has stables and wants to fund a Kolektivo community economy.

  • Sell and buy assets (bond and redeem) by minting/burning the Kolektivo Treasury Token (KTT). This implies that the treasury allows to:

    • List certain tokens as bondable/redeemable

    • List certain tokens to be unbonded/unredeemed

    • Dynamically set the price of the bonds based on the value of assets to un-/bond. Note that the pricing should depend on the average value for some time to prevent flash loan attacks.

  • Perform negative and positive rebases

  • Modify the rebase impact by applying a damping factor to the supply delta (e.g. 1/5)

What are supply delta and dampening factor?

The supply delta is the input of the rebasing function (i.e. by how much the rebase should be). A dampening factor decreases the supply delta parameter to stretch the rebasing out over multiple epoches (soft) vs. doing it at once (hard).

  • Create an elastic supply token (KTT).

  • Modify the deviation threshold defining supply boundaries in which no rebase should occur (e.g. 5%)

Error Messages

Code
Description

Treasury__ERC20IsNotBondable(address erc20)

Function is only callable for bondable erc20's

Treasury__ERC721IdIsNotBondable(address erc721, uint id)

Function is only callable for bondable erc721Id's

Treasury__ERC20IsNotRedeemable(address erc20)

Function is only callable for redeemable erc20's

Treasury__ERC721IdIsNotRedeemable(address erc721, uint id)

Function is only callable for redeemable erc721Id's

Treasury__ERC20IsNotRegistered(address erc20)

Function is only callable for registered erc20's

Treasury__ERC721IdIsNotRegistered(address erc721, uint id)

Function is only callable for registered erc721Id's

Treasury__StaleERC20PriceDeliveredByOracle(address erc20, address oracle)

Functionality is limited due to stale price delivered by oracle

Treasury__StaleERC721IdPriceDeliveredByOracle(address erc721, uint id, address oracle)

Functionality is limited due to stale price delivered by oracle

Treasury Token

  • The maximum supply is one billion.

  • Each rebase happens at an epoch.

  • Each time someone interacts with a token, e.g. token transfer, rebase is triggered a rebase.

  • Rebase can also be called manually.

Error Messages

Code
Description

InvalidRecipient

Invalid token recipient

InvalidAmount

Invalid token amount

MaxSupplyReached

Maximum supply reached

Failure Modes

Please note that this experimental MVP software is provided on an "as is" and "as available" basis. As this module is an first attempt, be aware that different failures may occur. We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.

The is a vanilla ERC-20 token backed by the Treasury's assets. It is called the Kolektivo Treasury Token (KTT), and it is an elastic / rebasing token, which means that 1 KTT is always worth 1$ worth of treasury assets. The KTT contract is inspired by the well-tested . Here are some of the token's characteristics:

💻
Treasury Token
Ampleforth
Treasury.sol
ElasticReceiptToken.sol
Ampleforth
Summary
Module Details
Treasury
Treasury Token
Failure Modes
KolektivoGitHub
https://github.com/Kolektivo/kolektivo-monetary-contracts/blob/main/src/Treasury.solgithub.com
https://github.com/Kolektivo/kolektivo-monetary-contracts/blob/main/src/ElasticReceiptToken.solgithub.com
Logo