Members
# __assert
Use a cerc20mock contract with the current address
Methods
# async balanceOfUnderlying(params) → {Promise.<uint256>}
Get the underlying balance of the owner
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
owner |
address
|
The address of the account to query |
The amount of underlying owned by owner
Promise.<uint256>
# deploy(params, options) → {Promise.<Transaction>}
Deploy CERC20Mock
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
Parameters |
underlying |
Address
|
The address of the underlying asset |
initialExchangeRate |
uint256
|
The initial exchange rate, scaled by 1e18 |
decimals |
uint256
|
ERC-20 decimal precision of this token |
options |
IContract~TxOptions
|
Transaction
Promise.<Transaction>
# async exchangeRateCurrent() → {Promise.<uint256>}
Accrue interest then return the up-to-date exchange rate
Calculated exchange rate
Promise.<uint256>
# initialBlockNumber() → {Promise.<uint256>}
Block number that interest started to increase from
Promise.<uint256>
# initialExchangeRate() → {Promise.<uint256>}
Initial exchange rate used when minting the first CTokens (used when totalSupply = 0)
Promise.<uint256>
# isCToken() → {Promise.<bool>}
Indicator that this is a CToken contract (for inspection)
Promise.<bool>
# mint(params) → {Promise.<bool>}
Sender supplies assets into the market and receives cTokens in exchange Accrues interest whether or not the operation succeeds, unless reverted
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
mintAmount |
uint256
|
The amount of the underlying asset to supply |
true=success, otherwise a failure
Promise.<bool>
# redeemUnderlying(params) → {Promise.<bool>}
Sender redeems cTokens in exchange for a specified amount of underlying asset
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
redeemAmount |
uint256
|
The amount of underlying to redeem |
true=success, otherwise a failure
Promise.<bool>
# supplyUnderlying(params) → {Promise.<bool>}
Sender supplies underlying to the money market
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
supplyAmount |
uint256
|
The amount of underlying to supply |
true=success, otherwise a failure
Promise.<bool>
Type Definitions
Object
# Options
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
test |
Boolean
|
|||
localtest |
Boolean
|
ganache local blockchain |
||
web3Connection |
Web3Connection
|
<optional> |
Web3Connection | created from params: 'test', 'localtest' and optional 'web3Connection' string and 'privateKey' |
contractAddress |
string
|
<optional> |