openzeppelin-upgrades icon indicating copy to clipboard operation
openzeppelin-upgrades copied to clipboard

Namespaced layout validations: extract detailed types in interfaces

Open ericglau opened this issue 1 year ago • 0 comments

Related to https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/1086#issuecomment-2380705809

If contracts inherit interfaces that have structs annotated with namespaces, those namespaces can still be validated but they won't have detailed type information such as slots or lengths.

When creating modified solc input, consider converting interfaces into abstract contracts, so that we can insert variables for the namespace structs to extract their detailed type information.

This would require:

  1. Change interface to abstract contract
  2. Add virtual to any interface functions since they are unimplemented
  3. Continue making other modifications similar to how contracts are treated, so that other function signature changes would also occur (to ensure the virtual function's signature does not become out of sync from any implementations)

However, this risks further compilation errors since there may be other edge cases. We should only consider this after https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/1088.

ericglau avatar Oct 02 '24 14:10 ericglau