dao-template icon indicating copy to clipboard operation
dao-template copied to clipboard

VM Exception while processing transaction: reverted with reason string 'Governor: vote not currently active'

Open SebasG22 opened this issue 3 years ago • 7 comments
trafficstars

Hey @PatrickAlphaC , Thank you for the video and code, I'm running yarn hardhat run scripts/vote.ts and got the following error:.

Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="Error: VM Exception while 
processing transaction: reverted with reason string 'Governor: vote not currently active'", 
method="estimateGas", transaction={"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","to":"0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"

I tried to use the solution proposed here #6 but did not work for this case.

SebasG22 avatar Jun 07 '22 00:06 SebasG22

You can see the error in your error:

processing transaction: reverted with reason string 'Governor: vote not currently active'", 

So, you're trying to vote on a proposal that isn't active yet.

PatrickAlphaC avatar Jun 07 '22 01:06 PatrickAlphaC

I had the same issue when following the video. In your deploy script "03-deploy-governor-contract.ts", change the args to:

args: [
            governanceToken.address,
            timelock.address,
            QUORUM_PERCENTAGE,
            VOTING_PERIOD,
            VOTING_DELAY
        ],

I think the order was different in the video, so it resulted in a longer voting delay, which meant that your proposal wasn't active yet.

Danielpark1239 avatar Jun 17 '22 04:06 Danielpark1239

oooo whoops! Is the code in the repo right tho?

PatrickAlphaC avatar Jun 17 '22 15:06 PatrickAlphaC

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? execution reverted: AccessControl: account 0xe39be77544004b24170a9866a53d1d3b6024a45b is missing role 0xb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1 { "originalError": { "code": 3, "data": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000094416363657373436f6e74726f6c3a206163636f756e7420307865333962653737353434303034623234313730613938363661353364316433623630323461343562206973206d697373696e6720726f6c6520307862303961613561656233373032636664353062366236326263343533323630343933386632313234386132376131643563613733363038326236383139636331000000000000000000000000", "message": "execution reverted: AccessControl: account 0xe39be77544004b24170a9866a53d1d3b6024a45b is missing role 0xb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1" }

when I Queue in my governorContractI get this error how can i resolve it i put my 7 days to solve this plz give me some clue

Divyansh-singh08 avatar Jun 28 '22 06:06 Divyansh-singh08

Greetings @Divyansh-singh08 , you stated that this happens if you want to queue it, so it happens if you calling the await governor.queue(...) method right? This is triggering the queue() function at the GovernorTimeLockControl.sol (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/extensions/GovernorTimelockControl.sol).

With what account are you sending this transaction? The error seems to state you want to execute the queue() function from an account which does not have the right to do it. Can you send the line where you are triggering the await governor.queue(...) function.

Not the proposal needs to be successfull to queue() it, but this behaviour should not be the case regarding your error message.

MichiMich avatar Jul 07 '22 15:07 MichiMich

Change the parameter order of GovernorContract deployment in 03-deploy-governor.ts, and it works for me. The actual code in author's repo is actually correct:

const governorContract = await deploy("GovernorContract", {
    from: deployer,
    args: [
        governanceToken.address,
        timeLock.address,
        QUORUM_PERCENTAGE,
        VOTING_PERIOD,
        VOTING_DELAY,
    ],
    log: true,
})

tamphill avatar Nov 10 '22 18:11 tamphill

Hey @SebasG22 , Found a solution, seems as if the the vote is not active so we just need to move forward in time a little bit, therefore I added another block l at the end of the vote function in the vote.js and it solves the issue :) 👇

  if (developmentChains.includes(network.name)) {
       await moveBlocks(VOTING_PERIOD + 2);
   }

I think this is because of the 1 block that we wait for in the await voteTx.wait(1) , not certain though. Cheers

chidubesteve avatar Aug 27 '23 22:08 chidubesteve