diff --git a/contracts/coordinator/test/coordinator.ts b/contracts/coordinator/test/coordinator.ts index 2369ac7797..ac3d2cd108 100644 --- a/contracts/coordinator/test/coordinator.ts +++ b/contracts/coordinator/test/coordinator.ts @@ -111,10 +111,8 @@ describe('Coordinator tests', () => { takerAssetData: assetDataUtils.encodeERC20AssetData(erc20TokenB.address), makerFeeAssetData: assetDataUtils.encodeERC20AssetData(makerFeeToken.address), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(makerFeeToken.address), - domain: { - verifyingContract: exchange.address, - chainId, - }, + exchangeAddress: exchange.address, + chainId, }; const makerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; const takerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)]; diff --git a/contracts/coordinator/test/mixins.ts b/contracts/coordinator/test/mixins.ts index 0e4d256708..6394b4e12b 100644 --- a/contracts/coordinator/test/mixins.ts +++ b/contracts/coordinator/test/mixins.ts @@ -12,7 +12,7 @@ import { } from '@0x/contracts-test-utils'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { transactionHashUtils } from '@0x/order-utils'; -import { EIP712DomainWithDefaultSchema, RevertReason, SignatureType, SignedOrder } from '@0x/types'; +import { RevertReason, SignatureType, SignedOrder } from '@0x/types'; import { BigNumber, LibBytesRevertErrors, providerUtils } from '@0x/utils'; import * as chai from 'chai'; import * as ethUtil from 'ethereumjs-util'; @@ -34,7 +34,6 @@ describe('Mixins tests', () => { let approvalFactory2: ApprovalFactory; let defaultOrder: SignedOrder; const exchangeAddress = randomAddress(); - let exchangeDomain: EIP712DomainWithDefaultSchema; before(async () => { await blockchainLifecycle.startAsync(); @@ -54,10 +53,6 @@ describe('Mixins tests', () => { ); const accounts = await web3Wrapper.getAvailableAddressesAsync(); [transactionSignerAddress, approvalSignerAddress1, approvalSignerAddress2] = accounts.slice(0, 3); - exchangeDomain = { - verifyingContract: constants.NULL_ADDRESS, - chainId, - }; defaultOrder = { makerAddress: constants.NULL_ADDRESS, takerAddress: constants.NULL_ADDRESS, @@ -74,7 +69,8 @@ describe('Mixins tests', () => { expirationTimeSeconds: constants.ZERO_AMOUNT, salt: constants.ZERO_AMOUNT, signature: constants.NULL_BYTES, - domain: exchangeDomain, + exchangeAddress: constants.NULL_ADDRESS, + chainId, }; const transactionSignerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(transactionSignerAddress)]; const approvalSignerPrivateKey1 = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(approvalSignerAddress1)]; @@ -152,7 +148,8 @@ describe('Mixins tests', () => { const decodedSignedOrders = decodedOrders.map(order => ({ ...order, signature: constants.NULL_BYTES, - domain: exchangeDomain, + exchangeAddress: constants.NULL_ADDRESS, + chainId, })); expect(orders).to.deep.eq(decodedSignedOrders); }); @@ -165,7 +162,8 @@ describe('Mixins tests', () => { const decodedSignedOrders = decodedOrders.map(order => ({ ...order, signature: constants.NULL_BYTES, - domain: exchangeDomain, + exchangeAddress: constants.NULL_ADDRESS, + chainId, })); expect(orders).to.deep.eq(decodedSignedOrders); }); @@ -178,7 +176,8 @@ describe('Mixins tests', () => { const decodedSignedOrders = decodedOrders.map(order => ({ ...order, signature: constants.NULL_BYTES, - domain: exchangeDomain, + exchangeAddress: constants.NULL_ADDRESS, + chainId, })); expect(orders).to.deep.eq(decodedSignedOrders); }); diff --git a/contracts/dev-utils/test/order_validation_utils.ts b/contracts/dev-utils/test/order_validation_utils.ts index 9fbcf33f8e..26a9787cf9 100644 --- a/contracts/dev-utils/test/order_validation_utils.ts +++ b/contracts/dev-utils/test/order_validation_utils.ts @@ -120,10 +120,8 @@ describe('OrderValidationUtils/OrderTransferSimulatorUtils', () => { takerAssetData: erc20AssetData2, makerFeeAssetData: feeAssetData, takerFeeAssetData: feeAssetData, - domain: { - verifyingContract: exchange.address, - chainId, - }, + exchangeAddress: exchange.address, + chainId, }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); diff --git a/contracts/exchange-forwarder/test/forwarder.ts b/contracts/exchange-forwarder/test/forwarder.ts index e960bf44ed..992218ff95 100644 --- a/contracts/exchange-forwarder/test/forwarder.ts +++ b/contracts/exchange-forwarder/test/forwarder.ts @@ -120,10 +120,8 @@ blockchainTests(ContractName.Forwarder, env => { takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultMakerAssetAddress), makerFee: Web3Wrapper.toBaseUnitAmount(0, DECIMALS_DEFAULT), takerFee: Web3Wrapper.toBaseUnitAmount(0, DECIMALS_DEFAULT), - domain: { - verifyingContract: exchangeInstance.address, - chainId, - }, + exchangeAddress: exchangeInstance.address, + chainId, }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); diff --git a/contracts/exchange-libs/src/reference_functions.ts b/contracts/exchange-libs/src/reference_functions.ts index 4a79c413e4..6b77a3cea8 100644 --- a/contracts/exchange-libs/src/reference_functions.ts +++ b/contracts/exchange-libs/src/reference_functions.ts @@ -1,6 +1,6 @@ import { ReferenceFunctions } from '@0x/contracts-utils'; import { LibMathRevertErrors } from '@0x/order-utils'; -import { FillResults, OrderWithoutDomain } from '@0x/types'; +import { FillResults, Order } from '@0x/types'; import { BigNumber } from '@0x/utils'; const { safeAdd, safeSub, safeMul, safeDiv } = ReferenceFunctions; @@ -94,7 +94,7 @@ export function addFillResults(a: FillResults, b: FillResults): FillResults { * Calculates amounts filled and fees paid by maker and taker. */ export function calculateFillResults( - order: OrderWithoutDomain, + order: Order, takerAssetFilledAmount: BigNumber, protocolFeeMultiplier: BigNumber, gasPrice: BigNumber, diff --git a/contracts/exchange-libs/test/lib_fill_results.ts b/contracts/exchange-libs/test/lib_fill_results.ts index 33fd4f3b3c..0e9cdf7cce 100644 --- a/contracts/exchange-libs/test/lib_fill_results.ts +++ b/contracts/exchange-libs/test/lib_fill_results.ts @@ -536,10 +536,8 @@ blockchainTests('LibFillResults', env => { feeRecipientAddress: randomAddress(), expirationTimeSeconds: randomUint256(), salt: randomUint256(), - domain: { - verifyingContract: constants.NULL_ADDRESS, - chainId: 1337, // The chain id for the isolated exchange - }, + exchangeAddress: constants.NULL_ADDRESS, + chainId: 1337, // The chain id for the isolated exchange }; function makeOrder(details?: Partial): Order { @@ -547,7 +545,7 @@ blockchainTests('LibFillResults', env => { } before(async () => { - ORDER_DEFAULTS.domain.verifyingContract = libsContract.address; + ORDER_DEFAULTS.exchangeAddress = libsContract.address; }); it('should correctly calculate the results when only the right order is fully filled', async () => { @@ -1209,10 +1207,8 @@ blockchainTests('LibFillResults', env => { feeRecipientAddress: randomAddress(), expirationTimeSeconds: randomUint256(), salt: randomUint256(), - domain: { - verifyingContract: constants.NULL_ADDRESS, - chainId: 1337, // The chain id for the isolated exchange - }, + exchangeAddress: constants.NULL_ADDRESS, + chainId: 1337, // The chain id for the isolated exchange }; function makeOrder(details?: Partial): Order { @@ -1220,7 +1216,7 @@ blockchainTests('LibFillResults', env => { } before(async () => { - ORDER_DEFAULTS.domain.verifyingContract = libsContract.address; + ORDER_DEFAULTS.exchangeAddress = libsContract.address; }); it('should transfer correct amounts when right order is fully filled', async () => { diff --git a/contracts/exchange-libs/test/lib_order.ts b/contracts/exchange-libs/test/lib_order.ts index f5a8451fd5..86353fa050 100644 --- a/contracts/exchange-libs/test/lib_order.ts +++ b/contracts/exchange-libs/test/lib_order.ts @@ -16,10 +16,8 @@ blockchainTests('LibOrder', env => { const randomAssetData = () => hexRandom(36); const EMPTY_ORDER: Order = { - domain: { - verifyingContract: constants.NULL_ADDRESS, - chainId: 0, - }, + exchangeAddress: constants.NULL_ADDRESS, + chainId: 0, senderAddress: constants.NULL_ADDRESS, makerAddress: constants.NULL_ADDRESS, takerAddress: constants.NULL_ADDRESS, @@ -52,7 +50,8 @@ blockchainTests('LibOrder', env => { const expectedHash = orderHashUtils.getOrderHashHex(order); const domainHash = ethUtil.bufferToHex( signTypedDataUtils.generateDomainHash({ - ...order.domain, + chainId: order.chainId, + exchangeAddress: order.exchangeAddress, name: constants.EIP712_DOMAIN_NAME, version: constants.EIP712_DOMAIN_VERSION, }), @@ -65,19 +64,14 @@ blockchainTests('LibOrder', env => { it('should correctly hash an empty order', async () => { await testGetTypedDataHashAsync({ ...EMPTY_ORDER, - domain: { - ...EMPTY_ORDER.domain, - verifyingContract: libOrderContract.address, - }, + exchangeAddress: libOrderContract.address, }); }); it('should correctly hash a non-empty order', async () => { await testGetTypedDataHashAsync({ - domain: { - verifyingContract: libOrderContract.address, - chainId: 1337, - }, + exchangeAddress: libOrderContract.address, + chainId: 1337, senderAddress: randomAddress(), makerAddress: randomAddress(), takerAddress: randomAddress(), @@ -98,14 +92,15 @@ blockchainTests('LibOrder', env => { it('orderHash should differ if the domain hash is different', async () => { const domainHash1 = ethUtil.bufferToHex( signTypedDataUtils.generateDomainHash({ - ...EMPTY_ORDER.domain, + chainId: EMPTY_ORDER.chainId, + exchangeAddress: EMPTY_ORDER.exchangeAddress, name: constants.EIP712_DOMAIN_NAME, version: constants.EIP712_DOMAIN_VERSION, }), ); const domainHash2 = ethUtil.bufferToHex( signTypedDataUtils.generateDomainHash({ - ...EMPTY_ORDER.domain, + exchangeAddress: EMPTY_ORDER.exchangeAddress, name: constants.EIP712_DOMAIN_NAME, version: constants.EIP712_DOMAIN_VERSION, chainId: 1337, @@ -135,10 +130,8 @@ blockchainTests('LibOrder', env => { it('should correctly hash a non-empty order', async () => { await testGetStructHashAsync({ // The domain is not used in this test, so it's okay if it is left empty. - domain: { - verifyingContract: constants.NULL_ADDRESS, - chainId: 0, - }, + exchangeAddress: constants.NULL_ADDRESS, + chainId: 0, senderAddress: randomAddress(), makerAddress: randomAddress(), takerAddress: randomAddress(), diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts index 140a8db0ab..1e55c3ec74 100644 --- a/contracts/exchange/test/core.ts +++ b/contracts/exchange/test/core.ts @@ -217,10 +217,8 @@ blockchainTests.resets('Exchange core', () => { takerAssetData: assetDataUtils.encodeERC20AssetData(defaultTakerAssetAddress), makerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), - domain: { - verifyingContract: exchange.address, - chainId, - }, + exchangeAddress: exchange.address, + chainId, }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); diff --git a/contracts/exchange/test/internal.ts b/contracts/exchange/test/internal.ts index 670ecede9e..5485397fff 100644 --- a/contracts/exchange/test/internal.ts +++ b/contracts/exchange/test/internal.ts @@ -56,10 +56,8 @@ blockchainTests('Exchange core internal functions', env => { salt: new BigNumber(_.random(0, 1e8)), feeRecipientAddress: randomAddress(), expirationTimeSeconds: new BigNumber(_.random(0, 1e8)), - domain: { - verifyingContract: constants.NULL_ADDRESS, - chainId: 1337, // The chain id for the isolated exchange - }, + exchangeAddress: constants.NULL_ADDRESS, + chainId: 1337, // The chain id for the isolated exchange }; function makeOrder(details?: Partial): Order { @@ -67,7 +65,7 @@ blockchainTests('Exchange core internal functions', env => { } before(async () => { - ORDER_DEFAULTS.domain.verifyingContract = testExchange.address; + ORDER_DEFAULTS.exchangeAddress = testExchange.address; }); it('should revert if the maker asset multiplication should overflow', async () => { @@ -292,7 +290,7 @@ blockchainTests('Exchange core internal functions', env => { ); const logs = receipt.logs as Array< LogWithDecodedArgs - >; + >; expect(logs.length === 4); expect(_.every(logs, log => log.event === 'DispatchTransferFromCalled')).to.be.true(); // taker -> maker @@ -472,7 +470,7 @@ blockchainTests('Exchange core internal functions', env => { ); const logs = receipt.logs as Array< LogWithDecodedArgs - >; + >; // Ensure that the logs have the correct lengths and names expect(logs.length).to.be.eq(7); @@ -566,7 +564,7 @@ blockchainTests('Exchange core internal functions', env => { ); const logs = receipt.logs as Array< LogWithDecodedArgs - >; + >; // Ensure that the logs have the correct lengths and names expect(logs.length).to.be.eq(8); diff --git a/contracts/exchange/test/match_orders.ts b/contracts/exchange/test/match_orders.ts index 1b52185b64..ce2a899897 100644 --- a/contracts/exchange/test/match_orders.ts +++ b/contracts/exchange/test/match_orders.ts @@ -198,10 +198,7 @@ describe('matchOrders', () => { defaultFeeTokenAddress = erc20Tokens[2].address; defaultERC721AssetAddress = erc721Token.address; defaultERC1155AssetAddress = erc1155Token.address; - const domain = { - verifyingContract: exchange.address, - chainId, - }; + // Create default order parameters const defaultOrderParamsLeft = { ...constants.STATIC_ORDER_PARAMS, @@ -211,7 +208,8 @@ describe('matchOrders', () => { makerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeTokenAddress), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeTokenAddress), feeRecipientAddress: feeRecipientAddressLeft, - domain, + exchangeAddress: exchange.address, + chainId, }; const defaultOrderParamsRight = { ...constants.STATIC_ORDER_PARAMS, @@ -221,7 +219,8 @@ describe('matchOrders', () => { makerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeTokenAddress), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeTokenAddress), feeRecipientAddress: feeRecipientAddressRight, - domain, + exchangeAddress: exchange.address, + chainId, }; const privateKeyLeft = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddressLeft)]; orderFactoryLeft = new OrderFactory(privateKeyLeft, defaultOrderParamsLeft); diff --git a/contracts/exchange/test/signature_validator.ts b/contracts/exchange/test/signature_validator.ts index b2d1377be9..f1107f7b92 100644 --- a/contracts/exchange/test/signature_validator.ts +++ b/contracts/exchange/test/signature_validator.ts @@ -435,10 +435,8 @@ blockchainTests.resets('MixinSignatureValidator', env => { takerFeeAssetData: assetDataUtils.encodeERC20AssetData(randomAddress()), makerFee: constants.ZERO_AMOUNT, takerFee: constants.ZERO_AMOUNT, - domain: { - verifyingContract: signatureValidator.address, - chainId, - }, + exchangeAddress: signatureValidator.address, + chainId, }; orderFactory = new OrderFactory(signerPrivateKey, defaultOrderParams); }); @@ -1148,7 +1146,7 @@ blockchainTests.resets('MixinSignatureValidator', env => { expect(res.logs.length).to.equal(1); const log = signatureValidatorLogDecoder.decodeLogOrThrow(res.logs[0]) as LogWithDecodedArgs< TestSignatureValidatorSignatureValidatorApprovalEventArgs - >; + >; const logArgs = log.args; expect(logArgs.signerAddress).to.equal(signerAddress); expect(logArgs.validatorAddress).to.equal(validatorWallet.address); @@ -1166,7 +1164,7 @@ blockchainTests.resets('MixinSignatureValidator', env => { expect(res.logs.length).to.equal(1); const log = signatureValidatorLogDecoder.decodeLogOrThrow(res.logs[0]) as LogWithDecodedArgs< TestSignatureValidatorSignatureValidatorApprovalEventArgs - >; + >; const logArgs = log.args; expect(logArgs.signerAddress).to.equal(signerAddress); expect(logArgs.validatorAddress).to.equal(validatorWallet.address); diff --git a/contracts/exchange/test/transactions.ts b/contracts/exchange/test/transactions.ts index 3ce7b0517d..e09f60149d 100644 --- a/contracts/exchange/test/transactions.ts +++ b/contracts/exchange/test/transactions.ts @@ -11,7 +11,7 @@ import { TransactionFactory, } from '@0x/contracts-test-utils'; import { assetDataUtils, ExchangeRevertErrors, orderHashUtils, transactionHashUtils } from '@0x/order-utils'; -import { EIP712DomainWithDefaultSchema, FillResults, OrderStatus } from '@0x/types'; +import { FillResults, OrderStatus } from '@0x/types'; import { AbiEncoder, BigNumber } from '@0x/utils'; import { LogWithDecodedArgs, MethodAbi } from 'ethereum-types'; import * as ethUtil from 'ethereumjs-util'; @@ -51,7 +51,6 @@ blockchainTests.resets('Exchange transactions', env => { let exchangeInstance: ExchangeContract; let erc20Proxy: ERC20ProxyContract; - let domain: EIP712DomainWithDefaultSchema; let orderFactory: OrderFactory; let makerTransactionFactory: TransactionFactory; let takerTransactionFactory: TransactionFactory; @@ -107,11 +106,6 @@ blockchainTests.resets('Exchange transactions', env => { defaultMakerFeeTokenAddress = makerFeeToken.address; defaultTakerFeeTokenAddress = takerFeeToken.address; - domain = { - verifyingContract: exchangeInstance.address, - chainId, - }; - const defaultOrderParams = { ...constants.STATIC_ORDER_PARAMS, makerAddress, @@ -120,7 +114,8 @@ blockchainTests.resets('Exchange transactions', env => { takerAssetData: assetDataUtils.encodeERC20AssetData(defaultTakerTokenAddress), makerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultMakerFeeTokenAddress), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultTakerFeeTokenAddress), - domain, + exchangeAddress: exchangeInstance.address, + chainId, }; makerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; takerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)]; @@ -146,7 +141,7 @@ blockchainTests.resets('Exchange transactions', env => { expect(transactionExecutionLogs.length).to.eq(1); const executionLogArgs = (transactionExecutionLogs[0] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(executionLogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction), ); @@ -611,7 +606,7 @@ blockchainTests.resets('Exchange transactions', env => { expect(validatorApprovalLogs.length).to.eq(1); const validatorApprovalLogArgs = (validatorApprovalLogs[0] as LogWithDecodedArgs< ExchangeSignatureValidatorApprovalEventArgs - >).args; + >).args; expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress); expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress); expect(validatorApprovalLogArgs.isApproved).to.eq(shouldApprove); @@ -633,7 +628,7 @@ blockchainTests.resets('Exchange transactions', env => { expect(validatorApprovalLogs.length).to.eq(1); const validatorApprovalLogArgs = (validatorApprovalLogs[0] as LogWithDecodedArgs< ExchangeSignatureValidatorApprovalEventArgs - >).args; + >).args; expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress); expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress); expect(validatorApprovalLogArgs.isApproved).to.eq(shouldApprove); @@ -661,14 +656,14 @@ blockchainTests.resets('Exchange transactions', env => { const execution1LogArgs = (transactionExecutionLogs[0] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution1LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction1), ); const execution2LogArgs = (transactionExecutionLogs[1] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution2LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction2), ); @@ -727,14 +722,14 @@ blockchainTests.resets('Exchange transactions', env => { const execution1LogArgs = (transactionExecutionLogs[0] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution1LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction1), ); const execution2LogArgs = (transactionExecutionLogs[1] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution2LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction2), ); @@ -792,14 +787,14 @@ blockchainTests.resets('Exchange transactions', env => { const execution1LogArgs = (transactionExecutionLogs[0] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution1LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction1), ); const execution2LogArgs = (transactionExecutionLogs[1] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution2LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction2), ); @@ -886,14 +881,14 @@ blockchainTests.resets('Exchange transactions', env => { const execution1LogArgs = (transactionExecutionLogs[0] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution1LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction1), ); const execution2LogArgs = (transactionExecutionLogs[1] as LogWithDecodedArgs< ExchangeTransactionExecutionEventArgs - >).args; + >).args; expect(execution2LogArgs.transactionHash).to.equal( transactionHashUtils.getTransactionHashHex(transaction2), ); diff --git a/contracts/exchange/test/utils/isolated_exchange_wrapper.ts b/contracts/exchange/test/utils/isolated_exchange_wrapper.ts index 43434ca4b4..239ece515b 100644 --- a/contracts/exchange/test/utils/isolated_exchange_wrapper.ts +++ b/contracts/exchange/test/utils/isolated_exchange_wrapper.ts @@ -101,11 +101,11 @@ export class IsolatedExchangeWrapper { } public getOrderHash(order: Order): string { - const domain = { - verifyingContract: this.instance.address, + const domainInfo = { + exchangeAddress: this.instance.address, chainId: IsolatedExchangeWrapper.CHAIN_ID, }; - return orderHashUtils.getOrderHashHex({ ...order, domain }); + return orderHashUtils.getOrderHashHex({ ...order, ...domainInfo }); } public async getOrderInfoAsync(order: Order): Promise { @@ -126,11 +126,11 @@ export class IsolatedExchangeWrapper { TCallAsyncArgs extends any[], TAwaitTransactionSuccessAsyncArgs extends any[], TResult - >( - contractFunction: MutatorContractFunction, - // tslint:disable-next-line: trailing-comma - ...args: TAwaitTransactionSuccessAsyncArgs - ): Promise { + >( + contractFunction: MutatorContractFunction, + // tslint:disable-next-line: trailing-comma + ...args: TAwaitTransactionSuccessAsyncArgs + ): Promise { this.lastTxEvents = createEmptyEvents(); this.lastTxBalanceChanges = {}; const [result, receipt] = await this.txHelper.getResultAndReceiptAsync(contractFunction, ...args); diff --git a/contracts/exchange/test/utils/order_factory_from_scenario.ts b/contracts/exchange/test/utils/order_factory_from_scenario.ts index 4a4ec073f5..a5fedd7575 100644 --- a/contracts/exchange/test/utils/order_factory_from_scenario.ts +++ b/contracts/exchange/test/utils/order_factory_from_scenario.ts @@ -430,10 +430,8 @@ export class OrderFactoryFromScenario { salt: generatePseudoRandomSalt(), feeRecipientAddress, expirationTimeSeconds, - domain: { - verifyingContract: this._exchangeAddress, - chainId: this._chainId, - }, + exchangeAddress: this._exchangeAddress, + chainId: this._chainId, }; return order; diff --git a/contracts/exchange/test/wrapper.ts b/contracts/exchange/test/wrapper.ts index 7fc562c59a..f6efa9cd16 100644 --- a/contracts/exchange/test/wrapper.ts +++ b/contracts/exchange/test/wrapper.ts @@ -97,10 +97,8 @@ blockchainTests.resets('Exchange wrappers', env => { takerAssetData: assetDataUtils.encodeERC20AssetData(defaultTakerAssetAddress), makerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(defaultFeeAssetAddress), - domain: { - verifyingContract: exchange.address, - chainId, - }, + exchangeAddress: exchange.address, + chainId, }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); @@ -607,7 +605,7 @@ blockchainTests.resets('Exchange wrappers', env => { protocolFeePaid: totalFillResults.protocolFeePaid.plus(currentFillResults.protocolFeePaid), }), nullFillResults, - ); + ); expect(fillResults).to.deep.equal(expectedFillResults); expect(newBalances).to.be.deep.equal(erc20Balances); @@ -683,7 +681,7 @@ blockchainTests.resets('Exchange wrappers', env => { protocolFeePaid: totalFillResults.protocolFeePaid.plus(currentFillResults.protocolFeePaid), }), nullFillResults, - ); + ); expect(fillResults).to.deep.equal(expectedFillResults); expect(newBalances).to.be.deep.equal(erc20Balances); @@ -799,7 +797,7 @@ blockchainTests.resets('Exchange wrappers', env => { protocolFeePaid: totalFillResults.protocolFeePaid.plus(currentFillResults.protocolFeePaid), }), nullFillResults, - ); + ); expect(fillResults).to.deep.equal(expectedFillResults); expect(newBalances).to.be.deep.equal(erc20Balances); @@ -876,7 +874,7 @@ blockchainTests.resets('Exchange wrappers', env => { protocolFeePaid: totalFillResults.protocolFeePaid.plus(currentFillResults.protocolFeePaid), }), nullFillResults, - ); + ); expect(fillResults).to.deep.equal(expectedFillResults); expect(newBalances).to.be.deep.equal(erc20Balances); diff --git a/contracts/exchange/test/wrapper_unit_tests.ts b/contracts/exchange/test/wrapper_unit_tests.ts index f9a231b71e..954c5fc012 100644 --- a/contracts/exchange/test/wrapper_unit_tests.ts +++ b/contracts/exchange/test/wrapper_unit_tests.ts @@ -90,10 +90,8 @@ blockchainTests('Exchange wrapper functions unit tests.', env => { function getExpectedOrderHash(order: Order): string { return orderHashUtils.getOrderHashHex({ ...order, - domain: { - verifyingContract: testContract.address, - chainId: CHAIN_ID, - }, + exchangeAddress: testContract.address, + chainId: CHAIN_ID, }); } diff --git a/contracts/extensions/test/balance_threshold_filter.ts b/contracts/extensions/test/balance_threshold_filter.ts index a34a7bcba3..1a90ae975a 100644 --- a/contracts/extensions/test/balance_threshold_filter.ts +++ b/contracts/extensions/test/balance_threshold_filter.ts @@ -177,10 +177,8 @@ describe(ContractName.BalanceThresholdFilter, () => { makerFee: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), DECIMALS_DEFAULT), takerFee: Web3Wrapper.toBaseUnitAmount(new BigNumber(150), DECIMALS_DEFAULT), senderAddress: erc721BalanceThresholdFilterInstance.address, - domain: { - verifyingContract: exchangeInstance.address, - chainId, - }, + exchangeAddress: exchangeInstance.address, + chainId, }; // Create two order factories with valid makers (who meet the threshold balance), and // one factory for an invalid address (that does not meet the threshold balance) diff --git a/contracts/extensions/test/dutch_auction.ts b/contracts/extensions/test/dutch_auction.ts index 7d1fdf44aa..82b2b4c659 100644 --- a/contracts/extensions/test/dutch_auction.ts +++ b/contracts/extensions/test/dutch_auction.ts @@ -163,10 +163,8 @@ describe(ContractName.DutchAuction, () => { expirationTimeSeconds: auctionEndTimeSeconds, makerFee: constants.ZERO_AMOUNT, takerFee: constants.ZERO_AMOUNT, - domain: { - verifyingContract: exchangeInstance.address, - chainId, - }, + exchangeAddress: exchangeInstance.address, + chainId, }; // Default buy order is for the auction begin price const buyerDefaultOrderParams = { diff --git a/contracts/extensions/test/order_matcher.ts b/contracts/extensions/test/order_matcher.ts index f5a0b1b9e5..cdc5d44a66 100644 --- a/contracts/extensions/test/order_matcher.ts +++ b/contracts/extensions/test/order_matcher.ts @@ -166,11 +166,6 @@ describe('OrderMatcher', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - const domain = { - verifyingContract: exchange.address, - chainId, - }; - // Create default order parameters const defaultOrderParamsLeft = { ...constants.STATIC_ORDER_PARAMS, @@ -180,7 +175,8 @@ describe('OrderMatcher', () => { feeRecipientAddress: feeRecipientAddressLeft, makerFee: constants.ZERO_AMOUNT, takerFee: constants.ZERO_AMOUNT, - domain, + exchangeAddress: exchange.address, + chainId, }; const defaultOrderParamsRight = { ...constants.STATIC_ORDER_PARAMS, @@ -190,7 +186,8 @@ describe('OrderMatcher', () => { feeRecipientAddress: feeRecipientAddressRight, makerFee: constants.ZERO_AMOUNT, takerFee: constants.ZERO_AMOUNT, - domain, + exchangeAddress: exchange.address, + chainId, }; const privateKeyLeft = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddressLeft)]; orderFactoryLeft = new OrderFactory(privateKeyLeft, defaultOrderParamsLeft); diff --git a/contracts/test-utils/src/order_utils.ts b/contracts/test-utils/src/order_utils.ts index 7dac2711d4..a01094c2df 100644 --- a/contracts/test-utils/src/order_utils.ts +++ b/contracts/test-utils/src/order_utils.ts @@ -31,7 +31,7 @@ export const orderUtils = { return cancel; }, getOrderWithoutDomain(signedOrder: SignedOrder): OrderWithoutDomain { - return _.omit(signedOrder, ['signature', 'domain']) as OrderWithoutDomain; + return _.omit(signedOrder, ['signature', 'exchangeAddress', 'chainId']) as OrderWithoutDomain; }, createBatchMatchOrders(signedOrdersLeft: SignedOrder[], signedOrdersRight: SignedOrder[]): BatchMatchOrder { return { diff --git a/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts b/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts index 38ddb229e7..44a919d854 100644 --- a/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts +++ b/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts @@ -82,10 +82,8 @@ describe('ExchangeSwapQuoteConsumer', () => { takerAssetData, makerFeeAssetData: assetDataUtils.encodeERC20AssetData(contractAddresses.zrxToken), takerFeeAssetData: assetDataUtils.encodeERC20AssetData(contractAddresses.zrxToken), - domain: { - verifyingContract: contractAddresses.exchange, - chainId: networkId, - }, + exchangeAddress: contractAddresses.exchange, + chainId: networkId, }; const privateKey = devConstants.TESTRPC_PRIVATE_KEYS[userAddresses.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); diff --git a/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts index 4881bb6532..fa639d38fe 100644 --- a/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts +++ b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts @@ -25,10 +25,8 @@ export const orderbookResponse: OrderbookResponse = { makerFeeAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d', takerFeeAssetData: '0x0257179264389b814a946f3e92105513705ca6b990', signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33', - domain: { - chainId: 1, - verifyingContract: '0x12459c951127e0c374ff9105dda097662a027093', - }, + chainId: 1, + exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093', }, metaData: {}, }, @@ -56,10 +54,8 @@ export const orderbookResponse: OrderbookResponse = { makerFeeAssetData: '0x0257179264389b814a946f3e92105513705ca6b990', takerFeeAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d', signature: '0x013842a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b3518891', - domain: { - chainId: 1, - verifyingContract: '0x12459c951127e0c374ff9105dda097662a027093', - }, + chainId: 1, + exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093', }, metaData: {}, }, diff --git a/packages/connect/test/fixtures/standard_relayer_api/orders.ts b/packages/connect/test/fixtures/standard_relayer_api/orders.ts index 5605266649..018b0851f0 100644 --- a/packages/connect/test/fixtures/standard_relayer_api/orders.ts +++ b/packages/connect/test/fixtures/standard_relayer_api/orders.ts @@ -24,10 +24,8 @@ export const ordersResponse: OrdersResponse = { makerFeeAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d', takerFeeAssetData: '0x0257179264389b814a946f3e92105513705ca6b990', signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33', - domain: { - chainId: 1, - verifyingContract: '0x12459c951127e0c374ff9105dda097662a027093', - }, + chainId: 1, + exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093', }, metaData: {}, }, diff --git a/packages/contract-wrappers/test/calldata_decoder_test.ts b/packages/contract-wrappers/test/calldata_decoder_test.ts index 4377fbb8aa..e9926d70a9 100644 --- a/packages/contract-wrappers/test/calldata_decoder_test.ts +++ b/packages/contract-wrappers/test/calldata_decoder_test.ts @@ -39,8 +39,8 @@ describe('ABI Decoding Calldata', () => { const [privateKeyLeft, privateKeyRight] = constants.TESTRPC_PRIVATE_KEYS; const exchangeAddress = addressUtils.generatePseudoRandomAddress(); const feeRecipientAddress = addressUtils.generatePseudoRandomAddress(); - const domain = { - verifyingContract: exchangeAddress, + const domainInfo = { + exchangeAddress, chainId, }; // Create orders to match. @@ -78,9 +78,9 @@ describe('ABI Decoding Calldata', () => { salt: new BigNumber(50010), }; const orderFactoryLeft = new OrderFactory(privateKeyLeft, orderLeft); - signedOrderLeft = await orderFactoryLeft.newSignedOrderAsync({ domain }); + signedOrderLeft = await orderFactoryLeft.newSignedOrderAsync(domainInfo); const orderFactoryRight = new OrderFactory(privateKeyRight, orderRight); - signedOrderRight = await orderFactoryRight.newSignedOrderAsync({ domain }); + signedOrderRight = await orderFactoryRight.newSignedOrderAsync(domainInfo); // Encode match orders transaction contractAddresses = await migrateOnceAsync(); await blockchainLifecycle.startAsync(); diff --git a/packages/contract-wrappers/test/coordinator_wrapper_test.ts b/packages/contract-wrappers/test/coordinator_wrapper_test.ts index 4acdfc7a15..05de597884 100644 --- a/packages/contract-wrappers/test/coordinator_wrapper_test.ts +++ b/packages/contract-wrappers/test/coordinator_wrapper_test.ts @@ -101,10 +101,8 @@ describe.skip('CoordinatorWrapper', () => { makerFeeAssetData: feeAssetData, takerFeeAssetData: feeAssetData, senderAddress: contractAddresses.coordinator, - domain: { - verifyingContract: exchangeContractAddress, - chainId, - }, + exchangeAddress: exchangeContractAddress, + chainId, }; const privateKey = constants.TESTRPC_PRIVATE_KEYS[userAddresses.indexOf(makerAddress)]; orderFactory = new OrderFactory(privateKey, defaultOrderParams); diff --git a/packages/fill-scenarios/src/fill_scenarios.ts b/packages/fill-scenarios/src/fill_scenarios.ts index 6c894d3987..d63eb0a209 100644 --- a/packages/fill-scenarios/src/fill_scenarios.ts +++ b/packages/fill-scenarios/src/fill_scenarios.ts @@ -124,12 +124,12 @@ export class FillScenarios { fillableAmount, ); const exchangeInstance = new ExchangeContract( - signedOrder.domain.verifyingContract, + signedOrder.exchangeAddress, this._web3Wrapper.getProvider(), this._web3Wrapper.getContractDefaults(), ); - const orderWithoutDomain = _.omit(signedOrder, ['signature', 'domain']) as OrderWithoutDomain; + const orderWithoutDomain = _.omit(signedOrder, ['signature', 'exchangeAddress', 'chainId']) as OrderWithoutDomain; const txHash = await exchangeInstance.fillOrder.sendTransactionAsync( orderWithoutDomain, diff --git a/packages/json-schemas/schemas/order_schema.json b/packages/json-schemas/schemas/order_schema.json index c4cc4d84b2..2d51fbfe63 100644 --- a/packages/json-schemas/schemas/order_schema.json +++ b/packages/json-schemas/schemas/order_schema.json @@ -1,21 +1,54 @@ { "id": "/orderSchema", "properties": { - "makerAddress": { "$ref": "/addressSchema" }, - "takerAddress": { "$ref": "/addressSchema" }, - "makerFee": { "$ref": "/wholeNumberSchema" }, - "takerFee": { "$ref": "/wholeNumberSchema" }, - "senderAddress": { "$ref": "/addressSchema" }, - "makerAssetAmount": { "$ref": "/wholeNumberSchema" }, - "takerAssetAmount": { "$ref": "/wholeNumberSchema" }, - "makerAssetData": { "$ref": "/hexSchema" }, - "takerAssetData": { "$ref": "/hexSchema" }, - "makerFeeAssetData": { "$ref": "/hexSchema" }, - "takerFeeAssetData": { "$ref": "/hexSchema" }, - "salt": { "$ref": "/wholeNumberSchema" }, - "feeRecipientAddress": { "$ref": "/addressSchema" }, - "expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }, - "domain": { "$ref": "/eip712DomainSchema" } + "makerAddress": { + "$ref": "/addressSchema" + }, + "takerAddress": { + "$ref": "/addressSchema" + }, + "makerFee": { + "$ref": "/wholeNumberSchema" + }, + "takerFee": { + "$ref": "/wholeNumberSchema" + }, + "senderAddress": { + "$ref": "/addressSchema" + }, + "makerAssetAmount": { + "$ref": "/wholeNumberSchema" + }, + "takerAssetAmount": { + "$ref": "/wholeNumberSchema" + }, + "makerAssetData": { + "$ref": "/hexSchema" + }, + "takerAssetData": { + "$ref": "/hexSchema" + }, + "makerFeeAssetData": { + "$ref": "/hexSchema" + }, + "takerFeeAssetData": { + "$ref": "/hexSchema" + }, + "salt": { + "$ref": "/wholeNumberSchema" + }, + "feeRecipientAddress": { + "$ref": "/addressSchema" + }, + "expirationTimeSeconds": { + "$ref": "/wholeNumberSchema" + }, + "chainId": { + "type": "number " + }, + "exchangeAddress": { + "$ref": "/addressSchema" + } }, "required": [ "makerAddress", @@ -32,7 +65,8 @@ "salt", "feeRecipientAddress", "expirationTimeSeconds", - "domain" + "chainId", + "exchangeAddress" ], "type": "object" } diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts index 74f95bf539..855777a390 100644 --- a/packages/json-schemas/test/schema_test.ts +++ b/packages/json-schemas/test/schema_test.ts @@ -219,10 +219,8 @@ describe('Schema', () => { salt: '67006738228878699843088602623665307406148487219438534730168799356281242528500', feeRecipientAddress: NULL_ADDRESS, expirationTimeSeconds: '42', - domain: { - verifyingContract: NULL_ADDRESS, - chainId: CHAIN_ID, - }, + exchangeAddress: NULL_ADDRESS, + chainId: CHAIN_ID, }; const relayerApiOrder = { order, diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts index 94b08124e6..ac09aa8241 100644 --- a/packages/order-utils/src/eip712_utils.ts +++ b/packages/order-utils/src/eip712_utils.ts @@ -59,11 +59,15 @@ export const eip712Utils = { const normalizedOrder = _.mapValues(order, value => { return !_.isString(value) ? value.toString() : value; }); + const partialDomain = { + chainId: order.chainId, + verifyingContract: order.exchangeAddress, + }; const typedData = eip712Utils.createTypedData( constants.EXCHANGE_ORDER_SCHEMA.name, { Order: constants.EXCHANGE_ORDER_SCHEMA.parameters }, normalizedOrder, - order.domain, + partialDomain, ); return typedData; }, diff --git a/packages/order-utils/src/order_factory.ts b/packages/order-utils/src/order_factory.ts index 66f266b381..fe8c376d5e 100644 --- a/packages/order-utils/src/order_factory.ts +++ b/packages/order-utils/src/order_factory.ts @@ -52,10 +52,8 @@ export const orderFactory = { salt: createOrderOpts.salt || defaultCreateOrderOpts.salt, expirationTimeSeconds: createOrderOpts.expirationTimeSeconds || defaultCreateOrderOpts.expirationTimeSeconds, - domain: { - verifyingContract: exchangeAddress, - chainId, - }, + exchangeAddress, + chainId, }; return order; }, @@ -87,7 +85,7 @@ export const orderFactory = { }; function getChainIdFromPartial(partialOrder: Partial | Partial): number { - const chainId: number = _.get(partialOrder, ['domain', 'chainId']); + const chainId = partialOrder.chainId; if (!_.isNumber(chainId)) { throw new Error('chainId must be valid'); } @@ -117,10 +115,8 @@ function generateEmptyOrder(chainId: number): Order { salt: generatePseudoRandomSalt(), feeRecipientAddress: constants.NULL_ADDRESS, expirationTimeSeconds: constants.INFINITE_TIMESTAMP_SEC, - domain: { - verifyingContract: constants.NULL_ADDRESS, - chainId, - }, + exchangeAddress: constants.NULL_ADDRESS, + chainId, }; } diff --git a/packages/order-utils/test/order_hash_test.ts b/packages/order-utils/test/order_hash_test.ts index 76a0765c74..fbce59a8b9 100644 --- a/packages/order-utils/test/order_hash_test.ts +++ b/packages/order-utils/test/order_hash_test.ts @@ -32,10 +32,8 @@ describe('Order hashing', () => { makerAssetAmount: new BigNumber(0), takerAssetAmount: new BigNumber(0), expirationTimeSeconds: new BigNumber(0), - domain: { - verifyingContract: fakeExchangeContractAddress, - chainId: fakeChainID, - }, + exchangeAddress: fakeExchangeContractAddress, + chainId: fakeChainID, }; it('calculates the order hash', async () => { const orderHash = orderHashUtils.getOrderHashHex(order); @@ -62,7 +60,7 @@ describe('Order hashing', () => { }; const expectedErrorMessage = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${ constants.NULL_ADDRESS - }`; + }`; expect(() => orderHashUtils.getOrderHashHex(orderWithInvalidtakerFormat)).to.throw(expectedErrorMessage); }); }); diff --git a/packages/order-utils/test/remaining_fillable_calculator_test.ts b/packages/order-utils/test/remaining_fillable_calculator_test.ts index 3bee3c0d65..c04b38e015 100644 --- a/packages/order-utils/test/remaining_fillable_calculator_test.ts +++ b/packages/order-utils/test/remaining_fillable_calculator_test.ts @@ -59,10 +59,8 @@ describe('RemainingFillableCalculator', () => { takerFeeAssetData, salt: zero, expirationTimeSeconds: zero, - domain: { - verifyingContract: zeroAddress, - chainId, - }, + exchangeAddress: zeroAddress, + chainId, }; } describe('Maker asset is not fee asset', () => { diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index 78d7d7f5fc..578aae1e02 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -41,10 +41,8 @@ describe('Signature utils', () => { makerAssetAmount: new BigNumber(0), takerAssetAmount: new BigNumber(0), expirationTimeSeconds: new BigNumber(0), - domain: { - verifyingContract: fakeExchangeContractAddress, - chainId: fakeChainId, - }, + exchangeAddress: fakeExchangeContractAddress, + chainId: fakeChainId, }; transaction = { domain: { diff --git a/packages/orderbook/test/utils.ts b/packages/orderbook/test/utils.ts index eb2d4743ae..83164db182 100644 --- a/packages/orderbook/test/utils.ts +++ b/packages/orderbook/test/utils.ts @@ -10,10 +10,8 @@ export const createOrder = (makerAssetData: string, takerAssetData: string): API takerAssetData, makerFeeAssetData: makerAssetData, takerFeeAssetData: takerAssetData, - domain: { - chainId: 0, - verifyingContract: '0x00', - }, + chainId: 0, + exchangeAddress: '0x00', senderAddress: '0x00', makerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(1), diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 76b5644c8f..b70674cfa7 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -182,10 +182,8 @@ export class Handler { // tslint:disable-next-line:custom-no-magic-numbers .div(1000) .integerValue(BigNumber.ROUND_FLOOR), - domain: { - verifyingContract: networkConfig.contractWrappers.exchange.address, - chainId: networkConfig.networkId, - }, + exchangeAddress: networkConfig.contractWrappers.exchange.address, + chainId: networkConfig.networkId, }; const orderHash = orderHashUtils.getOrderHashHex(order); const signature = await signatureUtils.ecSignHashAsync( diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 22ad940e3f..9a84477a83 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -3,11 +3,9 @@ import { BigNumber } from 'bignumber.js'; import { ContractAbi, ContractNetworks, DevdocOutput } from 'ethereum-types'; -// HACK: Rather then extending from OrderWithoutDomain -// we don't, because our docs don't expand inherited types, and it's unnecessarily -// confusing to introduce the user to the OrderWithoutDomain type. export interface Order { - domain: EIP712DomainWithDefaultSchema; + chainId: number; + exchangeAddress: string; makerAddress: string; takerAddress: string; feeRecipientAddress: string;