Guide on Testing Locked Feature

Step 1: Set Up Metamask

  1. Open the Metamask browser extension, click on the network dropdown menu in the top center of the Metamask window, and select "Goerli Testnet" from the available network options. If you don't see the Goerli Testnet option in the dropdown, follow the next steps.

  2. If you don't have the Goerli network added to Metamask, you have two options:

  3. Option 1: Enable Goerli Network in Metamask Settings

    • Click on the profile icon in the top right corner and select "Settings" from the dropdown menu.

    • In the Settings tab, scroll down to the "Networks" section.

    • Click on "Goerlie test network" under Test Networks to enable the testnet

  4. Option 2: Add Goerli Network Using Chainlist

    • Visit in your web browser.

    • On the Goerli Testnet page, click on the "Add to Metamask" button.

    • Metamask will open and prompt you to confirm adding the Goerli network. Click on "Approve" to add the network.

  5. After adding the Goerli network to Metamask, ensure that it is selected in the network dropdown menu.

  6. You are now ready to use Metamask with the Goerli Testnet.

Step 2: Obtain goerliETH

  1. Ensure that you have sufficient goerliETH tokens in your wallet to perform transactions on the Goerli Testnet.

  2. If you need goerliETH tokens, refer to the next section where we mentioned several faucet options such as QuickNode, Alchemy, Coinbase, ENS, or PK910 Goerli Faucet. Follow the instructions provided by us to obtain goerliETH tokens.

Step 3: Deploying a Test Token Contract

If you already have your own token contract on the Goerli Testnet, you can skip to the next step. Otherwise, follow these steps to deploy a test token contract using the token generator:

  1. On the token generator page, select "Goerli - Testnet" as the network for token deployment.

  2. Fill in the details for your token, such as the token name, token symbol, and token supply.

  3. Click on the "Next" button to proceed.

  4. In the billing section, click on "Skip" as this is a free service.

  5. Finally, click on the "Create Token" button to initiate the transaction for deploying your test token contract.

Alternatively, if you already have your own token contract, you can deploy that contract on the Goerli Testnet instead of using the token generator. Make sure you have the necessary contract code and follow the appropriate steps to deploy your custom token contract on the Goerli Testnet.

Note - We want to clarify that our project, LiquiShield, is not associated with "". The token generator provided in the tutorial is recommended specifically for deploying test token contracts on the Goerli Testnet.

Step 4: Creating a Liquidity Pool

  1. Open a web browser and visit

  2. On the LiquiShield DEX application, click on the "Pool" tab in the navigation menu.

  3. Click on the "Create Pair" button to initiate the process of creating a new liquidity pool.

  4. Select the tokens you want to add to the liquidity pool. For example, you can choose WETH (Wrapped Ether) and the token you generated earlier using the token generator.

  5. Enter the amount of tokens you wish to add to the liquidity pool. Make sure you have sufficient balances of both tokens in your wallet to provide liquidity.

  6. After confirming the token selection and the amount, click on the "Approve" button to approve the transaction for adding liquidity to the pool. Metamask will open, and you need to confirm and sign the transaction.

  7. Once the transaction is approved and confirmed, click on the "Supply" button to supply the selected tokens to the liquidity pool.

  8. Metamask will open again for you to confirm and sign the supply transaction.

  9. After confirming the transaction, the liquidity pool creation process will begin.

  10. Wait for the transaction to be confirmed on the Goerli Testnet. You can track the status of the transaction using the provided transaction link or a block explorer like Etherscan.

  11. Once the transaction is confirmed, your liquidity pool will be successfully created, and the tokens will be added to the pool.

Liquidity will be locked for 5 mins on Testnet after the addLiquidity transaction is confirmed, so you have to be quick here if you are testing the feature.

Step 5: Checking the Locked Liquidity Function

  • After creating the liquidity pool, navigate to the "Pool" tab on the LiquiShield DEX application.

  • You will be able to see the information of the pool you created. Click on the pool to access its details.

  • In the pool details, you will find options for managing your liquidity. Try to remove liquidity by clicking on the "Remove" button.

  • As you proceed with the removal process, you will need to approve the transaction using Metamask. Confirm and sign the transaction.

  • However, instead of allowing you to remove the liquidity, the transaction will throw an error. To view the error message, you can right-click on the webpage and select "Inspect Element." Then, go to the "Console" tab in the developer tools that open.

  • In the console tab, you will be able to see the error message indicating that the liquidity cannot be removed due to the locked liquidity feature.

  • Just hover/click on the tokens and that will be your LP pair address.

  • Keep in mind that on the Goerli Testnet, the locked duration is set to 5 minutes for testing purposes. This means you will not be able to remove the liquidity until the lock duration has elapsed, which is 5 minutes from time the liquidity pair is created.

  • Wait for the specified lock duration to pass, and then try removing the liquidity again. This time, the transaction should proceed successfully without any errors.

Note - If you are trying the locked liquidity removal function on the token generator provided by us, then 5 mins are very less. The contract generated through token generator creates a pair within the contract, so the 5 mins timer starts the moment the token is deployed. By the time you add liquidity, and enable trading, 5 mins would have already been passed. Please use the above token generator for trying this feature. On Mainnet, the locked duration is 2 months so it will work there ofc.

Last updated