forked from Synthetixio/synthetix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathISynthetixState.sol
30 lines (27 loc) · 1.34 KB
/
ISynthetixState.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
pragma solidity 0.4.25;
contract ISynthetixState {
// A struct for handing values associated with an individual user's debt position
struct IssuanceData {
// Percentage of the total debt owned at the time
// of issuance. This number is modified by the global debt
// delta array. You can figure out a user's exit price and
// collateralisation ratio using a combination of their initial
// debt and the slice of global debt delta which applies to them.
uint initialDebtOwnership;
// This lets us know when (in relative terms) the user entered
// the debt pool so we can calculate their exit price and
// collateralistion ratio
uint debtEntryIndex;
}
uint[] public debtLedger;
uint public issuanceRatio;
mapping(address => IssuanceData) public issuanceData;
function debtLedgerLength() external view returns (uint);
function hasIssued(address account) external view returns (bool);
function incrementTotalIssuerCount() external;
function decrementTotalIssuerCount() external;
function setCurrentIssuanceData(address account, uint initialDebtOwnership) external;
function lastDebtLedgerEntry() external view returns (uint);
function appendDebtLedgerValue(uint value) external;
function clearIssuanceData(address account) external;
}