diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-04-12 03:23:20 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-21 04:56:17 +0800 |
commit | 32a7442845f8b8db37f9a67648e5d3beac36490c (patch) | |
tree | 6a94d5efcd8940281a425584b254bc7e4ba5867b /packages/contracts/src | |
parent | a0dfdefd165ce8b8eb0e76707391f5efb8485040 (diff) | |
download | dexon-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.ts | 13 |
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; } |