Borrow
Type
Name
Description
async function borrowUSDC(amount) {
// USDC has 6 decimal places
const USDCDecimals = await USDC.decimals();
const amountInUsdcUnits = ethers.utils.parseUnits(amount.toString(), USDCDecimals);
// Borrow USDC
const borrowTx = await cUSDC.borrow(amountInUsdcUnits);
const receipt = await borrowTx.wait();
console.log(`Successfully borrowed ${amount} USDC`);
return receipt;
}Error Handling
Last updated
Was this helpful?