Questions tagged [flash-loans]
The flash-loans tag has no usage guidance.
57
questions
0
votes
1
answer
35
views
Flashloan Arbitrage error 'SafeERC20: low-level call failed'
So I finally am almost finished with my flashloan arbitrage how ever when I run it I get this error
'SafeERC20: low-level call failed'
here is my contract code
// SPDX-License-Identifier: MIT
pragma ...
1
vote
0
answers
24
views
How to Flash-Swap on UniswapV3
i need some help .I have already deployed the "pair flash" contract with hardhat , on uniswapV3 , now i need to know the function to call . Thanks !
https://docs.uniswap.org/protocol/guides/...
0
votes
0
answers
20
views
Can i use the data returned from 1inch's api swap, to perform a swap from a smart contract? (i.e for flashloans)
I'm trying to use the data returned from 1inch's Swap API endpoint, to essentially perform a swap from a smart contract instead of from an EOA. The old oneSplit contract provided an easy way to do ...
0
votes
0
answers
82
views
Pancakeswap Flashswap contract failing
I am new to Solidity and wanted to create a smart contract that that does a flash swap on Pancakeswap (BSC) and then arbitrages a pool that is based on Balancer V2.
When executing I get the following ...
0
votes
0
answers
69
views
Swap call to 0x contract failing
I am trying to build an arbitrage bot (learning) using AAVE flashloans, 0x and 1 Inch exchange swaps. While my flashloan call is successful but swap call to 0x exchange fails and revert '...
0
votes
0
answers
115
views
How to test out the flash loan arbitrage smart contract on BSC network?
I am in learning flash loan from PancakeSwap, I would like to know what is the better way to test out my flash loan arbitrage smart contract before deploying to BSC mainnet?
If I enter all real world ...
0
votes
0
answers
47
views
Flash Loan Transaction Pattern
I am trying to understand Flash loan and identify the patterns for those transactions. In my research, I found out that Uniswap Flash loan transactions can be identified from mainly three criteria.
(1)...
1
vote
1
answer
198
views
How does flashloan guarantee the borrowed ether/token will be paid back?
I'm wondering how does the contract ensure the borrowed money will be paid back? Can anyone provide an example?
0
votes
1
answer
76
views
[Brownie]: Aave Flashloan - Calling lending.pool.borrow() does not actually borrow
My code run successfully without errors, but it never does actually borrow anything from Aave when i call lending_pool.borrow(). Tried running this on both a mainnet-fork into local environment, as ...
0
votes
0
answers
52
views
ParserError: Expected '{' but got reserved keyword 'override' ) external override returns (bool) { ^------^
can someone fix the code problem below?
i compile in remix.ethereum.org , it show ParserError: Expected ';' but got '}'
} external override
enter code here`pragma solidity 0.5.8;
/**
Ropsten ...
0
votes
1
answer
249
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
0
answers
14
views
Latest Subgraph query
How to get the latest subgraph of pancakeswap ? I have tried with the below link but it is not working fine
go to this link
1
vote
1
answer
454
views
Which tokens can be borrowed from dYdX?
Is there a list of tokens that can be borrowed from dYdX for a flashloan? I assume it can be any of their supported Ethereum tokens but I'm having troubles finding a complete list of what they support....
1
vote
0
answers
62
views
Truffle test throws an error in "before each" hook
Developing a flash loan which i use truffle to test my code,
david@LAPTOP-3KIH2P0K:/mnt/c/pr0/flash/FlashloanLeveragedYieldFarm$ truffle test
Using network 'development'.
Compiling your contracts...
=...
1
vote
2
answers
109
views
Newbie with questions about Flash Loans
I am a newbie to flash loans and I am grateful if you could answer my questions below
Can one hundred thousand people flash loan the same crypto currency pair at the same time?
When doing a flash ...
1
vote
1
answer
68
views
Is this video a scam? I want to get into flashloans
Can anyone confirm if this video is a scam or if the code he uses will actually work?
I want to get into Flashloans so if anyone can provide good resources for learn that would be great!
https://www....
0
votes
1
answer
228
views
BSC Flashloan getting Pancake:Locked
im trying to get a flashloan in pancakeswap - BSC, but i'm getting locked from the locked modifier in the pair:
modifier lock() {
require(unlocked == 1, 'Pancake: LOCKED');
unlocked = 0;
_;...
0
votes
0
answers
48
views
How can a DEX protect itself against flash loan attacks?
How can a DEX protect itself against flash loan attacks?
I've seen this code inside a function:
require(msg.sender == tx.origin, "probably a flash loan tx")
Is it effective?
Are there other ...
1
vote
1
answer
254
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
1
answer
170
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
0
answers
63
views
<UnknownContract> when calling call trace in brownie console
I'm using Ganache + brownie and having trouble generating a meaningful call trace on "mainnet-fork". How do I go about resolving this?
I believe it has to do with a USDC contract I am ...
0
votes
0
answers
34
views
Transaction has Input but no Output. Can someone help me understand why this transaction is failing on the function call?
Here is the transaction: https://dashboard.tenderly.co/tx/mumbai/0x313c030fc42bd727cd72735475f365c25e6a59340a90bfee5ef2e80e6e3a20d6/debugger
This is a call to a trade function on an already deployed ...
1
vote
0
answers
395
views
Running a flashloan arbitrage contract on Quickswap but I keep getting a 'VirtualMachineError: revert' error with no other details
I assume that this means the transaction works but the profit margin isn't high enough to pay back the loan. But unlike the Uniswap errors that have an output like "INSUFFICIENT LIQUIDITY" ...
2
votes
1
answer
209
views
Why I need smart contract for arbitrage
To make arbitrage between two defis why i need a smart contract? web3py or web3js can interact with defi smart contracts. A script can monitor price difference and if find arbitrage opportunity script ...
1
vote
1
answer
105
views
How haven't flash loans completly destabilized the ethereum blockchain?
Now bare with me here, I might have kinda misunderstood what a flashloan actually is. Internet tells me that it's a type of uncollaterized lending, where a smart contract takes money out of a pool, ...
0
votes
2
answers
194
views
Solidity Expected '(' but got identifier
So I am working on a flash loan arbitrage in solidity and was coding the arbitrage logic when I got hit with
Expected '(' but got identifier
here is the code for the arbitrage
function startArbitrage(
...
1
vote
2
answers
3k
views
How to Tranfer Remaining NFTs And/Or Tokens Out of A Hacked Ethereum Wallet
I have a friend who got hacked recently. The hacker drained all of the valuable NFTs and ERC-20s out of the wallet. The hacker did leave some NFTs of lower value in the wallet. The victim of the hack ...
1
vote
1
answer
450
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....
0
votes
1
answer
152
views
How are UniSwap V2 flash swaps recorded
Are UniSwap V2 flash-swaps stored the same way "normal" swaps are stored? I.e. are they recorded under the "Swap" event on the blockchain?
Context:
I'm trying to reproduce the ...
0
votes
1
answer
56
views
How does the value of an NFT is calculated as a loaning asset?
I’ve been thinking, could it be that the very high NFT prices is an economic trick?
In other words, is this scenario possible:
-Alice have X value
-So, Alice hires Bob off-chain to submit a rubbish ...
0
votes
1
answer
4k
views
How to conduct a flash loan on PancakeSwap?
Apparently it's possible to take a flash loan on PancakeSwap, being that it's a fork of Uniswap. However, I haven't found any examples anywhere of a flash loan on PancakeSwap, nor do the docs mention ...
0
votes
0
answers
48
views
How do I inject swap site router logic inbetween my flashloan logic?
I need to use my borrows assest on exchange A to then transact on exchange B before repaying my flash loan. How do I interact with a swap sites router? Please forgive as I am very new to programing.
...
0
votes
1
answer
300
views
Struct on delegatecall
Is it possible to pass a struct as an argument to delegatecall ?
I have this function that calls delegatecall and takes a struct (a 0x quote) as an argument which is later used on the function ...
1
vote
1
answer
625
views
Is it still possible to ARB profitably across DEX exchanges (flashloans)?
I've followed some flash loan samples and explored scripts that scan common token pairs for arb opportunities across UNISWAP/KYBER and so far I haven't even seen any arb opportunities arise.
has all ...
0
votes
1
answer
418
views
Member "concat" not found or not visible after argument-dependent lookup
I'm trying to concatenate a series of strings but I'm getting the following error:
TypeError: Member "concat" not found or not visible after argument-dependent lookup in bytes storage ...
1
vote
1
answer
369
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
567
views
Gas Estimation Failed while Calling a Smart Contract Function
I have deployed a Flash Loan Arbitrage smart contract on BSC Testnet. I then loaded 1 BNB on smart contract now when I call a function of Smart Contract it gives me the following error.
"Gas ...
3
votes
1
answer
738
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'....
2
votes
1
answer
794
views
Abitrage with dydx flash loan always reverted
I have a smart contract that get flashLoan from dydx and arbitrage between Kyber and Uniswap. I have another javascript code that wait for a good opportunity between this tow dexes.
If there is an ...
1
vote
2
answers
187
views
How do flash loans work?
I am quite new to flash loans and I do not fully understand it. I have been reading on flash loan attacks lately and notice oftentimes it involves a huge dump on Uniswap to skew the price of a coin. I ...
1
vote
1
answer
341
views
Is this smart contract code malicious?
I was looking at the code here:
https://0bin.net/paste/Y0Vas-gl#qPO+In23eGFEftdhXP7hWqIkI2xfyqxEbyjL-beMsLH
which is shown in a tutorial about flash loans:
https://www.youtube.com/watch?v=o9o141Luzzo&...
0
votes
0
answers
290
views
Gas estimation failed -- flashloans -- solidity
I am able to deploy a smart contract, and even fund it with WETH from my metamask wallet without any gas estimation failures. When I try to execute my flashloan on this smart contract, however, I get ...
1
vote
1
answer
309
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 ...
0
votes
0
answers
229
views
Gas estimation failed when trying to get flashloan from Multiplier (on bsc)
I get a pop-up window every time when calling flashloan function says
Gas estimation errored with the following message (see below). The
transaction execution will likely fail. Do you want to force ...
0
votes
1
answer
390
views
Flash loan price manipulation
I am quite new to flash loan and I don't fully understand it. I've been reading on flash loan attacks lately and notice often times it involves a huge dump on Uniswap to skew the price of a coin. I am ...
1
vote
1
answer
279
views
Can a flash loan used to flash attack a smart contract?
I am new to flash loans. Let us say I have smart contract where people vote. Your voting power on this contract is based on how many token x you have. The votes are yes and no and the vote with more ...
1
vote
1
answer
60
views
What time Ethereum gas fee is calculated?
When is Ethereum gas fee calculated during execution of contract. I was wondering if i take out flash loan and if the trade happened to be profitable, will the profit be able to offset transaction ...
3
votes
1
answer
685
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
339
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
651
views
ETH2 Atomic Composability and Sharding: What does it really mean for DeFi users?
In the following post, Vitalik Buterin claimed that ETH2-Sharding will not break DeFi composablity:
[1] https://ethresear.ch/t/cross-shard-defi-composability/6268
However, I am not at all convinced by ...