aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-05-10 13:59:44 +0800
committerJacob Evans <jacob@dekz.net>2018-05-10 13:59:44 +0800
commitf9d2689a1212703586927f0e8612ed1700750d1b (patch)
tree19c9acf0389ae3fd87818820e6bce921f4775c2d /packages
parent9744b1906a111aa0c65c8fafb4db66aef32a5a23 (diff)
downloaddexon-sol-tools-f9d2689a1212703586927f0e8612ed1700750d1b.tar.gz
dexon-sol-tools-f9d2689a1212703586927f0e8612ed1700750d1b.tar.zst
dexon-sol-tools-f9d2689a1212703586927f0e8612ed1700750d1b.zip
Pad to 32 if asset ids are small
Diffstat (limited to 'packages')
-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);