SharesManagerV1

Kiln

Shares Manager (v1)

This contract handles the shares of the depositor and the ERC20 interface

Methods

allowance

function allowance(address _owner, address _spender) external view returns (uint256)

Retrieve the allowance value for a spender

Parameters

NameTypeDescription

_owner

address

Address that issued the allowance

_spender

address

Address that received the allowance

Returns

NameTypeDescription

_0

uint256

The allowance in shares for a given spender

approve

function approve(address _spender, uint256 _value) external nonpayable returns (bool)

Approves an account for future spendings

An approved account can use transferFrom to transfer funds on behalf of the token owner

Parameters

NameTypeDescription

_spender

address

Address that is allowed to spend the tokens

_value

uint256

The allowed amount in shares, will override previous value

Returns

NameTypeDescription

_0

bool

True if success

balanceOf

function balanceOf(address _owner) external view returns (uint256)

Retrieve the balance of an account

Parameters

NameTypeDescription

_owner

address

Address to be checked

Returns

NameTypeDescription

_0

uint256

The balance of the account in shares

balanceOfUnderlying

function balanceOfUnderlying(address _owner) external view returns (uint256)

Retrieve the underlying asset balance of an account

Parameters

NameTypeDescription

_owner

address

Address to be checked

Returns

NameTypeDescription

_0

uint256

The underlying balance of the account

decimals

function decimals() external pure returns (uint8)

Retrieve the decimal count

Returns

NameTypeDescription

_0

uint8

The decimal count

decreaseAllowance

function decreaseAllowance(address _spender, uint256 _subtractableValue) external nonpayable returns (bool)

Decrease allowance to another account

Parameters

NameTypeDescription

_spender

address

Spender that receives the allowance

_subtractableValue

uint256

Amount of shares to subtract

Returns

NameTypeDescription

_0

bool

True if success

increaseAllowance

function increaseAllowance(address _spender, uint256 _additionalValue) external nonpayable returns (bool)

Increase allowance to another account

Parameters

NameTypeDescription

_spender

address

Spender that receives the allowance

_additionalValue

uint256

Amount of shares to add

Returns

NameTypeDescription

_0

bool

True if success

name

function name() external pure returns (string)

Retrieve the token name

Returns

NameTypeDescription

_0

string

The token name

sharesFromUnderlyingBalance

function sharesFromUnderlyingBalance(uint256 _underlyingAssetAmount) external view returns (uint256)

Retrieve the shares count from an underlying asset amount

Parameters

NameTypeDescription

_underlyingAssetAmount

uint256

Amount of underlying asset to convert

Returns

NameTypeDescription

_0

uint256

The amount of shares worth the underlying asset amopunt

symbol

function symbol() external pure returns (string)

Retrieve the token symbol

Returns

NameTypeDescription

_0

string

The token symbol

totalSupply

function totalSupply() external view returns (uint256)

Retrieve the total token supply

Returns

NameTypeDescription

_0

uint256

The total supply in shares

totalUnderlyingSupply

function totalUnderlyingSupply() external view returns (uint256)

Retrieve the total underlying asset supply

Returns

NameTypeDescription

_0

uint256

The total underlying asset supply

transfer

function transfer(address _to, uint256 _value) external nonpayable returns (bool)

Performs a transfer from the message sender to the provided account

Parameters

NameTypeDescription

_to

address

Address receiving the tokens

_value

uint256

Amount of shares to be sent

Returns

NameTypeDescription

_0

bool

True if success

transferFrom

function transferFrom(address _from, address _to, uint256 _value) external nonpayable returns (bool)

Performs a transfer between two recipients

Parameters

NameTypeDescription

_from

address

Address sending the tokens

_to

address

Address receiving the tokens

_value

uint256

Amount of shares to be sent

Returns

NameTypeDescription

_0

bool

True if success

underlyingBalanceFromShares

function underlyingBalanceFromShares(uint256 _shares) external view returns (uint256)

Retrieve the underlying asset balance from an amount of shares

Parameters

NameTypeDescription

_shares

uint256

Amount of shares to convert

Returns

NameTypeDescription

_0

uint256

The underlying asset balance represented by the shares

Events

Approval

event Approval(address indexed owner, address indexed spender, uint256 value)

Parameters

NameTypeDescription

owner indexed

address

undefined

spender indexed

address

undefined

value

uint256

undefined

Transfer

event Transfer(address indexed from, address indexed to, uint256 value)

Parameters

NameTypeDescription

from indexed

address

undefined

to indexed

address

undefined

value

uint256

undefined

Errors

AllowanceTooLow

error AllowanceTooLow(address _from, address _operator, uint256 _allowance, uint256 _value)

Allowance too low to perform operation

Parameters

NameTypeDescription

_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

error BalanceTooLow()

Balance too low to perform operation

InvalidZeroAddress

error InvalidZeroAddress()

The address is zero

NullTransfer

error NullTransfer()

Invalid empty transfer

UnauthorizedTransfer

error UnauthorizedTransfer(address _from, address _to)

Invalid transfer recipients

Parameters

NameTypeDescription

_from

address

Account sending the funds in the invalid transfer

_to

address

Account receiving the funds in the invalid transfer

Last updated