From aed22fbc2203a59cf8d092e8f2b51cc534d79355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Tue, 17 Oct 2023 02:03:04 -0600 Subject: [PATCH] Add `view` modifier to `proxyAdmin` in TransparentUpgradeableProxy (#4688) Co-authored-by: Eric Lau --- .changeset/eleven-planets-relax.md | 5 +++++ contracts/proxy/transparent/TransparentUpgradeableProxy.sol | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/eleven-planets-relax.md diff --git a/.changeset/eleven-planets-relax.md b/.changeset/eleven-planets-relax.md new file mode 100644 index 00000000000..a1f1bbf1c4e --- /dev/null +++ b/.changeset/eleven-planets-relax.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': patch +--- + +`TransparentUpgradeableProxy`: Make internal `_proxyAdmin()` getter have `view` visibility. diff --git a/contracts/proxy/transparent/TransparentUpgradeableProxy.sol b/contracts/proxy/transparent/TransparentUpgradeableProxy.sol index c4488f99f8a..2e3fbc538e6 100644 --- a/contracts/proxy/transparent/TransparentUpgradeableProxy.sol +++ b/contracts/proxy/transparent/TransparentUpgradeableProxy.sol @@ -50,7 +50,7 @@ interface ITransparentUpgradeableProxy is IERC1967 { * IMPORTANT: This contract avoids unnecessary storage reads by setting the admin only during construction as an * immutable variable, preventing any changes thereafter. However, the admin slot defined in ERC-1967 can still be * overwritten by the implementation logic pointed to by this proxy. In such cases, the contract may end up in an - * undesirable state where the admin slot is different from the actual admin. Relying in the value of the admin slot + * undesirable state where the admin slot is different from the actual admin. Relying on the value of the admin slot * is generally fine if the implementation is trusted. * * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the @@ -84,7 +84,7 @@ contract TransparentUpgradeableProxy is ERC1967Proxy { /** * @dev Returns the admin of this proxy. */ - function _proxyAdmin() internal virtual returns (address) { + function _proxyAdmin() internal view virtual returns (address) { return _admin; }