FT Token
Overview
The FT token is Flying Tulip's native cross-chain token built on LayerZeroLayerZeroCross‑chain messaging protocol used to power OFT transfers.View glossary entry's OFTOFTCross‑chain messaging and token standard that allows FT to move natively across chains.View glossary entry standard, enabling seamless transfers between supported blockchains while incorporating pausepauseTemporarily halting token transfers or protocol operations via admin roles for safety.View glossary entry functionality and role-based access control.
Technical Implementation
The FT token contract:
- Is initially deployed with 10 billion tokens minted on Sonic chain (ID 146)
- Implements ERC20Permit for gasless approval transactions
- Features a pausingpausingTemporarily halting token transfers or protocol operations via admin roles for safety.View glossary entry mechanism that can be controlled by owner or configuratorconfiguratorAdmin role used to set or update parameters (e.g., pausing, asset lists, strategy weights).View glossary entry
- Supports burning functionality for token redemption mechanisms
- Uses LayerZeroLayerZeroCross‑chain messaging protocol used to power OFT transfers.View glossary entry's OFTOFTCross‑chain messaging and token standard that allows FT to move natively across chains.View glossary entry standard for cross-chain transfers
Access Control
The contract has two privileged roles:
- Owner: Can change token name/symbol and toggle pausepauseTemporarily halting token transfers or protocol operations via admin roles for safety.View glossary entry state
- ConfiguratorConfiguratorAdmin role used to set or update parameters (e.g., pausing, asset lists, strategy weights).View glossary entry: Can toggle pausepauseTemporarily halting token transfers or protocol operations via admin roles for safety.View glossary entry state and transfer configuratorconfiguratorAdmin role used to set or update parameters (e.g., pausing, asset lists, strategy weights).View glossary entry role
When paused, transfers are restricted except for:
- The configuratorconfiguratorAdmin role used to set or update parameters (e.g., pausing, asset lists, strategy weights).View glossary entry address
- The LayerZeroLayerZeroCross‑chain messaging protocol used to power OFT transfers.View glossary entry endpoint
- Messages initiated by the configuratorconfiguratorAdmin role used to set or update parameters (e.g., pausing, asset lists, strategy weights).View glossary entry
Contract Inheritance
The contract inherits all standard ERC20 functions (balanceOf, totalSupply, allowance, etc.) and ERC20Permit functions (permit, nonces, DOMAIN_SEPARATOR).
Write Functions
transfer
Transfers tokens from caller to recipient
function transfer(address to, uint256 amount) external returns (bool)
Parameters
to: Recipient address
amount: Amount to transfer
Returns
bool: Success boolean
transferFrom
Transfers tokens using allowance mechanism
function transferFrom(address from, address to, uint256 amount) external returns (bool)
Parameters
from: Source address
to: Destination address
amount: Amount to transfer
Returns
bool: Success boolean
approve
Sets spender's allowance over caller's tokens
function approve(address spender, uint256 amount) external returns (bool)
Parameters
spender: Address to authorize
amount: Allowance amount
Returns
bool: Success boolean
increaseAllowance
Increases spender's allowance
function increaseAllowance(address spender, uint256 addedValue) external returns (bool)
Parameters
spender: Address to authorize
addedValue: Amount to add to allowance
Returns
bool: Success boolean
decreaseAllowance
Decreases spender's allowance
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool)
Parameters
spender: Address to authorize
subtractedValue: Amount to subtract from allowance
Returns
bool: Success boolean
permit
Approves spender to spend owner's tokens via signed authorization
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external
Parameters
owner: Token owner
spender: Authorized spender
value: Amount to approve
deadline: Permit expiration timestamp
v, r, s: Signature components
burn
Burns tokens from caller's balance
function burn(uint256 amount) external
Parameters
amount: Number of tokens to burn
burnFrom
Burns tokens from another account (requires approval)
function burnFrom(address account, uint256 amount) external
Parameters
account: Address to burn from
amount: Number of tokens to burn
setPaused
Pauses or unpauses token transfers
function setPaused(bool isPaused) external
Parameters
isPaused: True to pausepauseTemporarily halting token transfers or protocol operations via admin roles for safety.View glossary entry, false to unpause
transferConfigurator
Transfers configuratorconfiguratorAdmin role used to set or update parameters (e.g., pausing, asset lists, strategy weights).View glossary entry role to new address
function transferConfigurator(address newConfigurator) external
Parameters
newConfigurator: New configuratorconfiguratorAdmin role used to set or update parameters (e.g., pausing, asset lists, strategy weights).View glossary entry address
setName
Changes token name
function setName(string memory newName) external
Parameters
newName: New token name
setSymbol
Changes token symbol
function setSymbol(string memory newSymbol) external
Parameters
newSymbol: New token symbol
send
Sends tokens to another chain
function send(uint16 dstChainId, bytes calldata to, uint256 amount, address zroPaymentAddress, bytes calldata adapterParams) external payable
Parameters
dstChainId: Destination chain ID
to: Recipient address bytes
amount: Amount to send
zroPaymentAddress: ZRO payment address
adapterParams: Parameters for the adapter
View Functions
name
Gets token name
function name() public view returns (string memory)
Returns
string: Current token name