This repository has been archived by the owner on Aug 9, 2021. It is now read-only.
Improve the inheritance architecture of the contracts by using overriding public variables #33
Labels
enhancement
Improvement for an existing feature or system
While studying Uniswap v3, I've recently discovered that public variables can override a constant function defined in an interface. For example, the function
token0()
defined here in theIUniswapV3PoolImmutables.sol
interface is then overridden by the public variabletoken0
defined here in the child contract UniswapV3Pool.This means that our current inheritance architecture could be improved by changing our current flow from:
to:
Additionally, all the
struct
andenum
types will have to be defined directly into the interface.I think this change would make the architecture simpler and more logic.
The text was updated successfully, but these errors were encountered: