Open queqoomts opened 2 years ago
// Withdraw async function withdraw() { const daiAmountinWei = web3.utils.toWei("2", "ether").toString() const daiAddress = "0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD" // kovan testnet DAI
try { // Make the borrow transaction via LendingPool contract const lpAddress = await getLendingPoolAddress() const lpContract = new web3.eth.Contract(LendingPoolABI, lpAddress) await lpContract.methods .withdraw(daiAddress, daiAmountinWei, myAddress) .send({ from: myAddress }) .catch((e) => { throw Error(`Error borrowing from the LendingPool contract: ${e.message}`) }) } catch (e) { alert(e.message) console.log(e.message) }
}`
`lpContract.methods.withdraw is not a function
// Withdraw async function withdraw() { const daiAmountinWei = web3.utils.toWei("2", "ether").toString() const daiAddress = "0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD" // kovan testnet DAI
}`