title: Fail with error 'PancakeLibrary: INSUFFICIENT_AMOUNT'
body: <p>I'm trying to fork PANCAKESWAP, everything seem to work well, I can add liquidity, but whenever I decided to add a liquidity that has to do with BNB (i.e calling the <code>addLiquidityETH</code> function) transaction gets reverted with that error message.</p>
  <p>After a little digging, I found out it only appears in a single place in the whole router.</p>
  <pre class="lang-js prettyprint-override"><code>// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
  function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
      require(amountA &gt; 0, 'PancakeLibrary: INSUFFICIENT_AMOUNT'); // THIS IS WHERE TRIGGERS THE REVERT!!
      require(reserveA &gt; 0 &amp;&amp; reserveB &gt; 0, 'PancakeLibrary: INSUFFICIENT_LIQUIDITY');
      amountB = amountA.mul(reserveB) / reserveA;
  }
  </code></pre>
  <p>and this <code>quote</code> function got called in the <code>_addLiquidity</code> function as seen below.</p>
  <pre class="lang-js prettyprint-override"><code>// **** ADD LIQUIDITY ****
  function _addLiquidity(
      address tokenA,
      address tokenB,
      uint amountADesired,
      uint amountBDesired,
      uint amountAMin,
      uint amountBMin
  ) internal virtual returns (uint amountA, uint amountB) {
      // create the pair if it doesn't exist yet
      if (IPancakeFactory(factory).getPair(tokenA, tokenB) == address(0)) {
          IPancakeFactory(factory).createPair(tokenA, tokenB);
      }
      (uint reserveA, uint reserveB) = PancakeLibrary.getReserves(factory, tokenA, tokenB);
      if (reserveA == 0 &amp;&amp; reserveB == 0) {
          (amountA, amountB) = (amountADesired, amountBDesired);
      } else {
          uint amountBOptimal = PancakeLibrary.quote(amountADesired, reserveA, reserveB); // here calls the quote function
          if (amountBOptimal &lt;= amountBDesired) {
              require(amountBOptimal &gt;= amountBMin, 'PancakeRouter: INSUFFICIENT_B_AMOUNT');
              (amountA, amountB) = (amountADesired, amountBOptimal);
          } else {
              uint amountAOptimal = PancakeLibrary.quote(amountBDesired, reserveB, reserveA); // and here too
              assert(amountAOptimal &lt;= amountADesired);
              require(amountAOptimal &gt;= amountAMin, 'PancakeRouter: INSUFFICIENT_A_AMOUNT');
              (amountA, amountB) = (amountAOptimal, amountBDesired);
          }
      }
  }
  </code></pre>
  <p>So far, these are the ONLY places that calls <code>quote</code> which will result to the transaction getting reverted, but I can't seem to find anything wrong I mean, <strong>AmountA</strong> is obviously <strong>&gt; 0</strong>.</p>
  <p>Any help would be really appreciated.</p>
  <p><strong>EDIT:</strong></p>
  <p>The error was from my end, I was debugging an old transaction where I didn't send BNB to the contract, and I assumed it was the same error I received for the future transaction, decided to check and found out the error I was receiving was <strong>INSUFFICIENT_A_AMOUNT</strong>, fixed it by setting <code>amountETHMin</code> and <code>amountTokenMin</code> to <strong><code>0</code></strong></p>