From f9d2689a1212703586927f0e8612ed1700750d1b Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 10 May 2018 15:59:44 +1000 Subject: Pad to 32 if asset ids are small --- packages/contracts/src/utils/asset_proxy_utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/contracts/src/utils/asset_proxy_utils.ts b/packages/contracts/src/utils/asset_proxy_utils.ts index 1a7a312dd..dc31c3497 100644 --- a/packages/contracts/src/utils/asset_proxy_utils.ts +++ b/packages/contracts/src/utils/asset_proxy_utils.ts @@ -18,7 +18,8 @@ export const assetProxyUtils = { encodeUint256(value: BigNumber): Buffer { const formattedValue = new BN(value.toString(10)); const encodedValue = ethUtil.toBuffer(formattedValue); - return encodedValue; + const paddedValue = ethUtil.setLengthLeft(encodedValue, 32); + return paddedValue; }, encodeERC20ProxyData(tokenAddress: string): string { const encodedAssetProxyId = assetProxyUtils.encodeAssetProxyId(AssetProxyId.ERC20); -- cgit v1.2.3