FundLockStateGetters

State Getters of the FundLock module.

View Source: contracts/fund-lock/FundLockStateGetters.sol

↗ Extends: FundLockStorage

FundLockStateGetters

Specific getter functionality for the ease of use. Overriding (covering) some of the {FundLockStorage} getters to provide more appropriate/parsed data.

Functions

  • balanceSheet(address userAddress, address tokenAddress)

  • fundsToWithdraw(address userAddress, address tokenAddress, uint256 index)

  • fundsToWithdrawTotal(address beneficiary, address token)

  • isEtherToken(address tokenAddress)

  • _getIsEtherAndAssetAddress(address tokenAddress)

balanceSheet

Getter returning the correct {balanceSheetS} value for the correct token and particular client.In cases of ETH usage it will convert the ETH address to WETH9 address and read the appropriate balance. See {getIsEtherAndAssetAddress}

function balanceSheet(address userAddress, address tokenAddress) external view
returns(uint256)

Returns

uint256 - balance amount

Arguments

NameTypeDescription

userAddress

address

- address of the user to check balance for

tokenAddress

address

- top level token address used (ETH for cases with Ether)

fundsToWithdraw

Getter used to pull data about client's withdraw requests.Wraps autogenerated getter for {fundsToWithdrawS} to find a proper token address (in the case of Ether) and read the correct storage slot of the mapping. This will return only ONE request at an index provided.

function fundsToWithdraw(address userAddress, address tokenAddress, uint256 index) external view
returns(value uint256, timestamp uint256)

Returns

value - the amount of funds marked for withdrawal

Arguments

NameTypeDescription

userAddress

address

- address of the client who sent withdrawal request(s)

tokenAddress

address

- address of the token withdrawn

index

uint256

- index of the particular withdrawal request (max of 5)

fundsToWithdrawTotal

Returns the total amount of token flagged for withdrawal for a particular user that still has active {tradeLock}. This is the SUM of all withdraw requests for a particular token and user.

function fundsToWithdrawTotal(address beneficiary, address token) external view
returns(uint256)

Returns

uint256 - total amount of client's funds marked for withdrawal

Arguments

NameTypeDescription

beneficiary

address

- address of the user to get balance for

token

address

- address of the token to get balance for

isEtherToken

Checks if the provided token is Ether.

function isEtherToken(address tokenAddress) internal view
returns(bool)

Arguments

NameTypeDescription

tokenAddress

address

_getIsEtherAndAssetAddress

Internal function used by other getters to determine if the provided token is Ether and return a proper token address used by {FundLockStorage}.

function _getIsEtherAndAssetAddress(address tokenAddress) internal view
returns(isEther bool, assetAddress address)

Arguments

NameTypeDescription

tokenAddress

address

Last updated