diff options
author | Jacob Evans <dekz@dekz.net> | 2018-05-18 10:26:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-18 10:26:31 +0800 |
commit | 0137c0da8ccd48fdae2a2685216a9f2e828b2753 (patch) | |
tree | 6bfd229ed914e6d930e64012a002544fb0fac3d5 | |
parent | 407731ab16711930c8305d4b638d3349cd636df9 (diff) | |
parent | f9d2689a1212703586927f0e8612ed1700750d1b (diff) | |
download | dexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.tar dexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.tar.gz dexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.tar.bz2 dexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.tar.lz dexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.tar.xz dexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.tar.zst dexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.zip |
Merge pull request #583 from 0xProject/bug/contracts/erc721-encoded-pad
ERC721Proxy Pad to 32 if asset ids are small
-rw-r--r-- | packages/contracts/src/utils/asset_proxy_utils.ts | 3 |
1 files changed, 2 insertions, 1 deletions
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); |