OFTWithFee
Inherits: BaseOFTWithFee, ERC20
SPDX-License-Identifier: SSPL-1.-0
State Variables
ld2sdRate
uint256 internal immutable ld2sdRate;
Functions
constructor
constructor(
string memory _name,
string memory _symbol,
uint8 decimals,
uint8 _sharedDecimals,
address authority,
address _lzEndpoint
)
ERC20(_name, _symbol, decimals)
BaseOFTWithFee(_sharedDecimals, authority, _lzEndpoint);
circulatingSupply
public functions
function circulatingSupply() public view virtual override returns (uint256);
token
This function returns the address of the token contract.
This function is used to return the address of the token contract. It is a public view virtual override function.
function token() public view virtual override returns (address);
_debitFrom
internal functions
function _debitFrom(address _from, uint16, bytes32, uint256 _amount) internal virtual override returns (uint256);
_creditTo
This function is used to credit an amount to a given address.
This function is used to mint a given amount to a given address. It is an internal virtual override function.
function _creditTo(uint16, address _toAddress, uint256 _amount) internal virtual override returns (uint256);
_transferFrom
This function transfers tokens from one address to another.
If the transfer is from this contract, no allowance check is necessary. Otherwise, the allowance of the spender is checked.
function _transferFrom(address _from, address _to, uint256 _amount) internal virtual override returns (uint256);
_ld2sdRate
This function returns the rate of conversion from LD to SD.
This function is internal and view virtual override.
function _ld2sdRate() internal view virtual override returns (uint256);
_spendAllowance
OpenZeppelin ERC20 extensions
Updates owner
s allowance for spender
based on spent amount
.
Does not update the allowance amount in case of infinite allowance.
Revert if not enough allowance is available.
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual;
_transfer
Moves amount
of tokens from from
to to
.
This internal function is equivalent to {transfer}, and can be used to
e.g. implement automatic token fees, slashing mechanisms, etc.
function _transfer(address from, address to, uint256 amount) internal;
Errors
InsufficientAllowance
error InsufficientAllowance();
InsufficientBalance
error InsufficientBalance();
SharedDecimalsTooLarge
error SharedDecimalsTooLarge();
ZeroAddress
error ZeroAddress();