Variables

The following are the most important variables used in the contract:

  • _NOT_ENTERED: a constant that indicates that the lock is not entered

  • _ENTERED: a constant that indicates that the lock is entered

  • _NO_ID: a constant that indicates that there is no position ID

  • _NO_ADDRESS: a constant that indicates that there is no address

  • _GENERAL_LOCK: a variable that is used as a lock to prevent reentrancy attacks

  • _IN_EXEC_LOCK: a variable that is used as a lock to avoid potential race conditions

  • POSITION_ID: a variable that indicates the position ID currently under execution

  • SPELL: a variable that indicates the spell currently under execution

  • config: an instance of IProtocolConfig that stores the protocol configuration

  • oracle: an instance of ICoreOracle that stores the address of the oracle contract

  • feeManager: an instance of IFeeManager that stores the address of the fee manager contract

  • nextPositionId: a variable that stores the next available position ID, starting from 1

  • bankStatus: a variable that stores the status of the bank, each bit stores a certain bank status, e.g. borrow allowed, repay allowed

  • allBanks: an array that stores the list of all listed banks

  • banks: a mapping from token to bank data

  • bTokenInBank: a mapping from bToken to its existence in bank

  • positions: a mapping from position ID to position data

  • allowContractCalls: a boolean variable that determines whether to allow calls from contracts or not

  • whitelistedTokens: a mapping from token to whitelist status

  • whitelistedSpells: a mapping from spell to whitelist status

  • whitelistedContracts: a mapping from user to whitelist status

Last updated