diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-08-25 05:38:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-25 05:38:54 +0800 |
commit | 7351bf0b14e24af78cd67e1c91c18ae0ca078bf1 (patch) | |
tree | 4054f02bf577ea213122cf5ad3694fc6586db85f /packages/contracts/src/2.0.0/protocol/Exchange/mixins | |
parent | 7f36574a57ced8ead0059b90673fe01f97f04827 (diff) | |
parent | 6a9669a409a61c4645af43f39a4e4a0761354e32 (diff) | |
download | dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar.gz dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar.zst dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.zip |
Merge pull request #1012 from 0xProject/feature/contracts/staticcall
Use staticcall for external function calls in MixinSignatureValidator
Diffstat (limited to 'packages/contracts/src/2.0.0/protocol/Exchange/mixins')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol b/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol index f14f2ba00..75fe9ec46 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/mixins/MSignatureValidator.sol @@ -43,4 +43,35 @@ contract MSignatureValidator is Trezor, // 0x08 NSignatureTypes // 0x09, number of signature types. Always leave at end. } + + /// @dev Verifies signature using logic defined by Wallet contract. + /// @param hash Any 32 byte hash. + /// @param walletAddress Address that should have signed the given hash + /// and defines its own signature verification method. + /// @param signature Proof that the hash has been signed by signer. + /// @return True if the address recovered from the provided signature matches the input signer address. + function isValidWalletSignature( + bytes32 hash, + address walletAddress, + bytes signature + ) + internal + view + returns (bool isValid); + + /// @dev Verifies signature using logic defined by Validator contract. + /// @param validatorAddress Address of validator contract. + /// @param hash Any 32 byte hash. + /// @param signerAddress Address that should have signed the given hash. + /// @param signature Proof that the hash has been signed by signer. + /// @return True if the address recovered from the provided signature matches the input signer address. + function isValidValidatorSignature( + address validatorAddress, + bytes32 hash, + address signerAddress, + bytes signature + ) + internal + view + returns (bool isValid); } |