Governance proposal execution failing

After successfully casting some votes on a proposal, I am trying the execute the proposal using the following:

const queue_tx = await governor.queue(
    [tokenAddress],
    [0],
    [calldata],
    descriptionHash
  );
  console.log("queue tx", queue_tx);

  const execute_tx = await governor.execute(
    [tokenAddress],
    [0],
    [calldata],
    descriptionHash
  );

  console.log("execute tx", execute_tx);

However, when I run this, I get the following error: "execution reverted: Governor: proposal not successful"

The proposal state is currently 1 (Active) but majority votes are received. Do I have to wait a certain period before trying to execute? (I don't remember setting this anywhere) Or am I missing something else?

My governor contract for reference: https://ropsten.etherscan.io/address/0xc9eCE0fE55bdA9c83d29aAD7796926e9171eba62

Any help would be appreciated. Thanks!

After a few minutes, the proposal status has changed to 3 (defeated) even though all votes were in support. What are potential causes of getting to this status?

Anyone able to help with this?

You can only execute a queued proposal during the grace period.
What is your Timelock settings?

This is how I initialilized and deployed my time lock contract:

const TimelockController = artifacts.require("MyTimelockController");
const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";

module.exports = function (deployer) {
  deployer.deploy(TimelockController, 0, [], [ZERO_ADDRESS]);
};

I did notice, however, that after successfully casting a few votes and then calling proposalVotes against the governor contract, I'm getting the following response:

[
    {
        "type": "BigNumber",
        "hex": "0x00"
    },
    {
        "type": "BigNumber",
        "hex": "0x00"
    },
    {
        "type": "BigNumber",
        "hex": "0x00"
    }
]

Looks like none of the votes are getting counted even though castVote executed successfully for multiple accounts. I also only cast votes from accounts that had tokens that the governor was initialized with. Am I missing something obvious?

Looks like I forgot to delegate token voting rights so all the vote weights were coming in as zero. Resolving this issue.

1 Like