diff --git a/contracts/proxy/ERC1967/ERC1967Utils.sol b/contracts/proxy/ERC1967/ERC1967Utils.sol index bb822bf3cd7..b6f705e54c1 100644 --- a/contracts/proxy/ERC1967/ERC1967Utils.sol +++ b/contracts/proxy/ERC1967/ERC1967Utils.sol @@ -31,8 +31,7 @@ library ERC1967Utils { /** * @dev Storage slot with the address of the current implementation. - * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is - * validated in the constructor. + * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; @@ -94,8 +93,7 @@ library ERC1967Utils { /** * @dev Storage slot with the admin of the contract. - * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is - * validated in the constructor. + * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; @@ -133,7 +131,7 @@ library ERC1967Utils { /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. - * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1) and is validated in the constructor. + * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; @@ -184,7 +182,8 @@ library ERC1967Utils { } /** - * @dev Reverts if `msg.value` is not zero. + * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract + * if an upgrade doesn't perform an initialization call. */ function _checkNonPayable() private { if (msg.value > 0) { diff --git a/contracts/proxy/beacon/IBeacon.sol b/contracts/proxy/beacon/IBeacon.sol index f5e9f79811f..56477c92a27 100644 --- a/contracts/proxy/beacon/IBeacon.sol +++ b/contracts/proxy/beacon/IBeacon.sol @@ -10,7 +10,7 @@ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * - * {BeaconProxy} will check that this address is a contract. + * {UpgradeableBeacon} will check that this address is a contract. */ function implementation() external view returns (address); } diff --git a/contracts/proxy/transparent/ProxyAdmin.sol b/contracts/proxy/transparent/ProxyAdmin.sol index c0e6780f41e..b9fc3764156 100644 --- a/contracts/proxy/transparent/ProxyAdmin.sol +++ b/contracts/proxy/transparent/ProxyAdmin.sol @@ -9,6 +9,8 @@ import {Ownable} from "../../access/Ownable.sol"; /** * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}. + * + * NOTE: This contract does not make use of {Context} deliberately. */ contract ProxyAdmin is Ownable { /** @@ -16,7 +18,7 @@ contract ProxyAdmin is Ownable { * and `upgradeAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeAndCall(address,bytes)` is present, and the second argument must - * be the empty byte string if no function should be called, being impossible to invoke the `receive` function + * be the empty byte string if no function should be called, making impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; diff --git a/contracts/proxy/utils/UUPSUpgradeable.sol b/contracts/proxy/utils/UUPSUpgradeable.sol index 7ad0c9abcb9..8591dadec70 100644 --- a/contracts/proxy/utils/UUPSUpgradeable.sol +++ b/contracts/proxy/utils/UUPSUpgradeable.sol @@ -25,7 +25,7 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable { * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must - * be the empty byte string if no function should be called, being impossible to invoke the `receive` function + * be the empty byte string if no function should be called, making impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; @@ -126,7 +126,9 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable { function _authorizeUpgrade(address newImplementation) internal virtual; /** - * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. + * @dev Performs ab implementation upgrade with a security check for UUPS proxies, and additional setup call. + * + * The security check calling {proxiableUUID} expects the id to be the ERC1967's implementation. * * Emits an {IERC1967-Upgraded} event. */