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
nameDescription: Returns the name of the token.
Returns:
stringrepresenting the token's name.
symbol
symbolDescription: Returns the token symbol.
Returns:
stringrepresenting the token's symbol.
decimals
decimalsDescription: Returns the number of decimals the token uses.
Returns:
uint8representing the number of decimal places the token uses. This affects the granularity of the token.
totalSupply
totalSupplyDescription: Returns the total amount of FXD tokens currently in circulation.
Returns:
uint256representing the total supply of tokens.
balanceOf
balanceOfParameters:
account(address): The address of the token holder.
Description: Provides the balance of FXD tokens held by a specific account.
Returns:
uint256representing the number of tokens held by the specified account.
transfer
transferParameters:
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:
boolindicating whether the transfer was successful.Emits:
Transferevent.
allowance
allowanceParameters:
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:
uint256representing the remaining amount of tokens allowed to be spent.
approve
approveParameters:
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:
boolindicating whether the approval was successful.Emits:
Approvalevent.
transferFrom
transferFromParameters:
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:
boolindicating whether the transfer was successful.Emits:
Transferevent.
Additional Functions
mint
mintParameters:
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
StablecoinAdapterin the process of taking the loan.
burn
burnParameters:
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
StablecoinAdapterin the process of repaying the loan.
increaseAllowance
increaseAllowanceParameters:
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:
boolindicating whether the operation was successful.
decreaseAllowance
decreaseAllowanceParameters:
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:
boolindicating whether the operation was successful.
Events
Transfer
TransferEmitted 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
ApprovalEmitted 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.
Last updated
Was this helpful?