How to Use Farms with BscScan
Since it requires several steps, using Farms with CoinOneSwap may seem daunting at first. This guide will guide you to use Farms contracts directly through BscScan.
Please understand that it is not recommended for beginners to use BscScan to interact with the contract. If you are not confident, we recommend that you use the How to Use Farm Guide instead.
Find the farm process identifier
To properly interact with the agricultural smart contract, you need to match the process identifier (PID) of the LP pair. Currently, the easiest way to find it is to check GitHub.
1. Open the Farms code of the CoinOneSwap website on GitHub.
2. Control/command + F and search for your match by stock code (not project name). For example,'CONE-BUSD'.
3. Write down or copy the PID number (389 in this example), you can easily access it. You will need this later.
Deposit LP tokens through BscScan
Depositing LP tokens using BscScan involves a few things. We have broken it down into multiple steps to make it easier to operate.
Get the main staking contract address
The main mortgage contract address is: 0x73feaa1eE314F8c655E354234017bE2193C9E24E
But suppose you want to confirm this, please visit CoinOneSwap: Main Staking Contract BscScan page. You will see the address in the upper left corner. Click the page icon to copy it to the clipboard. You will need it soon.
Open the contract for your LP token
You need to approve the smart contract of the LP token you wish to submit to the farm before you can use it.
From source code
1. First, open farms.ts on GitHub。
2. Control/command + F and search for your match by stock code (not project name). For example,'CONE-BNB'
3. When you have the code of the LP pair you are looking for, please find the address after "56:". This will be your contract address.
From the user interface
1. First, visit the CoinOneSwap farm page and use the "Search" field in the upper right corner to search for the match of your choice. We use CONE-BUSD in this example.
2. Click Details to expand the row to display more information.
3. 点击查看合约,在 BscScan 上打开智能合约。
Grant LP Token contract authority
Now that you have opened your LP token contract on BscScan, you will approve the use of your LP token on the farm.
1. On the contract page of LP Token, click Contract and then Write Contract.
2. Click Connect to Web3 to connect to MetaMask。
Confirm the connection.
3. Under Function 1, "Approval", you will see "spender:address". Paste the contract address of the main staking contract that you copied to the clipboard earlier.
4.You also need to approve the number of LP tokens that the contract can spend. In the value field, you need to enter the amount in Wei. You can easily change your amount to Wei using the BscScan unit converter. Here we will use 5 CONE-BUSD LP tokens.
You can also use -1 as the value to give unlimited spending approvals. This does not mean that you will spend everything by default, but just that your wallet allows you to use this contract for transactions of any size。
5.Click Write and accept the operation in your MetaMask wallet. You can now submit LP tokens to the farm, up to the amount you approved.
Deposit LP tokens using the smart contract of the master mortgage contract
Now that the main mortgage contract has been approved to use your LP tokens, it is time to make a deposit.
1. Go back to the CoinOneSwap: Main Staking Contract BscScan page, enter the contract, and then write the contract.
2. Click Connect to Web3 to connect to MetaMask.
3. Scroll to function 2, "Deposit", and enter your PID in the "_pid" field.
If you have not copied your PID before, you can learn how to obtain it in the Finding Farm Process Identifier section at the top of this page.
4. Under _pid you will see "_amount". Enter the spending amount of your previously approved LP contract.
5. Check the information and click Write. Confirm your actions in MetaMask。
6. You can confirm that your deposit is valid by clicking View your transaction.
Withdraw LP tokens
Withdrawing your LP tokens from the pool is very similar to depositing. The difference lies in the features you will interact with.
1.Go back to the CoinOneSwap: Main Staking Contract BscScan page, enter the contract, and then write the contract.
2. Click Connect to Web3 to connect to MetaMask.
3. Scroll all the way down to function 15, "Exit", and enter your PID in the "_pid" field.
If you have not copied your PID before, you can learn how to obtain it in the Finding Farm Process Identifier section at the top of this page.
4. Under _pid you will see "_amount". Enter the number of LPs you want to withdraw from the pool.
5. Check the information and click Write. Confirm your operation in MetaMask.
6. You can confirm the success of your withdrawal by clicking View your transaction.
Make an emergency withdrawal
Using the emergency withdrawal feature allows you to withdraw all funds from the pool when no other method is feasible.
Using the emergency withdrawal function will lose your CONE reward!
The CoinOneSwap team strongly recommends avoiding this feature unless the CoinOneSwap team officially recommends it, or if you are very used to interacting with smart contracts and understand the underlying code.
1. On the CoinOneSwap: Main Staking Contract BscScan page, enter the contract, and then write the contract。
2. Click Connect to Web3 to connect to MetaMask。
3. Scroll down to function 4, "emergencyWithdraw", and enter your PID in the "_pid" field.
If you have not copied your PID before, you can learn how to obtain it in the Finding Farm Process Identifier section at the top of this page.
4. Check the information and click Write. Confirm your operation in MetaMask.
5. You can confirm whether your withdrawal is valid by clicking View your transaction.
Last updated