Replies: 1 comment
-
Did you solve the problem? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
we are currently testing our app in rinkeby. We are swapping with our contract on the uniswap pool.
The logic in the contract is quite simple. Our problem is that if we trigger a swap on our contract and there is another swap in the last block or in the same block, we get a failed transaction. So on the update function in the uniswap pair contract, it suddenly rans out of gas.
The swaps always go through when only we swap ourselves. We have used the same contract in the BSC test network, and there we can swap in parallel and not run out of gas.
Somehow the default gas estimation fails from ether js in this case.
In this transaction the gaslimit was set to 136,921 and when I simulate it again with tenderly it goes through with 147,680 gas limit.:
https://dashboard.tenderly.co/tx/rinkeby/0x3f853a1efd4154530d34f36d1daf3eef1de840a72a6839411cf1e7e1edae1edb?trace=0.4.3.2.2
This is the same swap function/contract function in another transaction and it goes through (without someone swapping at the same time):
https://dashboard.tenderly.co/tx/rinkeby/0x758d3783f1ee408182d15adcc81b93b27822427ea7cc50988d4a74abec28af9a
Could anyone explain to me why this is happening and what we can do to prevent this ?
Beta Was this translation helpful? Give feedback.
All reactions