How to interact with mastercheft through TimeLock

Here is my masterchef contract:

:computer: Environment

I added 10 pools to the masterchef and now I can’t add any pool more due to massupdatePools function.
I found that I need to intergrate Timelock for doing this.


Here is my timelock contract how can I use timelock to do this?
I’ve made some transaction but it seem no use!

:1234: Code to reproduce

Hi, welcome! :wave:

I think you should call queueTransaction() at first, and then call executeTransaction() , as for parameters, I think it should be

queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta)

target  ------->>> masterchef contract address
value  -------->>> 0(no eth transfer)
signature ---->>> "add(uint256,address,bool)"
data   -------->>>  web3.eth.abi.encodeParameters([uint256,address,bool],YOUR_PARA1,YOUR_PARA2,YOUR_PARA3)
eta  -------->>> `eta` should be greater than  `getBlockTimestamp().add(delay)`

Thanks so much for reply me!
I called queueTransaction then try to excutetransaction with the same paramarter! But it still say

Are you able to make a nice tutorial on how to fork pancake?

Have you called the queue()

Sorry, but do you mean me?

0 target address 4ec61970cca06ca26a75cb5ae3f3da4636815150
1 value uint256 0
2 signature string updateEmissionRate(uint256)
3 data bytes 0ba84cd200000000000000000000000000000000000000000000000000000334625e33c3
4 eta uint256 1621599446

No sorry I mean Victor :sweat_smile:
Well I mean anyone who is able

1 Like

It’s not much hard! I will try to make it as soon as possible! I’m currently trying to fork a fork of pancake!


I just try to make another 2 call of queue and execute but it keep the same!

Thank you very much
I know how to fork everything but then to host the entire DEX what I should do? Upload everything on IPFS?
How can I link the verious contracts?
I hope your tutorial will help us

Finally, I’m successful to executeTransaction() but unfotunately the function keep revert can you help me to check the reason?

Hey, the help was awesome, I was able to queue a TX with the description,
(see my queue tx)
But not able to execute, my delay is 43200 (so like 12.5h) do i need to wait that time? thanks, greetings!

You need to wait the full delay. I would recommend for testing setting a sooner delay.

Hey Thanks for your Reply!
so I waited the time and tried with the same data, just took the current Unix epoch time +1000 (also with +44000) and it’s not working. It just shows 0.285 Gasfee in Metamsk (like usual for errors) do you might know what it is?

Not sure, it could be another problem with the contract itself. Is the function you are calling valid? When using a test net can you make the function work (without the timelock)?

Hey, thanks a lot for your reply.

The function I want to call is about transferring ownership. And it definitely works, because I already transferred ownership of Masterchef to the Timelock a few weeks ago. And I use the same hex data that appears when I try to change the owner in the MasterChef itself.
… Hmm really bad… I don’t know how to get access that again. ;(