@bananapus/core-v6 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/JBTerminalStore.sol +7 -12
package/package.json
CHANGED
package/src/JBTerminalStore.sol
CHANGED
|
@@ -882,8 +882,8 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
882
882
|
// Get a reference to the project's current ruleset.
|
|
883
883
|
ruleset = RULESETS.currentOf(projectId);
|
|
884
884
|
|
|
885
|
-
//
|
|
886
|
-
|
|
885
|
+
// Get the project's current surplus for the token being reclaimed.
|
|
886
|
+
uint256 surplus = _cashOutSurplusOf({
|
|
887
887
|
terminal: terminal, projectId: projectId, tokenToReclaim: tokenToReclaim, ruleset: ruleset
|
|
888
888
|
});
|
|
889
889
|
|
|
@@ -905,8 +905,7 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
905
905
|
|
|
906
906
|
// If the ruleset has a data hook which is enabled for cash outs, use it to derive a claim amount and memo.
|
|
907
907
|
if (ruleset.useDataHookForCashOut() && ruleset.dataHook() != address(0)) {
|
|
908
|
-
// Build the cash out context field-by-field
|
|
909
|
-
// (the struct has 11 fields — a struct literal would require all values on the stack at once).
|
|
908
|
+
// Build the cash out context field-by-field — the struct has 11 fields, too many for a literal.
|
|
910
909
|
JBBeforeCashOutRecordedContext memory context;
|
|
911
910
|
context.terminal = terminal;
|
|
912
911
|
context.holder = holder;
|
|
@@ -916,7 +915,7 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
916
915
|
context.totalSupply = totalSupply;
|
|
917
916
|
context.surplus = JBTokenAmount({
|
|
918
917
|
token: accountingContext.token,
|
|
919
|
-
value:
|
|
918
|
+
value: surplus,
|
|
920
919
|
decimals: accountingContext.decimals,
|
|
921
920
|
currency: accountingContext.currency
|
|
922
921
|
});
|
|
@@ -938,14 +937,10 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
938
937
|
cashOutTaxRate = ruleset.cashOutTaxRate();
|
|
939
938
|
}
|
|
940
939
|
|
|
941
|
-
//
|
|
942
|
-
|
|
943
|
-
if (reclaimAmount != 0) {
|
|
940
|
+
// Apply the bonding curve to calculate how much of the surplus is reclaimable.
|
|
941
|
+
if (surplus != 0) {
|
|
944
942
|
reclaimAmount = JBCashOuts.cashOutFrom({
|
|
945
|
-
surplus:
|
|
946
|
-
cashOutCount: cashOutCount,
|
|
947
|
-
totalSupply: totalSupply,
|
|
948
|
-
cashOutTaxRate: cashOutTaxRate
|
|
943
|
+
surplus: surplus, cashOutCount: cashOutCount, totalSupply: totalSupply, cashOutTaxRate: cashOutTaxRate
|
|
949
944
|
});
|
|
950
945
|
}
|
|
951
946
|
}
|