PERC20

The PERC20 contract represents interest-bearing ERC20 tokens users receive when supplying assets to Peridot Protocol.


πŸ› οΈ Key Functions & Parameters

βœ… mint(uint mintAmount)

Deposit underlying ERC20 tokens into the protocol to receive PERC20 tokens.

  • Parameters:

    • mintAmount: Amount of underlying asset tokens to deposit.


βœ… redeem(uint redeemTokens)

Withdraw underlying tokens by redeeming your PERC20 tokens.

  • Parameters:

    • redeemTokens: Amount of PERC20 tokens to redeem.


βœ… redeemUnderlying(uint redeemAmount)

Withdraw an exact amount of underlying tokens.

  • Parameters:

    • redeemAmount: Exact amount of underlying tokens to redeem.


βœ… borrow(uint borrowAmount)

Borrows underlying assets from the market.

  • Parameters:

    • borrowAmount: Amount of underlying tokens to borrow.


βœ… repayBorrow(uint repayAmount)

Repays borrowed tokens to the market.

  • Parameters:

    • repayAmount: Amount of borrowed tokens to repay.


βœ… balanceOfUnderlying(address owner)

Shows the underlying asset balance for a user (includes interest accrued).

  • Parameters:

    • owner: User's wallet address.

  • Returns:

    • Current underlying balance including accrued interest.


πŸ“ˆ View Functions & Information

  • exchangeRateCurrent(): Fetches current exchange rate (PERC20 ↔ underlying).

  • getCash(): Retrieves total available liquidity of underlying asset.


This contract allows users to earn interest transparently and manage their asset positions securely.

Last updated