File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,14 @@ contract Synth is ExternStateToken {
289
289
emitBurned (account, amount);
290
290
}
291
291
292
+ // Allow owner to set the total supply on import.
293
+ function setTotalSupply (uint amount )
294
+ external
295
+ optionalProxy_onlyOwner
296
+ {
297
+ totalSupply = amount;
298
+ }
299
+
292
300
// Allow synthetix to trigger a token fallback call from our synths so users get notified on
293
301
// exchange as well as transfer
294
302
function triggerTokenFallbackIfNeeded (address sender , address recipient , uint amount )
Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ contract SynthetixState is State, LimitedSetup {
71
71
// Global debt pool tracking
72
72
uint [] public debtLedger;
73
73
74
+ // Import state
75
+ uint public importedXDRAmount;
76
+
74
77
// A quantity of synths greater than this ratio
75
78
// may not be issued against a given value of SNX.
76
79
uint public issuanceRatio = SafeDecimalMath.unit () / 5 ;
@@ -210,12 +213,15 @@ contract SynthetixState is State, LimitedSetup {
210
213
// What is the value of the requested debt in XDRs?
211
214
uint xdrValue = synthetix.effectiveValue ("sUSD " , amount, "XDR " );
212
215
213
- // What is the value of all issued synths of the system (priced in XDRs) ?
214
- uint totalDebtIssued = synthetix. totalIssuedSynths ( " XDR " ) ;
216
+ // What is the value that we've previously imported ?
217
+ uint totalDebtIssued = importedXDRAmount ;
215
218
216
219
// What will the new total be including the new value?
217
220
uint newTotalDebtIssued = xdrValue.add (totalDebtIssued);
218
221
222
+ // Save that for the next import.
223
+ importedXDRAmount = newTotalDebtIssued;
224
+
219
225
// What is their percentage (as a high precision int) of the total debt?
220
226
uint debtPercentage = xdrValue.divideDecimalRoundPrecise (newTotalDebtIssued);
221
227
You can’t perform that action at this time.
0 commit comments