-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting UniswapV2: LOCKED exception #44
Comments
That error indicates reentrance. Is the token you are trying to swap calling into Uniswap on its transfer function? |
This is a common issue with the ganache fork chain, for some reason the locked state is not correct. I would recommend deploying to your own test chain |
@MicahZoltu no, it's a plain old ERC20 @moodysalem have you encountered it before? seems a bit of an overkill deploying the whole uniswap project just for simple tests.. |
@alonmuroch only via the discord questions, I haven't encountered it myself, but you only have to deploy the uniswap factory and router. I would recommend a local testnet over a mainnet ganache fork for unit tests anyway. This is an issue with the ganache fork code, as the pool is always unlocked after a swap. Nothing we can do in the uniswap contracts to fix it. |
I´m having the same issue in Hardhat deployment. #159 |
Hi Uniswap team,
I've encountered an issue when trying to integrate with Uniswap, didn't find anything on google which is similar.
I'm using Genache (forking mainnet).
IDE Remix
Deployment truffle
I did a simple contract which tries to exchange eth -> CDT (and erc20 token)
uniswap_router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
cdt = 0x177d39ac676ed1c67a2b268ad7f1e58826e5b0af
From that call I get UniswapV2: LOCKED which, after looking around, only appears in UniswapV2Pair.sol (here)
What did I do wrong here?
The text was updated successfully, but these errors were encountered: