Describe the bug
When trying to add liquidity to a token pair, the following error constantly pops up:
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Internal JSON-RPC error. { "code": -32000, "message": "gas required exceeds allowance (11000000)" }
Compile the NiiFi Router contract with the Optimism Remix compiler plugin with version 0.6.12 of Solidity.
Connect to the Nahmii testnet in Remix. Make sure your wallet contains testnet ETH and KNII. (or whatever token you test)
Select the IUniswapRouter02 contract in the deployment interface.
Attach the interface to address 0x31965F4782743be64CD3868f4Bc6843b82273feB with the at address button.
Use any of the addLiquidity functions. Example arguments for the KNII-ETH pair:
tokenA: 0xB68553758df8c253746d3cED96aA1De896F09470 (KNII, 6 decimals)
tokenB: 0x4200000000000000000000000000000000000006 (wETH, 28 decimals)
amountADesired: 5000000000
amountBDesired: 2000000000000000000
amountAMin: 4000000000
amountBMin: 1000000000000000000
to: Your address
deadline: Current unix timestamp + 100000
Expected behavior
The function should successfully execute and add liquidity to the given tokens token pair.
Factory, Router and personal addresses have been whitelisted.
Was able to execute functions on the Factory, not on the Router.
Router has been granted approval for the mentioned tokens. (ETH, KNII, NEURO)
Tested logic related to block.timestamp, doesn't seem to be the issue.
Contract variables hold the correct data.
Pair data is correct according to the Factory contract.
Issue is not related to wrong nonces.
Potential next steps
Deploy an unoptimized set of Factory-Router contracts and verify them on Blockscout, in the hope that Blockscout will provide some more details on why force-pushed transactions fail.
Enable arbitrary deployments to see whether it's a permissions issue.
Describe the bug When trying to add liquidity to a token pair, the following error constantly pops up:
To Reproduce Steps to reproduce the behavior:
IUniswapRouter02
contract in the deployment interface.0x31965F4782743be64CD3868f4Bc6843b82273feB
with theat address
button.addLiquidity
functions. Example arguments for the KNII-ETH pair: tokenA: 0xB68553758df8c253746d3cED96aA1De896F09470 (KNII, 6 decimals) tokenB: 0x4200000000000000000000000000000000000006 (wETH, 28 decimals) amountADesired: 5000000000 amountBDesired: 2000000000000000000 amountAMin: 4000000000 amountBMin: 1000000000000000000 to: Your address deadline: Current unix timestamp + 100000Expected behavior The function should successfully execute and add liquidity to the given tokens token pair.
Additional context Smart contract addresses:
Tried and tested
block.timestamp
, doesn't seem to be the issue.Potential next steps