Questions tagged [aave]
The aave tag has no usage guidance.
90
questions
1
vote
1
answer
656
views
Issue implementing and testing aave V3 flash loan
I'm trying to implement a flash loan using aave-v3 flash loan contracts. and when testing using hardhat I get this error:
Error:
Transaction reverted: function returned an unexpected amount of data
...
0
votes
2
answers
623
views
How to deposit ETH in AAVE v3 testnet WETHgateway.depositETH()
My goal: AAVE v3, deposit ETH, and borrow DAI
I played around with AAVE in lesson 10 of the Solidity, Blockchain, and Smart Contract Course, and as long as I stick to the course and use the v2 code ...
0
votes
3
answers
423
views
AttributeError - 'InterfaceContainer' object has no attribute
from brownie import config, network, interface
from scripts.helpful_scripts import get_account
from scripts.get_weth import get_weth
def main():
account = get_account()
erc20_address = config[...
0
votes
0
answers
129
views
Error depositing matic to Aave WEHTGateway in polygon mumbai test net
I'm testing out Patric Collins youtube video and trying to test it in polygon testnet Mumbai but I when I try to deposit eth/matic to Aave Wethgateway I face this error:
File "C:\Users\...
1
vote
1
answer
1k
views
What could go wrong if I change the version pragma of a third-party contract to make it importable with a newer Solidity compiler?
What are the consequences of changing compiler versions in dependency contracts to the same version as the main contract?
I have one main contract that inherits some other contracts to interact with ...
1
vote
1
answer
636
views
How to correctly import aave/flashloan-box in Remix IDE
I was following the step-by-step guide, and since there is only the main code, I've tried with the following imports
pragma solidity 0.6.12;
import { FlashLoanReceiverBase } from "https://...
1
vote
2
answers
2k
views
Is there any way to find the Aave health factor for a given address (not mine) at a given block?
Is there any way to find the Aave health factor for a given address (not mine) at a given block?
e.g. Find out the exact “health factor” for the address 0x0000006daea1723962647b7e189d311d757Fb793 at ...
4
votes
1
answer
1k
views
How to import Aave and Uniswap contracts from a 0.8.x Solidity contract
So I have some smart contracts with version pragmas set to 0.8.0, my Truffle config's solc is set to 0.8.2 and everything compiles except for some imported contracts from Aave and Uniswap.
This is ...
0
votes
1
answer
28
views
Why is this transaction showing value as 0?
New to crypto.
I see in the erc20 tokens column that there are some SNX tokens.
SNX was converted to aSNX then it was supposedly transferred to another wallet. But when I check that wallet there is no ...
0
votes
0
answers
266
views
Pending transactions remain pending forever?
I have a pending transaction stucked for more than 24 hours. I have receive advice on how to cancel it already so please do not answer me that advice again. Because it hasn't worked for me.
Now my ...
1
vote
1
answer
343
views
Approving tokens after flash loan
I'm creating a smart contract that can both make flash loans and swap tokens via 0x. I can call the flash loan and token swap functions just fine, but when I try to call the token swap within the ...
0
votes
1
answer
149
views
Get AAVE LendingPool address using Vyper interface contract
I'm at the very early stages of trying to understand how to send coins to AAVE. I've coded the following which is the first step to get the pool address from the proxy contract.
from vyper.interfaces ...
1
vote
1
answer
33
views
Distribution coefficient
I'm building a dapp and I need some help with creating the formula for a "distribution coefficient/index" (my math is rusted). The idea behind it is:
There's a total balance. Let's call it &...
2
votes
1
answer
59
views
Aave's gas consumption on state modification
On every action from LendingPool (deposit, withdraw, repay, borrow, etc), Aave updates its entire state for certain variables, including the aToken balances of each user holding aTokens.
How can Aave ...
1
vote
1
answer
742
views
Getting a compile error every time I try to compile a contract with Brownie that includes an import statement from the web
I have a contract that starts with the following import statements:
import 'https://github.com/aave/protocol-v2/blob/master/contracts/flashloan/base/FlashLoanReceiverBase.sol';
import 'https://github....
1
vote
1
answer
974
views
Retrieving Matic Reward Rates on AAVE with a Python script
I am trying to build a Python script to retrieve different AAVE rates programmatically (borrow, lending, and rewards), on the Polygon blockchain (will be very similar for Ethereum). I am using Python.
...
0
votes
1
answer
476
views
How to withdraw rewards with aave's LendingPool?
Let's say a contract deposits money into Aave with LendingPool.deposit(). After a while, we use LendingPool.withdraw(). Will it withdraw all rewards and interest? It doesn't seem so?
https://docs.aave....
1
vote
1
answer
1k
views
Transaction Reverted when attempting to withdraw from aave
I got an example running which deposits the Aave token into Aave. I'm using the Code Contracts examples provided by Aave v2 github
// Fork Kovan
await hre.network.provider.request({
method: '...
2
votes
0
answers
424
views
Simple Contract to supply eth to aave
I'm trying programatically deposit using into Aave V2 Contract Aave's Code Examples
// SPDX-License-Identifier: MIT
pragma solidity >= 0.4.22 < 0.8.7;
import { IERC20, ILendingPool, ...
0
votes
1
answer
34
views
How does Aavegotchi attach wearable NFTs to gotchi NFTs?
Aavegotchi (and presumably many other NFT games) have different types of NFTs, some of which can be attached to others.
For example:
An Aavegotchi ghost, or gotchi, is an NFT with attributes that ...
1
vote
1
answer
486
views
How do I claim rewards on polygon aave with smart contract?
What is the function to claim rewards on polygon aave? I can't seem to find it in its docs.
Thanks!
0
votes
1
answer
630
views
Aave deposit function on polygon says execution reverted
I have here a contract where I can deposit dai into the aave lending pool. I am able to deposit it, but unable to withdraw. Here is the contract:
// dai
ERC20 public TOKEN = ERC20(...
1
vote
1
answer
748
views
Failing to borrow from Aave's Lending Pool
I'm trying to borrow USDC from Aave v2's lending pool through an interface, but I can't manage to do it:
My contract:
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import './interfaces/...
0
votes
1
answer
2k
views
How can I acquire some ERC20 tokens to test AAVE on mumbai testnet?
I need to acquire some DAI or other assets which are supported by AAVE on Mumbai testnet to test my smart contract, but it seems that the AAVE faucet on their site is broken and does not work! (I ...
3
votes
2
answers
1k
views
Flashloan error `reverted with reason string 'SafeERC20: low-level call failed'`
I'm attempting to execute a flashloan on a forked mainnet within hardhat and am getting Error: VM Exception while processing transaction: reverted with reason string 'SafeERC20: low-level call failed'....
0
votes
1
answer
254
views
Aave Flashloan `reverted with reason '73'`
I'm getting an error when attempting to execute an Aave V2 Flashloan within a Hardhat-mocha test while connected to a fork of the Kovan network. It's unclear to me what revert reason "73" ...
1
vote
1
answer
560
views
How does flash loan lender know you are not able to pay it back?
Basically I am wondering how does it know when the loan is not paid back. I understand this is easy to check but how can it revert the transaction?
For example let's say I borrow 1M USDT, and then I ...
3
votes
0
answers
45
views
Why borrow DAI from compound has lower rate than borrow USDT?
As shown in the figure, borrowing Tether from compound have 10.73% APY, while borrow DAI from compound only have 4.64%.
However, we can exchange DAI or USDC to Tether in any exchange very easily, so ...
1
vote
0
answers
54
views
AAVE Protocol v1 issue on reserve addresses with compound ctoken addresses
https://kovan.etherscan.io/tx/0xa7f5e857d1a9ecb4aca0714b24a70ca0942cc1a656c8e09b6d01bab9af4ec9e5
I am trying to make a transaction from DSProxy (Smart Wallet) on a contract
https://kovan.etherscan.io/...
0
votes
1
answer
250
views
aAAVE (Atoken) accidently transferred from Metamask wallet to exchange AAVE wallet - HELP PLEASE! [closed]
Really hoping someone here can help.
I have AAVE being used as collateral on AAVEV2 as I borrowed some USDC at very low LTV. I use metamask to connect to AAVE and in my wallet you can see aAAVE (...
1
vote
2
answers
724
views
Is there any version of AAVE protocol deployed on polygon/matic testnet?
As AAVE documentation suggests, there is a deployed version of the protocol on matic/polygon mainnet. However, it does not make any mention of those smart contracts on Mumbai testnet which I need to ...
2
votes
1
answer
87
views
Calculating AAVE intereset rate belonging to different users that transferred into a smart contract
I have a smart contract that accepts user funds and adds them to an AAVE lending pool (DAI for example). Something like this:
lendingPool.deposit(stableCoinAddress, amount, address(this), 0);
As you ...
1
vote
1
answer
573
views
Getting current user balance of an aToken for a specific asset in AAVE v2 protocol
As AAVE protocol V2 documentation says:
aTokens are interest-bearing tokens that are minted and burned upon deposit and withdraw. The aTokens' value is pegged to the value of the corresponding ...
4
votes
1
answer
1k
views
Double Flash Loan
Looking into Flash Loans, is it possible to take out TWO at once (aave/dydx/uniswap)? How would you go about doing this?
Here is what I'm thinking of, but it seems too complicated:
Contract 1 takes a ...
1
vote
0
answers
1k
views
Does the gas limit for AAVE transactions need to be so high?
There are two parts to the fee you pay for an Ethereum transaction - gwei and gas limit. Gwei is determined by how competitive (ie, congested) the Ethereum network is. As most people are aware, the ...
1
vote
0
answers
474
views
Cant receive wETH to my contract after swap on uniswap
I write a simple contract to do a flash loan from aave and interact with uniswap in it. I found out that no wETH is sent to my contract after swaping on uniswap. Transcations are here: https://kovan....
1
vote
0
answers
57
views
Presign transaction to later publish with aave
Is it possible to have pre-signed tx that I could publish to close a position with aave.
Let's imagine I have 0.1 wbtc deposited with aave and I borrow 1000 usdt. I can close my position from the ...
2
votes
1
answer
434
views
why aave total supply not equal to circulation supply?
I'm new to the blockchain world. I'm trying hard to understand how tokens are generated and I learned that the tokens are not minable, unlike bitcoin or eth coins. also learned that these tokens only ...
16
votes
2
answers
5k
views
Explain "griefing" attack on Aave flash loan
Aave doc about flash loan warns to never store funds inside a receiver contract as it can be exposed to "griefing" attack.
So my questions are
Can you give an example of this attack?
How ...
5
votes
0
answers
4k
views
Contract call: data out of bounds
I'm working on a nextjs/react project in which i want to fetch the health factor of an address on AAVE. This can be done by calling getUserAcountData(address) on the lending pool contract. I can ...