RebasingDebtToken

Implementation of the interest bearing token for the ParaSpace protocol

constructor

constructor(contract IPool pool) public

balanceOf

function balanceOf(address user) public view returns (uint256)

Calculates the balance of the user: principal balance + debt interest accrued by the principal

Parameters

NameTypeDescription

user

address

The user whose balance is calculated

Return Values

NameTypeDescription

[0]

uint256

The balance of the user

scaledBalanceOf

function scaledBalanceOf(address user) public view returns (uint256)

Returns the scaled balance of the user. The scaled balance is the sum of all the updated stored balance divided by the reserve's liquidity index at the moment of the update

Parameters

NameTypeDescription

user

address

The user whose balance is calculated

Return Values

NameTypeDescription

[0]

uint256

The scaled balance of the user

getScaledUserBalanceAndSupply

function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256)

Returns the scaled balance of the user and the scaled total supply.

Parameters

NameTypeDescription

user

address

The address of the user

Return Values

NameTypeDescription

[0]

uint256

The scaled balance of the user

[1]

uint256

The scaled balance and the scaled total supply

totalSupply

function totalSupply() public view returns (uint256)

calculates the total supply of the specific aToken since the balance of every single user increases over time, the total supply does that too.

Return Values

NameTypeDescription

[0]

uint256

the current total supply

scaledTotalSupply

function scaledTotalSupply() public view virtual returns (uint256)

Returns the scaled total supply of the variable debt token. Represents sum(debt/index)

Return Values

NameTypeDescription

[0]

uint256

the scaled total supply

_scaledBalanceOf

function _scaledBalanceOf(address user, uint256 rebasingIndex) internal view returns (uint256)

_scaledTotalSupply

function _scaledTotalSupply(uint256 rebasingIndex) internal view returns (uint256)

lastRebasingIndex

function lastRebasingIndex() internal view virtual returns (uint256)

Return Values

NameTypeDescription

[0]

uint256

Current rebasing index in RAY