All pages
Powered by GitBook
1 of 1

Loading...

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.

transfer

  • Parameters:

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

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

allowance

  • Parameters:

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

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

approve

  • Parameters:

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

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

transferFrom

  • Parameters:

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

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

Additional Functions

mint

  • Parameters:

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

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

burn

  • Parameters:

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

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

increaseAllowance

  • Parameters:

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

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

decreaseAllowance

  • Parameters:

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

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

Events

Transfer

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

  • Parameters:

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

Approval

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

  • Parameters:

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

Returns
:
uint256
representing the number of tokens held by the specified account.
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.

  • 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.

  • 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.

  • 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.

  • 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.
    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.
    Description: Increases the allowance that a spender has to use the caller’s tokens.
  • Returns: bool indicating whether the operation was successful.

  • Description: Decreases the allowance that a spender has to use the caller’s tokens.
  • Returns: bool indicating whether the operation was successful.

  • to
    (address indexed): The address of the receiver.
  • value (uint256): The amount of tokens transferred.

  • spender
    (address indexed): The address of the spender who is granted permission.
  • value (uint256): The amount of tokens the spender is allowed to use.