Skip to main content

LPToken

This token is an ERC20 detailed token with added capability to be minted by the owner. It is used to represent user's shares when providing liquidity to swap contracts.

Functions#

constructor#

function constructor(
string name_,
string symbol_,
uint8 decimals_
) public

Deploys LPToken contract with given name, symbol, and decimals

the caller of this constructor will become the owner of this contract

Parameters:#

NameTypeDescription
name_stringname of this token
symbol_stringsymbol of this token
decimals_uint8number of decimals this token will be based on

mint#

function mint(
address recipient,
uint256 amount
) external

Mints the given amount of LPToken to the recipient.

only owner can call this mint function

Parameters:#

NameTypeDescription
recipientaddressaddress of account to receive the tokens
amountuint256amount of tokens to mint

_beforeTokenTransfer#

function _beforeTokenTransfer(
) internal

Overrides ERC20._beforeTokenTransfer() which get called on every transfers including minting and burning. This ensures that swap.updateUserWithdrawFees are called everytime.