Timelock Transaction Execution

Hi all,

i have a serious problem with my transactions execution.
I have a timelock with 24 delay.
I want to add new Pools / Farms and also i want to make a withdraw from a Pool because we accidentally sent Tokens in Masterchef and it’s giving some errors on rewards.

This is for example one transaction queued and tried to be executed :

and this is the error

I really need help…

@Lokum Hi welcome to the OZ forums.

I poked around and looked through the contract and validated that the Scheduled transaction data matched the Execute data. It does, meaning that this should have worked based on the scheduling and execution.

I think the next step in figuring out the solution is to figure out if the Transaction you are trying to do, can actually be done. I understand you want to make a withdrawal of these tokens, but can you as the TimeLock.

The TimeLock’s address will be what has to withdraw the tokens, as it is executing the transaction. If it doesn’t have power over the withdrawal, then it cannot do that.

If the TimeLock also can’t complete the transaction for other reasons, then it won’t be able to do this.

What is the error on your rewards that you describe?

Just reading into this it looks like https://bscscan.com/address/0x8705eaba437a2def65b0e455c025eec05d1ee4ab#readContract is your MasterChef contract you are using.

The owner is indeed the TimeLock.

I assume you are doing Write Contract → Function 12. withdraw.
Looking at the code of withdraw,

    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 _pid, uint256 _amount) public nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "withdraw: not good");
        updatePool(_pid);
        uint256 pending = user.amount.mul(pool.accLkmPerShare).div(1e12).sub(user.rewardDebt);
        if (pending > 0) {
            safeLkmTransfer(msg.sender, pending);
        }
        if (_amount > 0) {
            user.amount = user.amount.sub(_amount);
            pool.lpToken.safeTransfer(address(msg.sender), _amount);
        }
        user.rewardDebt = user.amount.mul(pool.accLkmPerShare).div(1e12);
        emit Withdraw(msg.sender, _pid, _amount);
    }

It looks like the require statement of user.amount, is that it needs a certain amount to less than the user’s amount. Does this TimeLock meet that requirement?

I also have noticed that there is an emergencyWithdraw function.
You might want to pursue that to fix the error, but there are no rewards.

This is also going to sound odd, but I think your delay timer is actually set to 6 hours, not 24. 21600 (minimum delay) / 3600 (1 hour unix) = 6 hours in Unix time. I could be wrong about that though as I do not have first hand experience with older TimeLocks.