- When should you put the virtual keyword on a function?
Include ‘virtual’ when you want inheriting contracts to be able to override the function.
- When should you put the keyword override on a function?
Include ‘override’ when overriding the base function.
- Why would a function have both virtual and override keywords on it?
This allows a function to override other base contract functions while having the ability to be overridden itself.