Hello!
I'm trying to compile my smart contract that was created in OpenZeppelin using their Contracts wizard. The contract is a Governor contract for a DAO as a test on the Ropsten testnet. I am using Truffle and Ganache.
Here is my code that was given back to me from the OZ Wizard:
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.9.0;
import "@openzeppelin/contracts/governance/Governor.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol";
/// @custom:security-contact Pavon Dunbar
contract PavonDAO is Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl {
constructor(IVotes _token, TimelockController _timelock)
Governor("PavonDAO")
GovernorSettings(1 /* 1 block */, 45818 /* 1 week */, 10e18)
GovernorVotes(_token)
GovernorVotesQuorumFraction(8)
GovernorTimelockControl(_timelock)
{}
...
When I try to compile the contract using
truffle test --network ropsten
I am met with this error and the compilation fails.
DeclarationError: Identifier not found or not unique.
--> project:/contracts/PavonDAO.sol:13:17:
|
13 | constructor(IVotes _token, TimelockController _timelock)
| ^^^^^^
Compilation failed. See above.
Truffle v5.4.31 (core: 5.4.31)
Node v16.9.1
THE ONLY THING I CHANGED was the solidity versions in the contract. But even when I reverted back to the original version, I was met with the same error.
Thanks in advance to anyone who responds.
Pavon