diff --git a/contracts/metatx/ERC2771Forwarder.sol b/contracts/metatx/ERC2771Forwarder.sol index dc0a9bbd967..02af6637ea3 100644 --- a/contracts/metatx/ERC2771Forwarder.sol +++ b/contracts/metatx/ERC2771Forwarder.sol @@ -107,8 +107,8 @@ contract ERC2771Forwarder is EIP712, Nonces { * receiver is provided. */ function verify(ForwardRequestData calldata request) public view virtual returns (bool) { - (bool alive, bool signerMatch, ) = _validate(request); - return alive && signerMatch; + (bool unexpired, bool signerMatch, ) = _validate(request); + return unexpired && signerMatch; } /** @@ -196,7 +196,7 @@ contract ERC2771Forwarder is EIP712, Nonces { */ function _validate( ForwardRequestData calldata request - ) internal view virtual returns (bool alive, bool signerMatch, address signer) { + ) internal view virtual returns (bool unexpired, bool signerMatch, address signer) { (address recovered, bool isValid) = _recoverForwardRequestSigner(request); return (isValid && request.deadline >= block.timestamp, recovered == request.from, recovered); } @@ -247,12 +247,12 @@ contract ERC2771Forwarder is EIP712, Nonces { ForwardRequestData calldata request, bool requireValidRequest ) internal virtual returns (bool success) { - (bool alive, bool signerMatch, address signer) = _validate(request); + (bool unexpired, bool signerMatch, address signer) = _validate(request); // Need to explicitly specify if a revert is required since non-reverting is default for // batches and reversion is opt-in since it could be useful in some scenarios if (requireValidRequest) { - if (!alive) { + if (!unexpired) { revert ERC2771ForwarderExpiredRequest(request.deadline); } @@ -262,7 +262,7 @@ contract ERC2771Forwarder is EIP712, Nonces { } // Ignore an invalid request because requireValidRequest = false - if (signerMatch && alive) { + if (signerMatch && unexpired) { // Nonce should be used before the call to prevent reusing by reentrancy uint256 currentNonce = _useNonce(signer); diff --git a/contracts/proxy/ERC1967/ERC1967Proxy.sol b/contracts/proxy/ERC1967/ERC1967Proxy.sol index 5e3f4dc78be..df3a6136919 100644 --- a/contracts/proxy/ERC1967/ERC1967Proxy.sol +++ b/contracts/proxy/ERC1967/ERC1967Proxy.sol @@ -14,17 +14,17 @@ import {ERC1967Utils} from "./ERC1967Utils.sol"; */ contract ERC1967Proxy is Proxy { /** - * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. + * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`. * - * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded + * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an encoded * function call, and allows initializing the storage of the proxy like a Solidity constructor. * * Requirements: * * - If `data` is empty, `msg.value` must be zero. */ - constructor(address _logic, bytes memory _data) payable { - ERC1967Utils.upgradeToAndCall(_logic, _data); + constructor(address implementation, bytes memory _data) payable { + ERC1967Utils.upgradeToAndCall(implementation, _data); } /** diff --git a/contracts/utils/Strings.sol b/contracts/utils/Strings.sol index 0037eee1b59..24c22d53d75 100644 --- a/contracts/utils/Strings.sol +++ b/contracts/utils/Strings.sol @@ -10,7 +10,7 @@ import {SignedMath} from "./math/SignedMath.sol"; * @dev String operations. */ library Strings { - bytes16 private constant _SYMBOLS = "0123456789abcdef"; + bytes16 private constant _HEX_DIGITS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** @@ -34,7 +34,7 @@ library Strings { ptr--; /// @solidity memory-safe-assembly assembly { - mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) + mstore8(ptr, byte(mod(value, 10), _HEX_DIGITS)) } value /= 10; if (value == 0) break; @@ -68,7 +68,7 @@ library Strings { buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { - buffer[i] = _SYMBOLS[localValue & 0xf]; + buffer[i] = _HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) {