diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-03-09 02:42:06 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-21 04:56:16 +0800 |
commit | 49f6c20b200edf353856af4940bf946ea33869fc (patch) | |
tree | 31ec8980f47086fa95b8f0711e981c031fff83df /packages/contracts/src/utils/order_utils.ts | |
parent | 6bfc02d79d189ee6487a74ec095bc7d12314e6a9 (diff) | |
download | dexon-sol-tools-49f6c20b200edf353856af4940bf946ea33869fc.tar dexon-sol-tools-49f6c20b200edf353856af4940bf946ea33869fc.tar.gz dexon-sol-tools-49f6c20b200edf353856af4940bf946ea33869fc.tar.bz2 dexon-sol-tools-49f6c20b200edf353856af4940bf946ea33869fc.tar.lz dexon-sol-tools-49f6c20b200edf353856af4940bf946ea33869fc.tar.xz dexon-sol-tools-49f6c20b200edf353856af4940bf946ea33869fc.tar.zst dexon-sol-tools-49f6c20b200edf353856af4940bf946ea33869fc.zip |
Update order utils
Diffstat (limited to 'packages/contracts/src/utils/order_utils.ts')
-rw-r--r-- | packages/contracts/src/utils/order_utils.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts index 513d0087e..c14dc4e80 100644 --- a/packages/contracts/src/utils/order_utils.ts +++ b/packages/contracts/src/utils/order_utils.ts @@ -53,8 +53,7 @@ export const orderUtils = { 'uint256 expirationTimeSeconds', 'uint256 salt', ]); - const orderSchemaHashHex = `0x${orderSchemaHashBuff.toString('hex')}`; - const orderHashBuff = crypto.solSHA3([ + const orderParamsHashBuff = crypto.solSHA3([ order.exchangeAddress, order.makerAddress, order.takerAddress, @@ -68,9 +67,10 @@ export const orderUtils = { order.expirationTimeSeconds, order.salt, ]); - const orderHashHex = `0x${orderHashBuff.toString('hex')}`; - const prefixedOrderHashBuff = crypto.solSHA3([new BigNumber(orderSchemaHashHex), new BigNumber(orderHashHex)]); - return prefixedOrderHashBuff; + const orderSchemaHashHex = `0x${orderSchemaHashBuff.toString('hex')}`; + const orderParamsHashHex = `0x${orderParamsHashBuff.toString('hex')}`; + const orderHashBuff = crypto.solSHA3([new BigNumber(orderSchemaHashHex), new BigNumber(orderParamsHashHex)]); + return orderHashBuff; }, getOrderHashHex(order: SignedOrder | UnsignedOrder): string { const orderHashBuff = orderUtils.getOrderHashBuff(order); |