From a59e9f024e76122c76600d938b565ea47938b287 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 4 Jun 2018 18:40:07 -0700 Subject: Update Order utils to use eip712 --- packages/order-utils/src/eip712_utils.ts | 70 +++++++++++++++++++++++++++++ packages/order-utils/src/index.ts | 3 +- packages/order-utils/src/order_hash.ts | 75 +++++++++++++------------------- packages/order-utils/src/types.ts | 10 +++++ 4 files changed, 112 insertions(+), 46 deletions(-) create mode 100644 packages/order-utils/src/eip712_utils.ts (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts new file mode 100644 index 000000000..f7583f8d5 --- /dev/null +++ b/packages/order-utils/src/eip712_utils.ts @@ -0,0 +1,70 @@ +import { BigNumber } from '@0xproject/utils'; +import ethUtil = require('ethereumjs-util'); +import * as _ from 'lodash'; + +import { crypto } from './crypto'; +import { EIP712Schema } from './types'; + +const EIP191_PREFIX = '\x19\x01'; +const EIP712_DOMAIN_NAME = '0x Protocol'; +const EIP712_DOMAIN_VERSION = '2'; +const EIP712_VALUE_LENGTH = 32; + +const EIP712_DOMAIN_SCHEMA: EIP712Schema = { + name: 'DomainSeparator', + parameters: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'contract', type: 'address' }, + ], +}; + +export const EIP712Utils = { + /** + * Compiles the EIP712Schema and returns the hash of the schema. + * @param schema The EIP712 schema. + * @return The hash of the compiled schema + */ + compileSchema(schema: EIP712Schema): Buffer { + const namedTypes = _.map(schema.parameters, parameter => `${parameter.type} ${parameter.name}`); + const namedTypesJoined = namedTypes.join(','); + const eip712Schema = `${schema.name}(${namedTypesJoined})`; + const eip712SchemaHashBuffer = crypto.solSHA3([eip712Schema]); + return eip712SchemaHashBuffer; + }, + /** + * Merges the EIP712 hash of a struct with the DomainSeparator for 0x v2. + * @param hashStruct the EIP712 hash of a struct + * @param contractAddress the exchange contract address + * @return The hash of an EIP712 message with domain separator prefixed + */ + createEIP712Message(hashStruct: Buffer, contractAddress: string): Buffer { + const domainSeparatorHashBuffer = EIP712Utils._getDomainSeparatorHashBuffer(contractAddress); + const messageBuff = crypto.solSHA3([EIP191_PREFIX, domainSeparatorHashBuffer, hashStruct]); + return messageBuff; + }, + pad32Address(address: string): Buffer { + const addressBuffer = ethUtil.toBuffer(address); + const addressPadded = EIP712Utils.pad32Buffer(addressBuffer); + return addressPadded; + }, + pad32Buffer(buffer: Buffer): Buffer { + const bufferPadded = ethUtil.setLengthLeft(buffer, EIP712_VALUE_LENGTH); + return bufferPadded; + }, + _getDomainSeparatorSchemaBuffer(): Buffer { + return EIP712Utils.compileSchema(EIP712_DOMAIN_SCHEMA); + }, + _getDomainSeparatorHashBuffer(exchangeAddress: string): Buffer { + const domainSeparatorSchemaBuffer = EIP712Utils._getDomainSeparatorSchemaBuffer(); + const nameHash = crypto.solSHA3([EIP712_DOMAIN_NAME]); + const versionHash = crypto.solSHA3([EIP712_DOMAIN_VERSION]); + const domainSeparatorHashBuff = crypto.solSHA3([ + domainSeparatorSchemaBuffer, + nameHash, + versionHash, + EIP712Utils.pad32Address(exchangeAddress), + ]); + return domainSeparatorHashBuff; + }, +}; diff --git a/packages/order-utils/src/index.ts b/packages/order-utils/src/index.ts index b844fbfcb..caa996621 100644 --- a/packages/order-utils/src/index.ts +++ b/packages/order-utils/src/index.ts @@ -4,9 +4,10 @@ export { orderFactory } from './order_factory'; export { constants } from './constants'; export { crypto } from './crypto'; export { generatePseudoRandomSalt } from './salt'; -export { OrderError, MessagePrefixType, MessagePrefixOpts } from './types'; +export { OrderError, MessagePrefixType, MessagePrefixOpts, EIP712Parameter, EIP712Schema } from './types'; export { AbstractBalanceAndProxyAllowanceFetcher } from './abstract/abstract_balance_and_proxy_allowance_fetcher'; export { AbstractOrderFilledCancelledFetcher } from './abstract/abstract_order_filled_cancelled_fetcher'; export { RemainingFillableCalculator } from './remaining_fillable_calculator'; export { OrderStateUtils } from './order_state_utils'; export { assetProxyUtils } from './asset_proxy_utils'; +export { EIP712Utils } from './eip712_utils'; diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index 2ef746ef8..b2414febc 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -9,9 +9,29 @@ import * as _ from 'lodash'; import { assert } from './assert'; import { crypto } from './crypto'; +import { EIP712Utils } from './eip712_utils'; +import { EIP712Schema } from './types'; const INVALID_TAKER_FORMAT = 'instance.takerAddress is not of a type(s) string'; +const EIP712_ORDER_SCHEMA: EIP712Schema = { + name: 'Order', + parameters: [ + { name: 'makerAddress', type: 'address' }, + { name: 'takerAddress', type: 'address' }, + { name: 'feeRecipientAddress', type: 'address' }, + { name: 'senderAddress', type: 'address' }, + { name: 'makerAssetAmount', type: 'uint256' }, + { name: 'takerAssetAmount', type: 'uint256' }, + { name: 'makerFee', type: 'uint256' }, + { name: 'takerFee', type: 'uint256' }, + { name: 'expirationTimeSeconds', type: 'uint256' }, + { name: 'salt', type: 'uint256' }, + { name: 'makerAssetData', type: 'bytes' }, + { name: 'takerAssetData', type: 'bytes' }, + ], +}; + export const orderHashUtils = { /** * Checks if the supplied hex encoded order hash is valid. @@ -45,7 +65,7 @@ export const orderHashUtils = { throw error; } - const orderHashBuff = this.getOrderHashBuff(order); + const orderHashBuff = orderHashUtils.getOrderHashBuffer(order); const orderHashHex = `0x${orderHashBuff.toString('hex')}`; return orderHashHex; }, @@ -54,15 +74,16 @@ export const orderHashUtils = { * @param order An object that conforms to the Order or SignedOrder interface definitions. * @return The resulting orderHash from hashing the supplied order as a Buffer */ - getOrderHashBuff(order: SignedOrder | Order): Buffer { + getOrderHashBuffer(order: SignedOrder | Order): Buffer { const makerAssetDataHash = crypto.solSHA3([ethUtil.toBuffer(order.makerAssetData)]); const takerAssetDataHash = crypto.solSHA3([ethUtil.toBuffer(order.takerAssetData)]); const orderParamsHashBuff = crypto.solSHA3([ - order.makerAddress, - order.takerAddress, - order.feeRecipientAddress, - order.senderAddress, + orderHashUtils._getOrderSchemaBuffer(), + EIP712Utils.pad32Address(order.makerAddress), + EIP712Utils.pad32Address(order.takerAddress), + EIP712Utils.pad32Address(order.feeRecipientAddress), + EIP712Utils.pad32Address(order.senderAddress), order.makerAssetAmount, order.takerAssetAmount, order.makerFee, @@ -72,46 +93,10 @@ export const orderHashUtils = { makerAssetDataHash, takerAssetDataHash, ]); - const orderParamsHashHex = `0x${orderParamsHashBuff.toString('hex')}`; - const orderSchemaHashHex = this._getOrderSchemaHex(); - const domainSeparatorHashHex = this._getDomainSeparatorHashHex(order.exchangeAddress); - const domainSeparatorSchemaHex = this._getDomainSeparatorSchemaHex(); - const orderHashBuff = crypto.solSHA3([ - new BigNumber(domainSeparatorSchemaHex), - new BigNumber(domainSeparatorHashHex), - new BigNumber(orderSchemaHashHex), - new BigNumber(orderParamsHashHex), - ]); + const orderHashBuff = EIP712Utils.createEIP712Message(orderParamsHashBuff, order.exchangeAddress); return orderHashBuff; }, - _getOrderSchemaHex(): string { - const orderSchemaHashBuff = crypto.solSHA3([ - 'Order(', - 'address makerAddress,', - 'address takerAddress,', - 'address feeRecipientAddress,', - 'address senderAddress,', - 'uint256 makerAssetAmount,', - 'uint256 takerAssetAmount,', - 'uint256 makerFee,', - 'uint256 takerFee,', - 'uint256 expirationTimeSeconds,', - 'uint256 salt,', - 'bytes makerAssetData,', - 'bytes takerAssetData,', - ')', - ]); - const schemaHashHex = `0x${orderSchemaHashBuff.toString('hex')}`; - return schemaHashHex; - }, - _getDomainSeparatorSchemaHex(): string { - const domainSeparatorSchemaHashBuff = crypto.solSHA3(['DomainSeparator(address contract)']); - const schemaHashHex = `0x${domainSeparatorSchemaHashBuff.toString('hex')}`; - return schemaHashHex; - }, - _getDomainSeparatorHashHex(exchangeAddress: string): string { - const domainSeparatorHashBuff = crypto.solSHA3([exchangeAddress]); - const domainSeparatorHashHex = `0x${domainSeparatorHashBuff.toString('hex')}`; - return domainSeparatorHashHex; + _getOrderSchemaBuffer(): Buffer { + return EIP712Utils.compileSchema(EIP712_ORDER_SCHEMA); }, }; diff --git a/packages/order-utils/src/types.ts b/packages/order-utils/src/types.ts index db0bfb249..858c0e18b 100644 --- a/packages/order-utils/src/types.ts +++ b/packages/order-utils/src/types.ts @@ -23,3 +23,13 @@ export interface MessagePrefixOpts { prefixType: MessagePrefixType; shouldAddPrefixBeforeCallingEthSign: boolean; } + +export interface EIP712Parameter { + name: string; + type: string; +} + +export interface EIP712Schema { + name: string; + parameters: EIP712Parameter[]; +} -- cgit v1.2.3 From a8d328bfc926a62d61830334fadc43fc5d013e0e Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 7 Jun 2018 16:03:14 -0700 Subject: Basic EIP712 encoder --- packages/order-utils/src/eip712_utils.ts | 61 +++++++++++++++++++++++++------- packages/order-utils/src/order_hash.ts | 19 +--------- 2 files changed, 50 insertions(+), 30 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts index f7583f8d5..e54ca0e83 100644 --- a/packages/order-utils/src/eip712_utils.ts +++ b/packages/order-utils/src/eip712_utils.ts @@ -2,6 +2,7 @@ import { BigNumber } from '@0xproject/utils'; import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; +import { assetProxyUtils } from './asset_proxy_utils'; import { crypto } from './crypto'; import { EIP712Schema } from './types'; @@ -19,6 +20,14 @@ const EIP712_DOMAIN_SCHEMA: EIP712Schema = { ], }; +enum EIP712Types { + String = 'string', + Bytes = 'bytes', + Address = 'address', + Bytes32 = 'bytes32', + Uint256 = 'uint256', +} + export const EIP712Utils = { /** * Compiles the EIP712Schema and returns the hash of the schema. @@ -26,9 +35,7 @@ export const EIP712Utils = { * @return The hash of the compiled schema */ compileSchema(schema: EIP712Schema): Buffer { - const namedTypes = _.map(schema.parameters, parameter => `${parameter.type} ${parameter.name}`); - const namedTypesJoined = namedTypes.join(','); - const eip712Schema = `${schema.name}(${namedTypesJoined})`; + const eip712Schema = EIP712Utils._encodeType(schema); const eip712SchemaHashBuffer = crypto.solSHA3([eip712Schema]); return eip712SchemaHashBuffer; }, @@ -57,14 +64,44 @@ export const EIP712Utils = { }, _getDomainSeparatorHashBuffer(exchangeAddress: string): Buffer { const domainSeparatorSchemaBuffer = EIP712Utils._getDomainSeparatorSchemaBuffer(); - const nameHash = crypto.solSHA3([EIP712_DOMAIN_NAME]); - const versionHash = crypto.solSHA3([EIP712_DOMAIN_VERSION]); - const domainSeparatorHashBuff = crypto.solSHA3([ - domainSeparatorSchemaBuffer, - nameHash, - versionHash, - EIP712Utils.pad32Address(exchangeAddress), - ]); - return domainSeparatorHashBuff; + const encodedData = EIP712Utils._encodeData(EIP712_DOMAIN_SCHEMA, { + name: EIP712_DOMAIN_NAME, + version: EIP712_DOMAIN_VERSION, + contract: exchangeAddress, + }); + const domainSeparatorHashBuff2 = crypto.solSHA3([domainSeparatorSchemaBuffer, ...encodedData]); + return domainSeparatorHashBuff2; + }, + _encodeType(schema: EIP712Schema): string { + const namedTypes = _.map(schema.parameters, ({ name, type }) => `${type} ${name}`); + const namedTypesJoined = namedTypes.join(','); + const encodedType = `${schema.name}(${namedTypesJoined})`; + return encodedType; + }, + _encodeData(schema: EIP712Schema, data: { [key: string]: any }): any { + const encodedTypes = []; + const encodedValues = []; + for (const parameter of schema.parameters) { + const value = data[parameter.name]; + if (parameter.type === EIP712Types.String || parameter.type === EIP712Types.Bytes) { + encodedTypes.push(EIP712Types.Bytes32); + encodedValues.push(crypto.solSHA3([ethUtil.toBuffer(value)])); + } else if (parameter.type === EIP712Types.Uint256) { + encodedTypes.push(EIP712Types.Uint256); + encodedValues.push(value); + } else if (parameter.type === EIP712Types.Address) { + encodedTypes.push(EIP712Types.Address); + encodedValues.push(EIP712Utils.pad32Address(value)); + } else { + throw new Error(`Unable to encode ${parameter.type}`); + } + } + return encodedValues; + }, + structHash(schema: EIP712Schema, data: { [key: string]: any }): Buffer { + const encodedData = EIP712Utils._encodeData(schema, data); + const schemaHash = EIP712Utils.compileSchema(schema); + const hashBuffer = crypto.solSHA3([schemaHash, ...encodedData]); + return hashBuffer; }, }; diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index b2414febc..46cce4b3b 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -75,24 +75,7 @@ export const orderHashUtils = { * @return The resulting orderHash from hashing the supplied order as a Buffer */ getOrderHashBuffer(order: SignedOrder | Order): Buffer { - const makerAssetDataHash = crypto.solSHA3([ethUtil.toBuffer(order.makerAssetData)]); - const takerAssetDataHash = crypto.solSHA3([ethUtil.toBuffer(order.takerAssetData)]); - - const orderParamsHashBuff = crypto.solSHA3([ - orderHashUtils._getOrderSchemaBuffer(), - EIP712Utils.pad32Address(order.makerAddress), - EIP712Utils.pad32Address(order.takerAddress), - EIP712Utils.pad32Address(order.feeRecipientAddress), - EIP712Utils.pad32Address(order.senderAddress), - order.makerAssetAmount, - order.takerAssetAmount, - order.makerFee, - order.takerFee, - order.expirationTimeSeconds, - order.salt, - makerAssetDataHash, - takerAssetDataHash, - ]); + const orderParamsHashBuff = EIP712Utils.structHash(EIP712_ORDER_SCHEMA, order); const orderHashBuff = EIP712Utils.createEIP712Message(orderParamsHashBuff, order.exchangeAddress); return orderHashBuff; }, -- cgit v1.2.3 From d4ee0e862297c16f8ee62efccd31f1193052c64e Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 18 Jun 2018 20:59:23 +1000 Subject: Rebase and update feedback Cache the domain separator data with address this Use the EIP712Types enum for types everywhere Rename EIP712 struct ExecuteTransaction to ZeroExTransaction --- packages/order-utils/src/eip712_utils.ts | 24 ++++++------------------ packages/order-utils/src/index.ts | 2 +- packages/order-utils/src/order_hash.ts | 26 +++++++++++++------------- packages/order-utils/src/types.ts | 10 +++++++++- 4 files changed, 29 insertions(+), 33 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts index e54ca0e83..00edd2531 100644 --- a/packages/order-utils/src/eip712_utils.ts +++ b/packages/order-utils/src/eip712_utils.ts @@ -4,7 +4,7 @@ import * as _ from 'lodash'; import { assetProxyUtils } from './asset_proxy_utils'; import { crypto } from './crypto'; -import { EIP712Schema } from './types'; +import { EIP712Schema, EIP712Types } from './types'; const EIP191_PREFIX = '\x19\x01'; const EIP712_DOMAIN_NAME = '0x Protocol'; @@ -12,22 +12,14 @@ const EIP712_DOMAIN_VERSION = '2'; const EIP712_VALUE_LENGTH = 32; const EIP712_DOMAIN_SCHEMA: EIP712Schema = { - name: 'DomainSeparator', + name: 'EIP712Domain', parameters: [ - { name: 'name', type: 'string' }, - { name: 'version', type: 'string' }, - { name: 'contract', type: 'address' }, + { name: 'name', type: EIP712Types.String }, + { name: 'version', type: EIP712Types.String }, + { name: 'verifyingContract', type: EIP712Types.Address }, ], }; -enum EIP712Types { - String = 'string', - Bytes = 'bytes', - Address = 'address', - Bytes32 = 'bytes32', - Uint256 = 'uint256', -} - export const EIP712Utils = { /** * Compiles the EIP712Schema and returns the hash of the schema. @@ -67,7 +59,7 @@ export const EIP712Utils = { const encodedData = EIP712Utils._encodeData(EIP712_DOMAIN_SCHEMA, { name: EIP712_DOMAIN_NAME, version: EIP712_DOMAIN_VERSION, - contract: exchangeAddress, + verifyingContract: exchangeAddress, }); const domainSeparatorHashBuff2 = crypto.solSHA3([domainSeparatorSchemaBuffer, ...encodedData]); return domainSeparatorHashBuff2; @@ -79,18 +71,14 @@ export const EIP712Utils = { return encodedType; }, _encodeData(schema: EIP712Schema, data: { [key: string]: any }): any { - const encodedTypes = []; const encodedValues = []; for (const parameter of schema.parameters) { const value = data[parameter.name]; if (parameter.type === EIP712Types.String || parameter.type === EIP712Types.Bytes) { - encodedTypes.push(EIP712Types.Bytes32); encodedValues.push(crypto.solSHA3([ethUtil.toBuffer(value)])); } else if (parameter.type === EIP712Types.Uint256) { - encodedTypes.push(EIP712Types.Uint256); encodedValues.push(value); } else if (parameter.type === EIP712Types.Address) { - encodedTypes.push(EIP712Types.Address); encodedValues.push(EIP712Utils.pad32Address(value)); } else { throw new Error(`Unable to encode ${parameter.type}`); diff --git a/packages/order-utils/src/index.ts b/packages/order-utils/src/index.ts index caa996621..5122e60fc 100644 --- a/packages/order-utils/src/index.ts +++ b/packages/order-utils/src/index.ts @@ -4,7 +4,7 @@ export { orderFactory } from './order_factory'; export { constants } from './constants'; export { crypto } from './crypto'; export { generatePseudoRandomSalt } from './salt'; -export { OrderError, MessagePrefixType, MessagePrefixOpts, EIP712Parameter, EIP712Schema } from './types'; +export { OrderError, MessagePrefixType, MessagePrefixOpts, EIP712Parameter, EIP712Schema, EIP712Types } from './types'; export { AbstractBalanceAndProxyAllowanceFetcher } from './abstract/abstract_balance_and_proxy_allowance_fetcher'; export { AbstractOrderFilledCancelledFetcher } from './abstract/abstract_order_filled_cancelled_fetcher'; export { RemainingFillableCalculator } from './remaining_fillable_calculator'; diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index 46cce4b3b..61f6c978f 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -10,25 +10,25 @@ import * as _ from 'lodash'; import { assert } from './assert'; import { crypto } from './crypto'; import { EIP712Utils } from './eip712_utils'; -import { EIP712Schema } from './types'; +import { EIP712Schema, EIP712Types } from './types'; const INVALID_TAKER_FORMAT = 'instance.takerAddress is not of a type(s) string'; const EIP712_ORDER_SCHEMA: EIP712Schema = { name: 'Order', parameters: [ - { name: 'makerAddress', type: 'address' }, - { name: 'takerAddress', type: 'address' }, - { name: 'feeRecipientAddress', type: 'address' }, - { name: 'senderAddress', type: 'address' }, - { name: 'makerAssetAmount', type: 'uint256' }, - { name: 'takerAssetAmount', type: 'uint256' }, - { name: 'makerFee', type: 'uint256' }, - { name: 'takerFee', type: 'uint256' }, - { name: 'expirationTimeSeconds', type: 'uint256' }, - { name: 'salt', type: 'uint256' }, - { name: 'makerAssetData', type: 'bytes' }, - { name: 'takerAssetData', type: 'bytes' }, + { name: 'makerAddress', type: EIP712Types.Address }, + { name: 'takerAddress', type: EIP712Types.Address }, + { name: 'feeRecipientAddress', type: EIP712Types.Address }, + { name: 'senderAddress', type: EIP712Types.Address }, + { name: 'makerAssetAmount', type: EIP712Types.Uint256 }, + { name: 'takerAssetAmount', type: EIP712Types.Uint256 }, + { name: 'makerFee', type: EIP712Types.Uint256 }, + { name: 'takerFee', type: EIP712Types.Uint256 }, + { name: 'expirationTimeSeconds', type: EIP712Types.Uint256 }, + { name: 'salt', type: EIP712Types.Uint256 }, + { name: 'makerAssetData', type: EIP712Types.Bytes }, + { name: 'takerAssetData', type: EIP712Types.Bytes }, ], }; diff --git a/packages/order-utils/src/types.ts b/packages/order-utils/src/types.ts index 858c0e18b..daa4aee11 100644 --- a/packages/order-utils/src/types.ts +++ b/packages/order-utils/src/types.ts @@ -26,10 +26,18 @@ export interface MessagePrefixOpts { export interface EIP712Parameter { name: string; - type: string; + type: EIP712Types; } export interface EIP712Schema { name: string; parameters: EIP712Parameter[]; } + +export enum EIP712Types { + String = 'string', + Bytes = 'bytes', + Address = 'address', + Bytes32 = 'bytes32', + Uint256 = 'uint256', +} -- cgit v1.2.3 From 560a55bfd1a05bda0d4fb4b97d76e9ea0d9301a7 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Tue, 19 Jun 2018 13:30:13 +1000 Subject: Optimize and remove redundant encodePacked --- packages/order-utils/src/eip712_utils.ts | 2 -- packages/order-utils/src/order_hash.ts | 3 --- 2 files changed, 5 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/eip712_utils.ts b/packages/order-utils/src/eip712_utils.ts index 00edd2531..2594e6d6d 100644 --- a/packages/order-utils/src/eip712_utils.ts +++ b/packages/order-utils/src/eip712_utils.ts @@ -1,8 +1,6 @@ -import { BigNumber } from '@0xproject/utils'; import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; -import { assetProxyUtils } from './asset_proxy_utils'; import { crypto } from './crypto'; import { EIP712Schema, EIP712Types } from './types'; diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index 074624e9e..54c500653 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -1,11 +1,8 @@ import { schemas, SchemaValidator } from '@0xproject/json-schemas'; import { Order, SignedOrder } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; -import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; import { assert } from './assert'; -import { crypto } from './crypto'; import { EIP712Utils } from './eip712_utils'; import { EIP712Schema, EIP712Types } from './types'; -- cgit v1.2.3