SharesManagerV1
Kiln
Shares Manager (v1)
This contract handles the shares of the depositor and the ERC20 interface
Methods
allowance
Retrieve the allowance value for a spender
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address that issued the allowance |
_spender | address | Address that received the allowance |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The allowance in shares for a given spender |
approve
Approves an account for future spendings
An approved account can use transferFrom to transfer funds on behalf of the token owner
Parameters
Name | Type | Description |
---|---|---|
_spender | address | Address that is allowed to spend the tokens |
_value | uint256 | The allowed amount in shares, will override previous value |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
balanceOf
Retrieve the balance of an account
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address to be checked |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The balance of the account in shares |
balanceOfUnderlying
Retrieve the underlying asset balance of an account
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address to be checked |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The underlying balance of the account |
decimals
Retrieve the decimal count
Returns
Name | Type | Description |
---|---|---|
_0 | uint8 | The decimal count |
decreaseAllowance
Decrease allowance to another account
Parameters
Name | Type | Description |
---|---|---|
_spender | address | Spender that receives the allowance |
_subtractableValue | uint256 | Amount of shares to subtract |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
increaseAllowance
Increase allowance to another account
Parameters
Name | Type | Description |
---|---|---|
_spender | address | Spender that receives the allowance |
_additionalValue | uint256 | Amount of shares to add |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
name
Retrieve the token name
Returns
Name | Type | Description |
---|---|---|
_0 | string | The token name |
sharesFromUnderlyingBalance
Retrieve the shares count from an underlying asset amount
Parameters
Name | Type | Description |
---|---|---|
_underlyingAssetAmount | uint256 | Amount of underlying asset to convert |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The amount of shares worth the underlying asset amopunt |
symbol
Retrieve the token symbol
Returns
Name | Type | Description |
---|---|---|
_0 | string | The token symbol |
totalSupply
Retrieve the total token supply
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The total supply in shares |
totalUnderlyingSupply
Retrieve the total underlying asset supply
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The total underlying asset supply |
transfer
Performs a transfer from the message sender to the provided account
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address receiving the tokens |
_value | uint256 | Amount of shares to be sent |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
transferFrom
Performs a transfer between two recipients
Parameters
Name | Type | Description |
---|---|---|
_from | address | Address sending the tokens |
_to | address | Address receiving the tokens |
_value | uint256 | Amount of shares to be sent |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
underlyingBalanceFromShares
Retrieve the underlying asset balance from an amount of shares
Parameters
Name | Type | Description |
---|---|---|
_shares | uint256 | Amount of shares to convert |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The underlying asset balance represented by the shares |
Events
Approval
Parameters
Name | Type | Description |
---|---|---|
owner | address | undefined |
spender | address | undefined |
value | uint256 | undefined |
Transfer
Parameters
Name | Type | Description |
---|---|---|
from | address | undefined |
to | address | undefined |
value | uint256 | undefined |
Errors
AllowanceTooLow
Allowance too low to perform operation
Parameters
Name | Type | Description |
---|---|---|
_from | address | Account where funds are sent from |
_operator | address | Account attempting the transfer |
_allowance | uint256 | Current allowance |
_value | uint256 | Requested transfer value in shares |
BalanceTooLow
Balance too low to perform operation
InvalidZeroAddress
The address is zero
NullTransfer
Invalid empty transfer
UnauthorizedTransfer
Invalid transfer recipients
Parameters
Name | Type | Description |
---|---|---|
_from | address | Account sending the funds in the invalid transfer |
_to | address | Account receiving the funds in the invalid transfer |
Last updated