๐ฆCore Market Integration
Prerequisites
Step 1: Supply Assets
MErc20 mToken = MErc20(0x...); // e.g. Moonwell USDC
EIP20Interface underlying = EIP20Interface(mToken.underlying());
uint supplyAmount = 1000e6; // 1,000 USDC
// Approve the mToken to pull underlying
underlying.approve(address(mToken), supplyAmount);
// Mint mTokens - returns 0 on success
uint err = mToken.mint(supplyAmount);
require(err == 0, "mint failed");Step 2: Enable as Collateral
Step 3: Borrow
Step 4: Repay and Withdraw
Step 5: Query Positions
Step 6: Claim Rewards
Error Handling
Full Example
Deployed Addresses
Last updated

