Skip to content

Commit 0460f5a

Browse files
committed
Fix N-19
1 parent a60707d commit 0460f5a

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

contracts/proxy/ERC1967/ERC1967Utils.sol

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ library ERC1967Utils {
3131

3232
/**
3333
* @dev Storage slot with the address of the current implementation.
34-
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
35-
* validated in the constructor.
34+
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
3635
*/
3736
// solhint-disable-next-line private-vars-leading-underscore
3837
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
@@ -94,8 +93,7 @@ library ERC1967Utils {
9493

9594
/**
9695
* @dev Storage slot with the admin of the contract.
97-
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
98-
* validated in the constructor.
96+
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
9997
*/
10098
// solhint-disable-next-line private-vars-leading-underscore
10199
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
@@ -133,7 +131,7 @@ library ERC1967Utils {
133131

134132
/**
135133
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
136-
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1) and is validated in the constructor.
134+
* This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
137135
*/
138136
// solhint-disable-next-line private-vars-leading-underscore
139137
bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
@@ -184,7 +182,8 @@ library ERC1967Utils {
184182
}
185183

186184
/**
187-
* @dev Reverts if `msg.value` is not zero.
185+
* @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
186+
* if an upgrade doesn't perform an initialization call.
188187
*/
189188
function _checkNonPayable() private {
190189
if (msg.value > 0) {

contracts/proxy/beacon/IBeacon.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface IBeacon {
1010
/**
1111
* @dev Must return an address that can be used as a delegate call target.
1212
*
13-
* {BeaconProxy} will check that this address is a contract.
13+
* {UpgradeableBeacon} will check that this address is a contract.
1414
*/
1515
function implementation() external view returns (address);
1616
}

contracts/proxy/transparent/ProxyAdmin.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ import {Ownable} from "../../access/Ownable.sol";
99
/**
1010
* @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an
1111
* explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.
12+
*
13+
* NOTE: This contract does not make use of {Context} deliberately.
1214
*/
1315
contract ProxyAdmin is Ownable {
1416
/**
1517
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgrade(address)`
1618
* and `upgradeAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
1719
* while `upgradeAndCall` will invoke the `receive` function if the second argument is the empty byte string.
1820
* If the getter returns `"5.0.0"`, only `upgradeAndCall(address,bytes)` is present, and the second argument must
19-
* be the empty byte string if no function should be called, being impossible to invoke the `receive` function
21+
* be the empty byte string if no function should be called, making impossible to invoke the `receive` function
2022
* during an upgrade.
2123
*/
2224
string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";

contracts/proxy/utils/UUPSUpgradeable.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable {
2525
* and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
2626
* while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
2727
* If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
28-
* be the empty byte string if no function should be called, being impossible to invoke the `receive` function
28+
* be the empty byte string if no function should be called, making impossible to invoke the `receive` function
2929
* during an upgrade.
3030
*/
3131
string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";
@@ -126,7 +126,9 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable {
126126
function _authorizeUpgrade(address newImplementation) internal virtual;
127127

128128
/**
129-
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
129+
* @dev Performs ab implementation upgrade with a security check for UUPS proxies, and additional setup call.
130+
*
131+
* The security check calling {proxiableUUID} expects the id to be the ERC1967's implementation.
130132
*
131133
* Emits an {IERC1967-Upgraded} event.
132134
*/

0 commit comments

Comments
 (0)