GEB Docs
  • Introduction to GEB
  • Community Resources
  • FLX Mechanics
  • FAQ
  • RAI
    • RAI Use-Cases
    • Multi-chain RAI
    • RAI Integrations
  • The Money God League
    • Intro to The League
  • Ungovernance
    • Governance Minimization Guide
  • Risk
    • GEB Risks
    • PID Failure Modes & Responses
  • Incentives
    • RAI Uniswap V2 Mint + LP Incentives Program
    • RAI Uniswap V3 Mint + LP Incentives Program (Inactive)
    • FLX Staking
    • RAI / ETH Uniswap V3 Oracle LP Incentives Program
  • Contract Variables Translation
    • Core Contracts Naming Transition
    • Governance Contracts Naming Transition
    • SAFE Management Contract Naming Transition
  • System Contracts
    • Core Module
      • SAFE Engine
      • Liquidation Engine
      • Accounting Engine
    • Auction Module
      • English Collateral Auction House
      • Fixed Discount Collateral Auction House
      • Increasing Discount Collateral Auction House
      • Debt Auction House
      • Surplus Auction House
    • Oracle Module
      • Oracle Relayer
      • Medianizer
        • DSValue
        • Governance Led Median
        • Chainlink Median
        • Uniswap V2 Median
      • FSM
        • Oracle Security Module
        • Dampened Security Module
        • FSM Governance Interface
    • Token Module
      • Token Adapters
      • System Coin
      • Protocol Token
      • Protocol Token Authority
      • Protocol Token Printing Permissions
    • Money Market Module
      • Tax Collector
    • Sustainability Module
      • Stability Fee Treasury
      • FSM Wrapper
      • Increasing Treasury Reimbursement
      • Mandatory Fixed Treasury Reimbursement
      • Increasing Reward Relayer
    • 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
  • GEB.js
    • Getting Started
    • Global Settlement Guide
    • API Reference
      • Geb
      • Safe
      • Proxy Actions
      • Geb Admin
  • APIs
    • API Endpoints
  • Pyflex
    • Getting Started
      • Configuration
      • GEB Basics
    • SAFE Management
      • Opening a SAFE
      • Closing a SAFE
    • Numerics
  • Keepers
    • Keeper Overview
    • Collateral Auction Keeper
      • Running in Docker
      • Running on a Host
      • Liquidations & Collateral Auctions
      • Collateral Auction Flash Swaps
    • Debt Auction Keeper
      • Running in Docker
      • Running on a Host
    • Staked Token Auction Keeper
      • Running in Docker
      • Running on a Host
    • Surplus Auction Keeper
      • Running in Docker
      • Running on a Host
    • Bidding Models
  • Liquidation Protection
    • SAFE Protection
    • Liquidation Protection Guide
    • Uni-V2 RAI/ETH Savior Details
    • Curve V1 Savior Details
Powered by GitBook
On this page
  • 1. Summary
  • 2. Contract Variables & Functions
  • 3. Walkthrough

Was this helpful?

  1. System Contracts
  2. Token Module

Protocol Token

The protocol's recapitalization source

PreviousSystem CoinNextProtocol Token Authority

Last updated 4 years ago

Was this helpful?

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