vFTHM
https://github.com/Into-the-Fathom/fathom-dao-smart-contracts/blob/master/contracts/dao/tokens/VMainToken.sol
vFTHM is a specialized governance token designed for the Fathom protocol. It incorporates features from several OpenZeppelin libraries, providing advanced functionality such as role-based access control, pausing capabilities, and permit-based approvals. The token is non-transferable unless the sender is on an allowlist, ensuring security and control over token transfers. The token's minting and burning capabilities are restricted to accounts with the minter role, which can be dynamically granted or revoked by an admin. This setup ensures that only authorized accounts can manage the token supply while maintaining strict control over token operations.
Setter Functions
transfer(address to, uint256 amount)
Parameters:
to
: The address of the recipient.amount
: The number of tokens to transfer.
Returns:
bool
: Whether the transfer was successful.
Description: Transfers tokens to a specified address.
approve(address spender, uint256 amount)
Parameters:
spender
: The address of the spender.amount
: The number of tokens to approve.
Returns:
bool
: Whether the approval was successful.
Description: Approves the specified number of tokens for spending by the spender.
transferFrom(address from, address to, uint256 amount)
Parameters:
from
: The address of the sender.to
: The address of the recipient.amount
: The number of tokens to transfer.
Returns:
bool
: Whether the transfer was successful.
Description: Transfers tokens from one specified address to another.
pause()
Parameters: None
Returns: None
Description: Pauses all token transfers and minting functions, putting the contract in a paused state.
unpause()
Parameters: None
Returns: None
Description: Unpauses all token transfers and minting functions, resuming normal contract operations.
Getter Functions
name()
Parameters: None
Returns:
string
: The name of the token.
Description: Returns the name of the token as set during the contract initialization.
symbol()
Parameters: None
Returns:
string
: The symbol of the token.
Description: Returns the symbol of the token as set during the contract initialization.
decimals()
Parameters: None
Returns:
uint8
: The number of decimal places the token uses.
Description: Returns the number of decimal places used to get its user representation.
totalSupply()
Parameters: None
Returns:
uint256
: The total supply of the token.
Description: Returns the total supply of the token.
balanceOf(address account)
Parameters:
account
: The address of the token holder.
Returns:
uint256
: The balance of the specified address.
Description: Returns the token balance of the specified address.
allowance(address owner, address spender)
Parameters:
owner
: The address of the token owner.spender
: The address of the spender.
Returns:
uint256
: The remaining number of tokens that the spender is allowed to spend on behalf of the owner.
Description: Returns the remaining number of tokens that the spender is allowed to spend on behalf of the owner.
paused()
Parameters: None
Returns:
bool
: Whether the contract is paused.
Description: Returns whether the contract is in a paused state.
nonces(address owner)
Parameters:
owner
: The address to check.
Returns:
uint256
: The current nonce for the address.
Description: Returns the current nonce for an address, used for permit functions.
checkpoints(address account, uint32 pos)
Parameters:
account
: The address to check.pos
: The position of the checkpoint.
Returns:
Checkpoint
: The checkpoint data.
Description: Returns the checkpoint for an address at a specific position.
numCheckpoints(address account)
Parameters:
account
: The address to check.
Returns:
uint32
: The number of checkpoints for the address.
Description: Returns the number of checkpoints for an address.
getVotes(address account)
Parameters:
account
: The address to check.
Returns:
uint256
: The current voting power of the address.
Description: Returns the current voting power of an address.
getPastVotes(address account, uint256 blockNumber)
Parameters:
account
: The address to check.blockNumber
: The block number to check.
Returns:
uint256
: The voting power of the address at the specified block number.
Description: Returns the voting power of an address at a specific block.
getPastTotalSupply(uint256 blockNumber)
Parameters:
blockNumber
: The block number to check.
Returns:
uint256
: The total supply of tokens at the specified block number.
Description: Returns the total supply of tokens at a specific block.
delegates(address account)
Parameters:
account
: The address to check.
Returns:
address
: The delegatee of the address.
Description: Returns the delegatee of an address.
Events
Transfer
Parameters:
address indexed from
: The address from which tokens are transferred.address indexed to
: The address to which tokens are transferred.uint256 value
: The number of tokens transferred.
Description: Emitted when tokens are transferred from one address to another, including zero value transfers.
Approval
Parameters:
address indexed owner
: The address of the token owner.address indexed spender
: The address of the spender.uint256 value
: The new allowance granted by the owner.
Description: Emitted when the allowance of a spender for an owner is set by a call to
approve
. This event indicates the amount of tokens the spender is allowed to transfer from the owner’s account.
Last updated