Can't setup liquidity mining

Hello,

I can’t set up a liquidity mining farm, I forked sushiswap

What I did:

  1. deployed all the necessary contracts & (everything is working fine swap,pair… except liquidity mining)

  2. If I enter contract address of the MasterChef.sol https://github.com/sushiswap/sushiswap/blob/canary/contracts/MasterChef.sol , then it shows on the interface.

  3. I used add(’‘1000000000000000000’,‘gov_token_address’, true) but still nothing…

Please advice

Please let me know if you want more details.

Thanks

Hi, welcome! :wave:

Sorry, I am not familiar with the sushiswap, is there a failed transaction hash?
Maybe you can ask help from swshiswap team, and they have some test cases in their contract repo, maybe you can have a look at them.

Hey, thanks for your response.

No, no failed transaction, nothing.
But I noticed when I use add() function to the pool and then I type poolInfo.length it returns 0, when it should return 1 I guess.

Do you know what the second parameter should take on add() function?

    function add(
        uint256 _allocPoint,
        IERC20 _lpToken,
        bool _withUpdate
    )

What is _lpToken ?

Thanks

There is a modifier for this function onlyOwner, so did you use the owner account to call this function?

As for _lpToken, for example, if you add liquidity of Your_Token-ETH into the sushiswap, you will get some LP tokens, so the token address you got is the value _lpToken

Hey, thank you.
I think you are putting me on the right course.

So, this must be a flow - First, I create pair from the interface, then when I add liquidity and I receive LP tokens I must pass that address as the second argument on add() function. But how can I get the address of the LP token I receive? which solidity file shall I use?

P.S I was told that _lpToken is the pair address of two tokens, guess it’s wrong.

Thanks again for your response.

When you add liquidity successfully, just check the transaction details on the etherscan, it will show the LP token.

Yes, I got it. I’m stuck at adding LP tokens to masterChef via add() function.

Which contract shall I interact with?

I think it should be the masterchief, I am not sure, and maybe you can have a look at the scripts which would deploy contracts or the test case in the sushiswap repo.

Hey, yes contract is MasterChief, but when I call Add() function, and after I run poolInfo.length it returns 0, I guess it should return 1 if add() function worked.

I did not deploy any WETH / MULTICALL contracts, I used address of before deployed contracts.

Everything works fine on interface swapping,creating pairs, adding liquidity. But this farm drives me crazy.

Pairs don’t appear on interface, but If I insert Sushiswap’s MasterChief contract address on the interface, Pair is shown

Hi! @varka did you solve the issue?