Created
April 15, 2020 08:43
-
-
Save AndonMitev/84ef93f5a9dd58b8d82f6da93ed68c6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
const lpCoreAddress = await getLatestLpCoreAddress(); | |
const contract = new ethers.Contract(lpCoreAddress, LendingPoolABI, provider.getSigner()); | |
const daiContract = new ethers.Contract(daiAddress, DaiTokenABI, provider.getSigner()); | |
const daiAmountInWei = ethers.utils.parseEther('1000000000000000000000000000000000000000000'); | |
const a = await daiContract.approve(lpCoreAddress, daiAmountInWei); | |
const result = await contract.deposit(daiAddress, daiAmountInWei, referralCode); | |
console.log('r', result); | |
} catch (error) { | |
console.log('error deposit dai', error); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment