@bananapus/core-v6 0.0.14 → 0.0.16
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/ADMINISTRATION.md +4 -0
- package/README.md +2 -2
- package/SKILLS.md +2 -0
- package/STYLE_GUIDE.md +150 -43
- package/foundry.toml +3 -3
- package/package.json +4 -4
- package/remappings.txt +1 -1
- package/script/Deploy.s.sol +23 -16
- package/script/DeployPeriphery.s.sol +71 -66
- package/script/helpers/CoreDeploymentLib.sol +84 -37
- package/src/JBChainlinkV3PriceFeed.sol +1 -0
- package/src/JBController.sol +19 -4
- package/src/JBERC20.sol +12 -3
- package/src/JBFundAccessLimits.sol +12 -2
- package/src/JBMultiTerminal.sol +3 -1
- package/src/JBPermissions.sol +1 -0
- package/src/JBProjects.sol +1 -1
- package/src/JBRulesets.sol +11 -0
- package/src/JBSplits.sol +5 -0
- package/src/JBTerminalStore.sol +3 -0
- package/src/JBTokens.sol +40 -4
- package/src/interfaces/IJBController.sol +6 -1
- package/src/interfaces/IJBPayoutTerminal.sol +0 -1
- package/src/interfaces/IJBPermitTerminal.sol +1 -0
- package/src/interfaces/IJBToken.sol +5 -0
- package/src/interfaces/IJBTokens.sol +13 -0
- package/src/libraries/JBMetadataResolver.sol +7 -3
- package/src/libraries/JBRulesetMetadataResolver.sol +21 -21
- package/src/structs/JBAccountingContext.sol +1 -0
- package/src/structs/JBAfterCashOutRecordedContext.sol +1 -0
- package/src/structs/JBAfterPayRecordedContext.sol +1 -0
- package/src/structs/JBBeforeCashOutRecordedContext.sol +1 -0
- package/src/structs/JBBeforePayRecordedContext.sol +1 -0
- package/src/structs/JBCashOutHookSpecification.sol +1 -0
- package/src/structs/JBCurrencyAmount.sol +1 -0
- package/src/structs/JBFee.sol +1 -0
- package/src/structs/JBFundAccessLimitGroup.sol +1 -0
- package/src/structs/JBPayHookSpecification.sol +1 -0
- package/src/structs/JBPermissionsData.sol +1 -0
- package/src/structs/JBRuleset.sol +1 -0
- package/src/structs/JBRulesetConfig.sol +1 -0
- package/src/structs/JBRulesetMetadata.sol +1 -0
- package/src/structs/JBRulesetWeightCache.sol +1 -0
- package/src/structs/JBRulesetWithMetadata.sol +1 -0
- package/src/structs/JBSingleAllowance.sol +1 -0
- package/src/structs/JBSplit.sol +1 -0
- package/src/structs/JBSplitGroup.sol +1 -0
- package/src/structs/JBSplitHookContext.sol +1 -0
- package/src/structs/JBTerminalConfig.sol +1 -0
- package/src/structs/JBTokenAmount.sol +1 -0
- package/test/ComprehensiveInvariant.t.sol +15 -5
- package/test/{AuditExploits.t.sol → CoreExploitTests.t.sol} +35 -4
- package/test/EconomicSimulation.t.sol +10 -2
- package/test/EntryPointPermutations.t.sol +18 -5
- package/test/FlashLoanAttacks.t.sol +12 -2
- package/test/PermissionEscalation.t.sol +54 -22
- package/test/RulesetTransitions.t.sol +15 -1
- package/test/SplitLoopTests.t.sol +26 -5
- package/test/TestAccessToFunds.sol +17 -2
- package/test/TestCashOut.sol +15 -2
- package/test/TestCashOutCountFor.sol +1 -2
- package/test/TestCashOutHooks.sol +47 -25
- package/test/TestCashOutTimingEdge.sol +13 -1
- package/test/TestDurationUnderflow.sol +13 -1
- package/test/TestFeeProcessingFailure.sol +17 -7
- package/test/TestFees.sol +14 -1
- package/test/TestInterfaceSupport.sol +20 -1
- package/test/TestJBERC20Inheritance.sol +11 -1
- package/test/TestLaunchProject.sol +13 -1
- package/test/TestMetaTx.sol +15 -1
- package/test/TestMetadataParserLib.sol +37 -4
- package/test/TestMigrationHeldFees.sol +17 -11
- package/test/TestMintTokensOf.sol +14 -1
- package/test/TestMultiTokenSurplus.sol +14 -1
- package/test/TestMultipleAccessLimits.sol +23 -1
- package/test/TestPayBurnRedeemFlow.sol +16 -1
- package/test/TestPayHooks.sol +33 -14
- package/test/TestPermissions.sol +20 -1
- package/test/TestPermissionsEdge.sol +5 -1
- package/test/TestPermit2Terminal.sol +36 -3
- package/test/TestRulesetQueueing.sol +24 -1
- package/test/TestRulesetQueuingStress.sol +28 -2
- package/test/TestRulesetWeightCaching.sol +5 -2
- package/test/TestSplits.sol +23 -1
- package/test/TestTerminalMigration.sol +11 -1
- package/test/TestTokenFlow.sol +18 -1
- package/test/TestWeightCacheStaleAfterRejection.sol +15 -1
- package/test/WeirdTokenTests.t.sol +18 -2
- package/test/fork/TestChainlinkPriceFeedFork.sol +254 -0
- package/test/formal/BondingCurveProperties.t.sol +8 -2
- package/test/formal/FeeProperties.t.sol +7 -1
- package/test/helpers/JBTest.sol +7 -7
- package/test/helpers/TestBaseWorkflow.sol +84 -1
- package/test/invariants/Phase3DeepInvariant.t.sol +13 -5
- package/test/invariants/RulesetsInvariant.t.sol +12 -2
- package/test/invariants/TerminalStoreInvariant.t.sol +11 -2
- package/test/invariants/TokensInvariant.t.sol +13 -2
- package/test/invariants/handlers/ComprehensiveHandler.sol +19 -1
- package/test/invariants/handlers/EconomicHandler.sol +31 -1
- package/test/invariants/handlers/Phase3Handler.sol +31 -2
- package/test/invariants/handlers/RulesetsHandler.sol +5 -1
- package/test/invariants/handlers/TerminalStoreHandler.sol +6 -1
- package/test/invariants/handlers/TokensHandler.sol +1 -2
- package/test/mock/ERC2771ForwarderMock.sol +1 -1
- package/test/mock/MockERC20.sol +1 -3
- package/test/mock/MockMaliciousBeneficiary.sol +2 -2
- package/test/mock/MockMaliciousSplitHook.sol +2 -1
- package/test/mock/MockPriceFeed.sol +1 -1
- package/test/units/static/JBChainlinkV3PriceFeed/TestPriceFeed.sol +0 -1
- package/test/units/static/JBController/JBControllerSetup.sol +10 -1
- package/test/units/static/JBController/TestBurnTokensOf.sol +8 -1
- package/test/units/static/JBController/TestClaimTokensFor.sol +4 -1
- package/test/units/static/JBController/TestDeployErc20For.sol +7 -1
- package/test/units/static/JBController/TestLaunchProjectFor.sol +21 -1
- package/test/units/static/JBController/TestLaunchRulesetsFor.sol +21 -1
- package/test/units/static/JBController/TestMigrateController.sol +10 -1
- package/test/units/static/JBController/TestMintTokensOfUnits.sol +10 -1
- package/test/units/static/JBController/TestPayReservedTokenToTerminal.sol +4 -1
- package/test/units/static/JBController/TestReceiveMigrationFrom.sol +5 -1
- package/test/units/static/JBController/TestRulesetViews.sol +7 -1
- package/test/units/static/JBController/TestSendReservedTokensToSplitsOf.sol +21 -1
- package/test/units/static/JBController/TestSetSplitGroupsOf.sol +6 -1
- package/test/units/static/JBController/TestSetTokenFor.sol +13 -1
- package/test/units/static/JBController/TestSetUriOf.sol +5 -1
- package/test/units/static/JBController/TestTransferCreditsFrom.sol +11 -1
- package/test/units/static/JBDeadline/TestDeadlineFuzz.sol +15 -4
- package/test/units/static/JBDirectory/JBDirectorySetup.sol +4 -1
- package/test/units/static/JBDirectory/TestPrimaryTerminalOf.sol +5 -1
- package/test/units/static/JBDirectory/TestSetControllerOf.sol +11 -1
- package/test/units/static/JBDirectory/TestSetControllerOfMigrationOrder.sol +7 -1
- package/test/units/static/JBDirectory/TestSetPrimaryTerminalOf.sol +11 -1
- package/test/units/static/JBDirectory/TestSetTerminalsOf.sol +10 -1
- package/test/units/static/JBERC20/JBERC20Setup.sol +2 -1
- package/test/units/static/JBERC20/SigUtils.sol +2 -0
- package/test/units/static/JBERC20/TestInitialize.sol +1 -1
- package/test/units/static/JBERC20/TestName.sol +1 -1
- package/test/units/static/JBERC20/TestNonces.sol +3 -1
- package/test/units/static/JBERC20/TestSymbol.sol +1 -1
- package/test/units/static/JBFeelessAdresses/JBFeelessSetup.sol +2 -1
- package/test/units/static/JBFeelessAdresses/TestInterfaces.sol +2 -1
- package/test/units/static/JBFeelessAdresses/TestSetFeelessAddress.sol +1 -1
- package/test/units/static/JBFees/TestFeesFuzz.sol +1 -1
- package/test/units/static/JBFixedPointNumber/TestAdjustDecimals.sol +0 -1
- package/test/units/static/JBFixedPointNumber/TestAdjustDecimalsFuzz.sol +0 -1
- package/test/units/static/JBFundAccessLimits/JBFundAccessSetup.sol +3 -1
- package/test/units/static/JBFundAccessLimits/TestFundAccessLimitsEdge.sol +4 -1
- package/test/units/static/JBFundAccessLimits/TestPayoutLimitOf.sol +4 -1
- package/test/units/static/JBFundAccessLimits/TestPayoutLimitsOf.sol +8 -1
- package/test/units/static/JBFundAccessLimits/TestSetFundAccessLimitsFor.sol +8 -1
- package/test/units/static/JBFundAccessLimits/TestSurplusAllowanceOf.sol +4 -1
- package/test/units/static/JBFundAccessLimits/TestSurplusAllowancesOf.sol +7 -1
- package/test/units/static/JBMetadataResolver/TestGetDataFor.sol +1 -1
- package/test/units/static/JBMetadataResolver/{TestMetadataResolverM20M21.sol → TestMetadataResolverEdgeCases.sol} +6 -5
- package/test/units/static/JBMetadataResolver/TestMetadataResolverFuzz.sol +2 -1
- package/test/units/static/JBMultiTerminal/JBMultiTerminalSetup.sol +12 -1
- package/test/units/static/JBMultiTerminal/TestAccountingContextsOf.sol +9 -1
- package/test/units/static/JBMultiTerminal/TestAddAccountingContextsFor.sol +18 -2
- package/test/units/static/JBMultiTerminal/TestAddToBalanceOf.sol +42 -7
- package/test/units/static/JBMultiTerminal/TestCashOutTokensOf.sol +30 -6
- package/test/units/static/JBMultiTerminal/TestExecutePayout.sol +18 -2
- package/test/units/static/JBMultiTerminal/TestExecuteProcessFee.sol +13 -3
- package/test/units/static/JBMultiTerminal/TestMigrateBalanceOf.sol +21 -4
- package/test/units/static/JBMultiTerminal/TestPay.sol +32 -6
- package/test/units/static/JBMultiTerminal/TestProcessHeldFeesOf.sol +0 -1
- package/test/units/static/JBMultiTerminal/TestSendPayoutsOf.sol +15 -1
- package/test/units/static/JBMultiTerminal/TestUseAllowanceOf.sol +17 -1
- package/test/units/static/JBPermissions/JBPermissionsSetup.sol +2 -1
- package/test/units/static/JBPermissions/TestHasPermission.sol +1 -1
- package/test/units/static/JBPermissions/TestHasPermissions.sol +1 -1
- package/test/units/static/JBPermissions/TestSetPermissionsFor.sol +3 -1
- package/test/units/static/JBPrices/JBPricesSetup.sol +6 -1
- package/test/units/static/JBPrices/TestAddPriceFeedFor.sol +6 -1
- package/test/units/static/JBPrices/TestPricePerUnitOf.sol +4 -1
- package/test/units/static/JBPrices/TestPrices.sol +4 -1
- package/test/units/static/JBProjects/JBProjectsSetup.sol +2 -1
- package/test/units/static/JBProjects/TestCreateFor.sol +3 -1
- package/test/units/static/JBProjects/TestInitialProject.sol +2 -1
- package/test/units/static/JBProjects/TestInterfaces.sol +0 -1
- package/test/units/static/JBProjects/TestSetResolver.sol +2 -1
- package/test/units/static/JBProjects/TestTokenUri.sol +3 -1
- package/test/units/static/JBRulesetMetadataResolver/TestSetCashOutTaxRateTo.sol +9 -1
- package/test/units/static/JBRulesets/JBRulesetsSetup.sol +3 -1
- package/test/units/static/JBRulesets/TestCurrentApprovalStatusForLatestRulesetOf.sol +9 -1
- package/test/units/static/JBRulesets/TestCurrentOf.sol +10 -1
- package/test/units/static/JBRulesets/TestGetRulesetOf.sol +7 -1
- package/test/units/static/JBRulesets/TestLatestQueuedRulesetOf.sol +9 -1
- package/test/units/static/JBRulesets/TestRulesets.sol +12 -2
- package/test/units/static/JBRulesets/TestRulesetsOf.sol +1 -1
- package/test/units/static/JBRulesets/TestUpcomingRulesetOf.sol +10 -1
- package/test/units/static/JBRulesets/TestUpdateRulesetWeightCache.sol +6 -1
- package/test/units/static/JBSplits/JBSplitsSetup.sol +3 -1
- package/test/units/static/JBSplits/TestSelfManagedSplitGroups.sol +8 -1
- package/test/units/static/JBSplits/TestSetSplitGroupsOf.sol +8 -1
- package/test/units/static/JBSplits/TestSplitsLockedEdge.sol +6 -1
- package/test/units/static/JBSplits/TestSplitsOf.sol +1 -1
- package/test/units/static/JBSplits/TestSplitsPacking.sol +5 -2
- package/test/units/static/JBSurplus/TestSurplusFuzz.sol +4 -2
- package/test/units/static/JBTerminalStore/JBTerminalStoreSetup.sol +5 -1
- package/test/units/static/JBTerminalStore/TestCurrentReclaimableSurplusOf.sol +14 -1
- package/test/units/static/JBTerminalStore/TestCurrentSurplusOf.sol +14 -1
- package/test/units/static/JBTerminalStore/TestCurrentTotalSurplusOf.sol +3 -1
- package/test/units/static/JBTerminalStore/TestRecordCashOutsFor.sol +20 -1
- package/test/units/static/JBTerminalStore/TestRecordPaymentFrom.sol +15 -1
- package/test/units/static/JBTerminalStore/TestRecordPayoutFor.sol +13 -1
- package/test/units/static/JBTerminalStore/TestRecordTerminalMigration.sol +8 -1
- package/test/units/static/JBTerminalStore/TestRecordUsedAllowanceOf.sol +16 -1
- package/test/units/static/JBTerminalStore/TestUint224Overflow.sol +15 -1
- package/test/units/static/JBTokens/JBTokensSetup.sol +5 -1
- package/test/units/static/JBTokens/TestBurnFrom.sol +4 -1
- package/test/units/static/JBTokens/TestClaimTokensFor.sol +4 -1
- package/test/units/static/JBTokens/TestDeployERC20ForUnits.sol +4 -1
- package/test/units/static/JBTokens/TestMintFor.sol +4 -1
- package/test/units/static/JBTokens/TestSetTokenFor.sol +4 -1
- package/test/units/static/JBTokens/TestTotalBalanceOf.sol +1 -1
- package/test/units/static/JBTokens/TestTotalSupplyOf.sol +1 -1
- package/test/units/static/JBTokens/TestTransferCreditsFrom.sol +3 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBController} from "../../../../src/JBController.sol";
|
|
5
|
+
import {IJBTerminal} from "../../../../src/interfaces/IJBTerminal.sol";
|
|
6
|
+
import {IJBToken} from "../../../../src/interfaces/IJBToken.sol";
|
|
7
|
+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
8
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
9
|
|
|
7
10
|
contract TestExecutePayReservedTokenToTerminal_Local is JBControllerSetup {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBController} from "../../../../src/JBController.sol";
|
|
5
|
+
import {IJBController} from "../../../../src/interfaces/IJBController.sol";
|
|
6
|
+
import {IJBMigratable} from "../../../../src/interfaces/IJBMigratable.sol";
|
|
7
|
+
import {IJBProjectUriRegistry} from "../../../../src/interfaces/IJBProjectUriRegistry.sol";
|
|
8
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
9
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
10
|
|
|
7
11
|
contract TestReceiveMigrationFrom_Local is JBControllerSetup {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBApprovalStatus} from "../../../../src/enums/JBApprovalStatus.sol";
|
|
5
|
+
import {IJBRulesetApprovalHook} from "../../../../src/interfaces/IJBRulesetApprovalHook.sol";
|
|
6
|
+
import {IJBRulesets} from "../../../../src/interfaces/IJBRulesets.sol";
|
|
7
|
+
import {JBRulesetMetadataResolver} from "../../../../src/libraries/JBRulesetMetadataResolver.sol";
|
|
8
|
+
import {JBRuleset} from "../../../../src/structs/JBRuleset.sol";
|
|
9
|
+
import {JBRulesetMetadata} from "../../../../src/structs/JBRulesetMetadata.sol";
|
|
10
|
+
import {JBRulesetWithMetadata} from "../../../../src/structs/JBRulesetWithMetadata.sol";
|
|
5
11
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
12
|
|
|
7
13
|
/**
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {StdStorage, stdStorage} from "forge-std/StdStorage.sol";
|
|
5
|
+
import {JBController} from "../../../../src/JBController.sol";
|
|
6
|
+
import {IJBController} from "../../../../src/interfaces/IJBController.sol";
|
|
7
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
8
|
+
import {IJBRulesetApprovalHook} from "../../../../src/interfaces/IJBRulesetApprovalHook.sol";
|
|
9
|
+
import {IJBRulesets} from "../../../../src/interfaces/IJBRulesets.sol";
|
|
10
|
+
import {IJBSplitHook} from "../../../../src/interfaces/IJBSplitHook.sol";
|
|
11
|
+
import {IJBSplits} from "../../../../src/interfaces/IJBSplits.sol";
|
|
12
|
+
import {IJBToken} from "../../../../src/interfaces/IJBToken.sol";
|
|
13
|
+
import {IJBTokens} from "../../../../src/interfaces/IJBTokens.sol";
|
|
14
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
15
|
+
import {JBRulesetMetadataResolver} from "../../../../src/libraries/JBRulesetMetadataResolver.sol";
|
|
16
|
+
import {JBFundAccessLimitGroup} from "../../../../src/structs/JBFundAccessLimitGroup.sol";
|
|
17
|
+
import {JBRuleset} from "../../../../src/structs/JBRuleset.sol";
|
|
18
|
+
import {JBRulesetConfig} from "../../../../src/structs/JBRulesetConfig.sol";
|
|
19
|
+
import {JBRulesetMetadata} from "../../../../src/structs/JBRulesetMetadata.sol";
|
|
20
|
+
import {JBSplit} from "../../../../src/structs/JBSplit.sol";
|
|
21
|
+
import {JBSplitGroup} from "../../../../src/structs/JBSplitGroup.sol";
|
|
22
|
+
import {JBSplitHookContext} from "../../../../src/structs/JBSplitHookContext.sol";
|
|
23
|
+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
24
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
5
25
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
26
|
|
|
7
27
|
contract TestSendReservedTokensToSplitsOf_Local is JBControllerSetup {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBPermissioned} from "../../../../src/abstract/JBPermissioned.sol";
|
|
5
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
6
|
+
import {IJBSplits} from "../../../../src/interfaces/IJBSplits.sol";
|
|
7
|
+
import {JBSplitGroup} from "../../../../src/structs/JBSplitGroup.sol";
|
|
8
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
9
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
5
10
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
11
|
|
|
7
12
|
contract TestSetSplitGroupsOf_Local is JBControllerSetup {
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBController} from "../../../../src/JBController.sol";
|
|
5
|
+
import {JBPermissioned} from "../../../../src/abstract/JBPermissioned.sol";
|
|
6
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
7
|
+
import {IJBRulesetApprovalHook} from "../../../../src/interfaces/IJBRulesetApprovalHook.sol";
|
|
8
|
+
import {IJBRulesets} from "../../../../src/interfaces/IJBRulesets.sol";
|
|
9
|
+
import {IJBToken} from "../../../../src/interfaces/IJBToken.sol";
|
|
10
|
+
import {IJBTokens} from "../../../../src/interfaces/IJBTokens.sol";
|
|
11
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
12
|
+
import {JBRulesetMetadataResolver} from "../../../../src/libraries/JBRulesetMetadataResolver.sol";
|
|
13
|
+
import {JBRuleset} from "../../../../src/structs/JBRuleset.sol";
|
|
14
|
+
import {JBRulesetMetadata} from "../../../../src/structs/JBRulesetMetadata.sol";
|
|
15
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
16
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
5
17
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
18
|
|
|
7
19
|
contract TestSetTokenFor_Local is JBControllerSetup {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBPermissioned} from "../../../../src/abstract/JBPermissioned.sol";
|
|
5
|
+
import {IJBController} from "../../../../src/interfaces/IJBController.sol";
|
|
6
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
7
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
8
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
5
9
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
10
|
|
|
7
11
|
contract TestSetUriOf_Local is JBControllerSetup {
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBController} from "../../../../src/JBController.sol";
|
|
5
|
+
import {JBPermissioned} from "../../../../src/abstract/JBPermissioned.sol";
|
|
6
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
7
|
+
import {IJBRulesetApprovalHook} from "../../../../src/interfaces/IJBRulesetApprovalHook.sol";
|
|
8
|
+
import {IJBRulesets} from "../../../../src/interfaces/IJBRulesets.sol";
|
|
9
|
+
import {IJBTokens} from "../../../../src/interfaces/IJBTokens.sol";
|
|
10
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
11
|
+
import {JBRulesetMetadataResolver} from "../../../../src/libraries/JBRulesetMetadataResolver.sol";
|
|
12
|
+
import {JBRuleset} from "../../../../src/structs/JBRuleset.sol";
|
|
13
|
+
import {JBRulesetMetadata} from "../../../../src/structs/JBRulesetMetadata.sol";
|
|
14
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
5
15
|
import {JBControllerSetup} from "./JBControllerSetup.sol";
|
|
6
16
|
|
|
7
17
|
contract TestTransferCreditsFrom_Local is JBControllerSetup {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBRulesetApprovalHook} from "../../../../src/interfaces/IJBRulesetApprovalHook.sol";
|
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
6
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
7
|
import {JBDeadline} from "../../../../src/JBDeadline.sol";
|
|
7
8
|
import {JBApprovalStatus} from "../../../../src/enums/JBApprovalStatus.sol";
|
|
@@ -46,8 +47,10 @@ contract TestDeadlineFuzz_Local is JBTest {
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
/// @notice Ruleset queued too close to start returns Failed.
|
|
49
|
-
function test_insufficientGap_isFailed() external {
|
|
50
|
+
function test_insufficientGap_isFailed() external view {
|
|
51
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
50
52
|
uint48 start = uint48(block.timestamp + 1 days);
|
|
53
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
51
54
|
uint48 queued = start - uint48(DURATION) + 1; // 1 second short of required gap
|
|
52
55
|
|
|
53
56
|
JBRuleset memory ruleset = _makeRuleset({queuedAt: queued, start: start});
|
|
@@ -56,9 +59,11 @@ contract TestDeadlineFuzz_Local is JBTest {
|
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
/// @notice Ruleset with exactly enough gap and deadline not yet passed returns ApprovalExpected.
|
|
59
|
-
function test_exactGap_deadlineNotPassed_isApprovalExpected() external {
|
|
62
|
+
function test_exactGap_deadlineNotPassed_isApprovalExpected() external view {
|
|
60
63
|
// queue far enough in advance, and start is still far in the future
|
|
64
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
61
65
|
uint48 start = uint48(block.timestamp + 2 * DURATION + 100);
|
|
66
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
62
67
|
uint48 queued = start - uint48(DURATION);
|
|
63
68
|
|
|
64
69
|
JBRuleset memory ruleset = _makeRuleset({queuedAt: queued, start: start});
|
|
@@ -67,8 +72,10 @@ contract TestDeadlineFuzz_Local is JBTest {
|
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
/// @notice Ruleset with enough gap and deadline passed returns Approved.
|
|
70
|
-
function test_gapSufficient_deadlinePassed_isApproved() external {
|
|
75
|
+
function test_gapSufficient_deadlinePassed_isApproved() external view {
|
|
76
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
71
77
|
uint48 start = uint48(block.timestamp + 1); // start is very soon
|
|
78
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
72
79
|
uint48 queued = start - uint48(DURATION) - 1; // plenty of gap
|
|
73
80
|
|
|
74
81
|
JBRuleset memory ruleset = _makeRuleset({queuedAt: queued, start: start});
|
|
@@ -123,7 +130,9 @@ contract TestDeadlineFuzz_Local is JBTest {
|
|
|
123
130
|
|
|
124
131
|
// Warp to a timestamp large enough so that start >= gap always holds.
|
|
125
132
|
vm.warp(gap + 1);
|
|
133
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
126
134
|
uint48 start = uint48(block.timestamp);
|
|
135
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
127
136
|
uint48 queuedAt = start - uint48(gap);
|
|
128
137
|
|
|
129
138
|
JBRuleset memory ruleset = _makeRuleset({queuedAt: queuedAt, start: start});
|
|
@@ -166,7 +175,9 @@ contract TestDeadlineFuzz_Local is JBTest {
|
|
|
166
175
|
// Ensure block.timestamp >= duration to avoid underflow.
|
|
167
176
|
vm.warp(duration + 1);
|
|
168
177
|
|
|
178
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
169
179
|
uint48 start = uint48(block.timestamp + 1);
|
|
180
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
170
181
|
uint48 queuedAt = uint48(block.timestamp - duration);
|
|
171
182
|
|
|
172
183
|
JBRuleset memory ruleset = _makeRuleset({queuedAt: queuedAt, start: start});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBDirectory} from "../../../../src/JBDirectory.sol";
|
|
5
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
6
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
7
|
+
import {IJBProjects} from "../../../../src/interfaces/IJBProjects.sol";
|
|
5
8
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
9
|
|
|
7
10
|
/*
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBDirectoryAccessControl} from "../../../../src/interfaces/IJBDirectoryAccessControl.sol";
|
|
5
|
+
import {IJBTerminal} from "../../../../src/interfaces/IJBTerminal.sol";
|
|
6
|
+
import {JBAccountingContext} from "../../../../src/structs/JBAccountingContext.sol";
|
|
7
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
8
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
9
|
import {JBDirectorySetup} from "./JBDirectorySetup.sol";
|
|
6
10
|
|
|
7
11
|
contract TestPrimaryTerminalOf_Local is JBDirectorySetup {
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {StdStorage, stdStorage} from "forge-std/StdStorage.sol";
|
|
5
|
+
import {JBDirectory} from "../../../../src/JBDirectory.sol";
|
|
6
|
+
import {JBPermissioned} from "../../../../src/abstract/JBPermissioned.sol";
|
|
7
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
8
|
+
import {IJBDirectoryAccessControl} from "../../../../src/interfaces/IJBDirectoryAccessControl.sol";
|
|
9
|
+
import {IJBMigratable} from "../../../../src/interfaces/IJBMigratable.sol";
|
|
10
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
11
|
+
import {IJBProjects} from "../../../../src/interfaces/IJBProjects.sol";
|
|
12
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
13
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
14
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
15
|
import {JBDirectorySetup} from "./JBDirectorySetup.sol";
|
|
6
16
|
|
|
7
17
|
contract TestSetControllerOf_Local is JBDirectorySetup {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {StdStorage, stdStorage} from "forge-std/StdStorage.sol";
|
|
5
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
6
|
+
import {IJBDirectoryAccessControl} from "../../../../src/interfaces/IJBDirectoryAccessControl.sol";
|
|
7
|
+
import {IJBMigratable} from "../../../../src/interfaces/IJBMigratable.sol";
|
|
8
|
+
import {IJBProjects} from "../../../../src/interfaces/IJBProjects.sol";
|
|
9
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
10
|
+
import {ERC165, IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
11
|
import {JBDirectorySetup} from "./JBDirectorySetup.sol";
|
|
6
12
|
|
|
7
13
|
/// @notice A mock controller that asserts the directory still points to it during migrate().
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {StdStorage, stdStorage} from "forge-std/StdStorage.sol";
|
|
5
|
+
import {JBDirectory} from "../../../../src/JBDirectory.sol";
|
|
6
|
+
import {JBPermissioned} from "../../../../src/abstract/JBPermissioned.sol";
|
|
7
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
8
|
+
import {IJBDirectoryAccessControl} from "../../../../src/interfaces/IJBDirectoryAccessControl.sol";
|
|
9
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
10
|
+
import {IJBTerminal} from "../../../../src/interfaces/IJBTerminal.sol";
|
|
11
|
+
import {JBAccountingContext} from "../../../../src/structs/JBAccountingContext.sol";
|
|
12
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
13
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
14
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
15
|
import {JBDirectorySetup} from "./JBDirectorySetup.sol";
|
|
6
16
|
|
|
7
17
|
contract TestSetPrimaryTerminalOf_Local is JBDirectorySetup {
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {StdStorage, stdStorage} from "forge-std/StdStorage.sol";
|
|
5
|
+
import {JBDirectory} from "../../../../src/JBDirectory.sol";
|
|
6
|
+
import {JBPermissioned} from "../../../../src/abstract/JBPermissioned.sol";
|
|
7
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
8
|
+
import {IJBDirectoryAccessControl} from "../../../../src/interfaces/IJBDirectoryAccessControl.sol";
|
|
9
|
+
import {IJBPermissions} from "../../../../src/interfaces/IJBPermissions.sol";
|
|
10
|
+
import {IJBTerminal} from "../../../../src/interfaces/IJBTerminal.sol";
|
|
11
|
+
import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
|
|
12
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
13
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
14
|
import {JBDirectorySetup} from "./JBDirectorySetup.sol";
|
|
6
15
|
|
|
7
16
|
contract TestSetTerminalsOf_Local is JBDirectorySetup {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBERC20} from "../../../../src/JBERC20.sol";
|
|
5
|
+
import {IJBToken} from "../../../../src/interfaces/IJBToken.sol";
|
|
5
6
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
7
|
|
|
7
8
|
/*
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
contract SigUtils {
|
|
5
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
5
6
|
bytes32 internal DOMAIN_SEPARATOR;
|
|
6
7
|
|
|
8
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
7
9
|
constructor(bytes32 _DOMAIN_SEPARATOR) {
|
|
8
10
|
DOMAIN_SEPARATOR = _DOMAIN_SEPARATOR;
|
|
9
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
5
5
|
import {JBERC20Setup} from "./JBERC20Setup.sol";
|
|
6
6
|
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
5
5
|
import {JBERC20Setup} from "./JBERC20Setup.sol";
|
|
6
6
|
|
|
7
7
|
contract TestName_Local is JBERC20Setup {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
|
|
5
5
|
import {JBERC20Setup} from "./JBERC20Setup.sol";
|
|
6
6
|
import {SigUtils} from "./SigUtils.sol";
|
|
7
7
|
|
|
@@ -9,7 +9,9 @@ contract TestNonces_Local is JBERC20Setup {
|
|
|
9
9
|
IERC20Permit _token;
|
|
10
10
|
SigUtils sigUtils;
|
|
11
11
|
|
|
12
|
+
// forge-lint: disable-next-line(screaming-snake-case-immutable)
|
|
12
13
|
bytes32 private immutable _hashedName = keccak256(bytes("JBToken"));
|
|
14
|
+
// forge-lint: disable-next-line(screaming-snake-case-immutable)
|
|
13
15
|
bytes32 private immutable _hashedVersion = keccak256(bytes("1"));
|
|
14
16
|
|
|
15
17
|
bytes32 _domain;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
5
5
|
import {JBERC20Setup} from "./JBERC20Setup.sol";
|
|
6
6
|
|
|
7
7
|
contract TestSymbol_Local is JBERC20Setup {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBFeelessAddresses} from "../../../../src/JBFeelessAddresses.sol";
|
|
5
|
+
import {IJBFeelessAddresses} from "../../../../src/interfaces/IJBFeelessAddresses.sol";
|
|
5
6
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
7
|
|
|
7
8
|
/*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBFeelessAddresses} from "../../../../src/interfaces/IJBFeelessAddresses.sol";
|
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
5
6
|
import {JBFeelessSetup} from "./JBFeelessSetup.sol";
|
|
6
7
|
|
|
7
8
|
contract TestSupportsInterface_Local is JBFeelessSetup {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBFeelessAddresses} from "../../../../src/interfaces/IJBFeelessAddresses.sol";
|
|
5
5
|
import {JBFeelessSetup} from "./JBFeelessSetup.sol";
|
|
6
6
|
|
|
7
7
|
contract TestSetFeelessAddress_Local is JBFeelessSetup {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
5
5
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
6
|
import {JBFees} from "../../../../src/libraries/JBFees.sol";
|
|
7
7
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBFundAccessLimits} from "../../../../src/JBFundAccessLimits.sol";
|
|
5
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
6
|
+
import {IJBFundAccessLimits} from "../../../../src/interfaces/IJBFundAccessLimits.sol";
|
|
5
7
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
8
|
|
|
7
9
|
/*
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBFundAccessLimits} from "../../../../src/JBFundAccessLimits.sol";
|
|
5
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
6
|
+
import {JBCurrencyAmount} from "../../../../src/structs/JBCurrencyAmount.sol";
|
|
7
|
+
import {JBFundAccessLimitGroup} from "../../../../src/structs/JBFundAccessLimitGroup.sol";
|
|
5
8
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
9
|
|
|
7
10
|
/// @notice Edge case tests for JBFundAccessLimits append behavior and packing.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
5
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
6
|
+
import {JBCurrencyAmount} from "../../../../src/structs/JBCurrencyAmount.sol";
|
|
7
|
+
import {JBFundAccessLimitGroup} from "../../../../src/structs/JBFundAccessLimitGroup.sol";
|
|
5
8
|
import {JBFundAccessSetup} from "./JBFundAccessSetup.sol";
|
|
6
9
|
|
|
7
10
|
contract TestPayoutLimitOf_Local is JBFundAccessSetup {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
5
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
6
|
+
import {JBCurrencyAmount} from "../../../../src/structs/JBCurrencyAmount.sol";
|
|
7
|
+
import {JBFundAccessLimitGroup} from "../../../../src/structs/JBFundAccessLimitGroup.sol";
|
|
5
8
|
import {JBFundAccessSetup} from "./JBFundAccessSetup.sol";
|
|
6
9
|
|
|
7
10
|
contract TestPayoutLimitsOf_Local is JBFundAccessSetup {
|
|
@@ -28,6 +31,7 @@ contract TestPayoutLimitsOf_Local is JBFundAccessSetup {
|
|
|
28
31
|
JBCurrencyAmount({amount: _payoutLimit, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))});
|
|
29
32
|
|
|
30
33
|
// Specify a second payout limit.
|
|
34
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
31
35
|
_payoutLimits[1] = JBCurrencyAmount({amount: _payoutLimit2, currency: uint32(uint160(_someToken))});
|
|
32
36
|
|
|
33
37
|
// Specify a surplus allowance.
|
|
@@ -66,6 +70,7 @@ contract TestPayoutLimitsOf_Local is JBFundAccessSetup {
|
|
|
66
70
|
|
|
67
71
|
assertEq(payoutLimits[0].currency, uint32(uint160(JBConstants.NATIVE_TOKEN)));
|
|
68
72
|
assertEq(payoutLimits[0].amount, _payoutLimit);
|
|
73
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
69
74
|
assertEq(payoutLimits[1].currency, uint32(uint160(_someToken)));
|
|
70
75
|
assertEq(payoutLimits[1].amount, _payoutLimit2);
|
|
71
76
|
}
|
|
@@ -77,6 +82,7 @@ contract TestPayoutLimitsOf_Local is JBFundAccessSetup {
|
|
|
77
82
|
|
|
78
83
|
assertEq(payoutLimits[0].currency, uint32(uint160(JBConstants.NATIVE_TOKEN)));
|
|
79
84
|
assertEq(payoutLimits[0].amount, _payoutLimit);
|
|
85
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
80
86
|
assertEq(payoutLimits[1].currency, uint32(uint160(_someToken)));
|
|
81
87
|
assertEq(payoutLimits[1].amount, _payoutLimit2);
|
|
82
88
|
}
|
|
@@ -88,6 +94,7 @@ contract TestPayoutLimitsOf_Local is JBFundAccessSetup {
|
|
|
88
94
|
|
|
89
95
|
assertEq(payoutLimits[0].currency, uint32(uint160(JBConstants.NATIVE_TOKEN)));
|
|
90
96
|
assertEq(payoutLimits[0].amount, _payoutLimit);
|
|
97
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
91
98
|
assertEq(payoutLimits[1].currency, uint32(uint160(_someToken)));
|
|
92
99
|
assertEq(payoutLimits[1].amount, _payoutLimit2);
|
|
93
100
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {JBFundAccessLimits} from "../../../../src/JBFundAccessLimits.sol";
|
|
5
|
+
import {JBControlled} from "../../../../src/abstract/JBControlled.sol";
|
|
6
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
7
|
+
import {IJBFundAccessLimits} from "../../../../src/interfaces/IJBFundAccessLimits.sol";
|
|
8
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
9
|
+
import {JBCurrencyAmount} from "../../../../src/structs/JBCurrencyAmount.sol";
|
|
10
|
+
import {JBFundAccessLimitGroup} from "../../../../src/structs/JBFundAccessLimitGroup.sol";
|
|
5
11
|
import {JBFundAccessSetup} from "./JBFundAccessSetup.sol";
|
|
6
12
|
|
|
7
13
|
contract TestSetFundAccessLimitsFor_Local is JBFundAccessSetup {
|
|
@@ -113,6 +119,7 @@ contract TestSetFundAccessLimitsFor_Local is JBFundAccessSetup {
|
|
|
113
119
|
JBCurrencyAmount({amount: _validLimit, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))});
|
|
114
120
|
|
|
115
121
|
// Specify a second payout limit.
|
|
122
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
116
123
|
_payoutLimits[1] = JBCurrencyAmount({amount: _validLimit, currency: uint32(uint160(_someToken))});
|
|
117
124
|
|
|
118
125
|
// Specify a surplus allowance.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
5
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
6
|
+
import {JBCurrencyAmount} from "../../../../src/structs/JBCurrencyAmount.sol";
|
|
7
|
+
import {JBFundAccessLimitGroup} from "../../../../src/structs/JBFundAccessLimitGroup.sol";
|
|
5
8
|
import {JBFundAccessSetup} from "./JBFundAccessSetup.sol";
|
|
6
9
|
|
|
7
10
|
contract TestSurplusAllowanceOf_Local is JBFundAccessSetup {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import {IJBDirectory} from "../../../../src/interfaces/IJBDirectory.sol";
|
|
5
|
+
import {JBConstants} from "../../../../src/libraries/JBConstants.sol";
|
|
6
|
+
import {JBCurrencyAmount} from "../../../../src/structs/JBCurrencyAmount.sol";
|
|
7
|
+
import {JBFundAccessLimitGroup} from "../../../../src/structs/JBFundAccessLimitGroup.sol";
|
|
5
8
|
import {JBFundAccessSetup} from "./JBFundAccessSetup.sol";
|
|
6
9
|
|
|
7
10
|
contract TestSurplusAllowancesOf_Local is JBFundAccessSetup {
|
|
@@ -31,6 +34,7 @@ contract TestSurplusAllowancesOf_Local is JBFundAccessSetup {
|
|
|
31
34
|
_surplusAllowances[0] =
|
|
32
35
|
JBCurrencyAmount({amount: 1e18, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))});
|
|
33
36
|
|
|
37
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
34
38
|
_surplusAllowances[1] = JBCurrencyAmount({amount: 2e18, currency: uint32(uint160(_someToken))});
|
|
35
39
|
|
|
36
40
|
_fundAccessLimitGroup[0] = JBFundAccessLimitGroup({
|
|
@@ -65,11 +69,13 @@ contract TestSurplusAllowancesOf_Local is JBFundAccessSetup {
|
|
|
65
69
|
|
|
66
70
|
assertEq(surplusLimits[0].currency, uint32(uint160(JBConstants.NATIVE_TOKEN)));
|
|
67
71
|
assertEq(surplusLimits[0].amount, 1e18);
|
|
72
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
68
73
|
assertEq(surplusLimits[1].currency, uint32(uint160(_someToken)));
|
|
69
74
|
assertEq(surplusLimits[1].amount, 2e18);
|
|
70
75
|
|
|
71
76
|
assertEq(surplusLimits2[0].currency, uint32(uint160(JBConstants.NATIVE_TOKEN)));
|
|
72
77
|
assertEq(surplusLimits2[0].amount, 1e18);
|
|
78
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
73
79
|
assertEq(surplusLimits2[1].currency, uint32(uint160(_someToken)));
|
|
74
80
|
assertEq(surplusLimits2[1].amount, 2e18);
|
|
75
81
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
|
-
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
4
|
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
6
5
|
import {JBMetadataResolver} from "../../../../src/libraries/JBMetadataResolver.sol";
|
|
7
6
|
|
|
@@ -24,6 +23,7 @@ contract TestGetDataFor_Local is JBTest {
|
|
|
24
23
|
assertEq("", _data);
|
|
25
24
|
}
|
|
26
25
|
|
|
26
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
27
27
|
modifier whenMetadataLengthGTMIN_METADATA_LENGTH() {
|
|
28
28
|
_;
|
|
29
29
|
}
|