Skip to main content

HasAaveBalanceMemoizer

HasAaveBalanceMemoizer​

the memoizer works in the context of a single token and therefore should not be used across multiple tokens.

BalanceMemoizer​

Parameters​

NameTypeDescription
struct BalanceMemoizer {
uint256 balanceOf;
bool balanceOfMemoized;
uint256 balanceOfOverlying;
bool balanceOfOverlyingMemoized;
contract IERC20 overlying;
bool overlyingMemoized;
}

constructor​

constructor(address addressesProvider) public

contract's constructor

Parameters​

NameTypeDescription
addressesProvideraddressaddress of AAVE's address provider

overlying​

function overlying(contract IERC20 token, struct HasAaveBalanceMemoizer.BalanceMemoizer memoizer) internal view returns (contract IERC20)

Gets the overlying for the token.

Parameters​

NameTypeDescription
tokencontract IERC20the token.
memoizerstruct HasAaveBalanceMemoizer.BalanceMemoizerthe memoizer.

Return Values​

NameTypeDescription
[0]contract IERC20overlying for the token.

balanceOfOverlying​

function balanceOfOverlying(contract IERC20 token, struct HasAaveBalanceMemoizer.BalanceMemoizer memoizer) internal view returns (uint256)

Gets the balance for the overlying of the token, or 0 if there is no overlying.

Parameters​

NameTypeDescription
tokencontract IERC20the token.
memoizerstruct HasAaveBalanceMemoizer.BalanceMemoizerthe memoizer.

Return Values​

NameTypeDescription
[0]uint256balance of the overlying, or 0 if there is no overlying.

balanceOf​

function balanceOf(contract IERC20 token, struct HasAaveBalanceMemoizer.BalanceMemoizer memoizer) internal view returns (uint256)

Gets the balance of the token

Parameters​

NameTypeDescription
tokencontract IERC20the token.
memoizerstruct HasAaveBalanceMemoizer.BalanceMemoizerthe memoizer.

Return Values​

NameTypeDescription
[0]uint256balance of the token.