TAI
  • How does TAI work?
    • Overview
    • Supported Collaterals
    • Liquidations and Auctions
    • Tokenomics
    • Governance
      • Goverance Process
      • Governance Parameters
    • Rewards
    • Audits
  • TAI Protocol: In-depth
    • Contracts
      • System Contracts
        • Core Module
          • SAFE Engine
          • Liquidation Engine
          • Accounting Engine
        • Auction Module
          • Increasing Discount Collateral Auction House
          • Debt Auction House
          • Surplus Auction House
        • Oracle Module
          • Oracle Relayer
          • Medianizer
            • DSValue
            • Governance Led Median
            • Chainlink Median
          • FSM
            • Oracle Security Module
        • Token Module
          • Token Adapters
          • System Coin: TAI
          • Protocol Token: RATE
          • Protocol Token Authority
        • Money Market Module
          • Tax Collector
        • Sustainability Module
          • Stability Fee Treasury
          • FSM Wrapper
          • Increasing Treasury Reimbursement
          • Mandatory Fixed Treasury Reimbursement
        • Automation Module
          • Collateral Auction Throttler
          • Single Spot Debt Ceiling Setter
          • ESM Threshold Setter
        • Governance Module
          • DSPause
        • Shutdown Module
          • Global Settlement
          • ESM
      • Proxy Infrastructure
        • DSProxy
        • Proxy Registry
      • Helper Contracts
        • SAFE Manager
      • Contract Addresses
    • Data APIs
      • API Endpoints
Powered by GitBook
On this page
  • 1. Summary
  • 2. Contract Variables & Functions
  • 3. Walkthrough
  1. TAI Protocol: In-depth
  2. Contracts
  3. System Contracts
  4. Token Module

Protocol Token: RATE

The protocol's recapitalization source

PreviousSystem Coin: TAINextProtocol Token Authority

Last updated 1 year ago

1. Summary

The protocol token is a that provides logic for burning and authorized minting of new tokens as well as delegation capabilities.

2. Contract Variables & Functions

Variables

  • guy - user address

  • wad - a quantity of tokens, usually as a fixed point integer with 10^18 decimal places.

  • dst - refers to the destination address.

  • name - returns the name of the token - e.g. "MyToken".

  • symbol - token symbol.

  • decimals - returns the number of decimals the token uses.

  • totalSupply - returns the total token supply.

  • balanceOf(usr: address) - user balance

  • delegates(usr: address) - a record of each account's delegate

  • checkpoints(usr: address, checkpoint: uint32) - a record of vote checkpoints for each account, by index

  • numCheckpoints(usr: address) - the number of checkpoints for each account

  • nonces(usr: address) - a record of states for signing / validating signatures

  • allowance(src: address, dst: address) - approvals

  • balanceOf(usr: address) - returns the account balance of another account with address _owner.

  • allowance(src: address, dst: address)- returns the amount which _spender is still allowed to withdraw from _owner.

  • DOMAIN_TYPEHASH - the EIP-712 typehash for the contract's domain

  • DELEGATION_TYPEHASH - the EIP-712 typehash for the delegation struct used by the contract

Functions

  • mint(usr: address, amount: uint256) - mint coins to an address

  • burn(usr: address, amount: uint256) - burn at an address

  • push(usr: address, amount: uint256) - transfer

  • pull(usr: address, amount: uint256)- transfer from

  • move(src: address, dst: address, amount: uint256) - transfer from

  • approve(usr: address, amount: uint256) - allow pulls and moves

  • transfer(dst: address, amount: uint256) - transfers coins from msg.sender to dst

  • delegate(delegatee: address) - delegate votes from msg.sender to delegatee

  • delegateBySig(delegatee: address, nonce: uint256, expiry: uint256, v: uint8, r: bytes32, s: bytes32) - delegates votes from signatory to delegatee

  • getCurrentVotes(account: address) external view returns (uint256) - gets the current votes balance for account

  • getPriorVotes(account: address, blockNumber: uint256) public view returns (uint256) - determine the prior number of votes for an account as of a block number

Data Structures

  • Checkpoint - stores a checkpoint's data. Contains:

    • fromBlock - the block from which that amount of votes has been marked

    • votes - the amount of votes

Events

  • Mint - emitted when new tokens are minted. Contains:

    • guy - the address for which the contract prints tokens

    • wad - the amount of tokens printed

  • Burn - emitted when tokens are burned. Contains:

    • guy - the address whose tokens are burned

    • wad - the amount of tokens that were burned

  • DelegateChanged - emitted when an address changes its delegate. Contains:

    • delegator - the address that changes its delegate

    • fromDelegate - the old delegate

    • toDelegate - the new delegate

  • DelegateVotesChanged - emitted when a delegate account's vote balance changes. Contains:

    • delegate - the delegate account

    • previousBalance - the delegate's previous vote balance

    • newBalance - the delegate's new vote balance

3. Walkthrough

Along with the standard ERC20 token interface, the protocol token also has -protected mint and burn functions.

DsDelegateToken
DSAuth