`ERC20Votes` in `wizard.openzeppelin.com`: bug or feature?

I'm setting up a new governance token using the Open Zeppelin wizard. When I click Votes, the contract adds ERC20Votes in the inheritance tree as expected. However, it also adds ERC20Permit automatically (even if Permit remains unchecked).

Is this a feature or a bug? If it's a feature, why is ERC20Permit coupled with ERC20Votes? Is using ERC20Permit considered best practice in 2021?

I can't answer your qn re. why permit is added w/ votes but I can answer your question on if permit is best practice.

I won't consider it to be best practice but it is definitely a nice to have feature. It allows you to do transferFrom without first having to call a separate approve txn i.e. it helps to improve UX by combing 2 steps into 1.

Hello @pandichef

ERC20votes require support for ERC712 signatures (for the signed delegation mechanism). This means we have to include the EIP712 base contract and include a nonce system. ERC20Votes does both of these so its simpler to just include it.

We could have included EIP712 and a nonce system without inheriting ERC20Permit, but that would have been an issue is someone decided to get both ERC20Votes and ERC20Permit in the same instance as the two nonces systems would have clashed :confused:

I see. Aside from gas and contract size, is there any downside to creating an ERC-20 token that inherits from ERC20Permit?

There is a cost penalty when deploying the contract, not when using it. I honestly don't see any downside to having the feature.