From 7de9a36d01d68d97e43ef3d0a9d2ddd3150b1077 Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Fri, 12 Apr 2019 12:29:56 -0400 Subject: [PATCH] In `@0x/contracts-exchange`: Fix comments in `MixinSignatureValidator.sol`. --- .../contracts/src/MixinSignatureValidator.sol | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/exchange/contracts/src/MixinSignatureValidator.sol b/contracts/exchange/contracts/src/MixinSignatureValidator.sol index fbc48823e1..2c3eb28402 100644 --- a/contracts/exchange/contracts/src/MixinSignatureValidator.sol +++ b/contracts/exchange/contracts/src/MixinSignatureValidator.sol @@ -111,7 +111,7 @@ contract MixinSignatureValidator is )); } - // Pop last byte off of signature byte array. + // Read the last byte off of signature byte array. uint8 signatureTypeRaw = uint8(signature[signature.length-1]); // Ensure signature is supported @@ -219,12 +219,6 @@ contract MixinSignatureValidator is return isValid; // Signature verified by validator contract. - // If used with an order, the maker of the order can still be an EOA. - // A signature using this type should be encoded as: - // | Offset | Length | Contents | - // | 0x00 | x | Signature to validate | - // | 0x00 + x | 20 | Address of validator contract | - // | 0x14 + x | 1 | Signature type is always "\x06" | } else if (signatureType == SignatureType.Validator) { isValid = isValidValidatorSignature( hash, @@ -282,7 +276,6 @@ contract MixinSignatureValidator is assembly { mstore(signature, signatureLength) } - // Static call the verification function. (bool didSucceed, bytes memory returnData) = walletAddress.staticcall(callData); // Return data should be a single bool. @@ -311,6 +304,13 @@ contract MixinSignatureValidator is view returns (bool isValid) { + // If used with an order, the maker of the order can still be an EOA. + // A signature using this type should be encoded as: + // | Offset | Length | Contents | + // | 0x00 | x | Signature to validate | + // | 0x00 + x | 20 | Address of validator contract | + // | 0x14 + x | 1 | Signature type is always "\x06" | + uint256 signatureLength = signature.length; // Read the validator address from the signature. address validatorAddress = signature.readAddress(signatureLength - 21);