aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/token_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-16 22:30:35 +0800
committerFabio Berger <me@fabioberger.com>2017-06-16 22:30:35 +0800
commitfe63a81f6a15a521c643b74f4442cdbf037202cf (patch)
treea596b494ceb6ed1a84ab054e5983a3b44fcc95cd /src/contract_wrappers/token_wrapper.ts
parent225ec506454ac9b912ee50fb6a138c201da1519b (diff)
downloaddexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar
dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar.gz
dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar.bz2
dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar.lz
dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar.xz
dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar.zst
dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.zip
Add and improve comments
Diffstat (limited to 'src/contract_wrappers/token_wrapper.ts')
-rw-r--r--src/contract_wrappers/token_wrapper.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts
index 98da6c2cd..29f9b2d1c 100644
--- a/src/contract_wrappers/token_wrapper.ts
+++ b/src/contract_wrappers/token_wrapper.ts
@@ -10,6 +10,11 @@ import {TokenContract, ZeroExError} from '../types';
const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 45730;
+/**
+ * This class includes all the functionality related to interacting with ERC20 token contracts.
+ * All ERC20 method calls are supported, along with some convenience methods for getting/setting allowances
+ * to the 0x Proxy smart contract.
+ */
export class TokenWrapper extends ContractWrapper {
private _tokenContractsByAddress: {[address: string]: TokenContract};
constructor(web3Wrapper: Web3Wrapper) {
@@ -138,12 +143,13 @@ export class TokenWrapper extends ContractWrapper {
/**
* Transfers `amountInBaseUnits` ERC20 tokens from `fromAddress` to `toAddress`.
* Requires the fromAddress to have sufficient funds and to have approved an allowance of
- * `amountInBaseUnits` for senderAddress.
+ * `amountInBaseUnits` to `senderAddress`.
* @param tokenAddress The hex encoded contract Ethereum address where the ERC20 token is deployed.
- * @param fromAddress The hex encoded user Ethereum address that will send the funds.
+ * @param fromAddress The hex encoded user Ethereum address whose funds are being sent.
* @param toAddress The hex encoded user Ethereum address that will receive the funds.
- * @param senderAddress The hex encoded user Ethereum address whose funds are being sent. The senderAddress
- * must have set an allowance to the fromAddress before this call.
+ * @param senderAddress The hex encoded user Ethereum address whose initiates the fund transfer. The
+ * `fromAddress` must have set an allowance to the `senderAddress`
+ * before this call.
* @param amountInBaseUnits The amount (specified in baseUnits) of the token to transfer.
*/
public async transferFromAsync(tokenAddress: string, fromAddress: string, toAddress: string,