Cannot do ERC20Votes in ERC4626 (original) (raw)

I think I originally posted this in the wrong place, as mainly what I need is some support advice. Here is the post: ERC4626Votes?

I have a protocol requirement, and I am wondering if there are any existing solutions to solve it. If not, I'd love to get some advice on an implementation.

My protocol has a:

However, I run into this problem: Ideally most of the liquidity is staked, but if most of the liquidity is staked, then governance doesn't work because there isn't enough primary token.

Instead, it would be far better if the staked token was the votes token.

I don't see any "ERC4626Votes" extension, so I assume this does not yet exist. I tried to make this functionality work by doing this:


contract StakedUNI is ERC20Votes, ERC4626 {
   constructor(string memory _name, string memory _symbol, address _underlying)
       ERC20(_name, _symbol)
       ERC4626(IERC20(_underlying))
   {}

   // The following functions are overrides required by Solidity.

   function _update(address _from, address _to, uint256 _value)
       internal
       override(ERC20, ERC20Votes)
   {
       super._update(_from, _to, _value);
   }

   function decimals() public pure override(ERC20, ERC4626) returns (uint8) {
       return 18;
   }
}

But I get this error:

Error: Compiler run failed:
Error (3415): No arguments passed to the base constructor. Specify the arguments or mark "StakedUNI" as abstract.
 --> src/StakedUNI.sol:10:1:
  |
10 | contract StakedUNI is ERC20Votes, ERC4626 {
  | ^ (Relevant source part starts here and spans across multiple lines).
Note: Base constructor parameters:
 --> lib/openzeppelin-contracts/contracts/utils/cryptography/EIP712.sol:66:16:
  |
66 |     constructor(string memory name, string memory version) {
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Does my problem make sense? How can I resolve this build error? If I do resolve this build error, will it work as expected ("stakedUNI" will be able to be used to vote)?