@bananapus/core-v6 0.0.1
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/LICENSE +21 -0
- package/README.md +112 -0
- package/SKILLS.md +151 -0
- package/docs/book.css +13 -0
- package/docs/book.toml +12 -0
- package/docs/solidity.min.js +74 -0
- package/docs/src/README.md +703 -0
- package/docs/src/SUMMARY.md +94 -0
- package/docs/src/src/JBChainlinkV3PriceFeed.sol/contract.JBChainlinkV3PriceFeed.md +83 -0
- package/docs/src/src/JBChainlinkV3SequencerPriceFeed.sol/contract.JBChainlinkV3SequencerPriceFeed.md +88 -0
- package/docs/src/src/JBController.sol/contract.JBController.md +1121 -0
- package/docs/src/src/JBDeadline.sol/contract.JBDeadline.md +84 -0
- package/docs/src/src/JBDirectory.sol/contract.JBDirectory.md +294 -0
- package/docs/src/src/JBERC20.sol/contract.JBERC20.md +190 -0
- package/docs/src/src/JBFeelessAddresses.sol/contract.JBFeelessAddresses.md +80 -0
- package/docs/src/src/JBFundAccessLimits.sol/contract.JBFundAccessLimits.md +253 -0
- package/docs/src/src/JBMultiTerminal.sol/contract.JBMultiTerminal.md +1472 -0
- package/docs/src/src/JBPermissions.sol/contract.JBPermissions.md +199 -0
- package/docs/src/src/JBPrices.sol/contract.JBPrices.md +154 -0
- package/docs/src/src/JBProjects.sol/contract.JBProjects.md +131 -0
- package/docs/src/src/JBRulesets.sol/contract.JBRulesets.md +677 -0
- package/docs/src/src/JBSplits.sol/contract.JBSplits.md +237 -0
- package/docs/src/src/JBTerminalStore.sol/contract.JBTerminalStore.md +591 -0
- package/docs/src/src/JBTokens.sol/contract.JBTokens.md +353 -0
- package/docs/src/src/README.md +25 -0
- package/docs/src/src/abstract/JBControlled.sol/abstract.JBControlled.md +64 -0
- package/docs/src/src/abstract/JBPermissioned.sol/abstract.JBPermissioned.md +84 -0
- package/docs/src/src/abstract/README.md +5 -0
- package/docs/src/src/enums/JBApprovalStatus.sol/enum.JBApprovalStatus.md +17 -0
- package/docs/src/src/enums/README.md +4 -0
- package/docs/src/src/interfaces/IJBCashOutHook.sol/interface.IJBCashOutHook.md +29 -0
- package/docs/src/src/interfaces/IJBCashOutTerminal.sol/interface.IJBCashOutTerminal.md +57 -0
- package/docs/src/src/interfaces/IJBControlled.sol/interface.IJBControlled.md +12 -0
- package/docs/src/src/interfaces/IJBController.sol/interface.IJBController.md +334 -0
- package/docs/src/src/interfaces/IJBDirectory.sol/interface.IJBDirectory.md +108 -0
- package/docs/src/src/interfaces/IJBDirectoryAccessControl.sol/interface.IJBDirectoryAccessControl.md +19 -0
- package/docs/src/src/interfaces/IJBFeeTerminal.sol/interface.IJBFeeTerminal.md +91 -0
- package/docs/src/src/interfaces/IJBFeelessAddresses.sol/interface.IJBFeelessAddresses.md +26 -0
- package/docs/src/src/interfaces/IJBFundAccessLimits.sol/interface.IJBFundAccessLimits.md +88 -0
- package/docs/src/src/interfaces/IJBMigratable.sol/interface.IJBMigratable.md +29 -0
- package/docs/src/src/interfaces/IJBMultiTerminal.sol/interface.IJBMultiTerminal.md +50 -0
- package/docs/src/src/interfaces/IJBPayHook.sol/interface.IJBPayHook.md +28 -0
- package/docs/src/src/interfaces/IJBPayoutTerminal.sol/interface.IJBPayoutTerminal.md +105 -0
- package/docs/src/src/interfaces/IJBPermissioned.sol/interface.IJBPermissioned.md +12 -0
- package/docs/src/src/interfaces/IJBPermissions.sol/interface.IJBPermissions.md +74 -0
- package/docs/src/src/interfaces/IJBPermitTerminal.sol/interface.IJBPermitTerminal.md +15 -0
- package/docs/src/src/interfaces/IJBPriceFeed.sol/interface.IJBPriceFeed.md +12 -0
- package/docs/src/src/interfaces/IJBPrices.sol/interface.IJBPrices.md +74 -0
- package/docs/src/src/interfaces/IJBProjectUriRegistry.sol/interface.IJBProjectUriRegistry.md +19 -0
- package/docs/src/src/interfaces/IJBProjects.sol/interface.IJBProjects.md +49 -0
- package/docs/src/src/interfaces/IJBRulesetApprovalHook.sol/interface.IJBRulesetApprovalHook.md +35 -0
- package/docs/src/src/interfaces/IJBRulesetDataHook.sol/interface.IJBRulesetDataHook.md +97 -0
- package/docs/src/src/interfaces/IJBRulesets.sol/interface.IJBRulesets.md +165 -0
- package/docs/src/src/interfaces/IJBSplitHook.sol/interface.IJBSplitHook.md +31 -0
- package/docs/src/src/interfaces/IJBSplits.sol/interface.IJBSplits.md +35 -0
- package/docs/src/src/interfaces/IJBTerminal.sol/interface.IJBTerminal.md +141 -0
- package/docs/src/src/interfaces/IJBTerminalStore.sol/interface.IJBTerminalStore.md +198 -0
- package/docs/src/src/interfaces/IJBToken.sol/interface.IJBToken.md +54 -0
- package/docs/src/src/interfaces/IJBTokenUriResolver.sol/interface.IJBTokenUriResolver.md +12 -0
- package/docs/src/src/interfaces/IJBTokens.sol/interface.IJBTokens.md +151 -0
- package/docs/src/src/interfaces/README.md +33 -0
- package/docs/src/src/libraries/JBCashOuts.sol/library.JBCashOuts.md +40 -0
- package/docs/src/src/libraries/JBConstants.sol/library.JBConstants.md +52 -0
- package/docs/src/src/libraries/JBCurrencyIds.sol/library.JBCurrencyIds.md +19 -0
- package/docs/src/src/libraries/JBFees.sol/library.JBFees.md +52 -0
- package/docs/src/src/libraries/JBFixedPointNumber.sol/library.JBFixedPointNumber.md +12 -0
- package/docs/src/src/libraries/JBMetadataResolver.sol/library.JBMetadataResolver.md +242 -0
- package/docs/src/src/libraries/JBRulesetMetadataResolver.sol/library.JBRulesetMetadataResolver.md +180 -0
- package/docs/src/src/libraries/JBSplitGroupIds.sol/library.JBSplitGroupIds.md +14 -0
- package/docs/src/src/libraries/JBSurplus.sol/library.JBSurplus.md +44 -0
- package/docs/src/src/libraries/README.md +12 -0
- package/docs/src/src/periphery/JBDeadline1Day.sol/contract.JBDeadline1Day.md +15 -0
- package/docs/src/src/periphery/JBDeadline3Days.sol/contract.JBDeadline3Days.md +15 -0
- package/docs/src/src/periphery/JBDeadline3Hours.sol/contract.JBDeadline3Hours.md +15 -0
- package/docs/src/src/periphery/JBDeadline7Days.sol/contract.JBDeadline7Days.md +15 -0
- package/docs/src/src/periphery/JBMatchingPriceFeed.sol/contract.JBMatchingPriceFeed.md +22 -0
- package/docs/src/src/periphery/README.md +8 -0
- package/docs/src/src/structs/JBAccountingContext.sol/struct.JBAccountingContext.md +20 -0
- package/docs/src/src/structs/JBAfterCashOutRecordedContext.sol/struct.JBAfterCashOutRecordedContext.md +43 -0
- package/docs/src/src/structs/JBAfterPayRecordedContext.sol/struct.JBAfterPayRecordedContext.md +42 -0
- package/docs/src/src/structs/JBBeforeCashOutRecordedContext.sol/struct.JBBeforeCashOutRecordedContext.md +45 -0
- package/docs/src/src/structs/JBBeforePayRecordedContext.sol/struct.JBBeforePayRecordedContext.md +41 -0
- package/docs/src/src/structs/JBCashOutHookSpecification.sol/struct.JBCashOutHookSpecification.md +22 -0
- package/docs/src/src/structs/JBCurrencyAmount.sol/struct.JBCurrencyAmount.md +17 -0
- package/docs/src/src/structs/JBFee.sol/struct.JBFee.md +20 -0
- package/docs/src/src/structs/JBFundAccessLimitGroup.sol/struct.JBFundAccessLimitGroup.md +39 -0
- package/docs/src/src/structs/JBPayHookSpecification.sol/struct.JBPayHookSpecification.md +22 -0
- package/docs/src/src/structs/JBPermissionsData.sol/struct.JBPermissionsData.md +21 -0
- package/docs/src/src/structs/JBRuleset.sol/struct.JBRuleset.md +55 -0
- package/docs/src/src/structs/JBRulesetConfig.sol/struct.JBRulesetConfig.md +51 -0
- package/docs/src/src/structs/JBRulesetMetadata.sol/struct.JBRulesetMetadata.md +79 -0
- package/docs/src/src/structs/JBRulesetWeightCache.sol/struct.JBRulesetWeightCache.md +16 -0
- package/docs/src/src/structs/JBRulesetWithMetadata.sol/struct.JBRulesetWithMetadata.md +16 -0
- package/docs/src/src/structs/JBSingleAllowance.sol/struct.JBSingleAllowance.md +26 -0
- package/docs/src/src/structs/JBSplit.sol/struct.JBSplit.md +49 -0
- package/docs/src/src/structs/JBSplitGroup.sol/struct.JBSplitGroup.md +17 -0
- package/docs/src/src/structs/JBSplitHookContext.sol/struct.JBSplitHookContext.md +29 -0
- package/docs/src/src/structs/JBTerminalConfig.sol/struct.JBTerminalConfig.md +16 -0
- package/docs/src/src/structs/JBTokenAmount.sol/struct.JBTokenAmount.md +23 -0
- package/docs/src/src/structs/README.md +25 -0
- package/foundry.lock +11 -0
- package/foundry.toml +41 -0
- package/package.json +38 -0
- package/remappings.txt +1 -0
- package/script/Deploy.s.sol +111 -0
- package/script/DeployPeriphery.s.sol +287 -0
- package/script/helpers/CoreDeploymentLib.sol +121 -0
- package/slither-ci.config.json +10 -0
- package/sphinx.lock +507 -0
- package/src/JBChainlinkV3PriceFeed.sol +77 -0
- package/src/JBChainlinkV3SequencerPriceFeed.sol +75 -0
- package/src/JBController.sol +1186 -0
- package/src/JBDeadline.sol +73 -0
- package/src/JBDirectory.sol +343 -0
- package/src/JBERC20.sol +131 -0
- package/src/JBFeelessAddresses.sol +54 -0
- package/src/JBFundAccessLimits.sol +308 -0
- package/src/JBMultiTerminal.sol +2024 -0
- package/src/JBPermissions.sol +252 -0
- package/src/JBPrices.sol +227 -0
- package/src/JBProjects.sol +126 -0
- package/src/JBRulesets.sol +1093 -0
- package/src/JBSplits.sol +324 -0
- package/src/JBTerminalStore.sol +908 -0
- package/src/JBTokens.sol +376 -0
- package/src/abstract/JBControlled.sol +48 -0
- package/src/abstract/JBPermissioned.sol +77 -0
- package/src/enums/JBApprovalStatus.sol +12 -0
- package/src/interfaces/IJBCashOutHook.sol +15 -0
- package/src/interfaces/IJBCashOutTerminal.sol +51 -0
- package/src/interfaces/IJBControlled.sol +10 -0
- package/src/interfaces/IJBController.sol +280 -0
- package/src/interfaces/IJBDirectory.sol +69 -0
- package/src/interfaces/IJBDirectoryAccessControl.sol +15 -0
- package/src/interfaces/IJBFeeTerminal.sol +61 -0
- package/src/interfaces/IJBFeelessAddresses.sol +17 -0
- package/src/interfaces/IJBFundAccessLimits.sol +94 -0
- package/src/interfaces/IJBMigratable.sol +24 -0
- package/src/interfaces/IJBMultiTerminal.sol +36 -0
- package/src/interfaces/IJBPayHook.sol +14 -0
- package/src/interfaces/IJBPayoutTerminal.sol +92 -0
- package/src/interfaces/IJBPermissioned.sol +10 -0
- package/src/interfaces/IJBPermissions.sol +71 -0
- package/src/interfaces/IJBPermitTerminal.sol +14 -0
- package/src/interfaces/IJBPriceFeed.sol +10 -0
- package/src/interfaces/IJBPrices.sol +65 -0
- package/src/interfaces/IJBProjectUriRegistry.sol +15 -0
- package/src/interfaces/IJBProjects.sol +27 -0
- package/src/interfaces/IJBRulesetApprovalHook.sol +21 -0
- package/src/interfaces/IJBRulesetDataHook.sol +56 -0
- package/src/interfaces/IJBRulesets.sol +151 -0
- package/src/interfaces/IJBSplitHook.sol +16 -0
- package/src/interfaces/IJBSplits.sol +28 -0
- package/src/interfaces/IJBTerminal.sol +120 -0
- package/src/interfaces/IJBTerminalStore.sol +225 -0
- package/src/interfaces/IJBToken.sol +39 -0
- package/src/interfaces/IJBTokenUriResolver.sol +10 -0
- package/src/interfaces/IJBTokens.sol +113 -0
- package/src/libraries/JBCashOuts.sol +120 -0
- package/src/libraries/JBConstants.sol +14 -0
- package/src/libraries/JBCurrencyIds.sol +7 -0
- package/src/libraries/JBFees.sol +28 -0
- package/src/libraries/JBFixedPointNumber.sol +12 -0
- package/src/libraries/JBMetadataResolver.sol +306 -0
- package/src/libraries/JBRulesetMetadataResolver.sol +160 -0
- package/src/libraries/JBSplitGroupIds.sol +7 -0
- package/src/libraries/JBSurplus.sol +40 -0
- package/src/periphery/JBDeadline1Day.sol +8 -0
- package/src/periphery/JBDeadline3Days.sol +8 -0
- package/src/periphery/JBDeadline3Hours.sol +8 -0
- package/src/periphery/JBDeadline7Days.sol +8 -0
- package/src/periphery/JBMatchingPriceFeed.sol +13 -0
- package/src/structs/JBAccountingContext.sol +12 -0
- package/src/structs/JBAfterCashOutRecordedContext.sol +30 -0
- package/src/structs/JBAfterPayRecordedContext.sol +29 -0
- package/src/structs/JBBeforeCashOutRecordedContext.sol +31 -0
- package/src/structs/JBBeforePayRecordedContext.sol +28 -0
- package/src/structs/JBCashOutHookSpecification.sol +15 -0
- package/src/structs/JBCurrencyAmount.sol +10 -0
- package/src/structs/JBFee.sol +12 -0
- package/src/structs/JBFundAccessLimitGroup.sol +28 -0
- package/src/structs/JBPayHookSpecification.sol +15 -0
- package/src/structs/JBPermissionsData.sol +13 -0
- package/src/structs/JBRuleset.sol +42 -0
- package/src/structs/JBRulesetConfig.sol +43 -0
- package/src/structs/JBRulesetMetadata.sol +56 -0
- package/src/structs/JBRulesetWeightCache.sol +9 -0
- package/src/structs/JBRulesetWithMetadata.sol +12 -0
- package/src/structs/JBSingleAllowance.sol +16 -0
- package/src/structs/JBSplit.sol +37 -0
- package/src/structs/JBSplitGroup.sol +12 -0
- package/src/structs/JBSplitHookContext.sol +20 -0
- package/src/structs/JBTerminalConfig.sol +12 -0
- package/src/structs/JBTokenAmount.sol +14 -0
- package/test/AuditExploits.t.sol +2710 -0
- package/test/ComprehensiveInvariant.t.sol +298 -0
- package/test/EconomicSimulation.t.sol +340 -0
- package/test/EntryPointPermutations.t.sol +671 -0
- package/test/FlashLoanAttacks.t.sol +792 -0
- package/test/PermissionEscalation.t.sol +679 -0
- package/test/RulesetTransitions.t.sol +699 -0
- package/test/SplitLoopTests.t.sol +731 -0
- package/test/TestAccessToFunds.sol +2644 -0
- package/test/TestCashOut.sol +185 -0
- package/test/TestCashOutCountFor.sol +272 -0
- package/test/TestCashOutHooks.sol +317 -0
- package/test/TestCashOutTimingEdge.sol +229 -0
- package/test/TestDurationUnderflow.sol +220 -0
- package/test/TestFeeProcessingFailure.sol +208 -0
- package/test/TestFees.sol +604 -0
- package/test/TestInterfaceSupport.sol +62 -0
- package/test/TestJBERC20Inheritance.sol +91 -0
- package/test/TestLaunchProject.sol +176 -0
- package/test/TestMetaTx.sol +203 -0
- package/test/TestMetadataParserLib.sol +438 -0
- package/test/TestMigrationHeldFees.sol +249 -0
- package/test/TestMintTokensOf.sol +172 -0
- package/test/TestMultiTokenSurplus.sol +206 -0
- package/test/TestMultipleAccessLimits.sol +642 -0
- package/test/TestPayBurnRedeemFlow.sol +180 -0
- package/test/TestPayHooks.sol +190 -0
- package/test/TestPermissions.sol +305 -0
- package/test/TestPermissionsEdge.sol +286 -0
- package/test/TestPermit2Terminal.sol +339 -0
- package/test/TestRulesetQueueing.sol +1001 -0
- package/test/TestRulesetQueuingStress.sol +778 -0
- package/test/TestRulesetWeightCaching.sol +177 -0
- package/test/TestSplits.sol +369 -0
- package/test/TestTerminalMigration.sol +167 -0
- package/test/TestTokenFlow.sol +174 -0
- package/test/WeirdTokenTests.t.sol +764 -0
- package/test/formal/BondingCurveProperties.t.sol +411 -0
- package/test/formal/FeeProperties.t.sol +246 -0
- package/test/helpers/JBTest.sol +129 -0
- package/test/helpers/MetadataResolverHelper.sol +116 -0
- package/test/helpers/TestBaseWorkflow.sol +317 -0
- package/test/invariants/Phase3DeepInvariant.t.sol +404 -0
- package/test/invariants/RulesetsInvariant.t.sol +115 -0
- package/test/invariants/TerminalStoreInvariant.t.sol +220 -0
- package/test/invariants/TokensInvariant.t.sol +184 -0
- package/test/invariants/handlers/ComprehensiveHandler.sol +285 -0
- package/test/invariants/handlers/EconomicHandler.sol +347 -0
- package/test/invariants/handlers/Phase3Handler.sol +414 -0
- package/test/invariants/handlers/RulesetsHandler.sol +111 -0
- package/test/invariants/handlers/TerminalStoreHandler.sol +146 -0
- package/test/invariants/handlers/TokensHandler.sol +127 -0
- package/test/mock/ERC2771ForwarderMock.sol +37 -0
- package/test/mock/MockERC20.sol +18 -0
- package/test/mock/MockMaliciousBeneficiary.sol +67 -0
- package/test/mock/MockMaliciousSplitHook.sol +42 -0
- package/test/mock/MockPriceFeed.sol +20 -0
- package/test/trees/JBController/burnTokensOf.tree +9 -0
- package/test/trees/JBController/claimTokensFor.tree +5 -0
- package/test/trees/JBController/deployERC20For.tree +5 -0
- package/test/trees/JBController/getRulesetOf.tree +5 -0
- package/test/trees/JBController/launchProjectFor.tree +12 -0
- package/test/trees/JBController/launchRulesetsFor.tree +8 -0
- package/test/trees/JBController/migrateController.tree +12 -0
- package/test/trees/JBController/mintTokensOf.tree +12 -0
- package/test/trees/JBController/payReservedTokenToTerminal.tree +8 -0
- package/test/trees/JBController/receiveMigrationFrom.tree +4 -0
- package/test/trees/JBController/sendReservedTokensToSplitsOf.tree +12 -0
- package/test/trees/JBController/setMetadataOf.tree +5 -0
- package/test/trees/JBController/setSplitGroupsOf.tree +5 -0
- package/test/trees/JBController/setTokenFor.tree +5 -0
- package/test/trees/JBController/transferCreditsFrom.tree +8 -0
- package/test/trees/JBDirectory/primaryTerminalOf.tree +8 -0
- package/test/trees/JBDirectory/setControllerOf.tree +11 -0
- package/test/trees/JBDirectory/setPrimaryTerminalOf.tree +15 -0
- package/test/trees/JBDirectory/setTerminalsOf.tree +11 -0
- package/test/trees/JBERC20/initialize.tree +7 -0
- package/test/trees/JBERC20/name.tree +5 -0
- package/test/trees/JBERC20/nonces.tree +5 -0
- package/test/trees/JBERC20/symbol.tree +5 -0
- package/test/trees/JBFeelessAddresses/setFeelessAddress.tree +5 -0
- package/test/trees/JBFeelessAddresses/supportsInterface.tree +5 -0
- package/test/trees/JBFundAccessLimits/payoutLimitOf.tree +5 -0
- package/test/trees/JBFundAccessLimits/payoutLimitsOf.tree +8 -0
- package/test/trees/JBFundAccessLimits/setFundAccessLimitsFor.tree +18 -0
- package/test/trees/JBFundAccessLimits/surplusAllowanceOf.tree +5 -0
- package/test/trees/JBFundAccessLimits/surplusAllowancesOf.tree +8 -0
- package/test/trees/JBMetadataResolver/getDataFor.tree +8 -0
- package/test/trees/JBMultiTerminal/accountingContextsOf.tree +5 -0
- package/test/trees/JBMultiTerminal/addAccountingContextsFor.tree +10 -0
- package/test/trees/JBMultiTerminal/addToBalanceOf.tree +23 -0
- package/test/trees/JBMultiTerminal/cashOutTokensOf.tree +23 -0
- package/test/trees/JBMultiTerminal/executePayout.tree +32 -0
- package/test/trees/JBMultiTerminal/executeProcessFee.tree +14 -0
- package/test/trees/JBMultiTerminal/migrateBalanceOf.tree +12 -0
- package/test/trees/JBMultiTerminal/pay.tree +23 -0
- package/test/trees/JBMultiTerminal/processHeldFeesOf.tree +8 -0
- package/test/trees/JBMultiTerminal/sendPayoutsOf.tree +34 -0
- package/test/trees/JBMultiTerminal/useAllowanceOf.tree +16 -0
- package/test/trees/JBPermissions/hasPermission.tree +8 -0
- package/test/trees/JBPermissions/hasPermissions.tree +8 -0
- package/test/trees/JBPermissions/setPermissionsFor.tree +5 -0
- package/test/trees/JBPrices/addPriceFeedFor.tree +14 -0
- package/test/trees/JBPrices/pricePerUnitOf.tree +11 -0
- package/test/trees/JBProjects/createFor.tree +11 -0
- package/test/trees/JBProjects/setTokenUriResolver.tree +5 -0
- package/test/trees/JBProjects/supportsInterface.tree +9 -0
- package/test/trees/JBProjects/tokenURI.tree +5 -0
- package/test/trees/JBRulesets/currentApprovalStatusForLatestRulesetOf.tree +8 -0
- package/test/trees/JBRulesets/currentOf.tree +12 -0
- package/test/trees/JBRulesets/getRulesetOf.tree +5 -0
- package/test/trees/JBRulesets/latestQueuedRulesetOf.tree +10 -0
- package/test/trees/JBRulesets/rulesetsOf.tree +11 -0
- package/test/trees/JBRulesets/upcomingRulesetOf.tree +20 -0
- package/test/trees/JBRulesets/updateRulesetWeightCache.tree +5 -0
- package/test/trees/JBSplits/setSplitGroupsOf.tree +17 -0
- package/test/trees/JBSplits/splitsOf.tree +5 -0
- package/test/trees/JBTerminalStore/currentReclaimableSurplusOf.tree +16 -0
- package/test/trees/JBTerminalStore/currentSurplusOf.tree +25 -0
- package/test/trees/JBTerminalStore/currentTotalSurplusOf.tree +5 -0
- package/test/trees/JBTerminalStore/recordCashOutsFor.tree +16 -0
- package/test/trees/JBTerminalStore/recordPaymentFrom.tree +14 -0
- package/test/trees/JBTerminalStore/recordPayoutFor.tree +10 -0
- package/test/trees/JBTerminalStore/recordTerminalMigration.tree +5 -0
- package/test/trees/JBTerminalStore/recordUsedAllowanceOf.tree +10 -0
- package/test/trees/JBTokens/burnFrom.tree +10 -0
- package/test/trees/JBTokens/claimTokensFor.tree +10 -0
- package/test/trees/JBTokens/deployERC20For.tree +12 -0
- package/test/trees/JBTokens/mintFor.tree +10 -0
- package/test/trees/JBTokens/setTokenFor.tree +11 -0
- package/test/trees/JBTokens/totalBalanceOf.tree +5 -0
- package/test/trees/JBTokens/totalSupplyOf.tree +5 -0
- package/test/trees/JBTokens/transferCreditsFrom.tree +8 -0
- package/test/trees/mintTokensOf.tree +12 -0
- package/test/units/static/JBChainlinkV3PriceFeed/TestPriceFeed.sol +220 -0
- package/test/units/static/JBController/JBControllerSetup.sol +40 -0
- package/test/units/static/JBController/TestBurnTokensOf.sol +107 -0
- package/test/units/static/JBController/TestClaimTokensFor.sol +60 -0
- package/test/units/static/JBController/TestDeployErc20For.sol +80 -0
- package/test/units/static/JBController/TestLaunchProjectFor.sol +282 -0
- package/test/units/static/JBController/TestLaunchRulesetsFor.sol +322 -0
- package/test/units/static/JBController/TestMigrateController.sol +148 -0
- package/test/units/static/JBController/TestMintTokensOfUnits.sol +102 -0
- package/test/units/static/JBController/TestPayReservedTokenToTerminal.sol +71 -0
- package/test/units/static/JBController/TestReceiveMigrationFrom.sol +95 -0
- package/test/units/static/JBController/TestRulesetViews.sol +219 -0
- package/test/units/static/JBController/TestSendReservedTokensToSplitsOf.sol +595 -0
- package/test/units/static/JBController/TestSetSplitGroupsOf.sol +63 -0
- package/test/units/static/JBController/TestSetTokenFor.sol +227 -0
- package/test/units/static/JBController/TestSetUriOf.sol +53 -0
- package/test/units/static/JBController/TestTransferCreditsFrom.sol +159 -0
- package/test/units/static/JBDeadline/TestDeadlineFuzz.sol +194 -0
- package/test/units/static/JBDirectory/JBDirectorySetup.sol +22 -0
- package/test/units/static/JBDirectory/TestPrimaryTerminalOf.sol +122 -0
- package/test/units/static/JBDirectory/TestSetControllerOf.sol +173 -0
- package/test/units/static/JBDirectory/TestSetControllerOfMigrationOrder.sol +98 -0
- package/test/units/static/JBDirectory/TestSetPrimaryTerminalOf.sol +169 -0
- package/test/units/static/JBDirectory/TestSetTerminalsOf.sol +128 -0
- package/test/units/static/JBERC20/JBERC20Setup.sol +20 -0
- package/test/units/static/JBERC20/SigUtils.sol +34 -0
- package/test/units/static/JBERC20/TestInitialize.sol +54 -0
- package/test/units/static/JBERC20/TestName.sol +30 -0
- package/test/units/static/JBERC20/TestNonces.sol +59 -0
- package/test/units/static/JBERC20/TestSymbol.sol +31 -0
- package/test/units/static/JBFeelessAdresses/JBFeelessSetup.sol +20 -0
- package/test/units/static/JBFeelessAdresses/TestInterfaces.sol +29 -0
- package/test/units/static/JBFeelessAdresses/TestSetFeelessAddress.sol +35 -0
- package/test/units/static/JBFees/TestFeesFuzz.sol +78 -0
- package/test/units/static/JBFixedPointNumber/TestAdjustDecimals.sol +16 -0
- package/test/units/static/JBFixedPointNumber/TestAdjustDecimalsFuzz.sol +71 -0
- package/test/units/static/JBFundAccessLimits/JBFundAccessSetup.sol +21 -0
- package/test/units/static/JBFundAccessLimits/TestFundAccessLimitsEdge.sol +159 -0
- package/test/units/static/JBFundAccessLimits/TestPayoutLimitOf.sol +56 -0
- package/test/units/static/JBFundAccessLimits/TestPayoutLimitsOf.sol +94 -0
- package/test/units/static/JBFundAccessLimits/TestSetFundAccessLimitsFor.sol +182 -0
- package/test/units/static/JBFundAccessLimits/TestSurplusAllowanceOf.sol +61 -0
- package/test/units/static/JBFundAccessLimits/TestSurplusAllowancesOf.sol +96 -0
- package/test/units/static/JBMetadataResolver/TestGetDataFor.sol +89 -0
- package/test/units/static/JBMetadataResolver/TestMetadataResolverFuzz.sol +227 -0
- package/test/units/static/JBMetadataResolver/TestMetadataResolverM20M21.sol +245 -0
- package/test/units/static/JBMultiTerminal/JBMultiTerminalSetup.sol +39 -0
- package/test/units/static/JBMultiTerminal/TestAccountingContextsOf.sol +65 -0
- package/test/units/static/JBMultiTerminal/TestAddAccountingContextsFor.sol +313 -0
- package/test/units/static/JBMultiTerminal/TestAddToBalanceOf.sol +432 -0
- package/test/units/static/JBMultiTerminal/TestCashOutTokensOf.sol +478 -0
- package/test/units/static/JBMultiTerminal/TestExecutePayout.sol +577 -0
- package/test/units/static/JBMultiTerminal/TestExecuteProcessFee.sol +176 -0
- package/test/units/static/JBMultiTerminal/TestMigrateBalanceOf.sol +190 -0
- package/test/units/static/JBMultiTerminal/TestPay.sol +514 -0
- package/test/units/static/JBMultiTerminal/TestProcessHeldFeesOf.sol +29 -0
- package/test/units/static/JBMultiTerminal/TestSendPayoutsOf.sol +243 -0
- package/test/units/static/JBMultiTerminal/TestUseAllowanceOf.sol +310 -0
- package/test/units/static/JBPermissions/JBPermissionsSetup.sol +18 -0
- package/test/units/static/JBPermissions/TestHasPermission.sol +50 -0
- package/test/units/static/JBPermissions/TestHasPermissions.sol +93 -0
- package/test/units/static/JBPermissions/TestSetPermissionsFor.sol +62 -0
- package/test/units/static/JBPrices/JBPricesSetup.sol +26 -0
- package/test/units/static/JBPrices/TestAddPriceFeedFor.sol +102 -0
- package/test/units/static/JBPrices/TestPricePerUnitOf.sol +129 -0
- package/test/units/static/JBPrices/TestPrices.sol +262 -0
- package/test/units/static/JBProjects/JBProjectsSetup.sol +20 -0
- package/test/units/static/JBProjects/TestCreateFor.sol +69 -0
- package/test/units/static/JBProjects/TestInitialProject.sol +19 -0
- package/test/units/static/JBProjects/TestInterfaces.sol +27 -0
- package/test/units/static/JBProjects/TestSetResolver.sol +36 -0
- package/test/units/static/JBProjects/TestTokenUri.sol +38 -0
- package/test/units/static/JBRulesetMetadataResolver/TestSetCashOutTaxRateTo.sol +99 -0
- package/test/units/static/JBRulesets/JBRulesetsSetup.sol +21 -0
- package/test/units/static/JBRulesets/TestCurrentApprovalStatusForLatestRulesetOf.sol +257 -0
- package/test/units/static/JBRulesets/TestCurrentOf.sol +231 -0
- package/test/units/static/JBRulesets/TestGetRulesetOf.sol +94 -0
- package/test/units/static/JBRulesets/TestLatestQueuedRulesetOf.sol +252 -0
- package/test/units/static/JBRulesets/TestRulesets.sol +617 -0
- package/test/units/static/JBRulesets/TestRulesetsOf.sol +37 -0
- package/test/units/static/JBRulesets/TestUpcomingRulesetOf.sol +526 -0
- package/test/units/static/JBRulesets/TestUpdateRulesetWeightCache.sol +91 -0
- package/test/units/static/JBSplits/JBSplitsSetup.sol +23 -0
- package/test/units/static/JBSplits/TestSelfManagedSplitGroups.sol +502 -0
- package/test/units/static/JBSplits/TestSetSplitGroupsOf.sol +370 -0
- package/test/units/static/JBSplits/TestSplitsLockedEdge.sol +262 -0
- package/test/units/static/JBSplits/TestSplitsOf.sol +24 -0
- package/test/units/static/JBSplits/TestSplitsPacking.sol +33 -0
- package/test/units/static/JBSurplus/TestSurplusFuzz.sol +125 -0
- package/test/units/static/JBTerminalStore/JBTerminalStoreSetup.sol +23 -0
- package/test/units/static/JBTerminalStore/TestCurrentReclaimableSurplusOf.sol +434 -0
- package/test/units/static/JBTerminalStore/TestCurrentSurplusOf.sol +428 -0
- package/test/units/static/JBTerminalStore/TestCurrentTotalSurplusOf.sol +65 -0
- package/test/units/static/JBTerminalStore/TestRecordCashOutsFor.sol +479 -0
- package/test/units/static/JBTerminalStore/TestRecordPaymentFrom.sol +508 -0
- package/test/units/static/JBTerminalStore/TestRecordPayoutFor.sol +257 -0
- package/test/units/static/JBTerminalStore/TestRecordTerminalMigration.sol +131 -0
- package/test/units/static/JBTerminalStore/TestRecordUsedAllowanceOf.sol +390 -0
- package/test/units/static/JBTerminalStore/TestUint224Overflow.sol +187 -0
- package/test/units/static/JBTokens/JBTokensSetup.sol +23 -0
- package/test/units/static/JBTokens/TestBurnFrom.sol +104 -0
- package/test/units/static/JBTokens/TestClaimTokensFor.sol +107 -0
- package/test/units/static/JBTokens/TestDeployERC20ForUnits.sol +89 -0
- package/test/units/static/JBTokens/TestMintFor.sol +97 -0
- package/test/units/static/JBTokens/TestSetTokenFor.sol +95 -0
- package/test/units/static/JBTokens/TestTotalBalanceOf.sol +65 -0
- package/test/units/static/JBTokens/TestTotalSupplyOf.sol +56 -0
- package/test/units/static/JBTokens/TestTransferCreditsFrom.sol +54 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# JBPermissionsData
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBPermissionsData.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: operator The address that permissions are being given to.
|
|
6
|
+
|
|
7
|
+
- member: projectId The ID of the project the operator is being given permissions for. Operators only have
|
|
8
|
+
permissions under this project's scope. An ID of 0 is a wildcard, which gives an operator permissions across all
|
|
9
|
+
projects.
|
|
10
|
+
|
|
11
|
+
- member: permissionIds The IDs of the permissions being given. See the `JBPermissionIds` library.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
```solidity
|
|
15
|
+
struct JBPermissionsData {
|
|
16
|
+
address operator;
|
|
17
|
+
uint64 projectId;
|
|
18
|
+
uint8[] permissionIds;
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# JBRuleset
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBRuleset.sol)
|
|
3
|
+
|
|
4
|
+
*`JBRuleset` timestamps are unix timestamps (seconds since 00:00 January 1st, 1970 UTC).*
|
|
5
|
+
|
|
6
|
+
**Notes:**
|
|
7
|
+
- member: cycleNumber The ruleset's cycle number. Each ruleset's `cycleNumber` is the previous ruleset's
|
|
8
|
+
`cycleNumber` plus one. Each project's first ruleset has a `cycleNumber` of 1.
|
|
9
|
+
|
|
10
|
+
- member: id The ruleset's ID, which is a timestamp of when this ruleset's rules were initialized. The
|
|
11
|
+
`rulesetId` stays the same for rulesets that automatically cycle over from a manually queued ruleset.
|
|
12
|
+
|
|
13
|
+
- member: basedOnId The `rulesetId` of the ruleset which was active when this ruleset was created.
|
|
14
|
+
|
|
15
|
+
- member: start The timestamp from which this ruleset is considered active.
|
|
16
|
+
|
|
17
|
+
- member: duration The number of seconds the ruleset lasts for. After this duration, a new ruleset will start.
|
|
18
|
+
The project owner can queue new rulesets at any time, which will take effect once the current ruleset's duration is
|
|
19
|
+
over. If the `duration` is 0, newly queued rulesets will take effect immediately. If a ruleset ends and there are no
|
|
20
|
+
new rulesets queued, the current ruleset cycles over to another one with the same properties but a new `start`
|
|
21
|
+
timestamp and a `weight` reduced by the ruleset's `weightCutPercent`.
|
|
22
|
+
|
|
23
|
+
- member: weight A fixed point number with 18 decimals which is typically used by payment terminals to
|
|
24
|
+
determine how many tokens should be minted when a payment is received. This can be used by other contracts for
|
|
25
|
+
arbitrary calculations.
|
|
26
|
+
|
|
27
|
+
- member: weightCutPercent The percentage by which to reduce the `weight` each time a new ruleset starts.
|
|
28
|
+
`weight`
|
|
29
|
+
is
|
|
30
|
+
a percentage out of `JBConstants.MAX_WEIGHT_CUT_PERCENT`. If it's 0, the next ruleset will have the same `weight` by
|
|
31
|
+
default. If it's 90%, the next ruleset's `weight` will be 10% smaller. If a ruleset explicitly sets a new `weight`,
|
|
32
|
+
the `weightCutPercent` doesn't apply.
|
|
33
|
+
|
|
34
|
+
- member: approvalHook An address of a contract that says whether a queued ruleset should be approved or
|
|
35
|
+
rejected. If a
|
|
36
|
+
ruleset is rejected, it won't go into effect. An approval hook can be used to create rules which dictate how a
|
|
37
|
+
project owner can change their ruleset over time.
|
|
38
|
+
|
|
39
|
+
- member: metadata Extra data associated with a ruleset which can be used by other contracts.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
```solidity
|
|
43
|
+
struct JBRuleset {
|
|
44
|
+
uint48 cycleNumber;
|
|
45
|
+
uint48 id;
|
|
46
|
+
uint48 basedOnId;
|
|
47
|
+
uint48 start;
|
|
48
|
+
uint32 duration;
|
|
49
|
+
uint112 weight;
|
|
50
|
+
uint32 weightCutPercent;
|
|
51
|
+
IJBRulesetApprovalHook approvalHook;
|
|
52
|
+
uint256 metadata;
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# JBRulesetConfig
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBRulesetConfig.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: mustStartAtOrAfter The earliest time the ruleset can start.
|
|
6
|
+
|
|
7
|
+
- member: duration The number of seconds the ruleset lasts for, after which a new ruleset will start. A
|
|
8
|
+
duration of 0 means that the ruleset will stay active until the project owner explicitly issues a reconfiguration,
|
|
9
|
+
at which point a new ruleset will immediately start with the updated properties. If the duration is greater than 0,
|
|
10
|
+
a project owner cannot make changes to a ruleset's parameters while it is active – any proposed changes will apply
|
|
11
|
+
to the subsequent ruleset. If no changes are proposed, a ruleset rolls over to another one with the same properties
|
|
12
|
+
but new `start` timestamp and a cut `weight`.
|
|
13
|
+
|
|
14
|
+
- member: weight A fixed point number with 18 decimals that contracts can use to base arbitrary calculations
|
|
15
|
+
on. For example, payment terminals can use this to determine how many tokens should be minted when a payment is
|
|
16
|
+
received.
|
|
17
|
+
|
|
18
|
+
- member: weightCutPercent A percent by how much the `weight` of the subsequent ruleset should be reduced, if
|
|
19
|
+
the
|
|
20
|
+
project owner hasn't queued the subsequent ruleset with an explicit `weight`. If it's 0, each ruleset will have
|
|
21
|
+
equal weight. If the number is 90%, the next ruleset will have a 10% smaller weight. This weight is out of
|
|
22
|
+
`JBConstants.MAX_WEIGHT_CUT_PERCENT`.
|
|
23
|
+
|
|
24
|
+
- member: approvalHook An address of a contract that says whether a proposed ruleset should be accepted or
|
|
25
|
+
rejected. It
|
|
26
|
+
can be used to create rules around how a project owner can change ruleset parameters over time.
|
|
27
|
+
|
|
28
|
+
- member: metadata Metadata specifying the controller-specific parameters that a ruleset can have. These
|
|
29
|
+
properties cannot change until the next ruleset starts.
|
|
30
|
+
|
|
31
|
+
- member: splitGroups An array of splits to use for any number of groups while the ruleset is active.
|
|
32
|
+
|
|
33
|
+
- member: fundAccessLimitGroups An array of structs which dictate the amount of funds a project can access from
|
|
34
|
+
its balance in each payment terminal while the ruleset is active. Amounts are fixed point numbers using the same
|
|
35
|
+
number of decimals as the corresponding terminal. The `_payoutLimit` and `_surplusAllowance` parameters must fit in
|
|
36
|
+
a `uint232`.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
```solidity
|
|
40
|
+
struct JBRulesetConfig {
|
|
41
|
+
uint48 mustStartAtOrAfter;
|
|
42
|
+
uint32 duration;
|
|
43
|
+
uint112 weight;
|
|
44
|
+
uint32 weightCutPercent;
|
|
45
|
+
IJBRulesetApprovalHook approvalHook;
|
|
46
|
+
JBRulesetMetadata metadata;
|
|
47
|
+
JBSplitGroup[] splitGroups;
|
|
48
|
+
JBFundAccessLimitGroup[] fundAccessLimitGroups;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# JBRulesetMetadata
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBRulesetMetadata.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: reservedPercent The reserved percent of the ruleset. This number is a percentage calculated out of
|
|
6
|
+
`JBConstants.MAX_RESERVED_PERCENT`.
|
|
7
|
+
|
|
8
|
+
- member: cashOutTaxRate The cash out tax rate of the ruleset. This number is a percentage calculated out of
|
|
9
|
+
`JBConstants.MAX_CASH_OUT_TAX_RATE`.
|
|
10
|
+
|
|
11
|
+
- member: baseCurrency The currency on which to base the ruleset's weight. By convention, this is
|
|
12
|
+
`uint32(uint160(tokenAddress))` for tokens, or a constant ID from e.g. `JBCurrencyIds` for other currencies.
|
|
13
|
+
|
|
14
|
+
- member: pausePay A flag indicating if the pay functionality should be paused during the ruleset.
|
|
15
|
+
|
|
16
|
+
- member: pauseCreditTransfers A flag indicating if the project token transfer functionality should be paused
|
|
17
|
+
during the funding cycle.
|
|
18
|
+
|
|
19
|
+
- member: allowOwnerMinting A flag indicating if the project owner or an operator with the `MINT_TOKENS`
|
|
20
|
+
permission from the owner should be allowed to mint project tokens on demand during this ruleset.
|
|
21
|
+
|
|
22
|
+
- member: allowTerminalMigration A flag indicating if migrating terminals should be allowed during this
|
|
23
|
+
ruleset.
|
|
24
|
+
|
|
25
|
+
- member: allowSetTerminals A flag indicating if a project's terminals can be added or removed.
|
|
26
|
+
|
|
27
|
+
- member: allowSetController A flag indicating if a project's controller can be changed.
|
|
28
|
+
|
|
29
|
+
- member: allowAddAccountingContext A flag indicating if a project can add new accounting contexts for its
|
|
30
|
+
terminals to use.
|
|
31
|
+
|
|
32
|
+
- member: allowAddPriceFeed A flag indicating if a project can add new price feeds to calculate exchange rates
|
|
33
|
+
between its tokens.
|
|
34
|
+
|
|
35
|
+
- member: ownerMustSendPayouts A flag indicating if privileged payout distribution should be
|
|
36
|
+
enforced, otherwise payouts can be distributed by anyone.
|
|
37
|
+
|
|
38
|
+
- member: holdFees A flag indicating if fees should be held during this ruleset.
|
|
39
|
+
|
|
40
|
+
- member: useTotalSurplusForCashOuts A flag indicating if cash outs should use the project's balance held
|
|
41
|
+
in all terminals instead of the project's local terminal balance from which the cash out is being fulfilled.
|
|
42
|
+
|
|
43
|
+
- member: useDataHookForPay A flag indicating if the data hook should be used for pay transactions during this
|
|
44
|
+
ruleset.
|
|
45
|
+
|
|
46
|
+
- member: useDataHookForCashOut A flag indicating if the data hook should be used for cash out transactions
|
|
47
|
+
during
|
|
48
|
+
this ruleset.
|
|
49
|
+
|
|
50
|
+
- member: dataHook The data hook to use during this ruleset.
|
|
51
|
+
|
|
52
|
+
- member: metadata Metadata of the metadata, only the 14 least significant bits can be used, the 2 most
|
|
53
|
+
significant bits are disregarded.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
```solidity
|
|
57
|
+
struct JBRulesetMetadata {
|
|
58
|
+
uint16 reservedPercent;
|
|
59
|
+
uint16 cashOutTaxRate;
|
|
60
|
+
uint32 baseCurrency;
|
|
61
|
+
bool pausePay;
|
|
62
|
+
bool pauseCreditTransfers;
|
|
63
|
+
bool allowOwnerMinting;
|
|
64
|
+
bool allowSetCustomToken;
|
|
65
|
+
bool allowTerminalMigration;
|
|
66
|
+
bool allowSetTerminals;
|
|
67
|
+
bool allowSetController;
|
|
68
|
+
bool allowAddAccountingContext;
|
|
69
|
+
bool allowAddPriceFeed;
|
|
70
|
+
bool ownerMustSendPayouts;
|
|
71
|
+
bool holdFees;
|
|
72
|
+
bool useTotalSurplusForCashOuts;
|
|
73
|
+
bool useDataHookForPay;
|
|
74
|
+
bool useDataHookForCashOut;
|
|
75
|
+
address dataHook;
|
|
76
|
+
uint16 metadata;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# JBRulesetWeightCache
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBRulesetWeightCache.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: weight The cached weight value.
|
|
6
|
+
|
|
7
|
+
- member: weightCutMultiple The weight cut multiple that produces the given weight.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
struct JBRulesetWeightCache {
|
|
12
|
+
uint112 weight;
|
|
13
|
+
uint168 weightCutMultiple;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# JBRulesetWithMetadata
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBRulesetWithMetadata.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: ruleset The ruleset.
|
|
6
|
+
|
|
7
|
+
- member: metadata The ruleset's metadata.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
struct JBRulesetWithMetadata {
|
|
12
|
+
JBRuleset ruleset;
|
|
13
|
+
JBRulesetMetadata metadata;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# JBSingleAllowance
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBSingleAllowance.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: sigDeadline Deadline on the permit signature.
|
|
6
|
+
|
|
7
|
+
- member: amount The maximum amount allowed to spend.
|
|
8
|
+
|
|
9
|
+
- member: expiration Timestamp at which a spender's token allowances become invalid.
|
|
10
|
+
|
|
11
|
+
- member: nonce An incrementing value indexed per owner,token,and spender for each signature.
|
|
12
|
+
|
|
13
|
+
- member: signature The signature over the permit data. Supports EOA signatures, compact signatures defined by
|
|
14
|
+
EIP-2098, and contract signatures defined by EIP-1271.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
```solidity
|
|
18
|
+
struct JBSingleAllowance {
|
|
19
|
+
uint256 sigDeadline;
|
|
20
|
+
uint160 amount;
|
|
21
|
+
uint48 expiration;
|
|
22
|
+
uint48 nonce;
|
|
23
|
+
bytes signature;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# JBSplit
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBSplit.sol)
|
|
3
|
+
|
|
4
|
+
Splits are used to send a percentage of a total token amount to a specific contract, project, or address.
|
|
5
|
+
Splits are used to send payouts and reserved tokens.
|
|
6
|
+
|
|
7
|
+
*1. If a non-zero split hook contract is specified, this split's tokens are sent there along with this split's
|
|
8
|
+
properties.*
|
|
9
|
+
|
|
10
|
+
*2. Otherwise, if a non-zero project ID is specified, this split's tokens are used to `pay` it through its
|
|
11
|
+
terminal if possible, or sent to the project's owner if not. If this payment yields tokens, those go to the split's
|
|
12
|
+
`beneficiary`.*
|
|
13
|
+
|
|
14
|
+
*3. Otherwise, this split's tokens are sent directly to the `beneficiary`.*
|
|
15
|
+
|
|
16
|
+
*To summarize, this split's tokens are sent according to the following priority: `split hook` > `projectId` >
|
|
17
|
+
`beneficiary`.*
|
|
18
|
+
|
|
19
|
+
**Notes:**
|
|
20
|
+
- member: percent The percent of the total token amount that this split sends. This number is out of
|
|
21
|
+
`JBConstants.SPLITS_TOTAL_PERCENT`.
|
|
22
|
+
|
|
23
|
+
- member: projectId The ID of a project to `pay`, if applicable. Resulting tokens will be routed to the
|
|
24
|
+
`beneficiary`.
|
|
25
|
+
|
|
26
|
+
- member: beneficiary Receives this split's tokens if the `hook` and `projectId` are zero. If the `projectId`
|
|
27
|
+
is specified, the `beneficiary` receives any project tokens minted by this split.
|
|
28
|
+
|
|
29
|
+
- member: preferAddToBalance If this split were to `pay` a project through its terminal, this flag indicates
|
|
30
|
+
whether it should prefer using the terminal's `addToBalance` function instead.
|
|
31
|
+
|
|
32
|
+
- member: lockedUntil The split cannot be changed until this timestamp. The `lockedUntil` timestamp can be
|
|
33
|
+
increased while a split is locked. If `lockedUntil` is zero, this split can be changed at any time.
|
|
34
|
+
|
|
35
|
+
- member: hook A contract which will receive this split's tokens and properties, and can define custom
|
|
36
|
+
behavior.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
```solidity
|
|
40
|
+
struct JBSplit {
|
|
41
|
+
uint32 percent;
|
|
42
|
+
uint64 projectId;
|
|
43
|
+
address payable beneficiary;
|
|
44
|
+
bool preferAddToBalance;
|
|
45
|
+
uint48 lockedUntil;
|
|
46
|
+
IJBSplitHook hook;
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# JBSplitGroup
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBSplitGroup.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: groupId An identifier for the group. By convention, this ID is `uint256(uint160(tokenAddress))` for
|
|
6
|
+
payouts and `1` for reserved tokens.
|
|
7
|
+
|
|
8
|
+
- member: splits The splits in the group.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
```solidity
|
|
12
|
+
struct JBSplitGroup {
|
|
13
|
+
uint256 groupId;
|
|
14
|
+
JBSplit[] splits;
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# JBSplitHookContext
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBSplitHookContext.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: token The token being sent to the split hook.
|
|
6
|
+
|
|
7
|
+
- member: amount The amount being sent to the split hook, as a fixed point number.
|
|
8
|
+
|
|
9
|
+
- member: decimals The number of decimals in the amount.
|
|
10
|
+
|
|
11
|
+
- member: projectId The project the split belongs to.
|
|
12
|
+
|
|
13
|
+
- member: groupId The group the split belongs to. By convention, this ID is `uint256(uint160(tokenAddress))`
|
|
14
|
+
for payouts and `1` for reserved tokens.
|
|
15
|
+
|
|
16
|
+
- member: split The split which specified the hook.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
```solidity
|
|
20
|
+
struct JBSplitHookContext {
|
|
21
|
+
address token;
|
|
22
|
+
uint256 amount;
|
|
23
|
+
uint256 decimals;
|
|
24
|
+
uint256 projectId;
|
|
25
|
+
uint256 groupId;
|
|
26
|
+
JBSplit split;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# JBTerminalConfig
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBTerminalConfig.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: terminal The terminal to configure.
|
|
6
|
+
|
|
7
|
+
- member: accountingContextsToAccept The accounting contexts to accept from the terminal.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
struct JBTerminalConfig {
|
|
12
|
+
IJBTerminal terminal;
|
|
13
|
+
JBAccountingContext[] accountingContextsToAccept;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# JBTokenAmount
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/structs/JBTokenAmount.sol)
|
|
3
|
+
|
|
4
|
+
**Notes:**
|
|
5
|
+
- member: token The token the payment was made in.
|
|
6
|
+
|
|
7
|
+
- member: decimals The number of decimals included in the value fixed point number.
|
|
8
|
+
|
|
9
|
+
- member: currency The currency. By convention, this is `uint32(uint160(tokenAddress))` for tokens, or a
|
|
10
|
+
constant ID from e.g. `JBCurrencyIds` for other currencies.
|
|
11
|
+
|
|
12
|
+
- member: value The amount of tokens that was paid, as a fixed point number.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
```solidity
|
|
16
|
+
struct JBTokenAmount {
|
|
17
|
+
address token;
|
|
18
|
+
uint8 decimals;
|
|
19
|
+
uint32 currency;
|
|
20
|
+
uint256 value;
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Contents
|
|
4
|
+
- [JBAccountingContext](JBAccountingContext.sol/struct.JBAccountingContext.md)
|
|
5
|
+
- [JBAfterCashOutRecordedContext](JBAfterCashOutRecordedContext.sol/struct.JBAfterCashOutRecordedContext.md)
|
|
6
|
+
- [JBAfterPayRecordedContext](JBAfterPayRecordedContext.sol/struct.JBAfterPayRecordedContext.md)
|
|
7
|
+
- [JBBeforeCashOutRecordedContext](JBBeforeCashOutRecordedContext.sol/struct.JBBeforeCashOutRecordedContext.md)
|
|
8
|
+
- [JBBeforePayRecordedContext](JBBeforePayRecordedContext.sol/struct.JBBeforePayRecordedContext.md)
|
|
9
|
+
- [JBCashOutHookSpecification](JBCashOutHookSpecification.sol/struct.JBCashOutHookSpecification.md)
|
|
10
|
+
- [JBCurrencyAmount](JBCurrencyAmount.sol/struct.JBCurrencyAmount.md)
|
|
11
|
+
- [JBFee](JBFee.sol/struct.JBFee.md)
|
|
12
|
+
- [JBFundAccessLimitGroup](JBFundAccessLimitGroup.sol/struct.JBFundAccessLimitGroup.md)
|
|
13
|
+
- [JBPayHookSpecification](JBPayHookSpecification.sol/struct.JBPayHookSpecification.md)
|
|
14
|
+
- [JBPermissionsData](JBPermissionsData.sol/struct.JBPermissionsData.md)
|
|
15
|
+
- [JBRuleset](JBRuleset.sol/struct.JBRuleset.md)
|
|
16
|
+
- [JBRulesetConfig](JBRulesetConfig.sol/struct.JBRulesetConfig.md)
|
|
17
|
+
- [JBRulesetMetadata](JBRulesetMetadata.sol/struct.JBRulesetMetadata.md)
|
|
18
|
+
- [JBRulesetWeightCache](JBRulesetWeightCache.sol/struct.JBRulesetWeightCache.md)
|
|
19
|
+
- [JBRulesetWithMetadata](JBRulesetWithMetadata.sol/struct.JBRulesetWithMetadata.md)
|
|
20
|
+
- [JBSingleAllowance](JBSingleAllowance.sol/struct.JBSingleAllowance.md)
|
|
21
|
+
- [JBSplit](JBSplit.sol/struct.JBSplit.md)
|
|
22
|
+
- [JBSplitGroup](JBSplitGroup.sol/struct.JBSplitGroup.md)
|
|
23
|
+
- [JBSplitHookContext](JBSplitHookContext.sol/struct.JBSplitHookContext.md)
|
|
24
|
+
- [JBTerminalConfig](JBTerminalConfig.sol/struct.JBTerminalConfig.md)
|
|
25
|
+
- [JBTokenAmount](JBTokenAmount.sol/struct.JBTokenAmount.md)
|
package/foundry.lock
ADDED
package/foundry.toml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[profile.default]
|
|
2
|
+
solc = '0.8.23'
|
|
3
|
+
evm_version = 'paris' # Required for L2s (Optimism, Arbitrum, etc.)
|
|
4
|
+
match_contract = "_Local" # Do not run fork tests
|
|
5
|
+
sizes = true
|
|
6
|
+
verbosity = 3 # display errors
|
|
7
|
+
optimizer_runs = 200
|
|
8
|
+
block_number = 14126430
|
|
9
|
+
block_timestamp = 1643802347
|
|
10
|
+
runs = 4096
|
|
11
|
+
libs = ["node_modules", "lib"]
|
|
12
|
+
build_info = false
|
|
13
|
+
extra_output = ['storageLayout']
|
|
14
|
+
fs_permissions = [{ access = "read-write", path = "./"}]
|
|
15
|
+
|
|
16
|
+
[rpc_endpoints]
|
|
17
|
+
ethereum ="${RPC_ETHEREUM_MAINNET}"
|
|
18
|
+
optimism = "${RPC_OPTIMISM_MAINNET}"
|
|
19
|
+
polygon = "${RPC_POLYGON_MUMBAI}"
|
|
20
|
+
arbitrum = "${RPC_ARBITRUM_MAINNET}"
|
|
21
|
+
base = "${RPC_BASE_MAINNET}"
|
|
22
|
+
arbitrum_sepolia = "${RPC_ARBITRUM_SEPOLIA}"
|
|
23
|
+
ethereum_sepolia ="${RPC_ETHEREUM_SEPOLIA}"
|
|
24
|
+
optimism_sepolia = "${RPC_OPTIMISM_SEPOLIA}"
|
|
25
|
+
polygon_mumbai = "${RPC_POLYGON_MUMBAI}"
|
|
26
|
+
base_sepolia = "${RPC_BASE_SEPOLIA}"
|
|
27
|
+
|
|
28
|
+
[profile.fork] # run via FOUNDRY_PROFILE=fork foundry test
|
|
29
|
+
fs_permissions = [{ access = "read", path = "./deployments/mainnet" }] # Get the deployment addresses for forking
|
|
30
|
+
match_contract = "_Fork"
|
|
31
|
+
|
|
32
|
+
[invariant]
|
|
33
|
+
runs = 1024
|
|
34
|
+
depth = 100
|
|
35
|
+
fail_on_revert = false
|
|
36
|
+
dictionary_weight = 40
|
|
37
|
+
|
|
38
|
+
[fmt]
|
|
39
|
+
number_underscore = "thousands"
|
|
40
|
+
multiline_func_header = "all"
|
|
41
|
+
wrap_comments = true
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bananapus/core-v6",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Bananapus/nana-core-v6"
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20.0.0"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "forge test",
|
|
14
|
+
"test:fork": "FOUNDRY_PROFILE=CI forge test",
|
|
15
|
+
"coverage": "forge coverage --match-path \"./src/*.sol\" --report lcov --report summary",
|
|
16
|
+
"deploy:mainnets": "source ./.env && npx sphinx propose ./script/Deploy.s.sol --networks mainnets",
|
|
17
|
+
"deploy:testnets": "source ./.env && npx sphinx propose ./script/Deploy.s.sol --networks testnets",
|
|
18
|
+
"deploy:mainnets:5_1:1": "source ./.env && npx sphinx propose ./script/Deploy5_1.1.s.sol --networks mainnets",
|
|
19
|
+
"deploy:testnets:5_1:1": "source ./.env && npx sphinx propose ./script/Deploy5_1.1.s.sol --networks testnets",
|
|
20
|
+
"deploy:mainnets:5_1:2": "source ./.env && npx sphinx propose ./script/Deploy5_1.2.s.sol --networks mainnets",
|
|
21
|
+
"deploy:testnets:5_1:2": "source ./.env && npx sphinx propose ./script/Deploy5_1.2.s.sol --networks testnets",
|
|
22
|
+
"deploy:testnets:periphery": "source ./.env && npx sphinx propose ./script/DeployPeriphery.s.sol --networks testnets",
|
|
23
|
+
"deploy:mainnets:periphery": "source ./.env && npx sphinx propose ./script/DeployPeriphery.s.sol --networks mainnets",
|
|
24
|
+
"deploy:testnets:usdc": "source ./.env && npx sphinx propose ./script/DeployUSDCFeeds.s.sol --networks testnets",
|
|
25
|
+
"deploy:mainnets:usdc": "source ./.env && npx sphinx propose ./script/DeployUSDCFeeds.s.sol --networks mainnets",
|
|
26
|
+
"artifacts": "source ./.env && npx sphinx artifacts --org-id 'ea165b21-7cdc-4d7b-be59-ecdd4c26bee4' --project-name 'nana-core-v6'"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@bananapus/permission-ids-v6": "^0.0.1",
|
|
30
|
+
"@chainlink/contracts": "^1.3.0",
|
|
31
|
+
"@openzeppelin/contracts": "^5.2.0",
|
|
32
|
+
"@prb/math": "^4.1.0",
|
|
33
|
+
"@uniswap/permit2": "github:Uniswap/permit2"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@sphinx-labs/plugins": "^0.33.2"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/remappings.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@sphinx-labs/contracts/=lib/sphinx/packages/contracts/contracts/foundry
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity 0.8.23;
|
|
3
|
+
|
|
4
|
+
import "@sphinx-labs/contracts/SphinxPlugin.sol";
|
|
5
|
+
import {Script, stdJson, VmSafe} from "forge-std/Script.sol";
|
|
6
|
+
import {CoreDeploymentLib} from "./helpers/CoreDeploymentLib.sol";
|
|
7
|
+
|
|
8
|
+
import {IPermit2} from "@uniswap/permit2/src/interfaces/IPermit2.sol";
|
|
9
|
+
import {JBPermissions} from "src/JBPermissions.sol";
|
|
10
|
+
import {JBProjects} from "src/JBProjects.sol";
|
|
11
|
+
import {JBPrices} from "src/JBPrices.sol";
|
|
12
|
+
import {JBRulesets} from "src/JBRulesets.sol";
|
|
13
|
+
import {JBDirectory} from "src/JBDirectory.sol";
|
|
14
|
+
import {JBERC20} from "src/JBERC20.sol";
|
|
15
|
+
import {JBTokens} from "src/JBTokens.sol";
|
|
16
|
+
import {JBSplits} from "src/JBSplits.sol";
|
|
17
|
+
import {JBFeelessAddresses} from "src/JBFeelessAddresses.sol";
|
|
18
|
+
import {JBFundAccessLimits} from "src/JBFundAccessLimits.sol";
|
|
19
|
+
import {JBController} from "src/JBController.sol";
|
|
20
|
+
import {JBTerminalStore} from "src/JBTerminalStore.sol";
|
|
21
|
+
import {JBMultiTerminal} from "src/JBMultiTerminal.sol";
|
|
22
|
+
|
|
23
|
+
import {ERC2771Forwarder} from "@openzeppelin/contracts/metatx/ERC2771Forwarder.sol";
|
|
24
|
+
|
|
25
|
+
contract Deploy is Script, Sphinx {
|
|
26
|
+
/// @notice The universal PERMIT2 address.
|
|
27
|
+
IPermit2 private constant _PERMIT2 = IPermit2(0x000000000022D473030F116dDEE9F6B43aC78BA3);
|
|
28
|
+
|
|
29
|
+
/// @notice The address that is allowed to forward calls to the terminal and controller on a users behalf.
|
|
30
|
+
string private constant TRUSTED_FORWARDER_NAME = "Juicebox";
|
|
31
|
+
address private TRUSTED_FORWARDER;
|
|
32
|
+
|
|
33
|
+
/// @notice The address that will manage the few privileged functions of the protocol.
|
|
34
|
+
address private MANAGER;
|
|
35
|
+
|
|
36
|
+
/// @notice The address that will own the fee-project.
|
|
37
|
+
address private FEE_PROJECT_OWNER;
|
|
38
|
+
|
|
39
|
+
/// @notice The nonce that gets used across all chains to sync deployment addresses and allow for new deployments of
|
|
40
|
+
/// the same bytecode.
|
|
41
|
+
uint256 private CORE_DEPLOYMENT_NONCE = 6;
|
|
42
|
+
|
|
43
|
+
function configureSphinx() public override {
|
|
44
|
+
sphinxConfig.projectName = "nana-core-v5";
|
|
45
|
+
sphinxConfig.mainnets = ["ethereum", "optimism", "base", "arbitrum"];
|
|
46
|
+
sphinxConfig.testnets = ["ethereum_sepolia", "optimism_sepolia", "base_sepolia", "arbitrum_sepolia"];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// @notice Deploys the protocol.
|
|
50
|
+
function run() public sphinx {
|
|
51
|
+
// Set the manager, this can be changed and won't affect deployment addresses.
|
|
52
|
+
MANAGER = safeAddress();
|
|
53
|
+
// Set the owner of the fee project to be the project multisig.
|
|
54
|
+
FEE_PROJECT_OWNER = safeAddress();
|
|
55
|
+
|
|
56
|
+
// Deploy the protocol.
|
|
57
|
+
deploy();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function deploy() public sphinx {
|
|
61
|
+
TRUSTED_FORWARDER =
|
|
62
|
+
address(new ERC2771Forwarder{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(TRUSTED_FORWARDER_NAME));
|
|
63
|
+
|
|
64
|
+
JBPermissions permissions =
|
|
65
|
+
new JBPermissions{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(TRUSTED_FORWARDER);
|
|
66
|
+
JBProjects projects = new JBProjects{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(
|
|
67
|
+
safeAddress(), safeAddress(), TRUSTED_FORWARDER
|
|
68
|
+
);
|
|
69
|
+
JBDirectory directory =
|
|
70
|
+
new JBDirectory{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(permissions, projects, safeAddress());
|
|
71
|
+
JBSplits splits = new JBSplits{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(directory);
|
|
72
|
+
JBRulesets rulesets = new JBRulesets{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(directory);
|
|
73
|
+
JBPrices prices = new JBPrices{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(
|
|
74
|
+
directory, permissions, projects, safeAddress(), TRUSTED_FORWARDER
|
|
75
|
+
);
|
|
76
|
+
JBTokens tokens = new JBTokens{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(
|
|
77
|
+
directory, new JBERC20{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}()
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
new JBFundAccessLimits{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(directory);
|
|
81
|
+
|
|
82
|
+
JBFeelessAddresses feeless =
|
|
83
|
+
new JBFeelessAddresses{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}(safeAddress());
|
|
84
|
+
|
|
85
|
+
new JBMultiTerminal{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}({
|
|
86
|
+
permissions: permissions,
|
|
87
|
+
projects: projects,
|
|
88
|
+
splits: splits,
|
|
89
|
+
store: new JBTerminalStore{salt: keccak256(abi.encode(CORE_DEPLOYMENT_NONCE))}({
|
|
90
|
+
directory: directory, rulesets: rulesets, prices: prices
|
|
91
|
+
}),
|
|
92
|
+
tokens: tokens,
|
|
93
|
+
feelessAddresses: feeless,
|
|
94
|
+
permit2: _PERMIT2,
|
|
95
|
+
trustedForwarder: TRUSTED_FORWARDER
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// If the manager is not the deployer we transfer all ownership to it.
|
|
99
|
+
if (MANAGER != safeAddress() && MANAGER != address(0)) {
|
|
100
|
+
directory.transferOwnership(MANAGER);
|
|
101
|
+
feeless.transferOwnership(MANAGER);
|
|
102
|
+
prices.transferOwnership(MANAGER);
|
|
103
|
+
projects.transferOwnership(MANAGER);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Transfer ownership to the fee project owner.
|
|
107
|
+
if (FEE_PROJECT_OWNER != safeAddress() && FEE_PROJECT_OWNER != address(0)) {
|
|
108
|
+
projects.safeTransferFrom(safeAddress(), FEE_PROJECT_OWNER, 1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|