aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 21:18:13 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 21:18:13 +0800
commitd5d20db439a4a6fe913462bd216a776cc4300450 (patch)
tree727913fb2c38945197c18b901a3e64a6ae4670de /src/contract_wrappers/exchange_wrapper.ts
parent07cdfa655be81862f7ff40fe5ac6fdb38d780370 (diff)
downloaddexon-sol-tools-d5d20db439a4a6fe913462bd216a776cc4300450.tar
dexon-sol-tools-d5d20db439a4a6fe913462bd216a776cc4300450.tar.gz
dexon-sol-tools-d5d20db439a4a6fe913462bd216a776cc4300450.tar.bz2
dexon-sol-tools-d5d20db439a4a6fe913462bd216a776cc4300450.tar.lz
dexon-sol-tools-d5d20db439a4a6fe913462bd216a776cc4300450.tar.xz
dexon-sol-tools-d5d20db439a4a6fe913462bd216a776cc4300450.tar.zst
dexon-sol-tools-d5d20db439a4a6fe913462bd216a776cc4300450.zip
Add NOT_A_TAKER check
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 7a5b6ac8c..e53754e07 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -116,6 +116,9 @@ export class ExchangeWrapper extends ContractWrapper {
if (fillAmount.eq(0)) {
throw new Error(FillOrderValidationErrs.FILL_AMOUNT_IS_ZERO);
}
+ if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== senderAddress) {
+ throw new Error(FillOrderValidationErrs.NOT_A_TAKER);
+ }
}
private async getExchangeInstanceOrThrowAsync(): Promise<ExchangeContract> {
const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any));