aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-04-12 03:23:20 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:17 +0800
commit32a7442845f8b8db37f9a67648e5d3beac36490c (patch)
tree6a94d5efcd8940281a425584b254bc7e4ba5867b /packages/contracts/src
parenta0dfdefd165ce8b8eb0e76707391f5efb8485040 (diff)
downloaddexon-0x-contracts-32a7442845f8b8db37f9a67648e5d3beac36490c.tar.gz
dexon-0x-contracts-32a7442845f8b8db37f9a67648e5d3beac36490c.tar.zst
dexon-0x-contracts-32a7442845f8b8db37f9a67648e5d3beac36490c.zip
Minor style improvements to asset proxy utils
Diffstat (limited to 'packages/contracts/src')
-rw-r--r--packages/contracts/src/utils/asset_proxy_utils.ts13
1 files changed, 3 insertions, 10 deletions
diff --git a/packages/contracts/src/utils/asset_proxy_utils.ts b/packages/contracts/src/utils/asset_proxy_utils.ts
index 835f444f6..7011e0e39 100644
--- a/packages/contracts/src/utils/asset_proxy_utils.ts
+++ b/packages/contracts/src/utils/asset_proxy_utils.ts
@@ -1,7 +1,6 @@
import { BigNumber } from '@0xproject/utils';
import BN = require('bn.js');
import ethUtil = require('ethereumjs-util');
-import * as Web3 from 'web3';
import { AssetProxyId } from './types';
@@ -25,33 +24,27 @@ export function encodeUint256(value: BigNumber): Buffer {
return encodedValue;
}
-export function encodeERC20ProxyMetadata_V1(tokenAddress: string) {
- // Encode metadata
+export function encodeERC20V1ProxyData(tokenAddress: string): string {
const encodedAssetProxyId = encodeAssetProxyId(AssetProxyId.ERC20_V1);
const encodedAddress = encodeAddress(tokenAddress);
const encodedMetadata = Buffer.concat([encodedAssetProxyId, encodedAddress]);
const encodedMetadataHex = ethUtil.bufferToHex(encodedMetadata);
-
return encodedMetadataHex;
}
-export function encodeERC20ProxyMetadata(tokenAddress: string) {
- // Encode metadata
+export function encodeERC20ProxyData(tokenAddress: string): string {
const encodedAssetProxyId = encodeAssetProxyId(AssetProxyId.ERC20);
const encodedAddress = encodeAddress(tokenAddress);
const encodedMetadata = Buffer.concat([encodedAssetProxyId, encodedAddress]);
const encodedMetadataHex = ethUtil.bufferToHex(encodedMetadata);
-
return encodedMetadataHex;
}
-export function encodeERC721ProxyMetadata(tokenAddress: string, tokenId: BigNumber) {
- // Encode metadata
+export function encodeERC721ProxyData(tokenAddress: string, tokenId: BigNumber): string {
const encodedAssetProxyId = encodeAssetProxyId(AssetProxyId.ERC721);
const encodedAddress = encodeAddress(tokenAddress);
const encodedTokenId = encodeUint256(tokenId);
const encodedMetadata = Buffer.concat([encodedAssetProxyId, encodedAddress, encodedTokenId]);
const encodedMetadataHex = ethUtil.bufferToHex(encodedMetadata);
-
return encodedMetadataHex;
}