Why do we need upgradeable versions of library contracts like Address + Context given they have no storage?

I was diffing libraries Address and Context and their Upgradeable counterparts and see no differences that would cause problems on upgrading the child contract.

What is the purpose of Address->AddressUpgradeable, Context->ContextUpgradeable, SafeMath->SafeMathUpgradeable?

This is for consistency, so that if you are writing upgradeable contracts, you can just have all of your imports from @openzeppelin/contracts-upgradeable without having to figure out which libraries to use from which package.

1 Like