Gloop
WebsiteTwitterDiscord
  • gLoop Litepaper v2
    • Introduction
    • The Two Tokens
    • Roadmap
  • PRODUCTS
    • GM Index
      • Providing/Removing Liquidity
      • Fees and Reflection
      • Deposit/Withdrawal Examples
    • GM Lending/Looping (Coming Soon)
    • GLOOP Staking (Coming Soon)
  • GM Points (COMING SOON)
  • FREQUENTLY ASKED QUESTIONS (FAQs)
    • GM Index (GMI)
  • Technical
    • Gloop Protocol Parameters
    • Contracts
      • GMI
        • GM Index
        • GMI USDC Zap
        • Token Banks
        • Token Oracles
        • Fees
    • Audits
  • GLoop Ecosystem
    • Tokenomics
  • Security and Risk
    • Risks
  • Social
    • Socials
Powered by GitBook
On this page
  • migrate
  • deposit
  1. Technical
  2. Contracts
  3. GMI

Token Banks

How the token banks work

PreviousGMI USDC ZapNextToken Oracles

Last updated 6 months ago

Before an asset is added to the Index, a bank contract for the token needs to be deployed. At deployment, the constructor stores the _manager address and the IERC20 interface type of the _token. The _manager address will normally be the address of the GM Index. The constructor then approves the manager to spend any amount of the token on behalf of the Bank. Once the token’s bank contract has been deployed, and a GM market and price oracle contract exist for the token, the token can be added to the Index (see main section for adding tokens).

migrate

function migrate(address newVault) external

Transfers all tokens in the Bank contract to a new Bank contract. This function can only be called by the manager.

Parameters:

Name
Type
Description

newVault

address

The address of the new Bank contract that all tokens will be transferred to

deposit

function deposit(uint256 _amount) external

Deposits an _amount of tokens into the Bank contract. This function can only be called by the manager, which is normally the GM Index contract. The tokens are sent from the depositor to the GM Index and then immediately sent to the token’s Bank contract.

Parameters:

Name
Type
Description

_amount

uint256

The amount of tokens to deposit

GM Index