Questions tagged [flash-loans]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
17 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
0answers
16 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
1answer
21 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://...
0
votes
0answers
8 views

Is it possible to borrow Asset X (let's say DAI) in a FLash Loan and reimburse the loan with Asset Y (let's say ETH) in AAVE?

Well I was wondering if it is possible to let's say borrow an asset in flash loan and then return the flash loan in a different asset on AAVE. For eg. I took a loan of 100 DAI and return the flash ...
1
vote
1answer
45 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
0answers
13 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
0answers
18 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
0answers
125 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" ...
0
votes
0answers
96 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
1answer
64 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
2answers
78 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
2answers
581 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
1answer
164 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
1answer
67 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
1answer
47 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
1answer
3k 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
0answers
42 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
1answer
124 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
1answer
343 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
1answer
164 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 ...
0
votes
0answers
28 views

ETHEREUM FLASHLOAN bXZ

I would like to compile this code and get a flashloan on bzX but it's getting me some errors. This is the code: pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; // "SPDX-License-...
1
vote
1answer
146 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
1answer
281 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 ...
2
votes
0answers
429 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
0answers
127 views

Weird problem with Dydx flashloan (smart contract)

I'm trying to create a smart contract capable o taking flashloans from Dydx, and I'm almost copy-pasting this sample code here: https://gist.github.com/cryptoscopia/1156a368c19a82be2d083e04376d261e ...
2
votes
1answer
419 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 ...
0
votes
0answers
22 views

Multplier Finance How to get the available reserves on mainnet and testnet

I am trying to conduct tests involving flash loans from multiplier.finance on the BSC testnet chain. I am trying to find out what the tokens with available reserves on the testnet lending pool. ...
1
vote
2answers
131 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 ...
0
votes
0answers
12 views

OpenZepplin contracts, is it good to go back to old contracts for solc 0.5

I am trying to use an existing contract which only works with pragma 0.5. I also use openZepplin contracts and I want to know if it is okey to go back to the old openZepplin contract that utilizes the ...
1
vote
1answer
240 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
0answers
230 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
1answer
205 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
0answers
132 views

Gas estimation error MCL flashloan (On bsc testnet)

I get this pop-up shows Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? every time I call flashloan. I directly ...
0
votes
0answers
175 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
1answer
259 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
1answer
228 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
1answer
48 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
1answer
458 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
0answers
249 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
0answers
556 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 ...
9
votes
1answer
1k 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 ...
1
vote
0answers
56 views

What causes re-entrancy attacks? [duplicate]

I’ve seen a lot of projects be hit with re-entrancy attacks caused by flash loans, what is the main process behind these attacks?
1
vote
1answer
120 views

Flash minting ether security considerations and attacks

Flash loans enable a class of attacks that have not been possible or observed as much in prior systems. Flash minting ether is a concept that is starting to be implemented. See Example of flash ...
8
votes
3answers
1k views

Flash loan security considerations and attacks

What do developers need to be aware of to make their contracts and systems safe against flash loans? What do they have to think about and protect against?
3
votes
0answers
242 views

Example of flash minting ether

The WETH10 project offers a flash minting feature. This contract allows to flashMint an arbitrary amount of Wrapped Ether, unbacked by real Ether, with the condition that it is burned before the end ...
1
vote
1answer
537 views

Flash loan compile error with function() external payable

I am attempting to compile a flash loan contract. I am having issues with the external payable function. I've tried adding fallback or receive as the error message suggests but I still receive the ...
1
vote
1answer
184 views

Flashloan callFunction being called internally

I had a chance to look at this contract. contract Flashloan is DyDxFlashLoan { uint256 public loan; constructor() public payable { (bool success, ) = WETH.call.value(msg.value)("&...