diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-08-09 06:50:59 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-08-09 06:50:59 +0800 |
commit | 03fb73d1d2017b41551f47552a5ca06f0dfb0f08 (patch) | |
tree | 995cb4f549f45ba88c7ce2b3e71e5ff0ac761a27 /packages | |
parent | 2a85f79040117cbcf58a03fb66dbd67f83b257d3 (diff) | |
parent | 651a468b4476a20542014da93b04f93fd3ff0515 (diff) | |
download | dexon-sol-tools-03fb73d1d2017b41551f47552a5ca06f0dfb0f08.tar dexon-sol-tools-03fb73d1d2017b41551f47552a5ca06f0dfb0f08.tar.gz dexon-sol-tools-03fb73d1d2017b41551f47552a5ca06f0dfb0f08.tar.bz2 dexon-sol-tools-03fb73d1d2017b41551f47552a5ca06f0dfb0f08.tar.lz dexon-sol-tools-03fb73d1d2017b41551f47552a5ca06f0dfb0f08.tar.xz dexon-sol-tools-03fb73d1d2017b41551f47552a5ca06f0dfb0f08.tar.zst dexon-sol-tools-03fb73d1d2017b41551f47552a5ca06f0dfb0f08.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into development
Diffstat (limited to 'packages')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol index ac7382715..44de54817 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol @@ -96,14 +96,15 @@ contract MixinSignatureValidator is "LENGTH_GREATER_THAN_0_REQUIRED" ); - // Ensure signature is supported + // Pop last byte off of signature byte array. uint8 signatureTypeRaw = uint8(signature.popLastByte()); + + // Ensure signature is supported require( signatureTypeRaw < uint8(SignatureType.NSignatureTypes), "SIGNATURE_UNSUPPORTED" ); - // Pop last byte off of signature byte array. SignatureType signatureType = SignatureType(signatureTypeRaw); // Variables are not scoped in Solidity. @@ -141,7 +142,12 @@ contract MixinSignatureValidator is v = uint8(signature[0]); r = signature.readBytes32(1); s = signature.readBytes32(33); - recovered = ecrecover(hash, v, r, s); + recovered = ecrecover( + hash, + v, + r, + s + ); isValid = signerAddress == recovered; return isValid; @@ -197,7 +203,6 @@ contract MixinSignatureValidator is // | 0x14 + x | 1 | Signature type is always "\x06" | } else if (signatureType == SignatureType.Validator) { // Pop last 20 bytes off of signature byte array. - address validatorAddress = signature.popLast20Bytes(); // Ensure signer has approved validator. |