aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-05-01 17:06:17 +0800
committerJacob Evans <jacob@dekz.net>2018-05-01 17:06:17 +0800
commit8e7937bdb61887ea3df66a602a275f5643e6585c (patch)
tree6f98eb5574b104b0e1862d217f2ab55109a7c511 /packages/0x.js/src
parentb36587fac833f4fa35aaed49e4ee05f6ce347a02 (diff)
downloaddexon-sol-tools-8e7937bdb61887ea3df66a602a275f5643e6585c.tar
dexon-sol-tools-8e7937bdb61887ea3df66a602a275f5643e6585c.tar.gz
dexon-sol-tools-8e7937bdb61887ea3df66a602a275f5643e6585c.tar.bz2
dexon-sol-tools-8e7937bdb61887ea3df66a602a275f5643e6585c.tar.lz
dexon-sol-tools-8e7937bdb61887ea3df66a602a275f5643e6585c.tar.xz
dexon-sol-tools-8e7937bdb61887ea3df66a602a275f5643e6585c.tar.zst
dexon-sol-tools-8e7937bdb61887ea3df66a602a275f5643e6585c.zip
Update comment to be more descriptive of null address in exchange simulator
Diffstat (limited to 'packages/0x.js/src')
-rw-r--r--packages/0x.js/src/utils/exchange_transfer_simulator.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/0x.js/src/utils/exchange_transfer_simulator.ts b/packages/0x.js/src/utils/exchange_transfer_simulator.ts
index ccefea930..f8301f5c2 100644
--- a/packages/0x.js/src/utils/exchange_transfer_simulator.ts
+++ b/packages/0x.js/src/utils/exchange_transfer_simulator.ts
@@ -67,7 +67,9 @@ export class ExchangeTransferSimulator {
tradeSide: TradeSide,
transferType: TransferType,
): Promise<void> {
- // If we are simulating an open order then 0x0 will have no balance or allowance
+ // HACK: When simulating an open order (e.g taker is NULL_ADDRESS), we don't want to adjust balances/
+ // allowances for the taker. We do however, want to increase the balance of the maker since the maker
+ // might be relying on those funds to fill subsequent orders or pay the order's fees.
if (from === constants.NULL_ADDRESS && tradeSide === TradeSide.Taker) {
await this._increaseBalanceAsync(tokenAddress, to, amountInBaseUnits);
return;