@bananapus/core-v6 0.0.49 → 0.0.52
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/CHANGELOG.md +37 -0
- package/foundry.toml +1 -0
- package/package.json +1 -1
- package/src/JBMultiTerminal.sol +530 -304
- package/src/interfaces/IJBCashOutTerminal.sol +68 -0
- package/src/interfaces/IJBFeeTerminal.sol +0 -3
- package/src/libraries/JBCashOutHookSpecsLib.sol +181 -0
- package/src/libraries/JBConstants.sol +6 -0
- package/src/libraries/JBFees.sol +25 -0
- package/src/libraries/JBHeldFeesLib.sol +288 -0
- package/src/libraries/JBRulesetMetadataResolver.sol +20 -12
- package/src/structs/JBRulesetMetadata.sol +4 -1
- package/test/helpers/JBTest.sol +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,23 @@ This file describes the verified change from `nana-core-v5` to the current `nana
|
|
|
30
30
|
- `IJBController.addPriceFeed(...)` became `addPriceFeedFor(...)`.
|
|
31
31
|
- `IJBTerminal.currentSurplusOf(...)` now takes `address[] calldata tokens` instead of the old accounting-context array input.
|
|
32
32
|
- The interface surface adds explicit hook-spec return types to preview flows, which changes what off-chain callers can and should decode.
|
|
33
|
+
- `IJBCashOutTerminal.payAfterCashOutTokensOf(...)` is new. It burns source-project tokens and pays the
|
|
34
|
+
reclaim into another project via that project's primary terminal for the reclaim token (which may itself
|
|
35
|
+
be a router that swaps before paying). Source-side cashout fee is skipped; the equivalent fee is bound on
|
|
36
|
+
the destination project's side by crediting `_feeFreeSurplusOf[beneficiaryProjectId][token]` on the first of the destination project's accounting contexts on this
|
|
37
|
+
terminal whose balance grows during the routing. Reverts if no delivery lands on this terminal under any
|
|
38
|
+
of the destination project's accounting contexts.
|
|
39
|
+
- `IJBCashOutTerminal.addToBalanceAfterCashOutTokensOf(...)` is new. Sibling of
|
|
40
|
+
`payAfterCashOutTokensOf` that adds the reclaim to the destination project's balance instead of paying
|
|
41
|
+
(no destination tokens minted). Same source-side fee-skip + destination-side `_feeFreeSurplusOf` credit
|
|
42
|
+
semantics, same opt-out via `pauseCrossProjectFeeFreeInflows`. Held-fee return on the destination side
|
|
43
|
+
is hardcoded to `false` so this entrypoint cannot unlock B's held fees.
|
|
44
|
+
- `JBRulesetMetadata.pauseCrossProjectFeeFreeInflows` is new (bit 80 in the packed metadata word). Opt-out
|
|
45
|
+
flag on the destination project's current ruleset; when set, `payAfterCashOutTokensOf` and
|
|
46
|
+
`addToBalanceAfterCashOutTokensOf` calls targeting the destination project revert. Default
|
|
47
|
+
`false` allows inflows — matching the existing intra-terminal payout semantic where receiving projects
|
|
48
|
+
accumulate `_feeFreeSurplusOf` credits from other projects' outflows. The trailing `metadata` field
|
|
49
|
+
narrowed from 14 to 13 bits to make room.
|
|
33
50
|
|
|
34
51
|
## Breaking ABI changes
|
|
35
52
|
|
|
@@ -38,8 +55,16 @@ This file describes the verified change from `nana-core-v5` to the current `nana
|
|
|
38
55
|
- `IJBController.previewMintOf(...)` is new.
|
|
39
56
|
- `IJBTerminal.previewPayFor(...)` is new.
|
|
40
57
|
- `IJBCashOutTerminal.previewCashOutFrom(...)` is new.
|
|
58
|
+
- `IJBCashOutTerminal.payAfterCashOutTokensOf(...)` is new.
|
|
59
|
+
- `IJBCashOutTerminal.addToBalanceAfterCashOutTokensOf(...)` is new.
|
|
60
|
+
- `IJBFeeTerminal.FEE()` is REMOVED. The terminal no longer re-exports the protocol fee constant; read
|
|
61
|
+
`JBConstants.FEE` directly. Off-chain integrators that previously called `terminal.FEE()` must switch to
|
|
62
|
+
reading the constant from `JBConstants`.
|
|
41
63
|
- `IJBTerminalStore.previewPayFrom(...)` and `previewCashOutFrom(...)` are new.
|
|
42
64
|
- `IJBTerminal.currentSurplusOf(...)` changed parameter shape.
|
|
65
|
+
- `JBRulesetMetadata` adds `pauseCrossProjectFeeFreeInflows` and narrows `metadata` from 14 to 13 bits.
|
|
66
|
+
Packed `JBRuleset.metadata` layout has shifted accordingly. Integrators that read the packed word directly
|
|
67
|
+
must rebuild against the new layout.
|
|
43
68
|
|
|
44
69
|
## Indexer impact
|
|
45
70
|
|
|
@@ -58,12 +83,24 @@ This file describes the verified change from `nana-core-v5` to the current `nana
|
|
|
58
83
|
- Added functions
|
|
59
84
|
- `IJBTerminal.previewPayFor(...)`
|
|
60
85
|
- `IJBCashOutTerminal.previewCashOutFrom(...)`
|
|
86
|
+
- `IJBCashOutTerminal.payAfterCashOutTokensOf(...)`
|
|
87
|
+
- `IJBCashOutTerminal.addToBalanceAfterCashOutTokensOf(...)`
|
|
61
88
|
- `IJBTerminalStore.previewPayFrom(...)`
|
|
62
89
|
- `IJBTerminalStore.previewCashOutFrom(...)`
|
|
63
90
|
- `IJBController.previewMintOf(...)`
|
|
64
91
|
- `IJBController.setTokenMetadataOf(...)`
|
|
92
|
+
- Added ruleset metadata flags
|
|
93
|
+
- `JBRulesetMetadata.pauseCrossProjectFeeFreeInflows` (bit 80; narrowed `metadata` field from 14 to 13 bits)
|
|
94
|
+
- Added libraries
|
|
95
|
+
- `JBHeldFeesLib` (held-fee bookkeeping extracted from `JBMultiTerminal` to relieve bytecode budget;
|
|
96
|
+
called via delegatecall, storage refs preserved)
|
|
97
|
+
- `JBCashOutHookSpecsLib` (cash-out hook specification fulfillment extracted from `JBMultiTerminal` to
|
|
98
|
+
relieve bytecode budget after adding `addToBalanceAfterCashOutTokensOf`; called via delegatecall, emits
|
|
99
|
+
`HookAfterRecordCashOut` from the terminal address)
|
|
65
100
|
- Renamed functions
|
|
66
101
|
- `IJBController.addPriceFeed(...)` -> `addPriceFeedFor(...)`
|
|
102
|
+
- Removed functions
|
|
103
|
+
- `IJBFeeTerminal.FEE()` (read `JBConstants.FEE` directly)
|
|
67
104
|
- Changed function shapes
|
|
68
105
|
- `IJBTerminal.currentSurplusOf(...)`
|
|
69
106
|
- Added events
|
package/foundry.toml
CHANGED