So here I am explaining the situation, I’m trying to launch my farming platform like Sushiswap, I have a community of 800 people who have followed me in various businesses and who are waiting for this platform to come out. The objective is to have more “reasonable” and not “excessive” interests in order to last on the long term.
I dont have dev for the moment and I want engage one in the future, but I’ve learn a lot from few weeks. And I have the same problem from long time:
I Create the Token
I Create the MasterChef contract
I Change the ownership Token to Masterchef address
I Create a Liquidity Pool Like “SUSHI-ETH”
I Modify the constants files and put the contracts address of Token + Masterchef and modify LP Address for the pools
What is wrong or missing ? because I can connect my wallet on the farming platform, I can also approve the transaction and see my LP Tokens or UNI V2, but when I want “DEPOSIT” this LP Tokens, i have an error in the execution of contract. If you can just help me for this question.
In the Masterchief we have (see below) It’s not good ?
// Add a new lp to the pool. Can only be called by the owner.
// XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(
uint256 _allocPoint,
IERC20 _lpToken,
bool _withUpdate
) public onlyOwner {
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardBlock =
block.number > startBlock ? block.number : startBlock;
totalAllocPoint = totalAllocPoint.add(_allocPoint);
poolInfo.push(
PoolInfo({
lpToken: _lpToken,
allocPoint: _allocPoint,
lastRewardBlock: lastRewardBlock,
accSushiPerShare: 0
})
);
}
function deposit(uint256 _pid, uint256 _amount) public {
require (_pid != 0, 'deposit CAKE by staking');
PoolInfo storage pool = poolInfo[_pid];
xxx
}
So you need to pass a correct _pid, and cakeToken is the first token in the poolInfo, so when you want to deposit your own lp token, I think you should call the function add to add this token into the poolInfo at first.
Thank you very much for all this informations. I’ve try to modify the Deposit and Withdraw by following your instructions normally. But it doesn’t work
No, I mean your operation steps.
And do you deploy the contract manually rather than by a script?
Or could you please paste the failed transaction hash at here?