diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-08-25 01:01:24 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-08-25 05:39:08 +0800 |
commit | 8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd (patch) | |
tree | 7b5d71c6cc99429c6e485efed15b555e0f72ed14 /packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol | |
parent | 7351bf0b14e24af78cd67e1c91c18ae0ca078bf1 (diff) | |
download | dexon-sol-tools-8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd.tar dexon-sol-tools-8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd.tar.gz dexon-sol-tools-8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd.tar.bz2 dexon-sol-tools-8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd.tar.lz dexon-sol-tools-8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd.tar.xz dexon-sol-tools-8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd.tar.zst dexon-sol-tools-8ce4f9c784556e93bde2c58b670bf6efd5d3b7fd.zip |
Remove SignatureType.Caller
Diffstat (limited to 'packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol | 34 |
1 files changed, 10 insertions, 24 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 017da742e..401fdd377 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol @@ -48,14 +48,16 @@ contract MixinSignatureValidator is ) external { - require( - isValidSignature( - hash, - signerAddress, - signature - ), - "INVALID_SIGNATURE" - ); + if (signerAddress != msg.sender) { + require( + isValidSignature( + hash, + signerAddress, + signature + ), + "INVALID_SIGNATURE" + ); + } preSigned[hash][signerAddress] = true; } @@ -172,22 +174,6 @@ contract MixinSignatureValidator is isValid = signerAddress == recovered; return isValid; - // Implicitly signed by caller. - // The signer has initiated the call. In the case of non-contract - // accounts it means the transaction itself was signed. - // Example: let's say for a particular operation three signatures - // A, B and C are required. To submit the transaction, A and B can - // give a signature to C, who can then submit the transaction using - // `Caller` for his own signature. Or A and C can sign and B can - // submit using `Caller`. Having `Caller` allows this flexibility. - } else if (signatureType == SignatureType.Caller) { - require( - signature.length == 0, - "LENGTH_0_REQUIRED" - ); - isValid = signerAddress == msg.sender; - return isValid; - // Signature verified by wallet contract. // If used with an order, the maker of the order is the wallet contract. } else if (signatureType == SignatureType.Wallet) { |