Fathom Protocol
  • Introduction
  • FXD Stablecoin
    • FXD Smart Contract Architecture
    • Minting and Burning Mechanisms with LTV Ratio
    • Soft-Pegging to the US Dollar
    • Opening and closing position flows
    • BookKeeping mechanism
      • Stablecoin Accounting
      • Collateral Accounting
    • Liquidation
      • Fixed Spread Liquidation Strategy
      • Liquidation process walk through
    • Emergency Shutdown
    • Maths for position safety
    • Fee structure
    • Risk Management
    • Interfaces
      • ProxyWalletRegistry
      • ProxyWallet
        • FathomStablecoinProxyActions
      • CollateralPoolConfig
      • BookKeeper
      • FXD
      • LiquidationEngine
      • FlashMintModule
      • PriceFeed
      • ShowStopper
      • StabilityFeeCollector
      • SystemDebtEngine
      • AdminControls
    • Deployments
      • XDC Network
    • User Guides
      • Open FXD position
      • Top Up FXD Position
      • Repay and close FXD position
    • Fathom Stablecoin Smart Contracts
    • Fathom Stablecoin Subgraph
  • Vaults
    • Key Features
    • Definitions
    • Architecture
    • Fees
    • Workflows
    • Vault Management
    • Strategy Creation
    • Interfaces
      • Factory
      • Vault
      • BaseStrategy
      • TokenizedStrategy
    • Deployments
      • XDC Network
    • User Guides
      • Deposit and Withdraw in Vault
    • Fathom Vaults Smart Contracts
    • Fathom Vaults Subgraph
  • Lending
    • Core Concepts
    • Protocol Mechanics
    • Architecture
    • Interfaces
      • FmToken
      • VariableDebtToken
      • StableDebtToken
      • L2Pool
      • PoolAddressesProvider
    • User Guides
      • Supply, Borrow, Repay and Withdraw Asset
    • Deployments
      • XDC Network
    • Fathom Lending Smart Contracts
    • Fathom Lending Subgraph
  • DEX
    • Core Concepts
    • Architecture
    • Interfaces
      • Factory
      • Pair
      • Router
    • User Guides
      • Providing Liquidity
      • Swapping Assets
    • Deployments
      • XDC Network
    • Fathom DEX Smart Contracts
    • Fathom DEX Subgraph
  • DAO
    • DAO Structure
    • Governance Process
    • Staking Process
    • Treasury Management
    • Risk Management and Security Measures
    • Contributing to Fathom DAO
    • Interfaces
      • FTHM
      • Staking
        • Vault
        • RewardsCalculator
        • vFTHM
      • Governance
        • TimelockController
    • Deployments
      • XDC Network
    • User Guides
      • Staking
      • Proposing
      • Voting
    • Fathom DAO Smart Contracts
    • Fathom DAO Subgraph
  • Whitepaper
    • Version 1.0
  • Resources
  • FXD Deployments
  • FTHM Deployments
  • Privacy Policy
  • Terms of Service
Powered by GitBook

Copyright© Fathom App 2024.

On this page
  • State Variables:
  • Set Functions:
  • Events:

Was this helpful?

Export as PDF
  1. DAO
  2. Interfaces
  3. Staking

Vault

https://github.com/Into-the-Fathom/fathom-dao-smart-contracts/blob/master/contracts/dao/staking/vault/packages/VaultPackage.sol

PreviousStakingNextRewardsCalculator

Last updated 11 months ago

Was this helpful?

is proxy, and its implementation is .

The VaultPackage contract manages the operations and state related to supported tokens and their deposits within the vault. It handles the addition and removal of tokens, depositing of tokens for rewards, and managing migration of tokens to a new vault package.

State Variables:

deposited (mapping(address => uint256))

  • Description: Tracks the total amount of each token that has been deposited into the vault.

  • Key: Token address.

  • Value: Amount deposited.

isSupportedToken (mapping(address => bool))

  • Description: Indicates whether a token is supported by the vault.

  • Key: Token address.

  • Value: Boolean indicating support.

listOfSupportedTokens (address[])

  • Description: An array of token addresses that are currently supported by the vault.

migrated (bool)

  • Description: A boolean flag indicating if the vault has been migrated to a new package.

Set Functions:

deposit(address _token, uint256 _amount)

  • Deposits a specified amount of a supported token into the vault.

  • Parameters:

    • _token (address): The token's address.

    • _amount (uint256): Amount of the token to deposit.

  • Returns: None.

payRewards(address _user, address _token, uint256 _amount)

  • Pays out rewards to a user from the deposited tokens.

  • Parameters:

    • _user (address): The user's address.

    • _token (address): The token's address.

    • _amount (uint256): Amount of the token to pay out.

  • Returns: None.

addSupportedToken(address _token)

  • Adds a token to the list of supported tokens.

  • Parameters:

    • _token (address): The token's address.

  • Returns: None.

removeSupportedToken(address _token)

  • Removes a token from the list of supported tokens.

  • Parameters:

    • _token (address): The token's address.

  • Returns: None.

migrate(address newVaultPackage)

  • Migrates the vault to a new package.

  • Parameters:

    • newVaultPackage (address): The new vault package's address.

  • Returns: None.

withdrawExtraSupportedTokens(address _withdrawTo)

  • Withdraws excess balances of supported tokens.

  • Parameters:

    • _withdrawTo (address): Address to which the tokens will be withdrawn.

  • Returns: None.

withdrawExtraUnsupportedToken(address _token, address _withdrawTo)

  • Withdraws all balances of an unsupported token.

  • Parameters:

    • _token (address): The token's address.

    • _withdrawTo (address): Address to which the tokens will be withdrawn.

  • Returns: None.

Events:

TokenAdded

  • Emitted when a token is added to the list of supported tokens.

  • Parameters:

    • tokenAddress (address indexed): Address of the token added.

    • addedBy (address indexed): Address of the user who added the token.

    • timestamp (uint256): Time at which the token was added.

TokenRemoved

  • Emitted when a token is removed from the list of supported tokens.

  • Parameters:

    • tokenAddress (address indexed): Address of the token removed.

    • removedBy (address indexed): Address of the user who removed the token.

    • timestamp (uint256): Time at which the token was removed.

VaultProxy
VaultPackage