Merge pull request #583 from 0xProject/bug/contracts/erc721-encoded-pad

ERC721Proxy Pad to 32 if asset ids are small
This commit is contained in:
Jacob Evans
2018-05-18 12:26:31 +10:00
committed by GitHub

View File

@@ -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);