        urlToMetaCoinMap[_url] = metaCoinAddress;
       if (urlToMetaCoinMap[_url] != address(0)) {
            revert MetaCoinExists();
        }
    import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers";
    import { ethers as hhethers } from "hardhat";
    import {IERC20Metadata, UpsideMetaCoin, UpsideProtocol, UpsideStakingStub} from "../types";
    // Add this import
+   import { expect } from "chai";
  it("Should permit user2 to execute transactions ahead of user1", async function () {
    const url1 = "https://example1.com";
    const liquidityTokenAddress = await liquidityToken.getAddress();
    const tokenizeFeeDestinationAddress = await owner.getAddress();

    // Fee configuration
    const newFeeInfo = {
      tokenizeFeeEnabled: true,
      tokenizeFeeDestinationAddress: tokenizeFeeDestinationAddress,
      swapFeeStartingBp: 9900,  // 99%
      swapFeeDecayBp: 100,      // 1%
      swapFeeDecayInterval: 6,  // 6 seconds
      swapFeeFinalBp: 100,      // 1%
      swapFeeDeployerBp: 1000,  // 10%
      swapFeeSellBp: 100,       // 1%
    };
  
    // Set fee info
    await upsideProtocol.connect(owner).setFeeInfo(newFeeInfo);

    // Turn off auto-mining to simulate pending transactions in the mempool
    await network.provider.send("evm_setAutomine", [false]);

    // User1 submits a transaction with normal gas fees
    const user1Tx = await upsideProtocol.connect(user1).tokenize(url1, liquidityTokenAddress, {
      gasPrice: ethers.parseUnits("10", "gwei"), // Low priority
    });

    // User2 submits the same transcation with higher gas price to front-run
    const user2Tx = await upsideProtocol.connect(user2).tokenize(url1, liquidityTokenAddress, {
      gasPrice: ethers.parseUnits("100", "gwei"), // High priority
    });

    // Mine the transactions, user2's should be prioritized
    await network.provider.send("evm_mine");

    // Reactivate auto-mining for normal operation
    await network.provider.send("evm_setAutomine", [true]);

    // Verify that user1's transaction failed because the URL was already tokenized
    await expect(user1Tx.wait()).to.be.revertedWithCustomError(upsideProtocol, "MetaCoinExists");
  }).timeout(100000000);
