-
Notifications
You must be signed in to change notification settings - Fork 11
/
SortedTrovesStorage.sol
36 lines (28 loc) · 1.15 KB
/
SortedTrovesStorage.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
import "./Interfaces/ISortedTroves.sol";
import "./Interfaces/ITroveManager.sol";
import "./Interfaces/IBorrowerOperations.sol";
import "./Dependencies/Ownable.sol";
import "./Dependencies/CheckContract.sol";
import "./Dependencies/console.sol";
contract SortedTrovesStorage is Ownable {
string public constant NAME = "SortedTroves";
address public borrowerOperationsAddress;
ITroveManager public troveManager;
// Information for a node in the list
struct Node {
bool exists;
address nextId; // Id of next node (smaller NICR) in the list
address prevId; // Id of previous node (larger NICR) in the list
}
// Information for the list
struct Data {
address head; // Head of the list. Also the node in the list with the largest NICR
address tail; // Tail of the list. Also the node in the list with the smallest NICR
uint256 maxSize; // Maximum size of the list
uint256 size; // Current size of the list
mapping(address => Node) nodes; // Track the corresponding ids for each node in the list
}
Data public data;
}