PToken
Implementation of the interest bearing token for the ParaSpace protocol
PERMIT_TYPEHASH
PTOKEN_REVISION
_treasury
_underlyingAsset
getRevision
Returns the revision number of the contract
Needs to be defined in the inherited class as a constant.
Return Values
constructor
Constructor.
Parameters
initialize
Initializes the pToken
Parameters
mint
Mints amount
xTokens to user
Parameters
Return Values
burn
Burns xTokens from user
and sends the equivalent amount of underlying to receiverOfUnderlying
In some instances, the mint event could be emitted from a burn transaction if the amount to burn is less than the interest that the user accrued
Parameters
mintToTreasury
Mints xTokens to the reserve treasury
Parameters
transferOnLiquidation
Transfers xTokens in the event of a borrow being liquidated, in case the liquidators reclaims the xToken
Parameters
balanceOf
Returns the amount of tokens owned by account
.
totalSupply
Returns the amount of tokens in existence.
RESERVE_TREASURY_ADDRESS
Returns the address of the ParaSpace treasury, receiving the fees on this xToken.
Return Values
UNDERLYING_ASSET_ADDRESS
Returns the address of the underlying asset of this xToken (E.g. WETH for pWETH)
Return Values
transferUnderlyingTo
Transfers the underlying asset to target
.
Used by the Pool to transfer assets in borrow(), withdraw() and flashLoan()
Parameters
handleRepayment
Handles the underlying received by the xToken after the transfer has been completed.
The default implementation is empty as with standard ERC20 tokens, nothing needs to be done after the transfer is concluded. However in the future there may be xTokens that allow for example to stake the underlying to receive LM rewards. In that case, handleRepayment()
would perform the staking of the underlying asset.
Parameters
permit
Allow passing a signed message to approve spending
implements the permit function as for https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md
Parameters
_transfer
Transfers the pTokens between two users. Validates the transfer (ie checks for valid HF after the transfer) if required
Parameters
_transfer
Overrides the parent _transfer to force validated transfer() and transferFrom()
Parameters
DOMAIN_SEPARATOR
Overrides the base function to fully implement IPToken see IncentivizedERC20.DOMAIN_SEPARATOR()
for more detailed documentation
nonces
Overrides the base function to fully implement IPToken see IncentivizedERC20.nonces()
for more detailed documentation
_EIP712BaseId
Returns the user readable name of signing domain (e.g. token name)
Return Values
rescueTokens
Rescue and transfer tokens locked in this contract
Parameters
getXTokenType
return token type`of xToken