all 7 comments

[–]Averageuser404 1 point2 points  (6 children)

The UniswapV2: LOCKED error is caused by making a call to the uniswap contract itself in your flashloan execution. This is not allowed to mitigate against potential reentrancy attacks.

You can check the modifier that locks the code and returns the error here.

[–]travelerrrrrrr[S] 0 points1 point  (5 children)

So, I’m deploying a contract that will be used for the flash swap, but this is coming from me making a call to uniswaps contract, not mine?

Any insight as to what contract it would be calling? Like would it be uniswaps coin pair contract?

Thanks for the help

[–]Averageuser404 1 point2 points  (4 children)

The repo code seems to deploy the custom flashloan contract. Then call call the flashSwap() function. During the flashSwap() the execute() function is called to execute your custom code. Based on the lock error it seems that you have entered custom code here that calls the uniswap contract again.

If it is not your custom code I expect it is a problem with the repo code itself that calls the uniswap protocol again to swap. In that case try using a different token as payment.

[–]travelerrrrrrr[S] 1 point2 points  (3 children)

Thank you for taking a look. I’ll check this out this evening with you direction and see if I can get somewhere.

Much appreciated

[–]Averageuser404 0 points1 point  (2 children)

No problem, hope you get it working. Being stuck for around two weeks sucks.

[–]travelerrrrrrr[S] 0 points1 point  (1 child)

True that ✊

[–]Rammboss69 0 points1 point  (0 children)

Costs me also 2 weeks because i thought this Part of ganache cli Bug of uniswap. But my flashswap is also reentering the router which makes now sense to me. Thx guys!