@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,1472 @@
|
|
|
1
|
+
# JBMultiTerminal
|
|
2
|
+
[Git Source](https://github.com/Bananapus/nana-core/blob/2998dca2fbd2658e2c8791d6dc8348147d69e28e/src/JBMultiTerminal.sol)
|
|
3
|
+
|
|
4
|
+
**Inherits:**
|
|
5
|
+
[JBPermissioned](/src/abstract/JBPermissioned.sol/abstract.JBPermissioned.md), ERC2771Context, [IJBMultiTerminal](/src/interfaces/IJBMultiTerminal.sol/interface.IJBMultiTerminal.md)
|
|
6
|
+
|
|
7
|
+
`JBMultiTerminal` manages native/ERC-20 payments, cash outs, and surplus allowance usage for any number of
|
|
8
|
+
projects. Terminals are the entry point for operations involving inflows and outflows of funds.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## State Variables
|
|
12
|
+
### FEE
|
|
13
|
+
This terminal's fee (as a fraction out of `JBConstants.MAX_FEE`).
|
|
14
|
+
|
|
15
|
+
*Fees are charged on payouts to addresses and surplus allowance usage, as well as cash outs while the
|
|
16
|
+
cash out tax rate is less than 100%.*
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
```solidity
|
|
20
|
+
uint256 public constant override FEE = 25;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### _FEE_BENEFICIARY_PROJECT_ID
|
|
25
|
+
Project ID #1 receives fees. It should be the first project launched during the deployment process.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
```solidity
|
|
29
|
+
uint256 internal constant _FEE_BENEFICIARY_PROJECT_ID = 1;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### _FEE_HOLDING_SECONDS
|
|
34
|
+
The number of seconds fees can be held for.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
```solidity
|
|
38
|
+
uint256 internal constant _FEE_HOLDING_SECONDS = 2_419_200;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### DIRECTORY
|
|
43
|
+
The directory of terminals and controllers for PROJECTS.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
```solidity
|
|
47
|
+
IJBDirectory public immutable override DIRECTORY;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### FEELESS_ADDRESSES
|
|
52
|
+
The contract that stores addresses that shouldn't incur fees when being paid towards or from.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
```solidity
|
|
56
|
+
IJBFeelessAddresses public immutable override FEELESS_ADDRESSES;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### PERMIT2
|
|
61
|
+
The permit2 utility.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
```solidity
|
|
65
|
+
IPermit2 public immutable override PERMIT2;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### PROJECTS
|
|
70
|
+
Mints ERC-721s that represent project ownership and transfers.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
```solidity
|
|
74
|
+
IJBProjects public immutable override PROJECTS;
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### RULESETS
|
|
79
|
+
The contract storing and managing project rulesets.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
```solidity
|
|
83
|
+
IJBRulesets public immutable override RULESETS;
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### SPLITS
|
|
88
|
+
The contract that stores splits for each project.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
```solidity
|
|
92
|
+
IJBSplits public immutable override SPLITS;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### STORE
|
|
97
|
+
The contract that stores and manages the terminal's data.
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
```solidity
|
|
101
|
+
IJBTerminalStore public immutable override STORE;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### TOKENS
|
|
106
|
+
The contract storing and managing project rulesets.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
```solidity
|
|
110
|
+
IJBTokens public immutable override TOKENS;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### _accountingContextForTokenOf
|
|
115
|
+
Context describing how a token is accounted for by a project.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
```solidity
|
|
119
|
+
mapping(uint256 projectId => mapping(address token => JBAccountingContext)) internal _accountingContextForTokenOf;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### _accountingContextsOf
|
|
124
|
+
A list of tokens accepted by each project.
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
```solidity
|
|
128
|
+
mapping(uint256 projectId => JBAccountingContext[]) internal _accountingContextsOf;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### _heldFeesOf
|
|
133
|
+
Fees that are being held for each project.
|
|
134
|
+
|
|
135
|
+
*Projects can temporarily hold fees and unlock them later by adding funds to the project's balance.*
|
|
136
|
+
|
|
137
|
+
*Held fees can be processed at any time by this terminal's owner.*
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
```solidity
|
|
141
|
+
mapping(uint256 projectId => mapping(address token => JBFee[])) internal _heldFeesOf;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
### _nextHeldFeeIndexOf
|
|
146
|
+
The next index to use when processing a next held fee.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
```solidity
|
|
150
|
+
mapping(uint256 projectId => mapping(address token => uint256)) internal _nextHeldFeeIndexOf;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## Functions
|
|
155
|
+
### constructor
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
```solidity
|
|
159
|
+
constructor(
|
|
160
|
+
IJBFeelessAddresses feelessAddresses,
|
|
161
|
+
IJBPermissions permissions,
|
|
162
|
+
IJBProjects projects,
|
|
163
|
+
IJBSplits splits,
|
|
164
|
+
IJBTerminalStore store,
|
|
165
|
+
IJBTokens tokens,
|
|
166
|
+
IPermit2 permit2,
|
|
167
|
+
address trustedForwarder
|
|
168
|
+
)
|
|
169
|
+
JBPermissioned(permissions)
|
|
170
|
+
ERC2771Context(trustedForwarder);
|
|
171
|
+
```
|
|
172
|
+
**Parameters**
|
|
173
|
+
|
|
174
|
+
|Name|Type|Description|
|
|
175
|
+
|----|----|-----------|
|
|
176
|
+
|`feelessAddresses`|`IJBFeelessAddresses`|A contract that stores addresses that shouldn't incur fees when being paid towards or from.|
|
|
177
|
+
|`permissions`|`IJBPermissions`|A contract storing permissions.|
|
|
178
|
+
|`projects`|`IJBProjects`|A contract which mints ERC-721s that represent project ownership and transfers.|
|
|
179
|
+
|`splits`|`IJBSplits`|A contract that stores splits for each project.|
|
|
180
|
+
|`store`|`IJBTerminalStore`|A contract that stores the terminal's data.|
|
|
181
|
+
|`tokens`|`IJBTokens`||
|
|
182
|
+
|`permit2`|`IPermit2`|A permit2 utility.|
|
|
183
|
+
|`trustedForwarder`|`address`|A trusted forwarder of transactions to this contract.|
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### accountingContextForTokenOf
|
|
187
|
+
|
|
188
|
+
A project's accounting context for a token.
|
|
189
|
+
|
|
190
|
+
*See the `JBAccountingContext` struct for more information.*
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
```solidity
|
|
194
|
+
function accountingContextForTokenOf(
|
|
195
|
+
uint256 projectId,
|
|
196
|
+
address token
|
|
197
|
+
)
|
|
198
|
+
external
|
|
199
|
+
view
|
|
200
|
+
override
|
|
201
|
+
returns (JBAccountingContext memory);
|
|
202
|
+
```
|
|
203
|
+
**Parameters**
|
|
204
|
+
|
|
205
|
+
|Name|Type|Description|
|
|
206
|
+
|----|----|-----------|
|
|
207
|
+
|`projectId`|`uint256`|The ID of the project to get token accounting context of.|
|
|
208
|
+
|`token`|`address`|The token to check the accounting context of.|
|
|
209
|
+
|
|
210
|
+
**Returns**
|
|
211
|
+
|
|
212
|
+
|Name|Type|Description|
|
|
213
|
+
|----|----|-----------|
|
|
214
|
+
|`<none>`|`JBAccountingContext`|The token's accounting context for the token.|
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
### accountingContextsOf
|
|
218
|
+
|
|
219
|
+
The tokens accepted by a project.
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
```solidity
|
|
223
|
+
function accountingContextsOf(uint256 projectId) external view override returns (JBAccountingContext[] memory);
|
|
224
|
+
```
|
|
225
|
+
**Parameters**
|
|
226
|
+
|
|
227
|
+
|Name|Type|Description|
|
|
228
|
+
|----|----|-----------|
|
|
229
|
+
|`projectId`|`uint256`|The ID of the project to get the accepted tokens of.|
|
|
230
|
+
|
|
231
|
+
**Returns**
|
|
232
|
+
|
|
233
|
+
|Name|Type|Description|
|
|
234
|
+
|----|----|-----------|
|
|
235
|
+
|`<none>`|`JBAccountingContext[]`|tokenContexts The accounting contexts of the accepted tokens.|
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
### currentSurplusOf
|
|
239
|
+
|
|
240
|
+
Gets the total current surplus amount in this terminal for a project, in terms of a given currency.
|
|
241
|
+
|
|
242
|
+
*This total surplus only includes tokens that the project accepts (as returned by
|
|
243
|
+
`accountingContextsOf(...)`).*
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
```solidity
|
|
247
|
+
function currentSurplusOf(
|
|
248
|
+
uint256 projectId,
|
|
249
|
+
JBAccountingContext[] memory accountingContexts,
|
|
250
|
+
uint256 decimals,
|
|
251
|
+
uint256 currency
|
|
252
|
+
)
|
|
253
|
+
external
|
|
254
|
+
view
|
|
255
|
+
override
|
|
256
|
+
returns (uint256);
|
|
257
|
+
```
|
|
258
|
+
**Parameters**
|
|
259
|
+
|
|
260
|
+
|Name|Type|Description|
|
|
261
|
+
|----|----|-----------|
|
|
262
|
+
|`projectId`|`uint256`|The ID of the project to get the current total surplus of.|
|
|
263
|
+
|`accountingContexts`|`JBAccountingContext[]`|The accounting contexts to use to calculate the surplus. Pass an empty array to use all of the project's accounting contexts.|
|
|
264
|
+
|`decimals`|`uint256`|The number of decimals to include in the fixed point returned value.|
|
|
265
|
+
|`currency`|`uint256`|The currency to express the returned value in terms of.|
|
|
266
|
+
|
|
267
|
+
**Returns**
|
|
268
|
+
|
|
269
|
+
|Name|Type|Description|
|
|
270
|
+
|----|----|-----------|
|
|
271
|
+
|`<none>`|`uint256`|The current surplus amount the project has in this terminal, in terms of `currency` and with the specified number of decimals.|
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
### heldFeesOf
|
|
275
|
+
|
|
276
|
+
Fees that are being held for a project.
|
|
277
|
+
|
|
278
|
+
*Projects can temporarily hold fees and unlock them later by adding funds to the project's balance.*
|
|
279
|
+
|
|
280
|
+
*Held fees can be processed at any time by this terminal's owner.*
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
```solidity
|
|
284
|
+
function heldFeesOf(
|
|
285
|
+
uint256 projectId,
|
|
286
|
+
address token,
|
|
287
|
+
uint256 count
|
|
288
|
+
)
|
|
289
|
+
external
|
|
290
|
+
view
|
|
291
|
+
override
|
|
292
|
+
returns (JBFee[] memory heldFees);
|
|
293
|
+
```
|
|
294
|
+
**Parameters**
|
|
295
|
+
|
|
296
|
+
|Name|Type|Description|
|
|
297
|
+
|----|----|-----------|
|
|
298
|
+
|`projectId`|`uint256`|The ID of the project that is holding fees.|
|
|
299
|
+
|`token`|`address`|The token that the fees are held in.|
|
|
300
|
+
|`count`|`uint256`||
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
### supportsInterface
|
|
304
|
+
|
|
305
|
+
Indicates whether this contract adheres to the specified interface.
|
|
306
|
+
|
|
307
|
+
*See [IERC165-supportsInterface](/src/JBController.sol/contract.JBController.md#supportsinterface).*
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
```solidity
|
|
311
|
+
function supportsInterface(bytes4 interfaceId) public pure override returns (bool);
|
|
312
|
+
```
|
|
313
|
+
**Parameters**
|
|
314
|
+
|
|
315
|
+
|Name|Type|Description|
|
|
316
|
+
|----|----|-----------|
|
|
317
|
+
|`interfaceId`|`bytes4`|The ID of the interface to check for adherence to.|
|
|
318
|
+
|
|
319
|
+
**Returns**
|
|
320
|
+
|
|
321
|
+
|Name|Type|Description|
|
|
322
|
+
|----|----|-----------|
|
|
323
|
+
|`<none>`|`bool`|A flag indicating if the provided interface ID is supported.|
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
### _balanceOf
|
|
327
|
+
|
|
328
|
+
Checks this terminal's balance of a specific token.
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
```solidity
|
|
332
|
+
function _balanceOf(address token) internal view returns (uint256);
|
|
333
|
+
```
|
|
334
|
+
**Parameters**
|
|
335
|
+
|
|
336
|
+
|Name|Type|Description|
|
|
337
|
+
|----|----|-----------|
|
|
338
|
+
|`token`|`address`|The address of the token to get this terminal's balance of.|
|
|
339
|
+
|
|
340
|
+
**Returns**
|
|
341
|
+
|
|
342
|
+
|Name|Type|Description|
|
|
343
|
+
|----|----|-----------|
|
|
344
|
+
|`<none>`|`uint256`|This terminal's balance.|
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
### _contextSuffixLength
|
|
348
|
+
|
|
349
|
+
*`ERC-2771` specifies the context as being a single address (20 bytes).*
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
```solidity
|
|
353
|
+
function _contextSuffixLength() internal view override(ERC2771Context, Context) returns (uint256);
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### _controllerOf
|
|
357
|
+
|
|
358
|
+
Returns the current controller of a project.
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
```solidity
|
|
362
|
+
function _controllerOf(uint256 projectId) internal view returns (IJBController);
|
|
363
|
+
```
|
|
364
|
+
**Parameters**
|
|
365
|
+
|
|
366
|
+
|Name|Type|Description|
|
|
367
|
+
|----|----|-----------|
|
|
368
|
+
|`projectId`|`uint256`|The ID of the project to get the controller of.|
|
|
369
|
+
|
|
370
|
+
**Returns**
|
|
371
|
+
|
|
372
|
+
|Name|Type|Description|
|
|
373
|
+
|----|----|-----------|
|
|
374
|
+
|`<none>`|`IJBController`|controller The project's controller.|
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
### _isFeeless
|
|
378
|
+
|
|
379
|
+
Returns a flag indicating if interacting with an address should not incur fees.
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
```solidity
|
|
383
|
+
function _isFeeless(address addr) internal view returns (bool);
|
|
384
|
+
```
|
|
385
|
+
**Parameters**
|
|
386
|
+
|
|
387
|
+
|Name|Type|Description|
|
|
388
|
+
|----|----|-----------|
|
|
389
|
+
|`addr`|`address`|The address to check.|
|
|
390
|
+
|
|
391
|
+
**Returns**
|
|
392
|
+
|
|
393
|
+
|Name|Type|Description|
|
|
394
|
+
|----|----|-----------|
|
|
395
|
+
|`<none>`|`bool`|A flag indicating if the address should not incur fees.|
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
### _msgData
|
|
399
|
+
|
|
400
|
+
The calldata. Preferred to use over `msg.data`.
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
```solidity
|
|
404
|
+
function _msgData() internal view override(ERC2771Context, Context) returns (bytes calldata);
|
|
405
|
+
```
|
|
406
|
+
**Returns**
|
|
407
|
+
|
|
408
|
+
|Name|Type|Description|
|
|
409
|
+
|----|----|-----------|
|
|
410
|
+
|`<none>`|`bytes`|calldata The `msg.data` of this call.|
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
### _msgSender
|
|
414
|
+
|
|
415
|
+
The message's sender. Preferred to use over `msg.sender`.
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
```solidity
|
|
419
|
+
function _msgSender() internal view override(ERC2771Context, Context) returns (address sender);
|
|
420
|
+
```
|
|
421
|
+
**Returns**
|
|
422
|
+
|
|
423
|
+
|Name|Type|Description|
|
|
424
|
+
|----|----|-----------|
|
|
425
|
+
|`sender`|`address`|The address which sent this call.|
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
### _ownerOf
|
|
429
|
+
|
|
430
|
+
The owner of a project.
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
```solidity
|
|
434
|
+
function _ownerOf(uint256 projectId) internal view returns (address);
|
|
435
|
+
```
|
|
436
|
+
**Parameters**
|
|
437
|
+
|
|
438
|
+
|Name|Type|Description|
|
|
439
|
+
|----|----|-----------|
|
|
440
|
+
|`projectId`|`uint256`|The ID of the project to get the owner of.|
|
|
441
|
+
|
|
442
|
+
**Returns**
|
|
443
|
+
|
|
444
|
+
|Name|Type|Description|
|
|
445
|
+
|----|----|-----------|
|
|
446
|
+
|`<none>`|`address`|The owner of the project.|
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
### _primaryTerminalOf
|
|
450
|
+
|
|
451
|
+
The primary terminal of a project for a token.
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
```solidity
|
|
455
|
+
function _primaryTerminalOf(uint256 projectId, address token) internal view returns (IJBTerminal);
|
|
456
|
+
```
|
|
457
|
+
**Parameters**
|
|
458
|
+
|
|
459
|
+
|Name|Type|Description|
|
|
460
|
+
|----|----|-----------|
|
|
461
|
+
|`projectId`|`uint256`|The ID of the project to get the primary terminal of.|
|
|
462
|
+
|`token`|`address`|The token to get the primary terminal of.|
|
|
463
|
+
|
|
464
|
+
**Returns**
|
|
465
|
+
|
|
466
|
+
|Name|Type|Description|
|
|
467
|
+
|----|----|-----------|
|
|
468
|
+
|`<none>`|`IJBTerminal`|The primary terminal of the project for the token.|
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
### addAccountingContextsFor
|
|
472
|
+
|
|
473
|
+
Adds accounting contexts for a project to this terminal so the project can begin accepting the tokens in
|
|
474
|
+
those contexts.
|
|
475
|
+
|
|
476
|
+
*Only a project's owner, an operator with the `ADD_ACCOUNTING_CONTEXTS` permission from that owner, or a
|
|
477
|
+
project's controller can add accounting contexts for the project.*
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
```solidity
|
|
481
|
+
function addAccountingContextsFor(
|
|
482
|
+
uint256 projectId,
|
|
483
|
+
JBAccountingContext[] calldata accountingContexts
|
|
484
|
+
)
|
|
485
|
+
external
|
|
486
|
+
override;
|
|
487
|
+
```
|
|
488
|
+
**Parameters**
|
|
489
|
+
|
|
490
|
+
|Name|Type|Description|
|
|
491
|
+
|----|----|-----------|
|
|
492
|
+
|`projectId`|`uint256`|The ID of the project having to add accounting contexts for.|
|
|
493
|
+
|`accountingContexts`|`JBAccountingContext[]`|The accounting contexts to add.|
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
### addToBalanceOf
|
|
497
|
+
|
|
498
|
+
Adds funds to a project's balance without minting tokens.
|
|
499
|
+
|
|
500
|
+
*Adding to balance can unlock held fees if `shouldUnlockHeldFees` is true.*
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
```solidity
|
|
504
|
+
function addToBalanceOf(
|
|
505
|
+
uint256 projectId,
|
|
506
|
+
address token,
|
|
507
|
+
uint256 amount,
|
|
508
|
+
bool shouldReturnHeldFees,
|
|
509
|
+
string calldata memo,
|
|
510
|
+
bytes calldata metadata
|
|
511
|
+
)
|
|
512
|
+
external
|
|
513
|
+
payable
|
|
514
|
+
override;
|
|
515
|
+
```
|
|
516
|
+
**Parameters**
|
|
517
|
+
|
|
518
|
+
|Name|Type|Description|
|
|
519
|
+
|----|----|-----------|
|
|
520
|
+
|`projectId`|`uint256`|The ID of the project to add funds to the balance of.|
|
|
521
|
+
|`token`|`address`|The token being added to the balance.|
|
|
522
|
+
|`amount`|`uint256`|The amount of tokens to add to the balance, as a fixed point number with the same number of decimals as this terminal. If this is a native token terminal, this is ignored and `msg.value` is used instead.|
|
|
523
|
+
|`shouldReturnHeldFees`|`bool`|A flag indicating if held fees should be returned based on the amount being added.|
|
|
524
|
+
|`memo`|`string`|A memo to pass along to the emitted event.|
|
|
525
|
+
|`metadata`|`bytes`|Extra data to pass along to the emitted event.|
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
### cashOutTokensOf
|
|
529
|
+
|
|
530
|
+
Holders can cash out a project's tokens to reclaim some of that project's surplus tokens, or to trigger
|
|
531
|
+
rules determined by the current ruleset's data hook and cash out hook.
|
|
532
|
+
|
|
533
|
+
*Only a token's holder or an operator with the `CASH_OUT_TOKENS` permission from that holder can cash out
|
|
534
|
+
those tokens.*
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
```solidity
|
|
538
|
+
function cashOutTokensOf(
|
|
539
|
+
address holder,
|
|
540
|
+
uint256 projectId,
|
|
541
|
+
uint256 cashOutCount,
|
|
542
|
+
address tokenToReclaim,
|
|
543
|
+
uint256 minTokensReclaimed,
|
|
544
|
+
address payable beneficiary,
|
|
545
|
+
bytes calldata metadata
|
|
546
|
+
)
|
|
547
|
+
external
|
|
548
|
+
override
|
|
549
|
+
returns (uint256 reclaimAmount);
|
|
550
|
+
```
|
|
551
|
+
**Parameters**
|
|
552
|
+
|
|
553
|
+
|Name|Type|Description|
|
|
554
|
+
|----|----|-----------|
|
|
555
|
+
|`holder`|`address`|The account whose tokens are being cashed out.|
|
|
556
|
+
|`projectId`|`uint256`|The ID of the project the project tokens belong to.|
|
|
557
|
+
|`cashOutCount`|`uint256`|The number of project tokens to cash out, as a fixed point number with 18 decimals.|
|
|
558
|
+
|`tokenToReclaim`|`address`|The token being reclaimed.|
|
|
559
|
+
|`minTokensReclaimed`|`uint256`|The minimum number of terminal tokens expected in return, as a fixed point number with the same number of decimals as this terminal. If the amount of tokens minted for the beneficiary would be less than this amount, the cash out is reverted.|
|
|
560
|
+
|`beneficiary`|`address payable`|The address to send the cashed out terminal tokens to, and to pass along to the ruleset's data hook and cash out hook if applicable.|
|
|
561
|
+
|`metadata`|`bytes`|Bytes to send along to the emitted event, as well as the data hook and cash out hook if applicable.|
|
|
562
|
+
|
|
563
|
+
**Returns**
|
|
564
|
+
|
|
565
|
+
|Name|Type|Description|
|
|
566
|
+
|----|----|-----------|
|
|
567
|
+
|`reclaimAmount`|`uint256`|The amount of terminal tokens that the project tokens were cashed out for, as a fixed point number with 18 decimals.|
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
### executePayout
|
|
571
|
+
|
|
572
|
+
Executes a payout to a split.
|
|
573
|
+
|
|
574
|
+
*Only accepts calls from this terminal itself.*
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
```solidity
|
|
578
|
+
function executePayout(
|
|
579
|
+
JBSplit calldata split,
|
|
580
|
+
uint256 projectId,
|
|
581
|
+
address token,
|
|
582
|
+
uint256 amount,
|
|
583
|
+
address originalMessageSender
|
|
584
|
+
)
|
|
585
|
+
external
|
|
586
|
+
returns (uint256 netPayoutAmount);
|
|
587
|
+
```
|
|
588
|
+
**Parameters**
|
|
589
|
+
|
|
590
|
+
|Name|Type|Description|
|
|
591
|
+
|----|----|-----------|
|
|
592
|
+
|`split`|`JBSplit`|The split to pay.|
|
|
593
|
+
|`projectId`|`uint256`|The ID of the project the split belongs to.|
|
|
594
|
+
|`token`|`address`|The address of the token being paid to the split.|
|
|
595
|
+
|`amount`|`uint256`|The total amount being paid to the split, as a fixed point number with the same number of decimals as this terminal.|
|
|
596
|
+
|`originalMessageSender`|`address`||
|
|
597
|
+
|
|
598
|
+
**Returns**
|
|
599
|
+
|
|
600
|
+
|Name|Type|Description|
|
|
601
|
+
|----|----|-----------|
|
|
602
|
+
|`netPayoutAmount`|`uint256`|The amount sent to the split after subtracting fees.|
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
### executeProcessFee
|
|
606
|
+
|
|
607
|
+
Process a specified amount of fees for a project.
|
|
608
|
+
|
|
609
|
+
*Only accepts calls from this terminal itself.*
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
```solidity
|
|
613
|
+
function executeProcessFee(
|
|
614
|
+
uint256 projectId,
|
|
615
|
+
address token,
|
|
616
|
+
uint256 amount,
|
|
617
|
+
address beneficiary,
|
|
618
|
+
IJBTerminal feeTerminal
|
|
619
|
+
)
|
|
620
|
+
external;
|
|
621
|
+
```
|
|
622
|
+
**Parameters**
|
|
623
|
+
|
|
624
|
+
|Name|Type|Description|
|
|
625
|
+
|----|----|-----------|
|
|
626
|
+
|`projectId`|`uint256`|The ID of the project paying the fee.|
|
|
627
|
+
|`token`|`address`|The token the fee is being paid in.|
|
|
628
|
+
|`amount`|`uint256`|The fee amount, as a fixed point number with 18 decimals.|
|
|
629
|
+
|`beneficiary`|`address`|The address to mint tokens to (from the project which receives fees), and pass along to the ruleset's data hook and pay hook if applicable.|
|
|
630
|
+
|`feeTerminal`|`IJBTerminal`|The terminal that'll receive the fees.|
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
### executeTransferTo
|
|
634
|
+
|
|
635
|
+
Transfer funds to an address.
|
|
636
|
+
|
|
637
|
+
*Only accepts calls from this terminal itself.*
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
```solidity
|
|
641
|
+
function executeTransferTo(address payable addr, address token, uint256 amount) external;
|
|
642
|
+
```
|
|
643
|
+
**Parameters**
|
|
644
|
+
|
|
645
|
+
|Name|Type|Description|
|
|
646
|
+
|----|----|-----------|
|
|
647
|
+
|`addr`|`address payable`|The address to transfer funds to.|
|
|
648
|
+
|`token`|`address`|The token to transfer.|
|
|
649
|
+
|`amount`|`uint256`|The amount of tokens to transfer.|
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
### migrateBalanceOf
|
|
653
|
+
|
|
654
|
+
Migrate a project's funds and operations to a new terminal that accepts the same token type.
|
|
655
|
+
|
|
656
|
+
*Only a project's owner or an operator with the `MIGRATE_TERMINAL` permission from that owner can migrate
|
|
657
|
+
the project's terminal.*
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
```solidity
|
|
661
|
+
function migrateBalanceOf(
|
|
662
|
+
uint256 projectId,
|
|
663
|
+
address token,
|
|
664
|
+
IJBTerminal to
|
|
665
|
+
)
|
|
666
|
+
external
|
|
667
|
+
override
|
|
668
|
+
returns (uint256 balance);
|
|
669
|
+
```
|
|
670
|
+
**Parameters**
|
|
671
|
+
|
|
672
|
+
|Name|Type|Description|
|
|
673
|
+
|----|----|-----------|
|
|
674
|
+
|`projectId`|`uint256`|The ID of the project being migrated.|
|
|
675
|
+
|`token`|`address`|The address of the token being migrated.|
|
|
676
|
+
|`to`|`IJBTerminal`|The terminal contract being migrated to, which will receive the project's funds and operations.|
|
|
677
|
+
|
|
678
|
+
**Returns**
|
|
679
|
+
|
|
680
|
+
|Name|Type|Description|
|
|
681
|
+
|----|----|-----------|
|
|
682
|
+
|`balance`|`uint256`|The amount of funds that were migrated, as a fixed point number with the same amount of decimals as this terminal.|
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
### pay
|
|
686
|
+
|
|
687
|
+
Pay a project with tokens.
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
```solidity
|
|
691
|
+
function pay(
|
|
692
|
+
uint256 projectId,
|
|
693
|
+
address token,
|
|
694
|
+
uint256 amount,
|
|
695
|
+
address beneficiary,
|
|
696
|
+
uint256 minReturnedTokens,
|
|
697
|
+
string calldata memo,
|
|
698
|
+
bytes calldata metadata
|
|
699
|
+
)
|
|
700
|
+
external
|
|
701
|
+
payable
|
|
702
|
+
override
|
|
703
|
+
returns (uint256 beneficiaryTokenCount);
|
|
704
|
+
```
|
|
705
|
+
**Parameters**
|
|
706
|
+
|
|
707
|
+
|Name|Type|Description|
|
|
708
|
+
|----|----|-----------|
|
|
709
|
+
|`projectId`|`uint256`|The ID of the project being paid.|
|
|
710
|
+
|`token`|`address`|The token being paid.|
|
|
711
|
+
|`amount`|`uint256`|The amount of terminal tokens being received, as a fixed point number with the same number of decimals as this terminal. If this terminal's token is native, this is ignored and `msg.value` is used in its place.|
|
|
712
|
+
|`beneficiary`|`address`|The address to mint tokens to, and pass along to the ruleset's data hook and pay hook if applicable.|
|
|
713
|
+
|`minReturnedTokens`|`uint256`|The minimum number of project tokens expected in return for this payment, as a fixed point number with the same number of decimals as this terminal. If the amount of tokens minted for the beneficiary would be less than this amount, the payment is reverted.|
|
|
714
|
+
|`memo`|`string`|A memo to pass along to the emitted event.|
|
|
715
|
+
|`metadata`|`bytes`|Bytes to pass along to the emitted event, as well as the data hook and pay hook if applicable.|
|
|
716
|
+
|
|
717
|
+
**Returns**
|
|
718
|
+
|
|
719
|
+
|Name|Type|Description|
|
|
720
|
+
|----|----|-----------|
|
|
721
|
+
|`beneficiaryTokenCount`|`uint256`|The number of tokens minted to the beneficiary, as a fixed point number with 18 decimals.|
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
### processHeldFeesOf
|
|
725
|
+
|
|
726
|
+
Process any fees that are being held for the project.
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
```solidity
|
|
730
|
+
function processHeldFeesOf(uint256 projectId, address token, uint256 count) external override;
|
|
731
|
+
```
|
|
732
|
+
**Parameters**
|
|
733
|
+
|
|
734
|
+
|Name|Type|Description|
|
|
735
|
+
|----|----|-----------|
|
|
736
|
+
|`projectId`|`uint256`|The ID of the project to process held fees for.|
|
|
737
|
+
|`token`|`address`|The token to process held fees for.|
|
|
738
|
+
|`count`|`uint256`|The number of fees to process.|
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
### sendPayoutsOf
|
|
742
|
+
|
|
743
|
+
Sends payouts to a project's current payout split group, according to its ruleset, up to its current
|
|
744
|
+
payout limit.
|
|
745
|
+
|
|
746
|
+
*If the percentages of the splits in the project's payout split group do not add up to 100%, the remainder
|
|
747
|
+
is sent to the project's owner.*
|
|
748
|
+
|
|
749
|
+
*Anyone can send payouts on a project's behalf. Projects can include a wildcard split (a split with no
|
|
750
|
+
`hook`, `projectId`, or `beneficiary`) to send funds to the `_msgSender()` which calls this function. This can
|
|
751
|
+
be used to incentivize calling this function.*
|
|
752
|
+
|
|
753
|
+
*payouts sent to addresses which aren't feeless incur the protocol fee.*
|
|
754
|
+
|
|
755
|
+
*Payouts a projects don't incur fees if its terminal is feeless.*
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
```solidity
|
|
759
|
+
function sendPayoutsOf(
|
|
760
|
+
uint256 projectId,
|
|
761
|
+
address token,
|
|
762
|
+
uint256 amount,
|
|
763
|
+
uint256 currency,
|
|
764
|
+
uint256 minTokensPaidOut
|
|
765
|
+
)
|
|
766
|
+
external
|
|
767
|
+
override
|
|
768
|
+
returns (uint256 amountPaidOut);
|
|
769
|
+
```
|
|
770
|
+
**Parameters**
|
|
771
|
+
|
|
772
|
+
|Name|Type|Description|
|
|
773
|
+
|----|----|-----------|
|
|
774
|
+
|`projectId`|`uint256`|The ID of the project having its payouts sent.|
|
|
775
|
+
|`token`|`address`|The token being sent.|
|
|
776
|
+
|`amount`|`uint256`|The total number of terminal tokens to send, as a fixed point number with same number of decimals as this terminal.|
|
|
777
|
+
|`currency`|`uint256`|The expected currency of the payouts being sent. Must match the currency of one of the project's current ruleset's payout limits.|
|
|
778
|
+
|`minTokensPaidOut`|`uint256`|The minimum number of terminal tokens that the `amount` should be worth (if expressed in terms of this terminal's currency), as a fixed point number with the same number of decimals as this terminal. If the amount of tokens paid out would be less than this amount, the send is reverted.|
|
|
779
|
+
|
|
780
|
+
**Returns**
|
|
781
|
+
|
|
782
|
+
|Name|Type|Description|
|
|
783
|
+
|----|----|-----------|
|
|
784
|
+
|`amountPaidOut`|`uint256`|The total amount paid out.|
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
### useAllowanceOf
|
|
788
|
+
|
|
789
|
+
Allows a project to pay out funds from its surplus up to the current surplus allowance.
|
|
790
|
+
|
|
791
|
+
*Only a project's owner or an operator with the `USE_ALLOWANCE` permission from that owner can use the
|
|
792
|
+
surplus allowance.*
|
|
793
|
+
|
|
794
|
+
*Incurs the protocol fee unless the caller is a feeless address.*
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
```solidity
|
|
798
|
+
function useAllowanceOf(
|
|
799
|
+
uint256 projectId,
|
|
800
|
+
address token,
|
|
801
|
+
uint256 amount,
|
|
802
|
+
uint256 currency,
|
|
803
|
+
uint256 minTokensPaidOut,
|
|
804
|
+
address payable beneficiary,
|
|
805
|
+
address payable feeBeneficiary,
|
|
806
|
+
string calldata memo
|
|
807
|
+
)
|
|
808
|
+
external
|
|
809
|
+
override
|
|
810
|
+
returns (uint256 netAmountPaidOut);
|
|
811
|
+
```
|
|
812
|
+
**Parameters**
|
|
813
|
+
|
|
814
|
+
|Name|Type|Description|
|
|
815
|
+
|----|----|-----------|
|
|
816
|
+
|`projectId`|`uint256`|The ID of the project to use the surplus allowance of.|
|
|
817
|
+
|`token`|`address`|The token being paid out from the surplus.|
|
|
818
|
+
|`amount`|`uint256`|The amount of terminal tokens to use from the project's current surplus allowance, as a fixed point number with the same amount of decimals as this terminal.|
|
|
819
|
+
|`currency`|`uint256`|The expected currency of the amount being paid out. Must match the currency of one of the project's current ruleset's surplus allowances.|
|
|
820
|
+
|`minTokensPaidOut`|`uint256`|The minimum number of terminal tokens that should be returned from the surplus allowance (excluding fees), as a fixed point number with 18 decimals. If the amount of surplus used would be less than this amount, the transaction is reverted.|
|
|
821
|
+
|`beneficiary`|`address payable`|The address to send the surplus funds to.|
|
|
822
|
+
|`feeBeneficiary`|`address payable`|The address to send the tokens resulting from paying the fee.|
|
|
823
|
+
|`memo`|`string`|A memo to pass along to the emitted event.|
|
|
824
|
+
|
|
825
|
+
**Returns**
|
|
826
|
+
|
|
827
|
+
|Name|Type|Description|
|
|
828
|
+
|----|----|-----------|
|
|
829
|
+
|`netAmountPaidOut`|`uint256`|The number of tokens that were sent to the beneficiary, as a fixed point number with the same amount of decimals as the terminal.|
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
### _acceptFundsFor
|
|
833
|
+
|
|
834
|
+
Accepts an incoming token.
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
```solidity
|
|
838
|
+
function _acceptFundsFor(
|
|
839
|
+
uint256 projectId,
|
|
840
|
+
address token,
|
|
841
|
+
uint256 amount,
|
|
842
|
+
bytes calldata metadata
|
|
843
|
+
)
|
|
844
|
+
internal
|
|
845
|
+
returns (uint256);
|
|
846
|
+
```
|
|
847
|
+
**Parameters**
|
|
848
|
+
|
|
849
|
+
|Name|Type|Description|
|
|
850
|
+
|----|----|-----------|
|
|
851
|
+
|`projectId`|`uint256`|The ID of the project that the transfer is being accepted for.|
|
|
852
|
+
|`token`|`address`|The token being accepted.|
|
|
853
|
+
|`amount`|`uint256`|The number of tokens being accepted.|
|
|
854
|
+
|`metadata`|`bytes`|The metadata in which permit2 context is provided.|
|
|
855
|
+
|
|
856
|
+
**Returns**
|
|
857
|
+
|
|
858
|
+
|Name|Type|Description|
|
|
859
|
+
|----|----|-----------|
|
|
860
|
+
|`<none>`|`uint256`|amount The number of tokens which have been accepted.|
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
### _addToBalanceOf
|
|
864
|
+
|
|
865
|
+
Adds funds to a project's balance without minting tokens.
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
```solidity
|
|
869
|
+
function _addToBalanceOf(
|
|
870
|
+
uint256 projectId,
|
|
871
|
+
address token,
|
|
872
|
+
uint256 amount,
|
|
873
|
+
bool shouldReturnHeldFees,
|
|
874
|
+
string memory memo,
|
|
875
|
+
bytes memory metadata
|
|
876
|
+
)
|
|
877
|
+
internal;
|
|
878
|
+
```
|
|
879
|
+
**Parameters**
|
|
880
|
+
|
|
881
|
+
|Name|Type|Description|
|
|
882
|
+
|----|----|-----------|
|
|
883
|
+
|`projectId`|`uint256`|The ID of the project to add funds to the balance of.|
|
|
884
|
+
|`token`|`address`|The address of the token being added to the project's balance.|
|
|
885
|
+
|`amount`|`uint256`|The amount of tokens to add as a fixed point number with the same number of decimals as this terminal. If this is a native token terminal, this is ignored and `msg.value` is used instead.|
|
|
886
|
+
|`shouldReturnHeldFees`|`bool`|A flag indicating if held fees should be returned based on the amount being added.|
|
|
887
|
+
|`memo`|`string`|A memo to pass along to the emitted event.|
|
|
888
|
+
|`metadata`|`bytes`|Extra data to pass along to the emitted event.|
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
### _beforeTransferTo
|
|
892
|
+
|
|
893
|
+
Logic to be triggered before transferring tokens from this terminal.
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
```solidity
|
|
897
|
+
function _beforeTransferTo(address to, address token, uint256 amount) internal returns (uint256);
|
|
898
|
+
```
|
|
899
|
+
**Parameters**
|
|
900
|
+
|
|
901
|
+
|Name|Type|Description|
|
|
902
|
+
|----|----|-----------|
|
|
903
|
+
|`to`|`address`|The address the transfer is going to.|
|
|
904
|
+
|`token`|`address`|The token being transferred.|
|
|
905
|
+
|`amount`|`uint256`|The number of tokens being transferred, as a fixed point number with the same number of decimals as this terminal.|
|
|
906
|
+
|
|
907
|
+
**Returns**
|
|
908
|
+
|
|
909
|
+
|Name|Type|Description|
|
|
910
|
+
|----|----|-----------|
|
|
911
|
+
|`<none>`|`uint256`|payValue The value to attach to the transaction being sent.|
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
### _cashOutTokensOf
|
|
915
|
+
|
|
916
|
+
Holders can cash out their tokens to reclaim some of a project's surplus, or to trigger rules determined
|
|
917
|
+
by
|
|
918
|
+
the project's current ruleset's data hook.
|
|
919
|
+
|
|
920
|
+
*Only a token holder or an operator with the `CASH_OUT_TOKENS` permission from that holder can cash out
|
|
921
|
+
those
|
|
922
|
+
tokens.*
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
```solidity
|
|
926
|
+
function _cashOutTokensOf(
|
|
927
|
+
address holder,
|
|
928
|
+
uint256 projectId,
|
|
929
|
+
uint256 cashOutCount,
|
|
930
|
+
address tokenToReclaim,
|
|
931
|
+
address payable beneficiary,
|
|
932
|
+
bytes memory metadata
|
|
933
|
+
)
|
|
934
|
+
internal
|
|
935
|
+
returns (uint256 reclaimAmount);
|
|
936
|
+
```
|
|
937
|
+
**Parameters**
|
|
938
|
+
|
|
939
|
+
|Name|Type|Description|
|
|
940
|
+
|----|----|-----------|
|
|
941
|
+
|`holder`|`address`|The account cashing out tokens.|
|
|
942
|
+
|`projectId`|`uint256`|The ID of the project whose tokens are being cashed out.|
|
|
943
|
+
|`cashOutCount`|`uint256`|The number of project tokens to cash out, as a fixed point number with 18 decimals.|
|
|
944
|
+
|`tokenToReclaim`|`address`|The address of the token which is being cashed out.|
|
|
945
|
+
|`beneficiary`|`address payable`|The address to send the reclaimed terminal tokens to.|
|
|
946
|
+
|`metadata`|`bytes`|Bytes to send along to the emitted event, as well as the data hook and cash out hook if applicable.|
|
|
947
|
+
|
|
948
|
+
**Returns**
|
|
949
|
+
|
|
950
|
+
|Name|Type|Description|
|
|
951
|
+
|----|----|-----------|
|
|
952
|
+
|`reclaimAmount`|`uint256`|The number of terminal tokens reclaimed for the `beneficiary`, as a fixed point number with 18 decimals.|
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
### _efficientAddToBalance
|
|
956
|
+
|
|
957
|
+
Fund a project either by calling this terminal's internal `addToBalance` function or by calling the
|
|
958
|
+
recipient
|
|
959
|
+
terminal's `addToBalance` function.
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
```solidity
|
|
963
|
+
function _efficientAddToBalance(
|
|
964
|
+
IJBTerminal terminal,
|
|
965
|
+
uint256 projectId,
|
|
966
|
+
address token,
|
|
967
|
+
uint256 amount,
|
|
968
|
+
bytes memory metadata
|
|
969
|
+
)
|
|
970
|
+
internal;
|
|
971
|
+
```
|
|
972
|
+
**Parameters**
|
|
973
|
+
|
|
974
|
+
|Name|Type|Description|
|
|
975
|
+
|----|----|-----------|
|
|
976
|
+
|`terminal`|`IJBTerminal`|The terminal on which the project is expecting to receive funds.|
|
|
977
|
+
|`projectId`|`uint256`|The ID of the project being funded.|
|
|
978
|
+
|`token`|`address`|The token being used.|
|
|
979
|
+
|`amount`|`uint256`|The amount being funded, as a fixed point number with the amount of decimals that the terminal's accounting context specifies.|
|
|
980
|
+
|`metadata`|`bytes`|Additional metadata to include with the payment.|
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
### _efficientPay
|
|
984
|
+
|
|
985
|
+
Pay a project either by calling this terminal's internal `pay` function or by calling the recipient
|
|
986
|
+
terminal's `pay` function.
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
```solidity
|
|
990
|
+
function _efficientPay(
|
|
991
|
+
IJBTerminal terminal,
|
|
992
|
+
uint256 projectId,
|
|
993
|
+
address token,
|
|
994
|
+
uint256 amount,
|
|
995
|
+
address beneficiary,
|
|
996
|
+
bytes memory metadata
|
|
997
|
+
)
|
|
998
|
+
internal;
|
|
999
|
+
```
|
|
1000
|
+
**Parameters**
|
|
1001
|
+
|
|
1002
|
+
|Name|Type|Description|
|
|
1003
|
+
|----|----|-----------|
|
|
1004
|
+
|`terminal`|`IJBTerminal`|The terminal on which the project is expecting to receive payments.|
|
|
1005
|
+
|`projectId`|`uint256`|The ID of the project being paid.|
|
|
1006
|
+
|`token`|`address`|The token being paid in.|
|
|
1007
|
+
|`amount`|`uint256`|The amount being paid, as a fixed point number with the amount of decimals that the terminal's accounting context specifies.|
|
|
1008
|
+
|`beneficiary`|`address`|The address to receive any platform tokens minted.|
|
|
1009
|
+
|`metadata`|`bytes`|Additional metadata to include with the payment.|
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
### _fulfillPayHookSpecificationsFor
|
|
1013
|
+
|
|
1014
|
+
Fulfills a list of pay hook specifications.
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
```solidity
|
|
1018
|
+
function _fulfillPayHookSpecificationsFor(
|
|
1019
|
+
uint256 projectId,
|
|
1020
|
+
JBPayHookSpecification[] memory specifications,
|
|
1021
|
+
JBTokenAmount memory tokenAmount,
|
|
1022
|
+
address payer,
|
|
1023
|
+
JBRuleset memory ruleset,
|
|
1024
|
+
address beneficiary,
|
|
1025
|
+
uint256 newlyIssuedTokenCount,
|
|
1026
|
+
bytes memory metadata
|
|
1027
|
+
)
|
|
1028
|
+
internal;
|
|
1029
|
+
```
|
|
1030
|
+
**Parameters**
|
|
1031
|
+
|
|
1032
|
+
|Name|Type|Description|
|
|
1033
|
+
|----|----|-----------|
|
|
1034
|
+
|`projectId`|`uint256`|The ID of the project being paid.|
|
|
1035
|
+
|`specifications`|`JBPayHookSpecification[]`|The pay hook specifications to be fulfilled.|
|
|
1036
|
+
|`tokenAmount`|`JBTokenAmount`|The amount of tokens that the project was paid.|
|
|
1037
|
+
|`payer`|`address`|The address that sent the payment.|
|
|
1038
|
+
|`ruleset`|`JBRuleset`|The ruleset the payment is being accepted during.|
|
|
1039
|
+
|`beneficiary`|`address`|The address which will receive any tokens that the payment yields.|
|
|
1040
|
+
|`newlyIssuedTokenCount`|`uint256`|The amount of tokens that are being issued and sent to the beneificary.|
|
|
1041
|
+
|`metadata`|`bytes`|Bytes to send along to the emitted event and pay hooks as applicable.|
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
### _fulfillCashOutHookSpecificationsFor
|
|
1045
|
+
|
|
1046
|
+
Fulfills a list of cash out hook specifications.
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
```solidity
|
|
1050
|
+
function _fulfillCashOutHookSpecificationsFor(
|
|
1051
|
+
uint256 projectId,
|
|
1052
|
+
JBTokenAmount memory beneficiaryReclaimAmount,
|
|
1053
|
+
address holder,
|
|
1054
|
+
uint256 cashOutCount,
|
|
1055
|
+
bytes memory metadata,
|
|
1056
|
+
JBRuleset memory ruleset,
|
|
1057
|
+
uint256 cashOutTaxRate,
|
|
1058
|
+
address payable beneficiary,
|
|
1059
|
+
JBCashOutHookSpecification[] memory specifications
|
|
1060
|
+
)
|
|
1061
|
+
internal
|
|
1062
|
+
returns (uint256 amountEligibleForFees);
|
|
1063
|
+
```
|
|
1064
|
+
**Parameters**
|
|
1065
|
+
|
|
1066
|
+
|Name|Type|Description|
|
|
1067
|
+
|----|----|-----------|
|
|
1068
|
+
|`projectId`|`uint256`|The ID of the project being cashed out from.|
|
|
1069
|
+
|`beneficiaryReclaimAmount`|`JBTokenAmount`|The number of tokens that are being cashed out from the project.|
|
|
1070
|
+
|`holder`|`address`|The address that holds the tokens being cashed out.|
|
|
1071
|
+
|`cashOutCount`|`uint256`|The number of tokens being cashed out.|
|
|
1072
|
+
|`metadata`|`bytes`|Bytes to send along to the emitted event and cash out hooks as applicable.|
|
|
1073
|
+
|`ruleset`|`JBRuleset`|The ruleset the cash out is being made during as a `JBRuleset` struct.|
|
|
1074
|
+
|`cashOutTaxRate`|`uint256`|The cash out tax rate influencing the reclaim amount.|
|
|
1075
|
+
|`beneficiary`|`address payable`|The address which will receive any terminal tokens that are cashed out.|
|
|
1076
|
+
|`specifications`|`JBCashOutHookSpecification[]`|The hook specifications being fulfilled.|
|
|
1077
|
+
|
|
1078
|
+
**Returns**
|
|
1079
|
+
|
|
1080
|
+
|Name|Type|Description|
|
|
1081
|
+
|----|----|-----------|
|
|
1082
|
+
|`amountEligibleForFees`|`uint256`|The amount of funds which were allocated to cash out hooks and are eligible for fees.|
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
### _pay
|
|
1086
|
+
|
|
1087
|
+
Pay a project with tokens.
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
```solidity
|
|
1091
|
+
function _pay(
|
|
1092
|
+
uint256 projectId,
|
|
1093
|
+
address token,
|
|
1094
|
+
uint256 amount,
|
|
1095
|
+
address payer,
|
|
1096
|
+
address beneficiary,
|
|
1097
|
+
string memory memo,
|
|
1098
|
+
bytes memory metadata
|
|
1099
|
+
)
|
|
1100
|
+
internal;
|
|
1101
|
+
```
|
|
1102
|
+
**Parameters**
|
|
1103
|
+
|
|
1104
|
+
|Name|Type|Description|
|
|
1105
|
+
|----|----|-----------|
|
|
1106
|
+
|`projectId`|`uint256`|The ID of the project being paid.|
|
|
1107
|
+
|`token`|`address`|The address of the token which the project is being paid with.|
|
|
1108
|
+
|`amount`|`uint256`|The amount of terminal tokens being received, as a fixed point number with the same number of decimals as this terminal. If this terminal's token is the native token, `amount` is ignored and `msg.value` is used in its place.|
|
|
1109
|
+
|`payer`|`address`|The address making the payment.|
|
|
1110
|
+
|`beneficiary`|`address`|The address to mint tokens to, and pass along to the ruleset's data hook and pay hook if applicable.|
|
|
1111
|
+
|`memo`|`string`|A memo to pass along to the emitted event.|
|
|
1112
|
+
|`metadata`|`bytes`|Bytes to send along to the emitted event, as well as the data hook and pay hook if applicable.|
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
### _processFee
|
|
1116
|
+
|
|
1117
|
+
Process a fee of the specified amount from a project.
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
```solidity
|
|
1121
|
+
function _processFee(
|
|
1122
|
+
uint256 projectId,
|
|
1123
|
+
address token,
|
|
1124
|
+
uint256 amount,
|
|
1125
|
+
address beneficiary,
|
|
1126
|
+
IJBTerminal feeTerminal,
|
|
1127
|
+
bool wasHeld
|
|
1128
|
+
)
|
|
1129
|
+
internal;
|
|
1130
|
+
```
|
|
1131
|
+
**Parameters**
|
|
1132
|
+
|
|
1133
|
+
|Name|Type|Description|
|
|
1134
|
+
|----|----|-----------|
|
|
1135
|
+
|`projectId`|`uint256`|The ID of the project paying the fee.|
|
|
1136
|
+
|`token`|`address`|The token the fee is being paid in.|
|
|
1137
|
+
|`amount`|`uint256`|The fee amount, as a fixed point number with 18 decimals.|
|
|
1138
|
+
|`beneficiary`|`address`|The address which will receive any platform tokens minted.|
|
|
1139
|
+
|`feeTerminal`|`IJBTerminal`|The terminal that'll receive the fee.|
|
|
1140
|
+
|`wasHeld`|`bool`|A flag indicating if the fee being processed was being held by this terminal.|
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
### _recordAddedBalanceFor
|
|
1144
|
+
|
|
1145
|
+
Records an added balance for a project.
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
```solidity
|
|
1149
|
+
function _recordAddedBalanceFor(uint256 projectId, address token, uint256 amount) internal;
|
|
1150
|
+
```
|
|
1151
|
+
**Parameters**
|
|
1152
|
+
|
|
1153
|
+
|Name|Type|Description|
|
|
1154
|
+
|----|----|-----------|
|
|
1155
|
+
|`projectId`|`uint256`|The ID of the project to record the added balance for.|
|
|
1156
|
+
|`token`|`address`|The token to record the added balance for.|
|
|
1157
|
+
|`amount`|`uint256`|The amount of the token to record, as a fixed point number with the same number of decimals as this terminal.|
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
### _returnHeldFees
|
|
1161
|
+
|
|
1162
|
+
Returns held fees to the project who paid them based on the specified amount.
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
```solidity
|
|
1166
|
+
function _returnHeldFees(uint256 projectId, address token, uint256 amount) internal returns (uint256 returnedFees);
|
|
1167
|
+
```
|
|
1168
|
+
**Parameters**
|
|
1169
|
+
|
|
1170
|
+
|Name|Type|Description|
|
|
1171
|
+
|----|----|-----------|
|
|
1172
|
+
|`projectId`|`uint256`|The project held fees are being returned to.|
|
|
1173
|
+
|`token`|`address`|The token that the held fees are in.|
|
|
1174
|
+
|`amount`|`uint256`|The amount to base the calculation on, as a fixed point number with the same number of decimals as this terminal.|
|
|
1175
|
+
|
|
1176
|
+
**Returns**
|
|
1177
|
+
|
|
1178
|
+
|Name|Type|Description|
|
|
1179
|
+
|----|----|-----------|
|
|
1180
|
+
|`returnedFees`|`uint256`|The amount of held fees that were returned, as a fixed point number with the same number of decimals as this terminal|
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
### _sendPayoutsOf
|
|
1184
|
+
|
|
1185
|
+
Sends payouts to a project's current payout split group, according to its ruleset, up to its current
|
|
1186
|
+
payout limit.
|
|
1187
|
+
|
|
1188
|
+
*If the percentages of the splits in the project's payout split group do not add up to 100%, the remainder
|
|
1189
|
+
is sent to the project's owner.*
|
|
1190
|
+
|
|
1191
|
+
*Anyone can send payouts on a project's behalf. Projects can include a wildcard split (a split with no
|
|
1192
|
+
`hook`, `projectId`, or `beneficiary`) to send funds to the `_msgSender()` which calls this function. This can
|
|
1193
|
+
be used to incentivize calling this function.*
|
|
1194
|
+
|
|
1195
|
+
*Payouts sent to addresses which aren't feeless incur the protocol fee.*
|
|
1196
|
+
|
|
1197
|
+
|
|
1198
|
+
```solidity
|
|
1199
|
+
function _sendPayoutsOf(
|
|
1200
|
+
uint256 projectId,
|
|
1201
|
+
address token,
|
|
1202
|
+
uint256 amount,
|
|
1203
|
+
uint256 currency
|
|
1204
|
+
)
|
|
1205
|
+
internal
|
|
1206
|
+
returns (uint256 amountPaidOut);
|
|
1207
|
+
```
|
|
1208
|
+
**Parameters**
|
|
1209
|
+
|
|
1210
|
+
|Name|Type|Description|
|
|
1211
|
+
|----|----|-----------|
|
|
1212
|
+
|`projectId`|`uint256`|The ID of the project to send the payouts of.|
|
|
1213
|
+
|`token`|`address`|The token being paid out.|
|
|
1214
|
+
|`amount`|`uint256`|The number of terminal tokens to pay out, as a fixed point number with same number of decimals as this terminal.|
|
|
1215
|
+
|`currency`|`uint256`|The expected currency of the amount being paid out. Must match the currency of one of the project's current ruleset's payout limits.|
|
|
1216
|
+
|
|
1217
|
+
**Returns**
|
|
1218
|
+
|
|
1219
|
+
|Name|Type|Description|
|
|
1220
|
+
|----|----|-----------|
|
|
1221
|
+
|`amountPaidOut`|`uint256`|The total amount that was paid out.|
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
### _sendPayoutToSplit
|
|
1225
|
+
|
|
1226
|
+
Sends a payout to a split.
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
```solidity
|
|
1230
|
+
function _sendPayoutToSplit(
|
|
1231
|
+
JBSplit memory split,
|
|
1232
|
+
uint256 projectId,
|
|
1233
|
+
address token,
|
|
1234
|
+
uint256 amount
|
|
1235
|
+
)
|
|
1236
|
+
internal
|
|
1237
|
+
returns (uint256);
|
|
1238
|
+
```
|
|
1239
|
+
**Parameters**
|
|
1240
|
+
|
|
1241
|
+
|Name|Type|Description|
|
|
1242
|
+
|----|----|-----------|
|
|
1243
|
+
|`split`|`JBSplit`|The split to pay.|
|
|
1244
|
+
|`projectId`|`uint256`|The ID of the project the split was specified by.|
|
|
1245
|
+
|`token`|`address`|The address of the token being paid out.|
|
|
1246
|
+
|`amount`|`uint256`|The total amount that the split is being paid, as a fixed point number with the same number of decimals as this terminal.|
|
|
1247
|
+
|
|
1248
|
+
**Returns**
|
|
1249
|
+
|
|
1250
|
+
|Name|Type|Description|
|
|
1251
|
+
|----|----|-----------|
|
|
1252
|
+
|`<none>`|`uint256`|netPayoutAmount The amount sent to the split after subtracting fees.|
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
### _sendPayoutsToSplitGroupOf
|
|
1256
|
+
|
|
1257
|
+
Sends payouts to the payout splits group specified in a project's ruleset.
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
```solidity
|
|
1261
|
+
function _sendPayoutsToSplitGroupOf(
|
|
1262
|
+
uint256 projectId,
|
|
1263
|
+
address token,
|
|
1264
|
+
uint256 rulesetId,
|
|
1265
|
+
uint256 amount
|
|
1266
|
+
)
|
|
1267
|
+
internal
|
|
1268
|
+
returns (uint256, uint256 amountEligibleForFees);
|
|
1269
|
+
```
|
|
1270
|
+
**Parameters**
|
|
1271
|
+
|
|
1272
|
+
|Name|Type|Description|
|
|
1273
|
+
|----|----|-----------|
|
|
1274
|
+
|`projectId`|`uint256`|The ID of the project to send the payouts of.|
|
|
1275
|
+
|`token`|`address`|The address of the token being paid out.|
|
|
1276
|
+
|`rulesetId`|`uint256`|The ID of the ruleset of the split group being paid.|
|
|
1277
|
+
|`amount`|`uint256`|The total amount being paid out, as a fixed point number with the same number of decimals as this terminal.|
|
|
1278
|
+
|
|
1279
|
+
**Returns**
|
|
1280
|
+
|
|
1281
|
+
|Name|Type|Description|
|
|
1282
|
+
|----|----|-----------|
|
|
1283
|
+
|`<none>`|`uint256`|amount The leftover amount (zero if the splits add up to 100%).|
|
|
1284
|
+
|`amountEligibleForFees`|`uint256`|The total amount of funds which were paid out and are eligible for fees.|
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
### _takeFeeFrom
|
|
1288
|
+
|
|
1289
|
+
Takes a fee into the platform's project (with the `_FEE_BENEFICIARY_PROJECT_ID`).
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
```solidity
|
|
1293
|
+
function _takeFeeFrom(
|
|
1294
|
+
uint256 projectId,
|
|
1295
|
+
address token,
|
|
1296
|
+
uint256 amount,
|
|
1297
|
+
address beneficiary,
|
|
1298
|
+
bool shouldHoldFees
|
|
1299
|
+
)
|
|
1300
|
+
internal
|
|
1301
|
+
returns (uint256 feeAmount);
|
|
1302
|
+
```
|
|
1303
|
+
**Parameters**
|
|
1304
|
+
|
|
1305
|
+
|Name|Type|Description|
|
|
1306
|
+
|----|----|-----------|
|
|
1307
|
+
|`projectId`|`uint256`|The ID of the project paying the fee.|
|
|
1308
|
+
|`token`|`address`|The address of the token that the fee is being paid in.|
|
|
1309
|
+
|`amount`|`uint256`|The fee's token amount, as a fixed point number with 18 decimals.|
|
|
1310
|
+
|`beneficiary`|`address`|The address to mint the platform's project's tokens for.|
|
|
1311
|
+
|`shouldHoldFees`|`bool`|If fees should be tracked and held instead of being exercised immediately.|
|
|
1312
|
+
|
|
1313
|
+
**Returns**
|
|
1314
|
+
|
|
1315
|
+
|Name|Type|Description|
|
|
1316
|
+
|----|----|-----------|
|
|
1317
|
+
|`feeAmount`|`uint256`|The amount of the fee taken.|
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
### _transferFrom
|
|
1321
|
+
|
|
1322
|
+
Transfers tokens.
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
```solidity
|
|
1326
|
+
function _transferFrom(address from, address payable to, address token, uint256 amount) internal;
|
|
1327
|
+
```
|
|
1328
|
+
**Parameters**
|
|
1329
|
+
|
|
1330
|
+
|Name|Type|Description|
|
|
1331
|
+
|----|----|-----------|
|
|
1332
|
+
|`from`|`address`|The address the transfer should originate from.|
|
|
1333
|
+
|`to`|`address payable`|The address the transfer should go to.|
|
|
1334
|
+
|`token`|`address`|The token being transfered.|
|
|
1335
|
+
|`amount`|`uint256`|The number of tokens being transferred, as a fixed point number with the same number of decimals as this terminal.|
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
### _useAllowanceOf
|
|
1339
|
+
|
|
1340
|
+
Allows a project to send out funds from its surplus up to the current surplus allowance.
|
|
1341
|
+
|
|
1342
|
+
*Only a project's owner or an operator with the `USE_ALLOWANCE` permission from that owner can use the
|
|
1343
|
+
surplus allowance.*
|
|
1344
|
+
|
|
1345
|
+
*Incurs the protocol fee unless the caller is a feeless address.*
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
```solidity
|
|
1349
|
+
function _useAllowanceOf(
|
|
1350
|
+
uint256 projectId,
|
|
1351
|
+
address owner,
|
|
1352
|
+
address token,
|
|
1353
|
+
uint256 amount,
|
|
1354
|
+
uint256 currency,
|
|
1355
|
+
address payable beneficiary,
|
|
1356
|
+
address payable feeBeneficiary,
|
|
1357
|
+
string memory memo
|
|
1358
|
+
)
|
|
1359
|
+
internal
|
|
1360
|
+
returns (uint256 netAmountPaidOut);
|
|
1361
|
+
```
|
|
1362
|
+
**Parameters**
|
|
1363
|
+
|
|
1364
|
+
|Name|Type|Description|
|
|
1365
|
+
|----|----|-----------|
|
|
1366
|
+
|`projectId`|`uint256`|The ID of the project to use the surplus allowance of.|
|
|
1367
|
+
|`owner`|`address`|The project's owner.|
|
|
1368
|
+
|`token`|`address`|The token being paid out from the surplus.|
|
|
1369
|
+
|`amount`|`uint256`|The amount of terminal tokens to use from the project's current surplus allowance, as a fixed point number with the same amount of decimals as this terminal.|
|
|
1370
|
+
|`currency`|`uint256`|The expected currency of the amount being paid out. Must match the currency of one of the project's current ruleset's surplus allowances.|
|
|
1371
|
+
|`beneficiary`|`address payable`|The address to send the funds to.|
|
|
1372
|
+
|`feeBeneficiary`|`address payable`|The address to send the tokens resulting from paying the fee.|
|
|
1373
|
+
|`memo`|`string`|A memo to pass along to the emitted event.|
|
|
1374
|
+
|
|
1375
|
+
**Returns**
|
|
1376
|
+
|
|
1377
|
+
|Name|Type|Description|
|
|
1378
|
+
|----|----|-----------|
|
|
1379
|
+
|`netAmountPaidOut`|`uint256`|The amount of tokens paid out.|
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
## Errors
|
|
1383
|
+
### JBMultiTerminal_AccountingContextAlreadySet
|
|
1384
|
+
|
|
1385
|
+
```solidity
|
|
1386
|
+
error JBMultiTerminal_AccountingContextAlreadySet(address token);
|
|
1387
|
+
```
|
|
1388
|
+
|
|
1389
|
+
### JBMultiTerminal_AddingAccountingContextNotAllowed
|
|
1390
|
+
|
|
1391
|
+
```solidity
|
|
1392
|
+
error JBMultiTerminal_AddingAccountingContextNotAllowed();
|
|
1393
|
+
```
|
|
1394
|
+
|
|
1395
|
+
### JBMultiTerminal_FeeTerminalNotFound
|
|
1396
|
+
|
|
1397
|
+
```solidity
|
|
1398
|
+
error JBMultiTerminal_FeeTerminalNotFound();
|
|
1399
|
+
```
|
|
1400
|
+
|
|
1401
|
+
### JBMultiTerminal_NoMsgValueAllowed
|
|
1402
|
+
|
|
1403
|
+
```solidity
|
|
1404
|
+
error JBMultiTerminal_NoMsgValueAllowed(uint256 value);
|
|
1405
|
+
```
|
|
1406
|
+
|
|
1407
|
+
### JBMultiTerminal_OverflowAlert
|
|
1408
|
+
|
|
1409
|
+
```solidity
|
|
1410
|
+
error JBMultiTerminal_OverflowAlert(uint256 value, uint256 limit);
|
|
1411
|
+
```
|
|
1412
|
+
|
|
1413
|
+
### JBMultiTerminal_PermitAllowanceNotEnough
|
|
1414
|
+
|
|
1415
|
+
```solidity
|
|
1416
|
+
error JBMultiTerminal_PermitAllowanceNotEnough(uint256 amount, uint256 allowance);
|
|
1417
|
+
```
|
|
1418
|
+
|
|
1419
|
+
### JBMultiTerminal_RecipientProjectTerminalNotFound
|
|
1420
|
+
|
|
1421
|
+
```solidity
|
|
1422
|
+
error JBMultiTerminal_RecipientProjectTerminalNotFound(uint256 projectId, address token);
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
### JBMultiTerminal_SplitHookInvalid
|
|
1426
|
+
|
|
1427
|
+
```solidity
|
|
1428
|
+
error JBMultiTerminal_SplitHookInvalid(IJBSplitHook hook);
|
|
1429
|
+
```
|
|
1430
|
+
|
|
1431
|
+
### JBMultiTerminal_TerminalTokensIncompatible
|
|
1432
|
+
|
|
1433
|
+
```solidity
|
|
1434
|
+
error JBMultiTerminal_TerminalTokensIncompatible();
|
|
1435
|
+
```
|
|
1436
|
+
|
|
1437
|
+
### JBMultiTerminal_TokenNotAccepted
|
|
1438
|
+
|
|
1439
|
+
```solidity
|
|
1440
|
+
error JBMultiTerminal_TokenNotAccepted(address token);
|
|
1441
|
+
```
|
|
1442
|
+
|
|
1443
|
+
### JBMultiTerminal_UnderMinReturnedTokens
|
|
1444
|
+
|
|
1445
|
+
```solidity
|
|
1446
|
+
error JBMultiTerminal_UnderMinReturnedTokens(uint256 count, uint256 min);
|
|
1447
|
+
```
|
|
1448
|
+
|
|
1449
|
+
### JBMultiTerminal_UnderMinTokensPaidOut
|
|
1450
|
+
|
|
1451
|
+
```solidity
|
|
1452
|
+
error JBMultiTerminal_UnderMinTokensPaidOut(uint256 amount, uint256 min);
|
|
1453
|
+
```
|
|
1454
|
+
|
|
1455
|
+
### JBMultiTerminal_UnderMinTokensReclaimed
|
|
1456
|
+
|
|
1457
|
+
```solidity
|
|
1458
|
+
error JBMultiTerminal_UnderMinTokensReclaimed(uint256 amount, uint256 min);
|
|
1459
|
+
```
|
|
1460
|
+
|
|
1461
|
+
### JBMultiTerminal_ZeroAccountingContextDecimals
|
|
1462
|
+
|
|
1463
|
+
```solidity
|
|
1464
|
+
error JBMultiTerminal_ZeroAccountingContextDecimals();
|
|
1465
|
+
```
|
|
1466
|
+
|
|
1467
|
+
### JBMultiTerminal_ZeroAccountingContextCurrency
|
|
1468
|
+
|
|
1469
|
+
```solidity
|
|
1470
|
+
error JBMultiTerminal_ZeroAccountingContextCurrency();
|
|
1471
|
+
```
|
|
1472
|
+
|