View Source: contracts/Interfaces/ISortedTroves.sol
↘ Derived Contracts: SortedTroves
ISortedTroves
Events
event SortedTrovesAddressChanged(address _sortedDoublyLLAddress);
event BorrowerOperationsAddressChanged(address _borrowerOperationsAddress);
event NodeAdded(address _id, uint256 _NICR);
event NodeRemoved(address _id);
- setParams(uint256 _size, address _TroveManagerAddress, address _borrowerOperationsAddress)
- insert(address _id, uint256 _ICR, address _prevId, address _nextId)
- remove(address _id)
- reInsert(address _id, uint256 _newICR, address _prevId, address _nextId)
- contains(address _id)
- isFull()
- isEmpty()
- getSize()
- getMaxSize()
- getFirst()
- getLast()
- getNext(address _id)
- getPrev(address _id)
- validInsertPosition(uint256 _ICR, address _prevId, address _nextId)
- findInsertPosition(uint256 _ICR, address _prevId, address _nextId)
Called only once on init, to set addresses of other Zero contracts and size. Callable only by owner
function setParams(uint256 _size, address _TroveManagerAddress, address _borrowerOperationsAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_size | uint256 | max size of troves list |
_TroveManagerAddress | address | TroveManager contract address |
_borrowerOperationsAddress | address | BorrowerOperations contract address |
Source Code
function setParams(
uint256 _size,
address _TroveManagerAddress,
address _borrowerOperationsAddress
) external;
Add a node to the list
function insert(address _id, uint256 _ICR, address _prevId, address _nextId) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_id | address | Node's id |
_ICR | uint256 | Node's NICR |
_prevId | address | Id of previous node for the insert position |
_nextId | address | Id of next node for the insert position |
Source Code
function insert(
address _id,
uint256 _ICR,
address _prevId,
address _nextId
) external;
Remove a node from the list
function remove(address _id) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_id | address | Node's id |
Source Code
function remove(address _id) external;
Re-insert the node at a new position, based on its new NICR
function reInsert(address _id, uint256 _newICR, address _prevId, address _nextId) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_id | address | Node's id |
_newICR | uint256 | Node's new NICR |
_prevId | address | Id of previous node for the new insert position |
_nextId | address | Id of next node for the new insert position |
Source Code
function reInsert(
address _id,
uint256 _newICR,
address _prevId,
address _nextId
) external;
Checks if the list contains a node
function contains(address _id) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
_id | address | Node's id |
Returns
true if list contains a node with given id
Source Code
function contains(address _id) external view returns (bool);
Checks if the list is full
function isFull() external view
returns(bool)
Source Code
function isFull() external view returns (bool);
Checks if the list is empty
function isEmpty() external view
returns(bool)
Source Code
function isEmpty() external view returns (bool);
function getSize() external view
returns(uint256)
Source Code
function getSize() external view returns (uint256);
function getMaxSize() external view
returns(uint256)
Source Code
function getMaxSize() external view returns (uint256);
function getFirst() external view
returns(address)
Source Code
function getFirst() external view returns (address);
function getLast() external view
returns(address)
Source Code
function getLast() external view returns (address);
function getNext(address _id) external view
returns(address)
Arguments
Name | Type | Description |
---|---|---|
_id | address | Node's id |
Returns
the next node (with a smaller NICR) in the list for a given node
Source Code
function getNext(address _id) external view returns (address);
function getPrev(address _id) external view
returns(address)
Arguments
Name | Type | Description |
---|---|---|
_id | address | Node's id |
Returns
the previous node (with a larger NICR) in the list for a given node
Source Code
function getPrev(address _id) external view returns (address);
Check if a pair of nodes is a valid insertion point for a new node with the given NICR
function validInsertPosition(uint256 _ICR, address _prevId, address _nextId) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
_ICR | uint256 | Node's NICR |
_prevId | address | Id of previous node for the insert position |
_nextId | address | Id of next node for the insert position |
Source Code
function validInsertPosition(
uint256 _ICR,
address _prevId,
address _nextId
) external view returns (bool);
Find the insert position for a new node with the given NICR
function findInsertPosition(uint256 _ICR, address _prevId, address _nextId) external view
returns(address, address)
Arguments
Name | Type | Description |
---|---|---|
_ICR | uint256 | Node's NICR |
_prevId | address | Id of previous node for the insert position |
_nextId | address | Id of next node for the insert position |
Source Code
function findInsertPosition(
uint256 _ICR,
address _prevId,
address _nextId
) external view returns (address, address);
- ActivePool
- ActivePoolStorage
- BaseMath
- BorrowerOperations
- BorrowerOperationsScript
- BorrowerOperationsStorage
- BorrowerWrappersScript
- CheckContract
- CollSurplusPool
- CollSurplusPoolStorage
- console
- Context
- DefaultPool
- DefaultPoolStorage
- DocsCover
- DSAuth
- DSAuthEvents
- DSAuthority
- DSNote
- DSProxy
- DSProxyCache
- DSProxyFactory
- ERC20
- ETHTransferScript
- FeeDistributor
- FeeDistributorStorage
- GasPool
- HintHelpers
- HintHelpersStorage
- IActivePool
- IBalanceRedirectPresale
- IBorrowerOperations
- ICollSurplusPool
- IDefaultPool
- IERC20
- IERC2612
- IExternalPriceFeed
- IFeeDistributor
- IFeeSharingProxy
- ILiquityBase
- ILiquityBaseParams
- IMasset
- IMoCBaseOracle
- Initializable
- IPool
- IPriceFeed
- IRSKOracle
- ISortedTroves
- IStabilityPool
- ITroveManager
- IWrbtc
- IZUSDToken
- LiquityBase
- LiquityBaseParams
- LiquityMath
- LiquitySafeMath128
- MoCMedianizer
- MultiTroveGetter
- MultiTroveGetterStorage
- NueToken
- Ownable
- PriceFeed
- PriceFeedStorage
- ProxiableContract
- ProxiableContract2
- Proxy
- RskOracle
- SafeMath
- SortedTroves
- SortedTrovesStorage
- StabilityPool
- StabilityPoolScript
- StabilityPoolStorage
- Storage
- Storage2
- TokenScript
- TroveManager
- TroveManagerBase
- TroveManagerBase1MinuteBootstrap
- TroveManagerRedeemOps
- TroveManagerScript
- TroveManagerStorage
- UpgradableProxy
- ZUSDToken
- ZUSDTokenStorage