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
const reserveData = await lendingPool.methods.getReserveData("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE").call() | |
.catch((e) => { | |
throw Error(`Error getting aave reserve data: ${e.message}`) | |
}); | |
const aTokenAddress = reserveData.aTokenAddress; |
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 |
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
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); |
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
const lendingPoolInstance = new web3.eth.Contract(lendingPoolABI, lendingPoolAddress); |
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
const lendingPoolAddress = await providerInstance.methods.getLendingPool().call() | |
.catch((e) => { | |
throw Error(`Error getting lendingPool address: ${e.message}`) | |
}); |
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
const providerInstance = new web3.eth.Contract(addressProviderABI, "0x24a42fD28C976A61Df5D00D0599C34c4f90748c8"); |
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
pragma solidity ^0.5.0; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
contract Tree { | |
using SafeMath for uint; | |
struct User { | |
address payable inviter; |
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
pragma solidity ^0.5.0; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
contract Doubler { | |
using SafeMath for uint; | |
address payable public owner; | |
struct User { | |
address payable addr; | |
uint amount; |
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
export const supplyEth = async (dispatch, cEthInstance, account, supplyValue, web3, network) => { | |
cEthInstance.methods.mint().send({from: account, value: supplyValue}) | |
.once('transactionHash', (hash) => { | |
dispatch(depositing()); | |
}) | |
.on('confirmation', (number, receipt) => { | |
if (number < 4){ | |
dispatch(depositConfirmation(number+1)); | |
if (number === 3) { | |
dispatch(finishedDepositing()); |
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
import { RampInstantSDK } from '@ramp-network/ramp-instant-sdk'; | |
new RampInstantSDK({ | |
hostAppName: 'Maker DAO', | |
hostLogoUrl: 'https://cdn-images-1.medium.com/max/2600/1*nqtMwugX7TtpcS-5c3lRjw.png', | |
variant: 'auto', | |
}).show(); |