@bananapus/core-v6 0.0.17 → 0.0.18

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.
Files changed (99) hide show
  1. package/CHANGE_LOG.md +38 -13
  2. package/package.json +1 -1
  3. package/docs/book.css +0 -13
  4. package/docs/book.toml +0 -12
  5. package/docs/solidity.min.js +0 -74
  6. package/docs/src/README.md +0 -703
  7. package/docs/src/SUMMARY.md +0 -94
  8. package/docs/src/src/JBChainlinkV3PriceFeed.sol/contract.JBChainlinkV3PriceFeed.md +0 -83
  9. package/docs/src/src/JBChainlinkV3SequencerPriceFeed.sol/contract.JBChainlinkV3SequencerPriceFeed.md +0 -88
  10. package/docs/src/src/JBController.sol/contract.JBController.md +0 -1121
  11. package/docs/src/src/JBDeadline.sol/contract.JBDeadline.md +0 -84
  12. package/docs/src/src/JBDirectory.sol/contract.JBDirectory.md +0 -294
  13. package/docs/src/src/JBERC20.sol/contract.JBERC20.md +0 -190
  14. package/docs/src/src/JBFeelessAddresses.sol/contract.JBFeelessAddresses.md +0 -80
  15. package/docs/src/src/JBFundAccessLimits.sol/contract.JBFundAccessLimits.md +0 -253
  16. package/docs/src/src/JBMultiTerminal.sol/contract.JBMultiTerminal.md +0 -1472
  17. package/docs/src/src/JBPermissions.sol/contract.JBPermissions.md +0 -199
  18. package/docs/src/src/JBPrices.sol/contract.JBPrices.md +0 -154
  19. package/docs/src/src/JBProjects.sol/contract.JBProjects.md +0 -131
  20. package/docs/src/src/JBRulesets.sol/contract.JBRulesets.md +0 -677
  21. package/docs/src/src/JBSplits.sol/contract.JBSplits.md +0 -237
  22. package/docs/src/src/JBTerminalStore.sol/contract.JBTerminalStore.md +0 -591
  23. package/docs/src/src/JBTokens.sol/contract.JBTokens.md +0 -353
  24. package/docs/src/src/README.md +0 -25
  25. package/docs/src/src/abstract/JBControlled.sol/abstract.JBControlled.md +0 -64
  26. package/docs/src/src/abstract/JBPermissioned.sol/abstract.JBPermissioned.md +0 -84
  27. package/docs/src/src/abstract/README.md +0 -5
  28. package/docs/src/src/enums/JBApprovalStatus.sol/enum.JBApprovalStatus.md +0 -17
  29. package/docs/src/src/enums/README.md +0 -4
  30. package/docs/src/src/interfaces/IJBCashOutHook.sol/interface.IJBCashOutHook.md +0 -29
  31. package/docs/src/src/interfaces/IJBCashOutTerminal.sol/interface.IJBCashOutTerminal.md +0 -57
  32. package/docs/src/src/interfaces/IJBControlled.sol/interface.IJBControlled.md +0 -12
  33. package/docs/src/src/interfaces/IJBController.sol/interface.IJBController.md +0 -334
  34. package/docs/src/src/interfaces/IJBDirectory.sol/interface.IJBDirectory.md +0 -108
  35. package/docs/src/src/interfaces/IJBDirectoryAccessControl.sol/interface.IJBDirectoryAccessControl.md +0 -19
  36. package/docs/src/src/interfaces/IJBFeeTerminal.sol/interface.IJBFeeTerminal.md +0 -91
  37. package/docs/src/src/interfaces/IJBFeelessAddresses.sol/interface.IJBFeelessAddresses.md +0 -26
  38. package/docs/src/src/interfaces/IJBFundAccessLimits.sol/interface.IJBFundAccessLimits.md +0 -88
  39. package/docs/src/src/interfaces/IJBMigratable.sol/interface.IJBMigratable.md +0 -29
  40. package/docs/src/src/interfaces/IJBMultiTerminal.sol/interface.IJBMultiTerminal.md +0 -50
  41. package/docs/src/src/interfaces/IJBPayHook.sol/interface.IJBPayHook.md +0 -28
  42. package/docs/src/src/interfaces/IJBPayoutTerminal.sol/interface.IJBPayoutTerminal.md +0 -105
  43. package/docs/src/src/interfaces/IJBPermissioned.sol/interface.IJBPermissioned.md +0 -12
  44. package/docs/src/src/interfaces/IJBPermissions.sol/interface.IJBPermissions.md +0 -74
  45. package/docs/src/src/interfaces/IJBPermitTerminal.sol/interface.IJBPermitTerminal.md +0 -15
  46. package/docs/src/src/interfaces/IJBPriceFeed.sol/interface.IJBPriceFeed.md +0 -12
  47. package/docs/src/src/interfaces/IJBPrices.sol/interface.IJBPrices.md +0 -74
  48. package/docs/src/src/interfaces/IJBProjectUriRegistry.sol/interface.IJBProjectUriRegistry.md +0 -19
  49. package/docs/src/src/interfaces/IJBProjects.sol/interface.IJBProjects.md +0 -49
  50. package/docs/src/src/interfaces/IJBRulesetApprovalHook.sol/interface.IJBRulesetApprovalHook.md +0 -35
  51. package/docs/src/src/interfaces/IJBRulesetDataHook.sol/interface.IJBRulesetDataHook.md +0 -97
  52. package/docs/src/src/interfaces/IJBRulesets.sol/interface.IJBRulesets.md +0 -165
  53. package/docs/src/src/interfaces/IJBSplitHook.sol/interface.IJBSplitHook.md +0 -31
  54. package/docs/src/src/interfaces/IJBSplits.sol/interface.IJBSplits.md +0 -35
  55. package/docs/src/src/interfaces/IJBTerminal.sol/interface.IJBTerminal.md +0 -141
  56. package/docs/src/src/interfaces/IJBTerminalStore.sol/interface.IJBTerminalStore.md +0 -198
  57. package/docs/src/src/interfaces/IJBToken.sol/interface.IJBToken.md +0 -54
  58. package/docs/src/src/interfaces/IJBTokenUriResolver.sol/interface.IJBTokenUriResolver.md +0 -12
  59. package/docs/src/src/interfaces/IJBTokens.sol/interface.IJBTokens.md +0 -151
  60. package/docs/src/src/interfaces/README.md +0 -33
  61. package/docs/src/src/libraries/JBCashOuts.sol/library.JBCashOuts.md +0 -40
  62. package/docs/src/src/libraries/JBConstants.sol/library.JBConstants.md +0 -52
  63. package/docs/src/src/libraries/JBCurrencyIds.sol/library.JBCurrencyIds.md +0 -19
  64. package/docs/src/src/libraries/JBFees.sol/library.JBFees.md +0 -52
  65. package/docs/src/src/libraries/JBFixedPointNumber.sol/library.JBFixedPointNumber.md +0 -12
  66. package/docs/src/src/libraries/JBMetadataResolver.sol/library.JBMetadataResolver.md +0 -242
  67. package/docs/src/src/libraries/JBRulesetMetadataResolver.sol/library.JBRulesetMetadataResolver.md +0 -180
  68. package/docs/src/src/libraries/JBSplitGroupIds.sol/library.JBSplitGroupIds.md +0 -14
  69. package/docs/src/src/libraries/JBSurplus.sol/library.JBSurplus.md +0 -44
  70. package/docs/src/src/libraries/README.md +0 -12
  71. package/docs/src/src/periphery/JBDeadline1Day.sol/contract.JBDeadline1Day.md +0 -15
  72. package/docs/src/src/periphery/JBDeadline3Days.sol/contract.JBDeadline3Days.md +0 -15
  73. package/docs/src/src/periphery/JBDeadline3Hours.sol/contract.JBDeadline3Hours.md +0 -15
  74. package/docs/src/src/periphery/JBDeadline7Days.sol/contract.JBDeadline7Days.md +0 -15
  75. package/docs/src/src/periphery/JBMatchingPriceFeed.sol/contract.JBMatchingPriceFeed.md +0 -22
  76. package/docs/src/src/periphery/README.md +0 -8
  77. package/docs/src/src/structs/JBAccountingContext.sol/struct.JBAccountingContext.md +0 -20
  78. package/docs/src/src/structs/JBAfterCashOutRecordedContext.sol/struct.JBAfterCashOutRecordedContext.md +0 -43
  79. package/docs/src/src/structs/JBAfterPayRecordedContext.sol/struct.JBAfterPayRecordedContext.md +0 -42
  80. package/docs/src/src/structs/JBBeforeCashOutRecordedContext.sol/struct.JBBeforeCashOutRecordedContext.md +0 -45
  81. package/docs/src/src/structs/JBBeforePayRecordedContext.sol/struct.JBBeforePayRecordedContext.md +0 -41
  82. package/docs/src/src/structs/JBCashOutHookSpecification.sol/struct.JBCashOutHookSpecification.md +0 -22
  83. package/docs/src/src/structs/JBCurrencyAmount.sol/struct.JBCurrencyAmount.md +0 -17
  84. package/docs/src/src/structs/JBFee.sol/struct.JBFee.md +0 -20
  85. package/docs/src/src/structs/JBFundAccessLimitGroup.sol/struct.JBFundAccessLimitGroup.md +0 -39
  86. package/docs/src/src/structs/JBPayHookSpecification.sol/struct.JBPayHookSpecification.md +0 -22
  87. package/docs/src/src/structs/JBPermissionsData.sol/struct.JBPermissionsData.md +0 -21
  88. package/docs/src/src/structs/JBRuleset.sol/struct.JBRuleset.md +0 -55
  89. package/docs/src/src/structs/JBRulesetConfig.sol/struct.JBRulesetConfig.md +0 -51
  90. package/docs/src/src/structs/JBRulesetMetadata.sol/struct.JBRulesetMetadata.md +0 -79
  91. package/docs/src/src/structs/JBRulesetWeightCache.sol/struct.JBRulesetWeightCache.md +0 -16
  92. package/docs/src/src/structs/JBRulesetWithMetadata.sol/struct.JBRulesetWithMetadata.md +0 -16
  93. package/docs/src/src/structs/JBSingleAllowance.sol/struct.JBSingleAllowance.md +0 -26
  94. package/docs/src/src/structs/JBSplit.sol/struct.JBSplit.md +0 -49
  95. package/docs/src/src/structs/JBSplitGroup.sol/struct.JBSplitGroup.md +0 -17
  96. package/docs/src/src/structs/JBSplitHookContext.sol/struct.JBSplitHookContext.md +0 -29
  97. package/docs/src/src/structs/JBTerminalConfig.sol/struct.JBTerminalConfig.md +0 -16
  98. package/docs/src/src/structs/JBTokenAmount.sol/struct.JBTokenAmount.md +0 -23
  99. package/docs/src/src/structs/README.md +0 -25
package/CHANGE_LOG.md CHANGED
@@ -10,6 +10,14 @@ This document describes all changes between `nana-core` (v5, Solidity 0.8.23) an
10
10
 
11
11
  `setSplitGroupsOf` self-auth now requires the upper 96 bits of the `groupId` to be non-zero. The full self-auth check is: `uint160(groupId) == msg.sender && groupId >> 160 != 0`. GroupIds with zero upper 96 bits (bare addresses like `uint256(uint160(tokenAddress))`) are protocol-reserved for terminal payout groups and always require controller authorization. This prevents accepted token contracts from writing a project's payout splits without controller auth. The 721 hook is unaffected since it already uses `hookAddress | tierId << 160` (non-zero upper bits).
12
12
 
13
+ ### 0.2 JBMultiTerminal -- Fee-Free Cashout Bypass Prevention
14
+
15
+ A new `_feeFreeSurplusOf` mapping (`projectId => token => uint256`) tracks cumulative fee-free intra-terminal payouts received by each project. When a split payout lands on the same terminal (intra-terminal routing, i.e. `terminal == this`), the net payout amount is added to `_feeFreeSurplusOf[projectId][token]`. During a cashout with `cashOutTaxRate == 0`, fees are now charged on the reclaim amount up to the tracked fee-free surplus (and the tracker is decremented accordingly). Cashouts beyond the fee-free surplus remain fee-free. This closes a round-trip fee bypass where funds could be routed fee-free into a project via an intra-terminal split payout and then cashed out fee-free via a zero-tax cashout.
16
+
17
+ ### 0.3 JBBeforeCashOutRecordedContext -- beneficiaryIsFeeless Field
18
+
19
+ A `bool beneficiaryIsFeeless` field was added to the `JBBeforeCashOutRecordedContext` struct (before the `metadata` field). `recordCashOutFor` in `IJBTerminalStore` gained a corresponding `bool beneficiaryIsFeeless` parameter. The terminal passes the result of its feeless address check, allowing data hooks to skip their own fees when the beneficiary is already feeless (e.g., project-to-project routing via the router terminal). This is a **breaking change** to both the struct layout and the `recordCashOutFor` function signature.
20
+
13
21
  ---
14
22
 
15
23
  ## 1. Breaking Changes
@@ -29,16 +37,19 @@ A `rulesetId` parameter was added. Callers must now specify which ruleset to cac
29
37
  | Change | v5 | v6 |
30
38
  |--------|----|----|
31
39
  | `currentReclaimableSurplusOf` parameter rename | `uint256 tokenCount` (4-param overload) | `uint256 cashOutCount` |
40
+ | `recordCashOutFor` new parameter | No `beneficiaryIsFeeless` parameter | `bool beneficiaryIsFeeless` added after `balanceAccountingContexts` |
32
41
 
33
42
  The parameter was renamed from `tokenCount` to `cashOutCount` in the simple 4-parameter overload.
34
43
 
44
+ `recordCashOutFor` gained a `bool beneficiaryIsFeeless` parameter so the terminal can pass through its feeless address check to data hooks via the `JBBeforeCashOutRecordedContext` struct.
45
+
35
46
  #### IJBPayoutTerminal
36
47
 
37
48
  | Change | v5 | v6 |
38
49
  |--------|----|----|
39
50
  | `sendPayoutsOf` return value | `returns (uint256 netLeftoverPayoutAmount)` | `returns (uint256 amountPaidOut)` |
40
51
 
41
- The return value semantics changed: v5 returned the net leftover payout amount (sent to the project owner), while v6 returns the total amount paid out.
52
+ The return variable name was corrected from `netLeftoverPayoutAmount` to `amountPaidOut` to match the actual implementation semantics (total amount paid out). The v5 implementation already returned the total amount from `STORE.recordPayoutFor()`, not the leftover — only the interface had the misleading name.
42
53
 
43
54
  #### IJBController
44
55
 
@@ -141,8 +152,8 @@ See section 2.2 above.
141
152
 
142
153
  | Contract | Event | Change |
143
154
  |----------|-------|--------|
144
- | `IJBCashOutTerminal` | `CashOut` | Event order changed in the interface (moved before `HookAfterRecordCashOut`); NatSpec added. No field changes. |
145
- | `IJBCashOutTerminal` | `HookAfterRecordCashOut` | Event order changed in the interface (moved after `CashOut`); NatSpec added. No field changes. |
155
+ | `IJBCashOutTerminal` | `CashOutTokens` | Event order changed in the interface (moved before `HookAfterRecordCashOut`); NatSpec added. No field changes. |
156
+ | `IJBCashOutTerminal` | `HookAfterRecordCashOut` | Event order changed in the interface (moved after `CashOutTokens`); NatSpec added. No field changes. |
146
157
 
147
158
  ### 3.3 All Interfaces Gained NatSpec
148
159
 
@@ -189,7 +200,13 @@ See section 2.3 above.
189
200
 
190
201
  ## 5. Struct Changes
191
202
 
192
- All structs are **identical** between v5 and v6. The only differences are:
203
+ All structs are identical between v5 and v6 except:
204
+
205
+ | Struct | Change |
206
+ |--------|--------|
207
+ | `JBBeforeCashOutRecordedContext` | New `bool beneficiaryIsFeeless` field added before `metadata`. Indicates whether the cash out's beneficiary is a feeless address, allowing data hooks to skip their own fees for in-protocol routing. |
208
+
209
+ Other struct-level differences (non-functional):
193
210
  - `forge-lint: disable-next-line(pascal-case-struct)` comments added to all struct definitions.
194
211
  - `JBSplit`: Additional NatSpec documentation on the `beneficiary` field behavior when set to `address(0)`.
195
212
 
@@ -269,6 +286,8 @@ No changes.
269
286
  | **Migration held fees** | Migration intentionally does not transfer held fees (documented: held fees belong to fee beneficiary, not the migrating project). |
270
287
  | **Held fee processing (reentrancy hardening)** | `processHeldFeesOf` now re-reads the storage index each iteration (instead of caching), deletes the entry before the external call, and updates the index before the external call. |
271
288
  | **Split payout documentation** | Failed split payouts documented as consuming payout limit by design. |
289
+ | **Fee-free cashout bypass prevention** | New `_feeFreeSurplusOf` mapping tracks cumulative fee-free intra-terminal payouts per project/token. During zero-tax cashouts, fees are charged up to this tracked amount (then decremented), preventing round-trip fee bypass. See Section 0.2. |
290
+ | **beneficiaryIsFeeless passthrough** | `cashOutTokensOf` now passes `_isFeeless(beneficiary)` to `recordCashOutFor`, which forwards it to data hooks via `JBBeforeCashOutRecordedContext.beneficiaryIsFeeless`. |
272
291
 
273
292
  ### 8.3 JBRulesets
274
293
 
@@ -285,36 +304,42 @@ No changes.
285
304
  |--------|-------------|
286
305
  | **Migration ordering** | `setControllerOf` now calls `migrate()` on the old controller BEFORE updating `controllerOf` in storage (so `migrate()` runs while the directory still points to the old controller). After updating storage, it calls `afterReceiveMigrationFrom` on the new controller. |
287
306
 
288
- ### 8.5 JBTokens
307
+ ### 8.5 JBSplits
308
+
309
+ | Change | Description |
310
+ |--------|-------------|
311
+ | **Stale storage cleanup** | `_setSplitsOf` now deletes stale packed split data when the new split count is smaller than the previous count, preventing leftover storage from prior configurations. |
312
+
313
+ ### 8.6 JBTokens
289
314
 
290
315
  | Change | Description |
291
316
  |--------|-------------|
292
317
  | **Overflow check timing** | `mintFor` now checks `totalSupplyOf(projectId) + count > type(uint208).max` BEFORE minting (v5 checked after). |
293
318
 
294
- ### 8.6 JBERC20
319
+ ### 8.7 JBERC20
295
320
 
296
321
  | Change | Description |
297
322
  |--------|-------------|
298
323
  | **Named revert** | `initialize()` now reverts with `JBERC20_AlreadyInitialized()` instead of a bare `revert()`. |
299
324
 
300
- ### 8.7 JBChainlinkV3PriceFeed
325
+ ### 8.8 JBChainlinkV3PriceFeed
301
326
 
302
327
  | Change | Description |
303
328
  |--------|-------------|
304
329
  | **Incomplete round check order** | The check for `updatedAt == 0` (incomplete round) now runs BEFORE the stale price check, avoiding false stale errors on incomplete rounds. |
305
330
 
306
- ### 8.8 JBChainlinkV3SequencerPriceFeed
331
+ ### 8.9 JBChainlinkV3SequencerPriceFeed
307
332
 
308
333
  | Change | Description |
309
334
  |--------|-------------|
310
335
  | **Typo fix** | Error parameter `gradePeriodTime` corrected to `gracePeriodTime` in `JBChainlinkV3SequencerPriceFeed_SequencerDown`. |
311
336
  | **Threshold docs** | Constructor parameter `threshold` documentation corrected from "blocks" to "seconds". |
312
337
 
313
- ### 8.9 Solidity Version
338
+ ### 8.10 Solidity Version
314
339
 
315
340
  All contracts upgraded from `pragma solidity 0.8.23` to `pragma solidity 0.8.26`.
316
341
 
317
- ### 8.10 Named Arguments
342
+ ### 8.11 Named Arguments
318
343
 
319
344
  Throughout the codebase, function calls were updated to use named argument syntax (e.g., `foo({bar: 1, baz: 2})`) for improved readability.
320
345
 
@@ -328,7 +353,7 @@ Throughout the codebase, function calls were updated to use named argument synta
328
353
  |----|----|-------|
329
354
  | `IJBController` | `IJBController` | Gained `setTokenMetadataOf`. `calldata` for terminal configs. |
330
355
  | `IJBRulesets` | `IJBRulesets` | `updateRulesetWeightCache` gained `rulesetId` parameter |
331
- | `IJBTerminalStore` | `IJBTerminalStore` | `tokenCount` renamed to `cashOutCount` in `currentReclaimableSurplusOf`. View functions reordered. |
356
+ | `IJBTerminalStore` | `IJBTerminalStore` | `tokenCount` renamed to `cashOutCount` in `currentReclaimableSurplusOf`. `recordCashOutFor` gained `beneficiaryIsFeeless` param. View functions reordered. |
332
357
  | `IJBPayoutTerminal` | `IJBPayoutTerminal` | `sendPayoutsOf` returns `amountPaidOut` (was `netLeftoverPayoutAmount`). `SendPayoutToSplit` event moved. |
333
358
  | `IJBPermitTerminal` | `IJBPermitTerminal` | Gained `Permit2AllowanceFailed` event |
334
359
  | `IJBMigratable` | `IJBMigratable` | Gained `afterReceiveMigrationFrom` function |
@@ -344,7 +369,7 @@ Throughout the codebase, function calls were updated to use named argument synta
344
369
  | v5 | v6 | Notes |
345
370
  |----|----|-------|
346
371
  | `JBController` | `JBController` | Token metadata, migration lifecycle (`afterReceiveMigrationFrom`), `LAUNCH_RULESETS` permission |
347
- | `JBMultiTerminal` | `JBMultiTerminal` | Reentrancy hardening, decimal validation rename, Permit2 event |
372
+ | `JBMultiTerminal` | `JBMultiTerminal` | Reentrancy hardening, decimal validation rename, Permit2 event, fee-free bypass prevention (`_feeFreeSurplusOf`), `beneficiaryIsFeeless` passthrough |
348
373
  | `JBRulesets` | `JBRulesets` | Approval hook try/catch, weight cache changes, threshold increase |
349
374
  | `JBDirectory` | `JBDirectory` | Migration ordering fix, afterReceiveMigration call |
350
375
  | `JBTokens` | `JBTokens` | Token metadata support, overflow check timing |
@@ -366,7 +391,7 @@ Throughout the codebase, function calls were updated to use named argument synta
366
391
 
367
392
  | v5 | v6 | Notes |
368
393
  |----|----|-------|
369
- | All 22 structs | Same names, same fields | Only lint comments added |
394
+ | All 22 structs | Same names | All identical except `JBBeforeCashOutRecordedContext` (gained `beneficiaryIsFeeless` field). Lint comments added to all. |
370
395
 
371
396
  ### Enums
372
397
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/core-v6",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
package/docs/book.css DELETED
@@ -1,13 +0,0 @@
1
- table {
2
- margin: 0 auto;
3
- border-collapse: collapse;
4
- width: 100%;
5
- }
6
-
7
- table td:first-child {
8
- width: 15%;
9
- }
10
-
11
- table td:nth-child(2) {
12
- width: 25%;
13
- }
package/docs/book.toml DELETED
@@ -1,12 +0,0 @@
1
- [book]
2
- src = "src"
3
- title = ""
4
-
5
- [output.html]
6
- no-section-label = true
7
- additional-js = ["solidity.min.js"]
8
- additional-css = ["book.css"]
9
- git-repository-url = "https://github.com/Bananapus/nana-core"
10
-
11
- [output.html.fold]
12
- enable = true
@@ -1,74 +0,0 @@
1
- hljs.registerLanguage("solidity",(()=>{"use strict";function e(){try{return!0
2
- }catch(e){return!1}}
3
- var a=/-?(\b0[xX]([a-fA-F0-9]_?)*[a-fA-F0-9]|(\b[1-9](_?\d)*(\.((\d_?)*\d)?)?|\.\d(_?\d)*)([eE][-+]?\d(_?\d)*)?|\b0)(?!\w|\$)/
4
- ;e()&&(a=a.source.replace(/\\b/g,"(?<!\\$)\\b"));var s={className:"number",
5
- begin:a,relevance:0},n={
6
- keyword:"assembly let function if switch case default for leave break continue u256 jump jumpi stop return revert selfdestruct invalid",
7
- built_in:"add sub mul div sdiv mod smod exp not lt gt slt sgt eq iszero and or xor byte shl shr sar addmod mulmod signextend keccak256 pc pop dup1 dup2 dup3 dup4 dup5 dup6 dup7 dup8 dup9 dup10 dup11 dup12 dup13 dup14 dup15 dup16 swap1 swap2 swap3 swap4 swap5 swap6 swap7 swap8 swap9 swap10 swap11 swap12 swap13 swap14 swap15 swap16 mload mstore mstore8 sload sstore msize gas address balance selfbalance caller callvalue calldataload calldatasize calldatacopy codesize codecopy extcodesize extcodecopy returndatasize returndatacopy extcodehash create create2 call callcode delegatecall staticcall log0 log1 log2 log3 log4 chainid origin gasprice basefee blockhash coinbase timestamp number difficulty gaslimit",
8
- literal:"true false"},i={className:"string",
9
- begin:/\bhex'(([0-9a-fA-F]{2}_?)*[0-9a-fA-F]{2})?'/},t={className:"string",
10
- begin:/\bhex"(([0-9a-fA-F]{2}_?)*[0-9a-fA-F]{2})?"/};function r(e){
11
- return e.inherit(e.APOS_STRING_MODE,{begin:/(\bunicode)?'/})}function l(e){
12
- return e.inherit(e.QUOTE_STRING_MODE,{begin:/(\bunicode)?"/})}var o={
13
- SOL_ASSEMBLY_KEYWORDS:n,baseAssembly:e=>{
14
- var a=r(e),o=l(e),c=/[A-Za-z_$][A-Za-z_$0-9.]*/,d=e.inherit(e.TITLE_MODE,{
15
- begin:/[A-Za-z$_][0-9A-Za-z$_]*/,lexemes:c,keywords:n}),u={className:"params",
16
- begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,lexemes:c,keywords:n,
17
- contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,o,s]},_={
18
- className:"operator",begin:/:=|->/};return{keywords:n,lexemes:c,
19
- contains:[a,o,i,t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,_,{
20
- className:"function",lexemes:c,beginKeywords:"function",end:"{",excludeEnd:!0,
21
- contains:[d,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_]}]}},
22
- solAposStringMode:r,solQuoteStringMode:l,HEX_APOS_STRING_MODE:i,
23
- HEX_QUOTE_STRING_MODE:t,SOL_NUMBER:s,isNegativeLookbehindAvailable:e}
24
- ;const{baseAssembly:c,solAposStringMode:d,solQuoteStringMode:u,HEX_APOS_STRING_MODE:_,HEX_QUOTE_STRING_MODE:m,SOL_NUMBER:b,isNegativeLookbehindAvailable:E}=o
25
- ;return e=>{for(var a=d(e),s=u(e),n=[],i=0;i<32;i++)n[i]=i+1
26
- ;var t=n.map((e=>8*e)),r=[];for(i=0;i<=80;i++)r[i]=i
27
- ;var l=n.map((e=>"bytes"+e)).join(" ")+" ",o=t.map((e=>"uint"+e)).join(" ")+" ",g=t.map((e=>"int"+e)).join(" ")+" ",M=[].concat.apply([],t.map((e=>r.map((a=>e+"x"+a))))),p={
28
- keyword:"var bool string int uint "+g+o+"byte bytes "+l+"fixed ufixed "+M.map((e=>"fixed"+e)).join(" ")+" "+M.map((e=>"ufixed"+e)).join(" ")+" enum struct mapping address new delete if else for while continue break return throw emit try catch revert unchecked _ function modifier event constructor fallback receive error virtual override constant immutable anonymous indexed storage memory calldata external public internal payable pure view private returns import from as using pragma contract interface library is abstract type assembly",
29
- literal:"true false wei gwei szabo finney ether seconds minutes hours days weeks years",
30
- built_in:"self this super selfdestruct suicide now msg block tx abi blockhash gasleft assert require Error Panic sha3 sha256 keccak256 ripemd160 ecrecover addmod mulmod log0 log1 log2 log3 log4"
31
- },O={className:"operator",begin:/[+\-!~*\/%<>&^|=]/
32
- },C=/[A-Za-z_$][A-Za-z_$0-9]*/,N={className:"params",begin:/\(/,end:/\)/,
33
- excludeBegin:!0,excludeEnd:!0,lexemes:C,keywords:p,
34
- contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,b,"self"]},f={
35
- begin:/\.\s*/,end:/[^A-Za-z0-9$_\.]/,excludeBegin:!0,excludeEnd:!0,keywords:{
36
- built_in:"gas value selector address length push pop send transfer call callcode delegatecall staticcall balance code codehash wrap unwrap name creationCode runtimeCode interfaceId min max"
37
- },relevance:2},y=e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/,
38
- lexemes:C,keywords:p}),w={className:"built_in",
39
- begin:(E()?"(?<!\\$)\\b":"\\b")+"(gas|value|salt)(?=:)"};function x(e,a){return{
40
- begin:(E()?"(?<!\\$)\\b":"\\b")+e+"\\.\\s*",end:/[^A-Za-z0-9$_\.]/,
41
- excludeBegin:!1,excludeEnd:!0,lexemes:C,keywords:{built_in:e+" "+a},
42
- contains:[f],relevance:10}}var h=c(e),v=e.inherit(h,{
43
- contains:h.contains.concat([{begin:/\./,end:/[^A-Za-z0-9$.]/,excludeBegin:!0,
44
- excludeEnd:!0,keywords:{built_in:"slot offset length address selector"},
45
- relevance:2},{begin:/_/,end:/[^A-Za-z0-9$.]/,excludeBegin:!0,excludeEnd:!0,
46
- keywords:{built_in:"slot offset"},relevance:2}])});return{aliases:["sol"],
47
- keywords:p,lexemes:C,
48
- contains:[a,s,_,m,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,w,O,{
49
- className:"function",lexemes:C,
50
- beginKeywords:"function modifier event constructor fallback receive error",
51
- end:/[{;]/,excludeEnd:!0,
52
- contains:[y,N,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:/%/
53
- },x("msg","gas value data sender sig"),x("block","blockhash coinbase difficulty gaslimit basefee number timestamp chainid"),x("tx","gasprice origin"),x("abi","decode encode encodePacked encodeWithSelector encodeWithSignature encodeCall"),x("bytes","concat"),f,{
54
- className:"class",lexemes:C,beginKeywords:"contract interface library",end:"{",
55
- excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"is",lexemes:C
56
- },y,N,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{lexemes:C,
57
- beginKeywords:"struct enum",end:"{",excludeEnd:!0,illegal:/[:"\[\]]/,
58
- contains:[y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{
59
- beginKeywords:"import",end:";",lexemes:C,keywords:"import from as",
60
- contains:[y,a,s,_,m,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,O]},{
61
- beginKeywords:"using",end:";",lexemes:C,keywords:"using for",
62
- contains:[y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,O]},{className:"meta",
63
- beginKeywords:"pragma",end:";",lexemes:C,keywords:{
64
- keyword:"pragma solidity experimental abicoder",
65
- built_in:"ABIEncoderV2 SMTChecker v1 v2"},
66
- contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(a,{
67
- className:"meta-string"}),e.inherit(s,{className:"meta-string"})]},{
68
- beginKeywords:"assembly",end:/\b\B/,
69
- contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(v,{begin:"{",
70
- end:"}",endsParent:!0,contains:v.contains.concat([e.inherit(v,{begin:"{",
71
- end:"}",contains:v.contains.concat(["self"])})])})]}],illegal:/#/}}})());
72
-
73
- // Ugly hack to reload HLJS
74
- hljs.initHighlightingOnLoad();