Open cesariomartins opened 2 years ago
hey dude, coud you resolve this? im having the same issue
I'm having the exact same issue
Ok, in my case I just changed:
token.transferFrom(address(this), owner(), balance);
to
token.transfer(owner(), balance);
And it worked... although both should be similar... I think
Another note: token.transferFrom(address(this), owner(), balance);
worked with Dai, but didn't work with USDC with aaveV2 contracts on ETH.
Ok, in my case I just changed:
token.transferFrom(address(this), owner(), balance);
to
token.transfer(owner(), balance);
And it worked... although both should be similar... I think
Do you have to implement this line after IERC20(asset).approve(address(POOL), amountOwing);
?
Ok, in my case I just changed:
token.transferFrom(address(this), owner(), balance);
to
token.transfer(owner(), balance);
And it worked... although both should be similar... I think
Do you have to implement this line after
IERC20(asset).approve(address(POOL), amountOwing);
?
Yes, you should always approve first from the contract that is initiating the transfer
token.transferFrom(address(this), owner(), balance);
I don't get you chief. On what line are you changing that piece of code? Please be clear.
I had the same problem but in my case I didn't have the right token in my contract. I was sending to my contract the Goerli LINK from the Chainlink documentation but instead I had to mint some aave-link from the aave contract. Then for the rest you should go as @EKami said.
Just declare an interface for the mint function
interface AAVE_LINK_INT { function mint(uint256 _wad) external payable; }
You can pass the address of the contract from the aave documentation (maybe on your constructor?)
AAVE_LINK = AAVE_LINK_INT(address(tokenAddres));
And finally just call the mint function to mint some aave token for your flashloan
AAVE_LINK.mint(5000000000000000000);
Obviously I used LINK but you can anther from the list.
Here's the link to aave's mintable contracts
I implemented a simple flashloan contract but keep getting the error "Fail with error 'ERC20: transfer amount exceeds balance'" (polygon mainnet) or "Fail with error '27'" (testnet), even with high balance from target token. It only works for very small amount like 0.0000001 WETH.
Can anybody help understand what is the issue here?
Tried to join discord but no success. Pls, advise if there is a better place for this kind of question. tks for the help