Created
July 10, 2020 10:53
-
-
Save alexroan/617dcf77b3bd210ad25b5e8f94679911 to your computer and use it in GitHub Desktop.
aave_full_deposit.js
This file contains hidden or 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
// Load the address provider | |
const providerInstance = new web3.eth.Contract(addressProviderABI, "0x24a42fD28C976A61Df5D00D0599C34c4f90748c8"); | |
// Get lending pool address | |
const lendingPoolAddress = await providerInstance.methods.getLendingPool().call() | |
.catch((e) => { | |
throw Error(`Error getting lendingPool address: ${e.message}`) | |
}); | |
// Load lending pool | |
const lendingPoolInstance = new web3.eth.Contract(lendingPoolABI, lendingPoolAddress); | |
// Deposit funds | |
lendingPoolInstance.methods.deposit( | |
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", supplyValue, 0).send({from: account, value: supplyValue}) | |
.once('transactionHash', (hash) => { | |
// transaction hash | |
}) | |
.on('confirmation', (number, receipt) => { | |
// number of confirmations | |
}) | |
.on('error', (error) => { | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment