Skip to content

Latest commit

 

History

History
256 lines (245 loc) · 10 KB

LoanTokenBase.md

File metadata and controls

256 lines (245 loc) · 10 KB

Loan Token Base contract. (LoanTokenBase.sol)

View Source: contracts/connectors/loantoken/LoanTokenBase.sol

↗ Extends: ReentrancyGuard, SharedReentrancyGuard, Ownable, Pausable ↘ Derived Contracts: AdvancedTokenStorage

LoanTokenBase contract

This contract code comes from bZx. bZx is a protocol for tokenized margin trading and lending https://bzx.network similar to the dYdX protocol.

  • Specific loan related storage for iTokens.
  • An loan token or iToken is a representation of a user funds in the pool and the interest they've earned. The redemption value of iTokens continually increase from the accretion of interest paid into the lending pool by borrowers. The user can sell iTokens to exit its position. The user might potentially use them as collateral wherever applicable.
  • There are three main tokens in the bZx system, iTokens, pTokens, and BZRX tokens. The bZx system of lending and borrowing depends on iTokens and pTokens, and when users lend or borrow money on bZx, their crypto assets go into or come out of global liquidity pools, which are pools of funds shared between many different exchanges. When lenders supply funds into the global liquidity pools, they automatically receive iTokens; When users borrow money to open margin trading positions, they automatically receive pTokens. The system is also designed to use the BZRX tokens, which are only used to pay fees on the network currently.

Contract Members

Constants & Variables

//internal members
uint256 internal constant WEI_PRECISION;
uint256 internal constant WEI_PERCENT_PRECISION;
int256 internal constant sWEI_PRECISION;
uint256 internal _flTotalAssetSupply;
uint88 internal lastSettleTime_;
mapping(address => uint256) internal checkpointPrices_;

//public members
string public name;
string public symbol;
uint8 public decimals;
address public loanTokenAddress;
uint256 public baseRate;
uint256 public rateMultiplier;
uint256 public lowUtilBaseRate;
uint256 public lowUtilRateMultiplier;
uint256 public targetLevel;
uint256 public kinkLevel;
uint256 public maxScaleRate;
uint256 public checkpointSupply;
uint256 public initialPrice;
mapping(uint256 => bytes32) public loanParamsIds;
mapping(address => uint256) public transactionLimit;

Functions

Contracts