Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Model<CERC20Methods>
    • CERC20

Implements

Index

Constructors

Properties

_contract: Web3Contract<CERC20Methods, any>
_erc20: ERC20
abi: AbiItem[]
contractAddress?: string
underlyingAddress?: string

Accessors

  • get account(): Account
  • Returns the Account associated with this connection

    Returns Account

  • get web3(): default
  • Returns the Web3 class assigned to this connection

    Returns default

Methods

  • allowance(owner: string, spender: string): Promise<number>
  • Function to check the amount of tokens that an owner allowed to a spender.

    Parameters

    • owner: string
    • spender: string

    Returns Promise<number>

  • approve(address: string, amount: string | number): Promise<TransactionReceipt<any>>
  • Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729

    Parameters

    • address: string
    • amount: string | number

    Returns Promise<TransactionReceipt<any>>

  • balanceOf(owner: string): Promise<number>
  • Gets the balance of the specified address.

    Parameters

    • owner: string

    Returns Promise<number>

  • balanceOfUnderlying(owner: string): Promise<number>
  • This also accrues interest in a transaction

    Parameters

    • owner: string

    Returns Promise<number>

  • connect(): Promise<boolean>
  • decimals(): Promise<number>
  • decreaseAllowance(spender: string, subtractedValue: number): Promise<boolean>
  • Decrease the amount of tokens that an owner allowed to a spender. approve should be called when _allowances[msg.sender][spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol Emits an Approval event.

    Parameters

    • spender: string
    • subtractedValue: number

    Returns Promise<boolean>

  • deploy(deployOptions: DeployOptions, account?: Account): Promise<TransactionReceipt<any>>
  • Deploy the loaded abi contract

    Parameters

    • deployOptions: DeployOptions
    • Optional account: Account

    Returns Promise<TransactionReceipt<any>>

  • deployJsonAbi(underlying_: string, initialExchangeRate_: number, decimals_: number): Promise<TransactionReceipt<any>>
  • exchangeRateCurrent(): Promise<number>
  • getApprovalEvents(filter: PastEventOptions): Promise<XEvents<ApprovalEvent>[]>
  • getTransferEvents(filter: PastEventOptions): Promise<XEvents<TransferEvent>[]>
  • increaseAllowance(spender: string, addedValue: number): Promise<boolean>
  • Increase the amount of tokens that an owner allowed to a spender. approve should be called when _allowances[msg.sender][spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol Emits an Approval event.

    Parameters

    • spender: string
    • addedValue: number

    Returns Promise<boolean>

  • initialBlockNumber(): Promise<number>
  • initialExchangeRate(): Promise<number>
  • isCToken(): Promise<boolean>
  • loadAbi(): void
  • loadContract(): Promise<void>
  • mint(mintAmount: number): Promise<boolean>
  • Accrues interest whether or not the operation succeeds, unless reverted

    Parameters

    • mintAmount: number

    Returns Promise<boolean>

  • redeemUnderlying(redeemAmount: number): Promise<boolean>
  • sendTx(method: ContractSendMethod, value?: any): Promise<TransactionReceipt<any>>
  • Interact with, or change a value of, a property on the contract

    Parameters

    • method: ContractSendMethod
    • Optional value: any

    Returns Promise<TransactionReceipt<any>>

  • sendUnsignedTx(method: ContractSendMethod, value?: any, __namedParameters?: Partial<Web3ConnectionOptions>): Promise<TransactionReceipt<any>>
  • start(): Promise<void>
  • supplyUnderlying(supplyAmount: number): Promise<boolean>
  • totalSupply(): Promise<number>
  • transfer(to: string, value: number): Promise<boolean>
  • Transfer token to a specified address

    Parameters

    • to: string
    • value: number

    Returns Promise<boolean>

  • transferFrom(from: string, to: string, value: number): Promise<boolean>
  • Transfer tokens from one address to another. Note that while this function emits an Approval event, this is not required as per the specification, and other compliant implementations may not emit the event.

    Parameters

    • from: string
    • to: string
    • value: number

    Returns Promise<boolean>

  • underlying(): Promise<string>

Generated using TypeDoc