Build a postHook
// Creating Contract interfaces
// Approve the lending contract to spend the erc20
const erc20Interface = new ethers.utils.Interface(erc20Abi);
const approvalerc20 = erc20Interface.encodeFunctionData("approve", [
radiantLendingPoolAddress,
ethers.constants.MaxUint256,
]);
// Create contract interface and encode deposit function for Radiant lending pool
const radiantLendingPoolInterface = new ethers.utils.Interface(
radiantLendingPoolAbi
);
const depositEncodedData = radiantLendingPoolInterface.encodeFunctionData(
"deposit",
[
usdcArbitrumAddress,
"0", // Placeholder for dynamic balance
signer.address,
0,
]
);Last updated