LogoLogo
  • Discover
    • 🌜About Moonwell
    • 👥Contributors
    • 🌐Networks
    • 🔗Quick Links
  • Moonwell Overview
    • 🌙Getting Started
      • Wallet Connection
    • 🤝Lend
      • Supply
      • Withdraw
      • Claiming Rewards
      • Lend FAQ
    • 🤝Borrow
      • How to Borrow
      • Loan Repayment
      • Credit and Liquidations
      • Borrow FAQ
    • 🏦Vaults
      • Interacting with Morpho Vaults
      • Fund Wallet and Deposit
    • 🌐Virtual Accounts
      • Create Virtual Account
      • Accessing Virtual Account
      • FAQ
    • 🦋Isolated Markets
      • Interacting with Isolated Markets
    • 💲USDC Anywhere
      • Supply USDC
      • Borrow USDC
    • 💳Moonwell Card
      • Get Started
      • Load and Spend
      • Auto Load
      • FAQ
    • 💡Smart Wallet
      • Create
      • Connect
      • Getting Started
    • 🌙Tokens
      • WELL Transparency Report
      • WELL Transfer
      • WELL Migration (Base)
      • MFAM Transparency Report
    • 🫂Stake
      • How to Stake
      • How to Unstake
      • Claim Staking Rewards
  • Governance
    • 🗳️Moonwell Governance
      • 🪙Delegate
      • 📜Proposals
      • 🗳️Voting
      • 🔢Parameters
      • ❔FAQ
      • 📜DAO Constitutions
        • Moonwell DAO Constitution
        • Moonwell Apollo DAO Constitution
      • 🗣️Forum
    • 🏛️Moonwell Foundation
      • 🏦Treasury
      • 🔒Security Council
      • 📃Governing Documents
        • Foundation Bylaws
        • Foundation M&A
  • Protocol Information
    • ‼️Protocol Information
    • 📊Asset Risk Parameters
    • 📈Interest Rate Curves
    • ⚖️Reserve Auctions
    • 🛡️Security
    • 🔎Audits
    • 📜Contracts
    • 🖊️Terms of Service
  • Developers
    • 🪙mTokens
      • 📝Contract Interactions
    • 👮‍♀️Comptroller
      • 📝Contract Interactions
      • 🚦Risk Parameters
      • 🛡️Guardian Roles
    • 🏦4626 Vaults
      • 👷‍♂️ERC20 Vault Deployment
        • 🗒️4626 ERC20 Vault Interface
      • 👷‍♀️ETH Vault Deployment
        • 🗒️4626 ETH Vault Interface
        • 📍4626 ETH Router
    • 💻Moonwell SDK
    • 🔨Contribution Guidelines
Powered by GitBook
On this page
  • Public Functions
  • Mint
  • Redeem
  • RedeemUnderlying
  • Borrow
  • RepayBorrow
  • RepayBorrowBehalf
  • LiquidateBorrow
  • SweepToken
  • AddReserves
  • BalanceOfUnderlying
  • GetAccountSnapshot
  • BorrowRatePerTimestamp
  • SupplyRatePerTimestamp
  • TotalBorrowsCurrent
  • Standard ERC-20 Functions
  • Admin Functions
  • SetPendingAdmin / AcceptAdmin
  • ReduceReserves
  1. Developers
  2. mTokens

Contract Interactions

PreviousmTokensNextComptroller

Last updated 9 months ago

Public Functions

This function is responsible for taking in ERC20 tokens or native assets and dispatching mTokens which represent the supplied position

This function is responsible for taking in mTokens and sending out the underlying asset back to the caller

Works exactly like Redeem, but instead allows you specify the amount of underlying tokens you'd like back (saving you from having to calculate/use the mToken exchangeRate)

Borrows a specific amount of assets from the protocol - only allowed if you have supplied (minted) collateral and called enterMarket with it, and you have sufficient liquidity to borrow the requested asset

Repays a borrow position the caller owns within the market

Repays a borrow position on behalf of someone else

Liquidates a borrower's position who is underwater/has a heath factor below 1.

Sweeps accidentally sent ERC-20 tokens to the protocol admin

Add a specified amount of liquidity to the protocol's reserves

Get the balance of an mToken holder denominated in the underlying asset instead of the mToken balance (accruing interest and calculating the balance from the exchange rate)

Gets a user's mTokenBalance, borrowBalance, and exchangeRateMantissa - useful for determining a user's current positions

Gets the borrower side interest rate per second on a specific market

Gets the supplier side interest rate per second on a specific market

Gets the total amount of outstanding borrows for a market

mTokens are ERC-20 complaint, so they expose the same interface around transfer, balanceOf, etc as any other ERC-20 token

Admin Functions

Only the protocol admin can call these functions!

A two step process to transfer admin control to an address

Withdraw reserve liquidity to the admin address

🪙
📝
Mint
Redeem
RedeemUnderlying
Borrow
RepayBorrow
RepayBorrowBehalf
LiquidateBorrow
SweepToken
AddReserves
BalanceOfUnderlying
GetAccountSnapshot
BorrowRatePerTimestamp
SupplyRatePerTimestamp
TotalBorrowsCurrent
Standard ERC-20 Functions
SetPendingAdmin / AcceptAdmin
ReduceReserves