Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

fallback return value "bytes memory" isn't asigned, #39

Open
FinagleLord opened this issue Aug 18, 2021 · 2 comments
Open

fallback return value "bytes memory" isn't asigned, #39

FinagleLord opened this issue Aug 18, 2021 · 2 comments

Comments

@FinagleLord
Copy link

FinagleLord commented Aug 18, 2021

fallback(bytes calldata _input) external returns (bytes memory) { (address sender, uint256 amount0, uint256 amount1, bytes memory data) = abi.decode(_input[4:], (address, uint256, uint256, bytes)); uniswapV2Call(sender, amount0, amount1, data); }

would this be a solution?

fallback(bytes calldata _input) external returns (bytes memory) { (address sender, uint256 amount0, uint256 amount1, bytes memory data) = abi.decode(_input[4:], (address, uint256, uint256, bytes)); uniswapV2Call(sender, amount0, amount1, data); return data; }

@FinagleLord
Copy link
Author

in the solution i just added "return data;" at the end

@FinagleLord FinagleLord changed the title return value "bytes memory" isn't asigned, fallback return value "bytes memory" isn't asigned, Aug 18, 2021
@AlvaroG9
Copy link

AlvaroG9 commented Aug 21, 2021

I have tried, but when making the call to "flashArbitrage", it gives me a "fail" when executing the contract. If we edit the invocation line:

"IUniswapV2Pair (info.lowerPool) .swap (amount0Out, amount1Out, address (this), data);"
by:
"IUniswapV2Pair (pair0) .swap (amount0Out, amount1Out, address (this), data);"

I am able to move forward a bit but it gives me a pancake error "Fail with error 'Pancake: LOCKED'"

Any solution?

PD: TESTNET BSC

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants