diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-15 06:00:02 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-15 06:00:02 +0800 |
commit | eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36 (patch) | |
tree | cb281c8fba3f1535d6b7f7a5de7f880a2257e776 /packages/order-utils/src/exchange_transfer_simulator.ts | |
parent | 12033abe095e902102f1d56e7a2711a630e6826b (diff) | |
download | dexon-0x-contracts-eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36.tar dexon-0x-contracts-eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36.tar.gz dexon-0x-contracts-eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36.tar.bz2 dexon-0x-contracts-eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36.tar.lz dexon-0x-contracts-eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36.tar.xz dexon-0x-contracts-eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36.tar.zst dexon-0x-contracts-eea86757d5cdd63de4b0b06f7dd76fc2c2ddbd36.zip |
- Refactor assetWrapper to contain more of the normalizing logic instead of erc20Wrapper and erc721Wrapper
- Add burn method to DummyERC721Token
- Add additional methods to assetWrapper to set balance/allowances on ERC20 and ERC721 tokens
- Use approve instead of approveAll for ERC721 tokens
Diffstat (limited to 'packages/order-utils/src/exchange_transfer_simulator.ts')
-rw-r--r-- | packages/order-utils/src/exchange_transfer_simulator.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/packages/order-utils/src/exchange_transfer_simulator.ts b/packages/order-utils/src/exchange_transfer_simulator.ts index cac4af243..a70259fcd 100644 --- a/packages/order-utils/src/exchange_transfer_simulator.ts +++ b/packages/order-utils/src/exchange_transfer_simulator.ts @@ -91,12 +91,11 @@ export class ExchangeTransferSimulator { amountInBaseUnits: BigNumber, ): Promise<void> { const assetProxyId = assetProxyUtils.decodeAssetDataId(assetData); - const isERC721Asset = assetProxyId === AssetProxyId.ERC721; const proxyAllowance = await this._store.getProxyAllowanceAsync(assetData, userAddress); // HACK: This code assumes that all tokens with an UNLIMITED_ALLOWANCE_IN_BASE_UNITS set, // are UnlimitedAllowanceTokens. This is however not true, it just so happens that all // DummyERC20Tokens we use in tests are. - if (!proxyAllowance.eq(constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS) && !isERC721Asset) { + if (!proxyAllowance.eq(constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS)) { this._store.setProxyAllowance(assetData, userAddress, proxyAllowance.minus(amountInBaseUnits)); } } |