@bananapus/core-v6 0.0.17 → 0.0.19

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 (107) hide show
  1. package/CHANGE_LOG.md +53 -13
  2. package/SKILLS.md +6 -0
  3. package/USER_JOURNEYS.md +4 -0
  4. package/package.json +1 -1
  5. package/src/JBTerminalStore.sol +357 -171
  6. package/src/interfaces/IJBTerminalStore.sol +70 -0
  7. package/test/fork/TestSequencerPriceFeedFork.sol +168 -0
  8. package/test/units/static/JBTerminalStore/TestCurrentReclaimableSurplusOf.sol +215 -0
  9. package/test/units/static/JBTerminalStore/TestPreviewCashOutFrom.sol +383 -0
  10. package/test/units/static/JBTerminalStore/TestPreviewPayFrom.sol +415 -0
  11. package/docs/book.css +0 -13
  12. package/docs/book.toml +0 -12
  13. package/docs/solidity.min.js +0 -74
  14. package/docs/src/README.md +0 -703
  15. package/docs/src/SUMMARY.md +0 -94
  16. package/docs/src/src/JBChainlinkV3PriceFeed.sol/contract.JBChainlinkV3PriceFeed.md +0 -83
  17. package/docs/src/src/JBChainlinkV3SequencerPriceFeed.sol/contract.JBChainlinkV3SequencerPriceFeed.md +0 -88
  18. package/docs/src/src/JBController.sol/contract.JBController.md +0 -1121
  19. package/docs/src/src/JBDeadline.sol/contract.JBDeadline.md +0 -84
  20. package/docs/src/src/JBDirectory.sol/contract.JBDirectory.md +0 -294
  21. package/docs/src/src/JBERC20.sol/contract.JBERC20.md +0 -190
  22. package/docs/src/src/JBFeelessAddresses.sol/contract.JBFeelessAddresses.md +0 -80
  23. package/docs/src/src/JBFundAccessLimits.sol/contract.JBFundAccessLimits.md +0 -253
  24. package/docs/src/src/JBMultiTerminal.sol/contract.JBMultiTerminal.md +0 -1472
  25. package/docs/src/src/JBPermissions.sol/contract.JBPermissions.md +0 -199
  26. package/docs/src/src/JBPrices.sol/contract.JBPrices.md +0 -154
  27. package/docs/src/src/JBProjects.sol/contract.JBProjects.md +0 -131
  28. package/docs/src/src/JBRulesets.sol/contract.JBRulesets.md +0 -677
  29. package/docs/src/src/JBSplits.sol/contract.JBSplits.md +0 -237
  30. package/docs/src/src/JBTerminalStore.sol/contract.JBTerminalStore.md +0 -591
  31. package/docs/src/src/JBTokens.sol/contract.JBTokens.md +0 -353
  32. package/docs/src/src/README.md +0 -25
  33. package/docs/src/src/abstract/JBControlled.sol/abstract.JBControlled.md +0 -64
  34. package/docs/src/src/abstract/JBPermissioned.sol/abstract.JBPermissioned.md +0 -84
  35. package/docs/src/src/abstract/README.md +0 -5
  36. package/docs/src/src/enums/JBApprovalStatus.sol/enum.JBApprovalStatus.md +0 -17
  37. package/docs/src/src/enums/README.md +0 -4
  38. package/docs/src/src/interfaces/IJBCashOutHook.sol/interface.IJBCashOutHook.md +0 -29
  39. package/docs/src/src/interfaces/IJBCashOutTerminal.sol/interface.IJBCashOutTerminal.md +0 -57
  40. package/docs/src/src/interfaces/IJBControlled.sol/interface.IJBControlled.md +0 -12
  41. package/docs/src/src/interfaces/IJBController.sol/interface.IJBController.md +0 -334
  42. package/docs/src/src/interfaces/IJBDirectory.sol/interface.IJBDirectory.md +0 -108
  43. package/docs/src/src/interfaces/IJBDirectoryAccessControl.sol/interface.IJBDirectoryAccessControl.md +0 -19
  44. package/docs/src/src/interfaces/IJBFeeTerminal.sol/interface.IJBFeeTerminal.md +0 -91
  45. package/docs/src/src/interfaces/IJBFeelessAddresses.sol/interface.IJBFeelessAddresses.md +0 -26
  46. package/docs/src/src/interfaces/IJBFundAccessLimits.sol/interface.IJBFundAccessLimits.md +0 -88
  47. package/docs/src/src/interfaces/IJBMigratable.sol/interface.IJBMigratable.md +0 -29
  48. package/docs/src/src/interfaces/IJBMultiTerminal.sol/interface.IJBMultiTerminal.md +0 -50
  49. package/docs/src/src/interfaces/IJBPayHook.sol/interface.IJBPayHook.md +0 -28
  50. package/docs/src/src/interfaces/IJBPayoutTerminal.sol/interface.IJBPayoutTerminal.md +0 -105
  51. package/docs/src/src/interfaces/IJBPermissioned.sol/interface.IJBPermissioned.md +0 -12
  52. package/docs/src/src/interfaces/IJBPermissions.sol/interface.IJBPermissions.md +0 -74
  53. package/docs/src/src/interfaces/IJBPermitTerminal.sol/interface.IJBPermitTerminal.md +0 -15
  54. package/docs/src/src/interfaces/IJBPriceFeed.sol/interface.IJBPriceFeed.md +0 -12
  55. package/docs/src/src/interfaces/IJBPrices.sol/interface.IJBPrices.md +0 -74
  56. package/docs/src/src/interfaces/IJBProjectUriRegistry.sol/interface.IJBProjectUriRegistry.md +0 -19
  57. package/docs/src/src/interfaces/IJBProjects.sol/interface.IJBProjects.md +0 -49
  58. package/docs/src/src/interfaces/IJBRulesetApprovalHook.sol/interface.IJBRulesetApprovalHook.md +0 -35
  59. package/docs/src/src/interfaces/IJBRulesetDataHook.sol/interface.IJBRulesetDataHook.md +0 -97
  60. package/docs/src/src/interfaces/IJBRulesets.sol/interface.IJBRulesets.md +0 -165
  61. package/docs/src/src/interfaces/IJBSplitHook.sol/interface.IJBSplitHook.md +0 -31
  62. package/docs/src/src/interfaces/IJBSplits.sol/interface.IJBSplits.md +0 -35
  63. package/docs/src/src/interfaces/IJBTerminal.sol/interface.IJBTerminal.md +0 -141
  64. package/docs/src/src/interfaces/IJBTerminalStore.sol/interface.IJBTerminalStore.md +0 -198
  65. package/docs/src/src/interfaces/IJBToken.sol/interface.IJBToken.md +0 -54
  66. package/docs/src/src/interfaces/IJBTokenUriResolver.sol/interface.IJBTokenUriResolver.md +0 -12
  67. package/docs/src/src/interfaces/IJBTokens.sol/interface.IJBTokens.md +0 -151
  68. package/docs/src/src/interfaces/README.md +0 -33
  69. package/docs/src/src/libraries/JBCashOuts.sol/library.JBCashOuts.md +0 -40
  70. package/docs/src/src/libraries/JBConstants.sol/library.JBConstants.md +0 -52
  71. package/docs/src/src/libraries/JBCurrencyIds.sol/library.JBCurrencyIds.md +0 -19
  72. package/docs/src/src/libraries/JBFees.sol/library.JBFees.md +0 -52
  73. package/docs/src/src/libraries/JBFixedPointNumber.sol/library.JBFixedPointNumber.md +0 -12
  74. package/docs/src/src/libraries/JBMetadataResolver.sol/library.JBMetadataResolver.md +0 -242
  75. package/docs/src/src/libraries/JBRulesetMetadataResolver.sol/library.JBRulesetMetadataResolver.md +0 -180
  76. package/docs/src/src/libraries/JBSplitGroupIds.sol/library.JBSplitGroupIds.md +0 -14
  77. package/docs/src/src/libraries/JBSurplus.sol/library.JBSurplus.md +0 -44
  78. package/docs/src/src/libraries/README.md +0 -12
  79. package/docs/src/src/periphery/JBDeadline1Day.sol/contract.JBDeadline1Day.md +0 -15
  80. package/docs/src/src/periphery/JBDeadline3Days.sol/contract.JBDeadline3Days.md +0 -15
  81. package/docs/src/src/periphery/JBDeadline3Hours.sol/contract.JBDeadline3Hours.md +0 -15
  82. package/docs/src/src/periphery/JBDeadline7Days.sol/contract.JBDeadline7Days.md +0 -15
  83. package/docs/src/src/periphery/JBMatchingPriceFeed.sol/contract.JBMatchingPriceFeed.md +0 -22
  84. package/docs/src/src/periphery/README.md +0 -8
  85. package/docs/src/src/structs/JBAccountingContext.sol/struct.JBAccountingContext.md +0 -20
  86. package/docs/src/src/structs/JBAfterCashOutRecordedContext.sol/struct.JBAfterCashOutRecordedContext.md +0 -43
  87. package/docs/src/src/structs/JBAfterPayRecordedContext.sol/struct.JBAfterPayRecordedContext.md +0 -42
  88. package/docs/src/src/structs/JBBeforeCashOutRecordedContext.sol/struct.JBBeforeCashOutRecordedContext.md +0 -45
  89. package/docs/src/src/structs/JBBeforePayRecordedContext.sol/struct.JBBeforePayRecordedContext.md +0 -41
  90. package/docs/src/src/structs/JBCashOutHookSpecification.sol/struct.JBCashOutHookSpecification.md +0 -22
  91. package/docs/src/src/structs/JBCurrencyAmount.sol/struct.JBCurrencyAmount.md +0 -17
  92. package/docs/src/src/structs/JBFee.sol/struct.JBFee.md +0 -20
  93. package/docs/src/src/structs/JBFundAccessLimitGroup.sol/struct.JBFundAccessLimitGroup.md +0 -39
  94. package/docs/src/src/structs/JBPayHookSpecification.sol/struct.JBPayHookSpecification.md +0 -22
  95. package/docs/src/src/structs/JBPermissionsData.sol/struct.JBPermissionsData.md +0 -21
  96. package/docs/src/src/structs/JBRuleset.sol/struct.JBRuleset.md +0 -55
  97. package/docs/src/src/structs/JBRulesetConfig.sol/struct.JBRulesetConfig.md +0 -51
  98. package/docs/src/src/structs/JBRulesetMetadata.sol/struct.JBRulesetMetadata.md +0 -79
  99. package/docs/src/src/structs/JBRulesetWeightCache.sol/struct.JBRulesetWeightCache.md +0 -16
  100. package/docs/src/src/structs/JBRulesetWithMetadata.sol/struct.JBRulesetWithMetadata.md +0 -16
  101. package/docs/src/src/structs/JBSingleAllowance.sol/struct.JBSingleAllowance.md +0 -26
  102. package/docs/src/src/structs/JBSplit.sol/struct.JBSplit.md +0 -49
  103. package/docs/src/src/structs/JBSplitGroup.sol/struct.JBSplitGroup.md +0 -17
  104. package/docs/src/src/structs/JBSplitHookContext.sol/struct.JBSplitHookContext.md +0 -29
  105. package/docs/src/src/structs/JBTerminalConfig.sol/struct.JBTerminalConfig.md +0 -16
  106. package/docs/src/src/structs/JBTokenAmount.sol/struct.JBTokenAmount.md +0 -23
  107. package/docs/src/src/structs/README.md +0 -25
@@ -1,94 +0,0 @@
1
- # Summary
2
- - [Home](README.md)
3
- # src
4
- - [❱ abstract](src/abstract/README.md)
5
- - [JBControlled](src/abstract/JBControlled.sol/abstract.JBControlled.md)
6
- - [JBPermissioned](src/abstract/JBPermissioned.sol/abstract.JBPermissioned.md)
7
- - [❱ enums](src/enums/README.md)
8
- - [JBApprovalStatus](src/enums/JBApprovalStatus.sol/enum.JBApprovalStatus.md)
9
- - [❱ interfaces](src/interfaces/README.md)
10
- - [IJBCashOutHook](src/interfaces/IJBCashOutHook.sol/interface.IJBCashOutHook.md)
11
- - [IJBCashOutTerminal](src/interfaces/IJBCashOutTerminal.sol/interface.IJBCashOutTerminal.md)
12
- - [IJBControlled](src/interfaces/IJBControlled.sol/interface.IJBControlled.md)
13
- - [IJBController](src/interfaces/IJBController.sol/interface.IJBController.md)
14
- - [IJBDirectory](src/interfaces/IJBDirectory.sol/interface.IJBDirectory.md)
15
- - [IJBDirectoryAccessControl](src/interfaces/IJBDirectoryAccessControl.sol/interface.IJBDirectoryAccessControl.md)
16
- - [IJBFeeTerminal](src/interfaces/IJBFeeTerminal.sol/interface.IJBFeeTerminal.md)
17
- - [IJBFeelessAddresses](src/interfaces/IJBFeelessAddresses.sol/interface.IJBFeelessAddresses.md)
18
- - [IJBFundAccessLimits](src/interfaces/IJBFundAccessLimits.sol/interface.IJBFundAccessLimits.md)
19
- - [IJBMigratable](src/interfaces/IJBMigratable.sol/interface.IJBMigratable.md)
20
- - [IJBMultiTerminal](src/interfaces/IJBMultiTerminal.sol/interface.IJBMultiTerminal.md)
21
- - [IJBPayHook](src/interfaces/IJBPayHook.sol/interface.IJBPayHook.md)
22
- - [IJBPayoutTerminal](src/interfaces/IJBPayoutTerminal.sol/interface.IJBPayoutTerminal.md)
23
- - [IJBPermissioned](src/interfaces/IJBPermissioned.sol/interface.IJBPermissioned.md)
24
- - [IJBPermissions](src/interfaces/IJBPermissions.sol/interface.IJBPermissions.md)
25
- - [IJBPermitTerminal](src/interfaces/IJBPermitTerminal.sol/interface.IJBPermitTerminal.md)
26
- - [IJBPriceFeed](src/interfaces/IJBPriceFeed.sol/interface.IJBPriceFeed.md)
27
- - [IJBPrices](src/interfaces/IJBPrices.sol/interface.IJBPrices.md)
28
- - [IJBProjectUriRegistry](src/interfaces/IJBProjectUriRegistry.sol/interface.IJBProjectUriRegistry.md)
29
- - [IJBProjects](src/interfaces/IJBProjects.sol/interface.IJBProjects.md)
30
- - [IJBRulesetApprovalHook](src/interfaces/IJBRulesetApprovalHook.sol/interface.IJBRulesetApprovalHook.md)
31
- - [IJBRulesetDataHook](src/interfaces/IJBRulesetDataHook.sol/interface.IJBRulesetDataHook.md)
32
- - [IJBRulesets](src/interfaces/IJBRulesets.sol/interface.IJBRulesets.md)
33
- - [IJBSplitHook](src/interfaces/IJBSplitHook.sol/interface.IJBSplitHook.md)
34
- - [IJBSplits](src/interfaces/IJBSplits.sol/interface.IJBSplits.md)
35
- - [IJBTerminal](src/interfaces/IJBTerminal.sol/interface.IJBTerminal.md)
36
- - [IJBTerminalStore](src/interfaces/IJBTerminalStore.sol/interface.IJBTerminalStore.md)
37
- - [IJBToken](src/interfaces/IJBToken.sol/interface.IJBToken.md)
38
- - [IJBTokenUriResolver](src/interfaces/IJBTokenUriResolver.sol/interface.IJBTokenUriResolver.md)
39
- - [IJBTokens](src/interfaces/IJBTokens.sol/interface.IJBTokens.md)
40
- - [❱ libraries](src/libraries/README.md)
41
- - [JBCashOuts](src/libraries/JBCashOuts.sol/library.JBCashOuts.md)
42
- - [JBConstants](src/libraries/JBConstants.sol/library.JBConstants.md)
43
- - [JBCurrencyIds](src/libraries/JBCurrencyIds.sol/library.JBCurrencyIds.md)
44
- - [JBFees](src/libraries/JBFees.sol/library.JBFees.md)
45
- - [JBFixedPointNumber](src/libraries/JBFixedPointNumber.sol/library.JBFixedPointNumber.md)
46
- - [JBMetadataResolver](src/libraries/JBMetadataResolver.sol/library.JBMetadataResolver.md)
47
- - [JBRulesetMetadataResolver](src/libraries/JBRulesetMetadataResolver.sol/library.JBRulesetMetadataResolver.md)
48
- - [JBSplitGroupIds](src/libraries/JBSplitGroupIds.sol/library.JBSplitGroupIds.md)
49
- - [JBSurplus](src/libraries/JBSurplus.sol/library.JBSurplus.md)
50
- - [❱ periphery](src/periphery/README.md)
51
- - [JBDeadline1Day](src/periphery/JBDeadline1Day.sol/contract.JBDeadline1Day.md)
52
- - [JBDeadline3Days](src/periphery/JBDeadline3Days.sol/contract.JBDeadline3Days.md)
53
- - [JBDeadline3Hours](src/periphery/JBDeadline3Hours.sol/contract.JBDeadline3Hours.md)
54
- - [JBDeadline7Days](src/periphery/JBDeadline7Days.sol/contract.JBDeadline7Days.md)
55
- - [JBMatchingPriceFeed](src/periphery/JBMatchingPriceFeed.sol/contract.JBMatchingPriceFeed.md)
56
- - [❱ structs](src/structs/README.md)
57
- - [JBAccountingContext](src/structs/JBAccountingContext.sol/struct.JBAccountingContext.md)
58
- - [JBAfterCashOutRecordedContext](src/structs/JBAfterCashOutRecordedContext.sol/struct.JBAfterCashOutRecordedContext.md)
59
- - [JBAfterPayRecordedContext](src/structs/JBAfterPayRecordedContext.sol/struct.JBAfterPayRecordedContext.md)
60
- - [JBBeforeCashOutRecordedContext](src/structs/JBBeforeCashOutRecordedContext.sol/struct.JBBeforeCashOutRecordedContext.md)
61
- - [JBBeforePayRecordedContext](src/structs/JBBeforePayRecordedContext.sol/struct.JBBeforePayRecordedContext.md)
62
- - [JBCashOutHookSpecification](src/structs/JBCashOutHookSpecification.sol/struct.JBCashOutHookSpecification.md)
63
- - [JBCurrencyAmount](src/structs/JBCurrencyAmount.sol/struct.JBCurrencyAmount.md)
64
- - [JBFee](src/structs/JBFee.sol/struct.JBFee.md)
65
- - [JBFundAccessLimitGroup](src/structs/JBFundAccessLimitGroup.sol/struct.JBFundAccessLimitGroup.md)
66
- - [JBPayHookSpecification](src/structs/JBPayHookSpecification.sol/struct.JBPayHookSpecification.md)
67
- - [JBPermissionsData](src/structs/JBPermissionsData.sol/struct.JBPermissionsData.md)
68
- - [JBRuleset](src/structs/JBRuleset.sol/struct.JBRuleset.md)
69
- - [JBRulesetConfig](src/structs/JBRulesetConfig.sol/struct.JBRulesetConfig.md)
70
- - [JBRulesetMetadata](src/structs/JBRulesetMetadata.sol/struct.JBRulesetMetadata.md)
71
- - [JBRulesetWeightCache](src/structs/JBRulesetWeightCache.sol/struct.JBRulesetWeightCache.md)
72
- - [JBRulesetWithMetadata](src/structs/JBRulesetWithMetadata.sol/struct.JBRulesetWithMetadata.md)
73
- - [JBSingleAllowance](src/structs/JBSingleAllowance.sol/struct.JBSingleAllowance.md)
74
- - [JBSplit](src/structs/JBSplit.sol/struct.JBSplit.md)
75
- - [JBSplitGroup](src/structs/JBSplitGroup.sol/struct.JBSplitGroup.md)
76
- - [JBSplitHookContext](src/structs/JBSplitHookContext.sol/struct.JBSplitHookContext.md)
77
- - [JBTerminalConfig](src/structs/JBTerminalConfig.sol/struct.JBTerminalConfig.md)
78
- - [JBTokenAmount](src/structs/JBTokenAmount.sol/struct.JBTokenAmount.md)
79
- - [JBChainlinkV3PriceFeed](src/JBChainlinkV3PriceFeed.sol/contract.JBChainlinkV3PriceFeed.md)
80
- - [JBChainlinkV3SequencerPriceFeed](src/JBChainlinkV3SequencerPriceFeed.sol/contract.JBChainlinkV3SequencerPriceFeed.md)
81
- - [JBController](src/JBController.sol/contract.JBController.md)
82
- - [JBDeadline](src/JBDeadline.sol/contract.JBDeadline.md)
83
- - [JBDirectory](src/JBDirectory.sol/contract.JBDirectory.md)
84
- - [JBERC20](src/JBERC20.sol/contract.JBERC20.md)
85
- - [JBFeelessAddresses](src/JBFeelessAddresses.sol/contract.JBFeelessAddresses.md)
86
- - [JBFundAccessLimits](src/JBFundAccessLimits.sol/contract.JBFundAccessLimits.md)
87
- - [JBMultiTerminal](src/JBMultiTerminal.sol/contract.JBMultiTerminal.md)
88
- - [JBPermissions](src/JBPermissions.sol/contract.JBPermissions.md)
89
- - [JBPrices](src/JBPrices.sol/contract.JBPrices.md)
90
- - [JBProjects](src/JBProjects.sol/contract.JBProjects.md)
91
- - [JBRulesets](src/JBRulesets.sol/contract.JBRulesets.md)
92
- - [JBSplits](src/JBSplits.sol/contract.JBSplits.md)
93
- - [JBTerminalStore](src/JBTerminalStore.sol/contract.JBTerminalStore.md)
94
- - [JBTokens](src/JBTokens.sol/contract.JBTokens.md)
@@ -1,83 +0,0 @@
1
- # JBChainlinkV3PriceFeed
2
- [Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/JBChainlinkV3PriceFeed.sol)
3
-
4
- **Inherits:**
5
- [IJBPriceFeed](/src/interfaces/IJBPriceFeed.sol/interface.IJBPriceFeed.md)
6
-
7
- An `IJBPriceFeed` implementation that reports prices from a Chainlink `AggregatorV3Interface`.
8
-
9
-
10
- ## State Variables
11
- ### FEED
12
- The Chainlink feed that prices are reported from.
13
-
14
-
15
- ```solidity
16
- AggregatorV3Interface public immutable FEED;
17
- ```
18
-
19
-
20
- ### THRESHOLD
21
- How many seconds old a Chainlink price update is allowed to be before considered "stale".
22
-
23
-
24
- ```solidity
25
- uint256 public immutable THRESHOLD;
26
- ```
27
-
28
-
29
- ## Functions
30
- ### constructor
31
-
32
-
33
- ```solidity
34
- constructor(AggregatorV3Interface feed, uint256 threshold);
35
- ```
36
- **Parameters**
37
-
38
- |Name|Type|Description|
39
- |----|----|-----------|
40
- |`feed`|`AggregatorV3Interface`|The Chainlink feed to report prices from.|
41
- |`threshold`|`uint256`|How many seconds old a price update may be.|
42
-
43
-
44
- ### currentUnitPrice
45
-
46
- Gets the current price (per 1 unit) from the feed.
47
-
48
-
49
- ```solidity
50
- function currentUnitPrice(uint256 decimals) public view virtual override returns (uint256);
51
- ```
52
- **Parameters**
53
-
54
- |Name|Type|Description|
55
- |----|----|-----------|
56
- |`decimals`|`uint256`|The number of decimals the return value should use.|
57
-
58
- **Returns**
59
-
60
- |Name|Type|Description|
61
- |----|----|-----------|
62
- |`<none>`|`uint256`|The current unit price from the feed, as a fixed point number with the specified number of decimals.|
63
-
64
-
65
- ## Errors
66
- ### JBChainlinkV3PriceFeed_IncompleteRound
67
-
68
- ```solidity
69
- error JBChainlinkV3PriceFeed_IncompleteRound();
70
- ```
71
-
72
- ### JBChainlinkV3PriceFeed_NegativePrice
73
-
74
- ```solidity
75
- error JBChainlinkV3PriceFeed_NegativePrice(int256 price);
76
- ```
77
-
78
- ### JBChainlinkV3PriceFeed_StalePrice
79
-
80
- ```solidity
81
- error JBChainlinkV3PriceFeed_StalePrice(uint256 timestamp, uint256 threshold, uint256 updatedAt);
82
- ```
83
-
@@ -1,88 +0,0 @@
1
- # JBChainlinkV3SequencerPriceFeed
2
- [Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/JBChainlinkV3SequencerPriceFeed.sol)
3
-
4
- **Inherits:**
5
- [JBChainlinkV3PriceFeed](/src/JBChainlinkV3PriceFeed.sol/contract.JBChainlinkV3PriceFeed.md)
6
-
7
- An `IJBPriceFeed` implementation that reports prices from a Chainlink `AggregatorV3Interface` from
8
- optimistic sequencers.
9
-
10
-
11
- ## State Variables
12
- ### GRACE_PERIOD_TIME
13
- How long the sequencer must be re-active in order to return a price.
14
-
15
-
16
- ```solidity
17
- uint256 public immutable GRACE_PERIOD_TIME;
18
- ```
19
-
20
-
21
- ### SEQUENCER_FEED
22
- The Chainlink sequencer feed that prices are reported from.
23
-
24
-
25
- ```solidity
26
- AggregatorV2V3Interface public immutable SEQUENCER_FEED;
27
- ```
28
-
29
-
30
- ## Functions
31
- ### constructor
32
-
33
-
34
- ```solidity
35
- constructor(
36
- AggregatorV3Interface feed,
37
- uint256 gracePeriod,
38
- AggregatorV2V3Interface sequencerFeed,
39
- uint256 threshold
40
- )
41
- JBChainlinkV3PriceFeed(feed, threshold);
42
- ```
43
- **Parameters**
44
-
45
- |Name|Type|Description|
46
- |----|----|-----------|
47
- |`feed`|`AggregatorV3Interface`|The Chainlink feed to report prices from.|
48
- |`gracePeriod`|`uint256`|How long the sequencer should have been re-active before returning prices.|
49
- |`sequencerFeed`|`AggregatorV2V3Interface`|The Chainlink feed to report sequencer status.|
50
- |`threshold`|`uint256`|How many blocks old a price update may be.|
51
-
52
-
53
- ### currentUnitPrice
54
-
55
- Gets the current price (per 1 unit) from the feed.
56
-
57
-
58
- ```solidity
59
- function currentUnitPrice(uint256 decimals) public view override returns (uint256);
60
- ```
61
- **Parameters**
62
-
63
- |Name|Type|Description|
64
- |----|----|-----------|
65
- |`decimals`|`uint256`|The number of decimals the return value should use.|
66
-
67
- **Returns**
68
-
69
- |Name|Type|Description|
70
- |----|----|-----------|
71
- |`<none>`|`uint256`|The current unit price from the feed, as a fixed point number with the specified number of decimals.|
72
-
73
-
74
- ## Errors
75
- ### JBChainlinkV3SequencerPriceFeed_SequencerDownOrRestarting
76
-
77
- ```solidity
78
- error JBChainlinkV3SequencerPriceFeed_SequencerDownOrRestarting(
79
- uint256 timestamp, uint256 gradePeriodTime, uint256 startedAt
80
- );
81
- ```
82
-
83
- ### JBChainlinkV3SequencerPriceFeed_InvalidRound
84
-
85
- ```solidity
86
- error JBChainlinkV3SequencerPriceFeed_InvalidRound();
87
- ```
88
-