aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-02 23:02:16 +0800
committerFabio Berger <me@fabioberger.com>2017-06-02 23:02:16 +0800
commit38c48eb2266632a10fee75ecea7bbce4c343c1cb (patch)
treeaf7ddddb9ecd51b0049f0d5fb6a13f56d90b8667 /src/contract_wrappers/exchange_wrapper.ts
parent166de5da02bbb8b0dd3501b595113221a802ac92 (diff)
downloaddexon-sol-tools-38c48eb2266632a10fee75ecea7bbce4c343c1cb.tar
dexon-sol-tools-38c48eb2266632a10fee75ecea7bbce4c343c1cb.tar.gz
dexon-sol-tools-38c48eb2266632a10fee75ecea7bbce4c343c1cb.tar.bz2
dexon-sol-tools-38c48eb2266632a10fee75ecea7bbce4c343c1cb.tar.lz
dexon-sol-tools-38c48eb2266632a10fee75ecea7bbce4c343c1cb.tar.xz
dexon-sol-tools-38c48eb2266632a10fee75ecea7bbce4c343c1cb.tar.zst
dexon-sol-tools-38c48eb2266632a10fee75ecea7bbce4c343c1cb.zip
Improve fillOrderAsync comment
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 93e49cf33..131211771 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -61,9 +61,12 @@ export class ExchangeWrapper extends ContractWrapper {
return isValidSignature;
}
/**
- * Fills a signed order with a fillAmount denominated in baseUnits of the taker token. The caller can
- * decide whether they want the call to throw if the balance/allowance checks fail by setting
- * shouldCheckTransfer to false. If set to true, the call will fail without throwing, preserving gas costs.
+ * Fills a signed order with a fillAmount denominated in baseUnits of the taker token.
+ * Since the order in which transactions are included in the next block is indeterminate, race-conditions
+ * could arise where a users balance or allowance changes before the fillOrder executes. Because of this,
+ * we allow you to specify `shouldCheckTransfer`. If true, the smart contract will not throw if while
+ * executing, the parties do not have sufficient balances/allowances, preserving gas costs. Setting it to
+ * false foregoes this check and causes the smart contract to throw instead.
*/
public async fillOrderAsync(signedOrder: SignedOrder, fillTakerAmountInBaseUnits: BigNumber.BigNumber,
shouldCheckTransfer: boolean): Promise<void> {