FmToken

https://github.com/Into-the-Fathom/fathom-lending-platform-smart-contracts/blob/master/contracts/protocol/tokenization/FmToken.sol

The FmToken is an interest-bearing token used within the Fathom protocol. It represents the user's stake in the underlying assets supplied to the protocol. This document provides details on the storage, functions, and events related to the FmToken contract.

Functions

ERC20 Functions

  • name() external view returns (string memory): Returns the name of the token.

  • symbol() external view returns (string memory): Returns the symbol of the token.

  • decimals() external view returns (uint8): Returns the decimals of the token.

  • totalSupply() public view returns (uint256): Returns the total supply of the token.

  • balanceOf(address account) public view returns (uint256): Returns the balance of the specified account.

  • transfer(address recipient, uint256 amount) external returns (bool): Transfers tokens from the caller to the specified recipient.

  • allowance(address owner, address spender) external view returns (uint256): Returns the allowance of the spender for the owner's tokens.

  • approve(address spender, uint256 amount) external returns (bool): Approves the spender to use the specified amount of the caller's tokens.

  • transferFrom(address sender, address recipient, uint256 amount) external returns (bool): Transfers tokens from the sender to the recipient using the allowance mechanism.

Incentive Functions

  • getIncentivesController() external view returns (IFathomIncentivesController): Returns the address of the incentives controller.

  • setIncentivesController(IFathomIncentivesController controller) external: Sets a new incentives controller.

Minting and Burning

  • mint(address caller, address onBehalfOf, uint256 amount, uint256 index) external returns (bool): Mints tokens to the specified user.

  • burn(address from, address receiverOfUnderlying, uint256 amount, uint256 index) external: Burns tokens from the specified user and transfers the underlying asset to the specified receiver.

  • mintToTreasury(uint256 amount, uint256 index) external: Mints tokens to the treasury.

Other Functions

  • transferOnLiquidation(address from, address to, uint256 value) external: Transfers tokens during liquidation.

  • transferUnderlyingTo(address target, uint256 amount) external: Transfers the underlying asset to the specified target.

  • handleRepayment(address user, address onBehalfOf, uint256 amount) external: Handles repayment of the underlying asset.

  • permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external: Approves spending of tokens using a signed message.

Events

  • BalanceTransfer(address indexed from, address indexed to, uint256 value, uint256 index): Emitted during the transfer of tokens.

  • Mint(address indexed caller, address indexed onBehalfOf, uint256 value, uint256 balanceIncrease, uint256 index): Emitted during the minting of tokens.

  • Burn(address indexed from, address indexed target, uint256 value, uint256 balanceIncrease, uint256 index): Emitted during the burning of tokens.

  • Transfer(address indexed from, address indexed to, uint256 value): Emitted during the transfer of tokens.

  • Approval(address indexed owner, address indexed spender, uint256 value): Emitted when approval for spending is granted.

Last updated

Copyright© Fathom App 2024.