Skip to main content

FeeOnTransferERC20

Git Source Inherits: ERC20 This is an example implementation to facilitate testing During deployment _tokenName and _tokenSymbol are set in constructor

State Variables

transferFee

uint256 immutable transferFee;

Functions

constructor

Constructor sets params
constructor(string memory _name, string memory _symbol, uint16 _fee) ERC20(_name, _symbol);
Parameters
NameTypeDescription
_namestringName of the token
_symbolstringSymbol of the token
_feeuint16

mint

Function that mints new tokens. Allows for free and open minting of tokens.
function mint(address to, uint256 amount) public;
Parameters
NameTypeDescription
toaddressrecipient address
amountuint256number of tokens to mint

transfer

function transfer(address to, uint256 amount) public virtual override returns (bool);

transferFrom

function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool);