aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-05-18 10:26:31 +0800
committerGitHub <noreply@github.com>2018-05-18 10:26:31 +0800
commit0137c0da8ccd48fdae2a2685216a9f2e828b2753 (patch)
tree6bfd229ed914e6d930e64012a002544fb0fac3d5 /packages/contracts/src
parent407731ab16711930c8305d4b638d3349cd636df9 (diff)
parentf9d2689a1212703586927f0e8612ed1700750d1b (diff)
downloaddexon-sol-tools-0137c0da8ccd48fdae2a2685216a9f2e828b2753.tar.gz
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
Diffstat (limited to 'packages/contracts/src')
-rw-r--r--packages/contracts/src/utils/asset_proxy_utils.ts3
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);