Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

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

Open
SebasG22 opened this issue Jun 7, 2022 · 7 comments

Comments

@SebasG22
Copy link
Contributor

SebasG22 commented Jun 7, 2022

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.

@PatrickAlphaC
Copy link
Owner

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.

@Danielpark1239
Copy link

Danielpark1239 commented Jun 17, 2022

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.

@PatrickAlphaC
Copy link
Owner

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

@Divyansh-singh08
Copy link

Divyansh-singh08 commented Jun 28, 2022

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

@MichiMich
Copy link

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.

@tamphill
Copy link

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,
})

@chidubesteve
Copy link

chidubesteve commented Aug 27, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants