Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile contracts with TypeError: Function needs to specify overridden contract "GovernorVotes" #8

Open
wuminqi opened this issue Sep 29, 2022 · 0 comments

Comments

@wuminqi
Copy link

wuminqi commented Sep 29, 2022

Failed to run npm run compile on OSX 12.6 with Node.js v16.4.2.

The message says TypeError: Function needs to specify overridden contract "GovernorVotes".

It appears that override(Governor, IGovernor) should be override(GovernorVotes, IGovernor) to pass the compilation according to the message tip.

Detailed Output

➜  contracts git:(main) ✗ npm run compile

> codefordao-contracts@0.1.0 compile
> npx hardhat compile

Solidity 0.8.12 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.

Learn more at https://hardhat.org/hardhat-runner/docs/reference/solidity-support

TypeError: Function needs to specify overridden contract "GovernorVotes".
  --> contracts/core/Governor.sol:69:9:
   |
69 |         override(Governor, IGovernor)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: This contract: 
  --> @openzeppelin/contracts/governance/extensions/GovernorVotes.sol:14:1:
   |
14 | abstract contract GovernorVotes is Governor {
   | ^ (Relevant source part starts here and spans across multiple lines).


TypeError: Invalid contract specified in override list: "Governor".
  --> contracts/core/Governor.sol:69:9:
   |
69 |         override(Governor, IGovernor)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: This contract: 
  --> @openzeppelin/contracts/governance/Governor.sol:26:1:
   |
26 | abstract contract Governor is Context, ERC165, EIP712, IGovernor {
   | ^ (Relevant source part starts here and spans across multiple lines).


Error HH600: Compilation failed

For more info go to https://hardhat.org/HH600 or run Hardhat with --show-stack-traces

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

No branches or pull requests

1 participant