Last active
February 16, 2020 17:12
-
-
Save ajb413/29b8332fdcf683bfab2624d227193ed1 to your computer and use it in GitHub Desktop.
Supply DAI to Compound snippet
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
console.log('Now transferring DAI from my wallet to MyContract...'); | |
let transferResult = await daiContract.methods.transfer( | |
myContractAddress, | |
web3.utils.toHex(10e18) // 10 DAI to send to MyContract | |
).send({ | |
from: myWalletAddress, | |
gasLimit: web3.utils.toHex(150000), // posted at compound.finance/developers#gas-costs | |
gasPrice: web3.utils.toHex(20000000000), // use ethgasstation.info (mainnet only) | |
}); | |
console.log('MyContract now has DAI to supply to the Compound Protocol.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment