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
  • Overview
  • ERC-20 Standard Functions
  • Additional Functions
  • Events

Was this helpful?

Export as PDF
  1. FXD Stablecoin
  2. Interfaces

FXD

https://github.com/Into-the-Fathom/fathom-stablecoin-smart-contracts/blob/master/contracts/main/stablecoin-core/FathomStablecoin.sol

Overview

The FXD token adheres to the ERC-20 standard and includes additional functionalities tailored to the Fathom protocol's needs.

ERC-20 Standard Functions

name

  • Description: Returns the name of the token.

  • Returns: string representing the token's name.

symbol

  • Description: Returns the token symbol.

  • Returns: string representing the token's symbol.

decimals

  • Description: Returns the number of decimals the token uses.

  • Returns: uint8 representing the number of decimal places the token uses. This affects the granularity of the token.

totalSupply

  • Description: Returns the total amount of FXD tokens currently in circulation.

  • Returns: uint256 representing the total supply of tokens.

balanceOf

  • Parameters:

    • account (address): The address of the token holder.

  • Description: Provides the balance of FXD tokens held by a specific account.

  • Returns: uint256 representing the number of tokens held by the specified account.

transfer

  • Parameters:

    • to (address): The address of the recipient.

    • amount (uint256): The amount of FXD tokens to transfer.

  • Description: Transfers a specified amount of FXD tokens from the caller's account to another address.

  • Returns: bool indicating whether the transfer was successful.

  • Emits: Transfer event.

allowance

  • Parameters:

    • owner (address): The address of the token owner.

    • spender (address): The address of the spender.

  • Description: Returns the remaining number of tokens that the spender is allowed to spend on behalf of the owner.

  • Returns: uint256 representing the remaining amount of tokens allowed to be spent.

approve

  • Parameters:

    • spender (address): The address of the spender.

    • amount (uint256): The amount of FXD tokens the spender is allowed to use.

  • Description: Approves a spender to withdraw tokens from the owner's account multiple times, up to the specified amount.

  • Returns: bool indicating whether the approval was successful.

  • Emits: Approval event.

transferFrom

  • Parameters:

    • from (address): The address of the sender.

    • to (address): The address of the recipient.

    • amount (uint256): The amount of tokens to transfer.

  • Description: Transfers tokens from one account to another, using an allowance mechanism.

  • Returns: bool indicating whether the transfer was successful.

  • Emits: Transfer event.

Additional Functions

mint

  • Parameters:

    • to (address): The address that will receive the created tokens.

    • amount (uint256): The amount of tokens to create.

  • Description: Mints new FXD tokens and assigns them to the specified address, increasing the total supply. Can be called only by the StablecoinAdapter in the process of taking the loan.

burn

  • Parameters:

    • from (address): The address from which tokens will be burned.

    • amount (uint256): The amount of tokens to burn.

  • Description: Burns a specified amount of FXD tokens from a given account, reducing the total supply. Can be called only by the StablecoinAdapter in the process of repaying the loan.

increaseAllowance

  • Parameters:

    • spender (address): The address of the spender.

    • addedValue (uint256): The additional amount of tokens that the spender is allowed to spend.

  • Description: Increases the allowance that a spender has to use the caller’s tokens.

  • Returns: bool indicating whether the operation was successful.

decreaseAllowance

  • Parameters:

    • spender (address): The address of the spender.

    • subtractedValue (uint256): The amount by which to decrease the spender's allowance.

  • Description: Decreases the allowance that a spender has to use the caller’s tokens.

  • Returns: bool indicating whether the operation was successful.

Events

Transfer

  • Emitted when: Tokens are moved from one account to another.

  • Parameters:

    • from (address indexed): The address of the sender.

    • to (address indexed): The address of the receiver.

    • value (uint256): The amount of tokens transferred.

Approval

  • Emitted when: A spender is approved to use tokens from another account.

  • Parameters:

    • owner (address indexed): The address of the token owner.

    • spender (address indexed): The address of the spender who is granted permission.

    • value (uint256): The amount of tokens the spender is allowed to use.

PreviousBookKeeperNextLiquidationEngine

Last updated 11 months ago

Was this helpful?