nahmii / niifi-token-contract

Governance token contract for NIIFI
7 stars 1 forks source link

Router contract always throws gas estimate error #1

Closed HDauven closed 3 years ago

HDauven commented 3 years ago

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)" }

To Reproduce Steps to reproduce the behavior:

  1. Open Remix
  2. Import the flattened NiiFi Router contract.
  3. Compile the NiiFi Router contract with the Optimism Remix compiler plugin with version 0.6.12 of Solidity.
  4. Connect to the Nahmii testnet in Remix. Make sure your wallet contains testnet ETH and KNII. (or whatever token you test)
  5. Select the IUniswapRouter02 contract in the deployment interface.
  6. Attach the interface to address 0x31965F4782743be64CD3868f4Bc6843b82273feB with the at address button.
  7. 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.

Additional context Smart contract addresses:

Tried and tested

Potential next steps

HDauven commented 3 years ago

Issue got resolved. Thanks for helping out here @katat.

Nahmii Testnet contracts are now deployed here: