diff --git a/.gas-snapshot b/.gas-snapshot index dd5ecb045..6b9e938ae 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,37 +1,37 @@ BeaconProxyTest:testDeploymentInvariants() (gas: 108566) -BeaconProxyTest:testImplementation(uint256) (runs: 256, μ: 61827, ~: 62916) +BeaconProxyTest:testImplementation(uint256) (runs: 256, μ: 61849, ~: 62938) BeaconTest:testDeploymentInvariants() (gas: 13655) BeaconTest:testSupportsInterface() (gas: 5585) -BeaconTest:testUpgradeTo() (gas: 2549819) +BeaconTest:testUpgradeTo() (gas: 2540609) BeaconTest:testUpgradeToFailsIfImplementationNotContract() (gas: 13099) BeaconTest:testUpgradeToOnlyCallableByOwner(address) (runs: 256, μ: 11768, ~: 11768) -BountyManagerLifecycle:test_e2e_BountyManagerLifecycle() (gas: 3989391) -BountyManagerTest:testAddBounty(uint256,uint256,uint256,bytes) (runs: 256, μ: 2558580, ~: 2446605) -BountyManagerTest:testAddBountyModifierInPosition() (gas: 63018) -BountyManagerTest:testAddClaim(uint256,address[],uint256[],bytes) (runs: 256, μ: 137563648, ~: 106686449) -BountyManagerTest:testAddClaimModifierInPosition() (gas: 252109) -BountyManagerTest:testContributorsNotChanged(bool,address,uint256) (runs: 256, μ: 776687, ~: 832263) -BountyManagerTest:testGetBountyInformationModifierInPosition() (gas: 15882) +BountyManagerLifecycle:test_e2e_BountyManagerLifecycle() (gas: 3919822) +BountyManagerTest:testAddBounty(uint256,uint256,uint256,bytes) (runs: 256, μ: 2523487, ~: 2434234) +BountyManagerTest:testAddBountyModifierInPosition() (gas: 63511) +BountyManagerTest:testAddClaim(uint256,address[],uint256[],bytes) (runs: 256, μ: 139305208, ~: 124961825) +BountyManagerTest:testAddClaimModifierInPosition() (gas: 252479) +BountyManagerTest:testContributorsNotChanged(bool,address,uint256) (runs: 256, μ: 777222, ~: 832123) +BountyManagerTest:testGetBountyInformationModifierInPosition() (gas: 15837) BountyManagerTest:testGetClaimInformationModifierInPosition() (gas: 16309) BountyManagerTest:testInit() (gas: 210) -BountyManagerTest:testLockBounty() (gas: 190873) -BountyManagerTest:testLockBountyModifierInPosition() (gas: 215717) -BountyManagerTest:testLocked(bool) (runs: 256, μ: 762851, ~: 825850) -BountyManagerTest:testNotClaimed(bool) (runs: 256, μ: 828706, ~: 825871) -BountyManagerTest:testOnlyClaimContributor(address[],uint256[],address) (runs: 256, μ: 5353162, ~: 6092880) -BountyManagerTest:testReinitFails() (gas: 31571) -BountyManagerTest:testUpdateBounty(bytes) (runs: 256, μ: 237100, ~: 223676) -BountyManagerTest:testUpdateBountyModifierInPosition() (gas: 220349) -BountyManagerTest:testUpdateClaimContributors(address[],uint256[]) (runs: 256, μ: 5706259, ~: 6350719) -BountyManagerTest:testUpdateClaimContributorsModifierInPosition() (gas: 1256305) -BountyManagerTest:testUpdateClaimDetails(bytes) (runs: 256, μ: 592315, ~: 578555) -BountyManagerTest:testUpdateClaimDetailsModifierInPosition() (gas: 1219559) -BountyManagerTest:testValidBountyId(uint256,uint256) (runs: 256, μ: 40652839, ~: 41108006) -BountyManagerTest:testValidClaimId(uint256,uint256) (runs: 256, μ: 136051760, ~: 133989336) -BountyManagerTest:testValidContributorsForBounty(uint256,uint256,address[],uint256[]) (runs: 256, μ: 576061, ~: 269657) -BountyManagerTest:testValidPayoutAmounts(uint256,uint256) (runs: 256, μ: 84431, ~: 29974) -BountyManagerTest:testVerifyClaim(address[],uint256[],bytes) (runs: 256, μ: 10086457, ~: 11095160) -BountyManagerTest:testVerifyClaimModifierInPosition() (gas: 1266063) +BountyManagerTest:testLockBounty() (gas: 190720) +BountyManagerTest:testLockBountyModifierInPosition() (gas: 216047) +BountyManagerTest:testLocked(bool) (runs: 256, μ: 760034, ~: 825710) +BountyManagerTest:testNotClaimed(bool) (runs: 256, μ: 828670, ~: 825731) +BountyManagerTest:testOnlyClaimContributor(address[],uint256[],address) (runs: 256, μ: 5352985, ~: 6091519) +BountyManagerTest:testReinitFails() (gas: 31593) +BountyManagerTest:testUpdateBounty(bytes) (runs: 256, μ: 236969, ~: 223545) +BountyManagerTest:testUpdateBountyModifierInPosition() (gas: 220701) +BountyManagerTest:testUpdateClaimContributors(address[],uint256[]) (runs: 256, μ: 5703444, ~: 6350712) +BountyManagerTest:testUpdateClaimContributorsModifierInPosition() (gas: 1256432) +BountyManagerTest:testUpdateClaimDetails(bytes) (runs: 256, μ: 592266, ~: 578506) +BountyManagerTest:testUpdateClaimDetailsModifierInPosition() (gas: 1219397) +BountyManagerTest:testValidBountyId(uint256,uint256) (runs: 256, μ: 41144364, ~: 42855134) +BountyManagerTest:testValidClaimId(uint256,uint256) (runs: 256, μ: 136819516, ~: 136351521) +BountyManagerTest:testValidContributorsForBounty(uint256,uint256,address[],uint256[]) (runs: 256, μ: 602689, ~: 270427) +BountyManagerTest:testValidPayoutAmounts(uint256,uint256) (runs: 256, μ: 87268, ~: 29920) +BountyManagerTest:testVerifyClaim(address[],uint256[],bytes) (runs: 256, μ: 10084741, ~: 11090557) +BountyManagerTest:testVerifyClaimModifierInPosition() (gas: 1266071) Deployment:testContructor() (gas: 22575) Deployment:testInitialization() (gas: 22554) Deployment:testInitilizationFailsIfMintAlreadyExecuted(address,uint256) (runs: 256, μ: 183728, ~: 183558) @@ -54,17 +54,17 @@ ERC20:testTransferAll(address,address,uint256) (runs: 256, μ: 209763, ~: 209763 ERC20:testTransferAllFrom(address,address,uint256) (runs: 256, μ: 216650, ~: 216622) ERC20:testTransferAllFromWithZeroToken(address,address) (runs: 256, μ: 282655, ~: 282630) ERC20:testTransferFrom(address,address,uint256) (runs: 256, μ: 216601, ~: 216573) -ERC20PaymentClientTest:testAddPaymentOrder(uint256,address,uint256,uint256) (runs: 256, μ: 20994, ~: 21264) -ERC20PaymentClientTest:testAddPaymentOrderFailsForInvalidAmount() (gas: 9470) -ERC20PaymentClientTest:testAddPaymentOrderFailsForInvalidRecipient() (gas: 11858) -ERC20PaymentClientTest:testAddPaymentOrders() (gas: 333592) -ERC20PaymentClientTest:testCollectPaymentOrders(uint256,address,uint256,uint256) (runs: 256, μ: 41937, ~: 42210) +ERC20PaymentClientTest:testAddPaymentOrder(uint256,address,uint256,uint256) (runs: 256, μ: 20915, ~: 21199) +ERC20PaymentClientTest:testAddPaymentOrderFailsForInvalidAmount() (gas: 9447) +ERC20PaymentClientTest:testAddPaymentOrderFailsForInvalidRecipient() (gas: 11812) +ERC20PaymentClientTest:testAddPaymentOrders() (gas: 333527) +ERC20PaymentClientTest:testCollectPaymentOrders(uint256,address,uint256,uint256) (runs: 256, μ: 41848, ~: 42145) ERC20PaymentClientTest:testCollectPaymentOrdersFailsCallerNotAuthorized() (gas: 11805) -ERC20PaymentClientTest:testEnsureTokenAllowance(uint256,uint256) (runs: 256, μ: 2461360, ~: 2458918) -ERC20PaymentClientTest:testEnsureTokenBalance(uint256) (runs: 256, μ: 2631869, ~: 2634512) -ERC20PaymentClientTest:testIsAuthorizedPaymentProcessor(address) (runs: 256, μ: 2425740, ~: 2425740) -FundManagement:test_e2e_OrchestratorFundManagement() (gas: 2449268) -LibMetadataTest:testIdentifier((uint256,uint256,string,string)) (runs: 256, μ: 2761, ~: 2787) +ERC20PaymentClientTest:testEnsureTokenAllowance(uint256,uint256) (runs: 256, μ: 2457041, ~: 2459694) +ERC20PaymentClientTest:testEnsureTokenBalance(uint256) (runs: 256, μ: 2627410, ~: 2629898) +ERC20PaymentClientTest:testIsAuthorizedPaymentProcessor(address) (runs: 256, μ: 2421126, ~: 2421126) +FundManagement:test_e2e_OrchestratorFundManagement() (gas: 2445863) +LibMetadataTest:testIdentifier((uint256,uint256,string,string)) (runs: 256, μ: 2768, ~: 2787) LibMetadataTest:testMetadataInvalidIfTitleEmpty(uint256,uint256) (runs: 256, μ: 3552, ~: 3552) LibMetadataTest:testMetadataInvalidIfURLEmpty(uint256,uint256) (runs: 256, μ: 3494, ~: 3494) LibMetadataTest:testMetadataInvalidIfVersionOnlyZero(uint256,uint256) (runs: 256, μ: 725, ~: 725) @@ -86,17 +86,17 @@ LinkedIdListTest:testValidId(uint256[],uint256) (runs: 256, μ: 3410871, ~: 3581 LinkedIdListTest:testValidMoveParameter(uint256[],uint256,uint256,uint256) (runs: 256, μ: 3327895, ~: 3175285) LinkedIdListTest:testValidNewId(uint256[],uint256) (runs: 256, μ: 3428955, ~: 3601866) LinkedIdListTest:testValidPosition(uint256[],uint256) (runs: 256, μ: 3410873, ~: 3580480) -MetadataManagerTest:testInit() (gas: 491680) -MetadataManagerTest:testInit2MetadataManager() (gas: 57826) +MetadataManagerTest:testInit() (gas: 487718) +MetadataManagerTest:testInit2MetadataManager() (gas: 57984) MetadataManagerTest:testReinitFails() (gas: 31524) -MetadataManagerTest:testSetter() (gas: 317480) +MetadataManagerTest:testSetter() (gas: 317194) MintBurn:testFailBurnAll(address,uint256) (runs: 256, μ: 167810, ~: 223832) MintBurn:testFailMintMoreThanMaxSupply(address) (runs: 256, μ: 93127, ~: 93127) -ModuleFactoryTest:testCreateModule((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 405717, ~: 398133) -ModuleFactoryTest:testCreateModuleFailsIfBeaconsImplementationIsZero((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 1254177, ~: 1254208) -ModuleFactoryTest:testCreateModuleFailsIfMetadataUnregistered((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 16772, ~: 16750) +ModuleFactoryTest:testCreateModule((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 406648, ~: 398068) +ModuleFactoryTest:testCreateModuleFailsIfBeaconsImplementationIsZero((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 1249562, ~: 1249594) +ModuleFactoryTest:testCreateModuleFailsIfMetadataUnregistered((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 16765, ~: 16750) ModuleFactoryTest:testDeploymentInvariants() (gas: 10709) -ModuleFactoryTest:testRegisterMetadata((uint256,uint256,string,string)) (runs: 256, μ: 73945, ~: 73961) +ModuleFactoryTest:testRegisterMetadata((uint256,uint256,string,string)) (runs: 256, μ: 73946, ~: 73961) ModuleFactoryTest:testRegisterMetadataFailsIfAlreadyRegistered() (gas: 208365) ModuleFactoryTest:testRegisterMetadataFailsIfBeaconsImplementationIsZero() (gas: 33633) ModuleFactoryTest:testRegisterMetadataFailsIfMetadataInvalid() (gas: 20331) @@ -118,221 +118,208 @@ ModuleManagerTest:testReinitFails() (gas: 13773) ModuleManagerTest:testRemoveModuleFailsIfCallerNotAuthorized(address) (runs: 256, μ: 90707, ~: 90707) ModuleManagerTest:testRemoveModuleFailsIfNotModule(address) (runs: 256, μ: 22492, ~: 22492) ModuleManagerTest:testRemoveModules(address[]) (runs: 256, μ: 7252102, ~: 6521859) -ModuleUpdateTest:testBeaconUpgrade((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 2906836, ~: 2899146) +ModuleUpdateTest:testBeaconUpgrade((uint256,uint256,string,string),address,bytes) (runs: 256, μ: 2896727, ~: 2889789) ModuleUpdateTest:testDeploymentInvariants() (gas: 10686) -OrchestratorCreation:testCreateNewOrchestrator() (gas: 3551507) -OrchestratorCreation:testManageModulesLiveOnPorposal() (gas: 5376761) -OrchestratorFactoryTest:testCreateOrchestrator(uint256) (runs: 256, μ: 3999697, ~: 3842870) +OrchestratorCreation:testCreateNewOrchestrator() (gas: 3505838) +OrchestratorCreation:testManageModulesLiveOnPorposal() (gas: 5302458) +OrchestratorFactoryTest:testCreateOrchestrator(uint256) (runs: 256, μ: 4229359, ~: 4450276) OrchestratorFactoryTest:testDeploymentInvariants() (gas: 10647) -OrchestratorFactoryTest:testOrchestratorMapping(uint256) (runs: 256, μ: 10083193, ~: 9979944) -OrchestratorFactoryTest:testValidOrchestratorId(uint256,uint256) (runs: 256, μ: 9932949, ~: 10154506) -OrchestratorTest:testExecuteTx(uint256,address[]) (runs: 256, μ: 7153042, ~: 8882617) -OrchestratorTest:testExecuteTxFailsIfCallFails(uint256,address[]) (runs: 256, μ: 7154258, ~: 8883740) -OrchestratorTest:testExecuteTxFailsIfCallerNotAuthorized(uint256,address[]) (runs: 256, μ: 7140243, ~: 8869725) -OrchestratorTest:testInit(uint256,address[]) (runs: 256, μ: 4898554, ~: 4860801) -OrchestratorTest:testReinitFails(uint256,address[]) (runs: 256, μ: 7208565, ~: 8905092) -OrchestratorTest:testSetAuthorizer(uint256,address[]) (runs: 256, μ: 5982993, ~: 5902474) -OrchestratorTest:testSetFundingManager(uint256,address[]) (runs: 256, μ: 5589478, ~: 5558319) -OrchestratorTest:testSetPaymentProcessor(uint256,address[]) (runs: 256, μ: 4357186, ~: 4329008) +OrchestratorFactoryTest:testOrchestratorMapping(uint256) (runs: 256, μ: 10361148, ~: 10584639) +OrchestratorFactoryTest:testValidOrchestratorId(uint256,uint256) (runs: 256, μ: 10497278, ~: 11159241) +OrchestratorTest:testExecuteTx(uint256,address[]) (runs: 256, μ: 7214170, ~: 8883380) +OrchestratorTest:testExecuteTxFailsIfCallFails(uint256,address[]) (runs: 256, μ: 7215381, ~: 8884501) +OrchestratorTest:testExecuteTxFailsIfCallerNotAuthorized(uint256,address[]) (runs: 256, μ: 7200417, ~: 8869537) +OrchestratorTest:testInit(uint256,address[]) (runs: 256, μ: 4959516, ~: 4973894) +OrchestratorTest:testReinitFails(uint256,address[]) (runs: 256, μ: 7139737, ~: 8867351) +OrchestratorTest:testSetAuthorizer(uint256,address[]) (runs: 256, μ: 5880519, ~: 5893033) +OrchestratorTest:testSetFundingManager(uint256,address[]) (runs: 256, μ: 5634225, ~: 5594092) +OrchestratorTest:testSetPaymentProcessor(uint256,address[]) (runs: 256, μ: 4405651, ~: 4369396) OrchestratorTest:testVersion() (gas: 9727) Rebase:testNoRebaseIfMaxSupplyTarget() (gas: 118025) Rebase:testNoRebaseIfZeroSupplyTarget() (gas: 90080) Rebase:testRebaseTables() (gas: 26401914) -RebasingFundingManagerTest:testDeposit(address,uint256) (runs: 256, μ: 233868, ~: 233812) -RebasingFundingManagerTest:testDepositAndSpendFunds(uint256,uint256[]) (runs: 256, μ: 5232630, ~: 656898) -RebasingFundingManagerTest:testDepositSpendUntilEmptyRedepositAndWindDown(uint256,uint256[]) (runs: 256, μ: 6515804, ~: 848463) -RebasingFundingManagerTest:testInit() (gas: 31515) -RebasingFundingManagerTest:testInit2RebasingFundingManager() (gas: 57974) +RebasingFundingManagerTest:testDeposit(address,uint256) (runs: 256, μ: 233905, ~: 233857) +RebasingFundingManagerTest:testDepositAndSpendFunds(uint256,uint256[]) (runs: 256, μ: 5056859, ~: 656788) +RebasingFundingManagerTest:testDepositSpendUntilEmptyRedepositAndWindDown(uint256,uint256[]) (runs: 256, μ: 6940627, ~: 847462) +RebasingFundingManagerTest:testInit() (gas: 31471) +RebasingFundingManagerTest:testInit2RebasingFundingManager() (gas: 57956) RebasingFundingManagerTest:testReinitFails() (gas: 31543) -RebasingFundingManagerTest:testSelfDepositFails(address,uint256) (runs: 256, μ: 248825, ~: 248783) +RebasingFundingManagerTest:testSelfDepositFails(address,uint256) (runs: 256, μ: 248759, ~: 248717) RebasingFundingManagerTest:testTransferOrchestratorToken(address,uint256) (runs: 256, μ: 382, ~: 382) -RebasingFundingManagerTest:testTransferOrchestratorTokenFails(address,address) (runs: 256, μ: 112211, ~: 112359) -RecurringPaymentManagerTest:testAddRecurringPayment(uint256,uint256,uint256,address) (runs: 256, μ: 2378736, ~: 2382987) -RecurringPaymentManagerTest:testAddRecurringPaymentModifierInPosition() (gas: 354925) -RecurringPaymentManagerTest:testGetFutureEpoch(uint256) (runs: 256, μ: 286268, ~: 286160) +RebasingFundingManagerTest:testTransferOrchestratorTokenFails(address,address) (runs: 256, μ: 112403, ~: 112403) +RecurringPaymentManagerTest:testAddRecurringPayment(uint256,uint256,uint256,address) (runs: 256, μ: 2243415, ~: 2118229) +RecurringPaymentManagerTest:testAddRecurringPaymentModifierInPosition() (gas: 350335) +RecurringPaymentManagerTest:testGetFutureEpoch(uint256) (runs: 256, μ: 286241, ~: 286138) RecurringPaymentManagerTest:testGetRecurringPaymentInformationModifierInPosition() (gas: 14545) RecurringPaymentManagerTest:testInit() (gas: 781847) -RecurringPaymentManagerTest:testInit2RecurringPaymentManager() (gas: 109091) +RecurringPaymentManagerTest:testInit2RecurringPaymentManager() (gas: 109161) RecurringPaymentManagerTest:testReinitFails() (gas: 280851) -RecurringPaymentManagerTest:testRemoveRecurringPayment(uint256,uint256) (runs: 256, μ: 6373703, ~: 6493005) -RecurringPaymentManagerTest:testRemoveRecurringPaymentModifierInPosition() (gas: 302650) -RecurringPaymentManagerTest:testTrigger(uint256,address[]) (runs: 256, μ: 21093187, ~: 18124064) -RecurringPaymentManagerTest:testTriggerFor(uint256,address[],uint256,uint256) (runs: 256, μ: 7210612, ~: 7147899) -RecurringPaymentManagerTest:testTriggerForModifierInPosition(uint256) (runs: 256, μ: 593863, ~: 594058) -RecurringPaymentManagerTest:testValidId(uint256,uint256,uint256) (runs: 256, μ: 60978773, ~: 60945726) -RecurringPaymentManagerTest:testValidStartEpoch(uint256,uint256) (runs: 256, μ: 438510, ~: 462141) -RecurringPayments:test_e2e_RecurringPayments(uint256) (runs: 256, μ: 3724231, ~: 3724233) -RegisterModuleAtFactory:test_e2e_RegisterModuleAtModuleFactory() (gas: 2038209) -RoleAuthorizerTest:testAdminCannotModifyRoleIfAdminBurned() (gas: 1509243) -RoleAuthorizerTest:testAdminIgnoresIfRoleIsSelfManaged() (gas: 1482435) -RoleAuthorizerTest:testBurnAdminChangesRoleState() (gas: 253) -RoleAuthorizerTest:testBurnedModuleCorrectlyReturnToManagedState() (gas: 1426583) -RoleAuthorizerTest:testChangeRoleAdminOnModuleRole() (gas: 1490184) -RoleAuthorizerTest:testChangeRoleAdminOnModuleRoleFailsIfNotAdmin() (gas: 1375332) -RoleAuthorizerTest:testGrantAdminRole() (gas: 113865) -RoleAuthorizerTest:testGrantAdminRoleFailsIfNotOwner() (gas: 52415) -RoleAuthorizerTest:testGrantGlobalRole() (gas: 118807) -RoleAuthorizerTest:testGrantGlobalRoleFailsIfNotOwner() (gas: 54976) -RoleAuthorizerTest:testGrantManagerRole(address[]) (runs: 256, μ: 1079354, ~: 1165259) -RoleAuthorizerTest:testGrantManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 766013, ~: 825612) -RoleAuthorizerTest:testGrantOwnerRole(address[]) (runs: 256, μ: 1086756, ~: 1134940) -RoleAuthorizerTest:testGrantRoleFromModule() (gas: 1437188) -RoleAuthorizerTest:testGrantRoleFromModuleFailsIfCalledByNonModule() (gas: 1349038) -RoleAuthorizerTest:testGrantRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1319241) -RoleAuthorizerTest:testGrantRoleFromModuleFailsIfModuleNotSelfManaged() (gas: 1329908) -RoleAuthorizerTest:testGrantRoleFromModuleIdempotence() (gas: 1438319) -RoleAuthorizerTest:testInit2RoleAuthorizer() (gas: 57923) -RoleAuthorizerTest:testInitWithInitialOwner(address) (runs: 256, μ: 2919027, ~: 2919027) -RoleAuthorizerTest:testInitWithoutInitialOwners() (gas: 2882527) -RoleAuthorizerTest:testModifyRoleByAdminFailsIfAdminBurned() (gas: 1534950) -RoleAuthorizerTest:testModuleOnlyUsesOrchestratorRolesWhenNotSelfManaged() (gas: 1426563) -RoleAuthorizerTest:testModuleOnlyUsesOwnRolesWhenSelfManaged() (gas: 1440057) -RoleAuthorizerTest:testModuleReturnToManagedMode() (gas: 231) -RoleAuthorizerTest:testReinitFails() (gas: 1541157) -RoleAuthorizerTest:testRemoveLastOwnerFails() (gas: 32354) -RoleAuthorizerTest:testRevokeGlobalRole() (gas: 97391) -RoleAuthorizerTest:testRevokeGlobalRoleFailsIfNotOwner() (gas: 152592) -RoleAuthorizerTest:testRevokeManagerRole(address[]) (runs: 256, μ: 921244, ~: 1000532) -RoleAuthorizerTest:testRevokeManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 766270, ~: 825888) -RoleAuthorizerTest:testRevokeOwnerRole() (gas: 98472) -RoleAuthorizerTest:testRevokeRoleFromModule() (gas: 1370023) -RoleAuthorizerTest:testRevokeRoleFromModuleFailsIfCalledByNonModule() (gas: 1349046) -RoleAuthorizerTest:testRevokeRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1321311) -RoleAuthorizerTest:testRevokeRoleFromModuleFailsIfModuleNotSelfManaged() (gas: 1331945) -RoleAuthorizerTest:testRevokeRoleFromModuleIdempotence() (gas: 1354143) -RoleAuthorizerTest:testtoggleModuleSelfManagement() (gas: 1323826) -SimplePaymentProcessorTest:testCancelPaymentsFailsWhenCalledByNonModule(address) (runs: 256, μ: 32806, ~: 32816) -SimplePaymentProcessorTest:testCancelPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2303677, ~: 2303677) +RecurringPaymentManagerTest:testRemoveRecurringPayment(uint256,uint256) (runs: 256, μ: 6329564, ~: 6462062) +RecurringPaymentManagerTest:testRemoveRecurringPaymentModifierInPosition() (gas: 299725) +RecurringPaymentManagerTest:testTrigger(uint256,address[]) (runs: 256, μ: 21560606, ~: 18663371) +RecurringPaymentManagerTest:testTriggerFor(uint256,address[],uint256,uint256) (runs: 256, μ: 7176903, ~: 7145248) +RecurringPaymentManagerTest:testTriggerForModifierInPosition(uint256) (runs: 256, μ: 590668, ~: 590882) +RecurringPaymentManagerTest:testValidId(uint256,uint256,uint256) (runs: 256, μ: 57457266, ~: 54311315) +RecurringPaymentManagerTest:testValidStartEpoch(uint256,uint256) (runs: 256, μ: 436534, ~: 459553) +RecurringPayments:test_e2e_RecurringPayments(uint256) (runs: 256, μ: 3721981, ~: 3721970) +RegisterModuleAtFactory:test_e2e_RegisterModuleAtModuleFactory() (gas: 2033595) +RoleAuthorizerTest:testAdminCannotModifyRoleIfAdminBurned() (gas: 1476959) +RoleAuthorizerTest:testBurnAdminChangesRoleState() (gas: 231) +RoleAuthorizerTest:testChangeRoleAdminOnModuleRole() (gas: 1457766) +RoleAuthorizerTest:testChangeRoleAdminOnModuleRoleFailsIfNotAdmin() (gas: 1342941) +RoleAuthorizerTest:testGrantAdminRole() (gas: 113912) +RoleAuthorizerTest:testGrantAdminRoleFailsIfNotOwner() (gas: 52513) +RoleAuthorizerTest:testGrantGlobalRole() (gas: 116633) +RoleAuthorizerTest:testGrantGlobalRoleFailsIfNotOwner() (gas: 52829) +RoleAuthorizerTest:testGrantManagerRole(address[]) (runs: 256, μ: 1063461, ~: 1165064) +RoleAuthorizerTest:testGrantManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 768151, ~: 825495) +RoleAuthorizerTest:testGrantOwnerRole(address[]) (runs: 256, μ: 1084829, ~: 1182213) +RoleAuthorizerTest:testGrantRoleFromModule() (gas: 1404624) +RoleAuthorizerTest:testGrantRoleFromModuleFailsIfCalledByNonModule() (gas: 1316676) +RoleAuthorizerTest:testGrantRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1287682) +RoleAuthorizerTest:testGrantRoleFromModuleIdempotence() (gas: 1405597) +RoleAuthorizerTest:testInit2RoleAuthorizer() (gas: 57946) +RoleAuthorizerTest:testInitWithInitialOwner(address) (runs: 256, μ: 2662619, ~: 2662619) +RoleAuthorizerTest:testInitWithoutInitialOwners() (gas: 2627170) +RoleAuthorizerTest:testModifyRoleByAdminFailsIfAdminBurned() (gas: 1502753) +RoleAuthorizerTest:testReinitFails() (gas: 1648509) +RoleAuthorizerTest:testRemoveLastOwnerFails() (gas: 29526) +RoleAuthorizerTest:testRevokeGlobalRole() (gas: 95342) +RoleAuthorizerTest:testRevokeGlobalRoleFailsIfNotOwner() (gas: 150168) +RoleAuthorizerTest:testRevokeManagerRole(address[]) (runs: 256, μ: 920463, ~: 997992) +RoleAuthorizerTest:testRevokeManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 767909, ~: 825232) +RoleAuthorizerTest:testRevokeOwnerRole() (gas: 95943) +RoleAuthorizerTest:testRevokeRoleFromModule() (gas: 1336995) +RoleAuthorizerTest:testRevokeRoleFromModuleFailsIfCalledByNonModule() (gas: 1316656) +RoleAuthorizerTest:testRevokeRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1289671) +RoleAuthorizerTest:testRevokeRoleFromModuleIdempotence() (gas: 1321126) +SimplePaymentProcessorTest:testCancelPaymentsFailsWhenCalledByNonModule(address) (runs: 256, μ: 32828, ~: 32838) +SimplePaymentProcessorTest:testCancelPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2299092, ~: 2299092) SimplePaymentProcessorTest:testInit() (gas: 20668) -SimplePaymentProcessorTest:testInit2SimplePaymentProcessor() (gas: 57757) -SimplePaymentProcessorTest:testProcessPayments(address,uint256) (runs: 256, μ: 234217, ~: 234280) +SimplePaymentProcessorTest:testInit2SimplePaymentProcessor() (gas: 57894) +SimplePaymentProcessorTest:testProcessPayments(address,uint256) (runs: 256, μ: 234198, ~: 234260) SimplePaymentProcessorTest:testProcessPaymentsFailsWhenCalledByNonModule(address) (runs: 256, μ: 32850, ~: 32860) -SimplePaymentProcessorTest:testProcessPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2303686, ~: 2303686) +SimplePaymentProcessorTest:testProcessPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2299079, ~: 2299079) SimplePaymentProcessorTest:testReinitFails() (gas: 31449) SimulateTransferPrecision:testSimulation() (gas: 3718) -SingleVoteGovernorLifecycle:test_e2e_SingleVoteGovernorLifecycle() (gas: 3900876) -SingleVoteGovernorTest:testAbstain(address[]) (runs: 256, μ: 8811401, ~: 8178529) -SingleVoteGovernorTest:testAbstainUnauthorized(address[]) (runs: 256, μ: 884088, ~: 876479) -SingleVoteGovernorTest:testAddVoters(address[]) (runs: 256, μ: 1207306, ~: 1191454) -SingleVoteGovernorTest:testCastInvalidVote(uint8) (runs: 256, μ: 199963, ~: 199963) -SingleVoteGovernorTest:testCreateVote() (gas: 850170) -SingleVoteGovernorTest:testCreateVoteWithRecentlyAuthorizedAddress(address[]) (runs: 256, μ: 11608604, ~: 11465472) -SingleVoteGovernorTest:testDoubleExecution() (gas: 367687) -SingleVoteGovernorTest:testDoubleVoting(address[]) (runs: 256, μ: 8168145, ~: 7857725) -SingleVoteGovernorTest:testExecuteFailedVote() (gas: 258986) +SingleVoteGovernorLifecycle:test_e2e_SingleVoteGovernorLifecycle() (gas: 3828119) +SingleVoteGovernorTest:testAbstain(address[]) (runs: 256, μ: 8951529, ~: 8399001) +SingleVoteGovernorTest:testAbstainUnauthorized(address[]) (runs: 256, μ: 868651, ~: 840686) +SingleVoteGovernorTest:testAddVoters(address[]) (runs: 256, μ: 1201433, ~: 1190618) +SingleVoteGovernorTest:testCastInvalidVote(uint8) (runs: 256, μ: 199933, ~: 199933) +SingleVoteGovernorTest:testCreateVote() (gas: 850104) +SingleVoteGovernorTest:testCreateVoteWithRecentlyAuthorizedAddress(address[]) (runs: 256, μ: 11652293, ~: 11462356) +SingleVoteGovernorTest:testDoubleExecution() (gas: 367597) +SingleVoteGovernorTest:testDoubleVoting(address[]) (runs: 256, μ: 8272674, ~: 8064702) +SingleVoteGovernorTest:testExecuteFailedVote() (gas: 258956) SingleVoteGovernorTest:testExecuteInexistentVote(uint256) (runs: 256, μ: 13353, ~: 13353) -SingleVoteGovernorTest:testExecuteWhileVotingOpen() (gas: 276436) +SingleVoteGovernorTest:testExecuteWhileVotingOpen() (gas: 276376) SingleVoteGovernorTest:testGetThreshold() (gas: 10278) SingleVoteGovernorTest:testGetVoteDuration() (gas: 10254) -SingleVoteGovernorTest:testGovernanceThresholdChange() (gas: 367446) -SingleVoteGovernorTest:testGovernanceVoteDurationChange() (gas: 365285) -SingleVoteGovernorTest:testInit() (gas: 64675) -SingleVoteGovernorTest:testInit2SingleVoteGovernor() (gas: 76866) -SingleVoteGovernorTest:testInitWithDuplicateInitialVotersFails(address[],uint8) (runs: 256, μ: 3170390, ~: 3168778) -SingleVoteGovernorTest:testInitWithInitialVoters(address[]) (runs: 256, μ: 3552491, ~: 3532035) -SingleVoteGovernorTest:testInitWithInvalidInitialVotersFails() (gas: 2892040) +SingleVoteGovernorTest:testGovernanceThresholdChange() (gas: 367334) +SingleVoteGovernorTest:testGovernanceVoteDurationChange() (gas: 365195) +SingleVoteGovernorTest:testInit() (gas: 62213) +SingleVoteGovernorTest:testInit2SingleVoteGovernor() (gas: 76936) +SingleVoteGovernorTest:testInitWithDuplicateInitialVotersFails(address[],uint8) (runs: 256, μ: 3176054, ~: 3166874) +SingleVoteGovernorTest:testInitWithInitialVoters(address[]) (runs: 256, μ: 3526605, ~: 3488885) +SingleVoteGovernorTest:testInitWithInvalidInitialVotersFails() (gas: 2878054) SingleVoteGovernorTest:testMotionSetInvalidVoteDuration() (gas: 18203) -SingleVoteGovernorTest:testMotionSetThreshold() (gas: 20733) +SingleVoteGovernorTest:testMotionSetThreshold() (gas: 20711) SingleVoteGovernorTest:testMotionSetVoteDuration() (gas: 18595) -SingleVoteGovernorTest:testOnlyGovernanceIsAuthorized(address) (runs: 256, μ: 31216, ~: 31216) -SingleVoteGovernorTest:testReinitFails() (gas: 1544926) +SingleVoteGovernorTest:testOnlyGovernanceIsAuthorized(address) (runs: 256, μ: 33097, ~: 33097) +SingleVoteGovernorTest:testReinitFails() (gas: 1656758) SingleVoteGovernorTest:testRemoveTooManyVoters() (gas: 22418) -SingleVoteGovernorTest:testRemoveUntilVoterListEmpty() (gas: 28199) -SingleVoteGovernorTest:testRemoveVoter(address[]) (runs: 256, μ: 7526403, ~: 7632636) -SingleVoteGovernorTest:testSetUnreachableThreshold(uint256) (runs: 256, μ: 15070, ~: 15070) -SingleVoteGovernorTest:testUnauthorizedGovernanceVoteDurationChange(address[]) (runs: 256, μ: 7805067, ~: 7915236) -SingleVoteGovernorTest:testUnauthorizedThresholdChange(address[]) (runs: 256, μ: 7805760, ~: 7915939) -SingleVoteGovernorTest:testUnauthorizedVoteCreation(address[]) (runs: 256, μ: 808108, ~: 787147) -SingleVoteGovernorTest:testUnauthorizedVoterAddition(address[]) (runs: 256, μ: 7810313, ~: 7920556) -SingleVoteGovernorTest:testUnauthorizedVoterRemoval(address[]) (runs: 256, μ: 7810311, ~: 7920555) -SingleVoteGovernorTest:testVoteAgainst(address[]) (runs: 256, μ: 8964131, ~: 8580706) -SingleVoteGovernorTest:testVoteAgainstUnauthorized(address[]) (runs: 256, μ: 883831, ~: 876225) -SingleVoteGovernorTest:testVoteExecution() (gas: 365307) -SingleVoteGovernorTest:testVoteInFavor(address[]) (runs: 256, μ: 8941311, ~: 8580440) -SingleVoteGovernorTest:testVoteInFavorUnauthorized(address[]) (runs: 256, μ: 884088, ~: 876479) -SingleVoteGovernorTest:testVoteOnExpired(uint256[]) (runs: 256, μ: 1445154, ~: 1468712) -SingleVoteGovernorTest:testVoteOnUnexistingID(uint160[]) (runs: 256, μ: 586791, ~: 420526) -StreamingPaymentProcessorTest:testBlockedAddressCanClaimLater() (gas: 476312) -StreamingPaymentProcessorTest:testCancelPaymentsFailsWhenCalledByNonModule(address) (runs: 256, μ: 32882, ~: 32882) -StreamingPaymentProcessorTest:testCancelPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2303677, ~: 2303677) -StreamingPaymentProcessorTest:testCancelRunningPayments(address[],uint128[],uint64[]) (runs: 256, μ: 10704002, ~: 7786160) -StreamingPaymentProcessorTest:testFalseReturningTokenTransfers() (gas: 472459) -StreamingPaymentProcessorTest:testInit() (gas: 21431) -StreamingPaymentProcessorTest:testInit2StreamingPaymentProcessor() (gas: 57844) -StreamingPaymentProcessorTest:testProcessPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2303738, ~: 2303738) -StreamingPaymentProcessorTest:testProcessPaymentsWorksForDueTimeThatIsPlacedBeforeStartTime(address[],uint256[]) (runs: 256, μ: 6197767, ~: 5848984) +SingleVoteGovernorTest:testRemoveUntilVoterListEmpty() (gas: 28181) +SingleVoteGovernorTest:testRemoveVoter(address[]) (runs: 256, μ: 7281132, ~: 7062431) +SingleVoteGovernorTest:testSetUnreachableThreshold(uint256) (runs: 256, μ: 15048, ~: 15048) +SingleVoteGovernorTest:testUnauthorizedGovernanceVoteDurationChange(address[]) (runs: 256, μ: 7551643, ~: 7324785) +SingleVoteGovernorTest:testUnauthorizedThresholdChange(address[]) (runs: 256, μ: 7551895, ~: 7325030) +SingleVoteGovernorTest:testUnauthorizedVoteCreation(address[]) (runs: 256, μ: 807402, ~: 786729) +SingleVoteGovernorTest:testUnauthorizedVoterAddition(address[]) (runs: 256, μ: 7556720, ~: 7329710) +SingleVoteGovernorTest:testUnauthorizedVoterRemoval(address[]) (runs: 256, μ: 7556718, ~: 7329708) +SingleVoteGovernorTest:testVoteAgainst(address[]) (runs: 256, μ: 8926678, ~: 8578046) +SingleVoteGovernorTest:testVoteAgainstUnauthorized(address[]) (runs: 256, μ: 868399, ~: 840443) +SingleVoteGovernorTest:testVoteExecution() (gas: 365217) +SingleVoteGovernorTest:testVoteInFavor(address[]) (runs: 256, μ: 8905600, ~: 8355909) +SingleVoteGovernorTest:testVoteInFavorUnauthorized(address[]) (runs: 256, μ: 868651, ~: 840686) +SingleVoteGovernorTest:testVoteOnExpired(uint256[]) (runs: 256, μ: 1434058, ~: 1457327) +SingleVoteGovernorTest:testVoteOnUnexistingID(uint160[]) (runs: 256, μ: 544076, ~: 410496) +StreamingPaymentProcessorTest:testBlockedAddressCanClaimLater() (gas: 476241) +StreamingPaymentProcessorTest:testCancelPaymentsFailsWhenCalledByNonModule(address) (runs: 256, μ: 32904, ~: 32904) +StreamingPaymentProcessorTest:testCancelPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2299092, ~: 2299092) +StreamingPaymentProcessorTest:testCancelRunningPayments(address[],uint128[],uint64[]) (runs: 256, μ: 10708969, ~: 7464512) +StreamingPaymentProcessorTest:testFalseReturningTokenTransfers() (gas: 472388) +StreamingPaymentProcessorTest:testInit() (gas: 21409) +StreamingPaymentProcessorTest:testInit2StreamingPaymentProcessor() (gas: 57914) +StreamingPaymentProcessorTest:testProcessPaymentsFailsWhenCalledOnOtherClient(address) (runs: 256, μ: 2299131, ~: 2299131) +StreamingPaymentProcessorTest:testProcessPaymentsWorksForDueTimeThatIsPlacedBeforeStartTime(address[],uint256[]) (runs: 256, μ: 6251554, ~: 5868448) StreamingPaymentProcessorTest:testReinitFails() (gas: 31498) -StreamingPaymentProcessorTest:testStreamingCalculation(address[],uint128[]) (runs: 256, μ: 16055487, ~: 15343756) -StreamingPaymentProcessorTest:testUpdateFinishedPayments(address[],uint128[],uint64[]) (runs: 256, μ: 20101487, ~: 13540399) -StreamingPaymentProcessorTest:test_cancelRunningPayments_allCreatedOrdersGetCancelled(address[],uint128[]) (runs: 256, μ: 12813565, ~: 8554715) -StreamingPaymentProcessorTest:test_claimVestedAmounts_fullVesting(address[],uint128[],uint64[]) (runs: 256, μ: 10120403, ~: 7000892) -StreamingPaymentProcessorTest:test_processPayments(address[],uint128[],uint64[]) (runs: 256, μ: 8227094, ~: 6313645) -StreamingPaymentProcessorTest:test_processPayments_discardsInvalidPaymentOrders() (gas: 539462) +StreamingPaymentProcessorTest:testStreamingCalculation(address[],uint128[]) (runs: 256, μ: 15803533, ~: 15334219) +StreamingPaymentProcessorTest:testUpdateFinishedPayments(address[],uint128[],uint64[]) (runs: 256, μ: 17793966, ~: 13542916) +StreamingPaymentProcessorTest:test_cancelRunningPayments_allCreatedOrdersGetCancelled(address[],uint128[]) (runs: 256, μ: 13252893, ~: 9213976) +StreamingPaymentProcessorTest:test_claimVestedAmounts_fullVesting(address[],uint128[],uint64[]) (runs: 256, μ: 9913617, ~: 6674393) +StreamingPaymentProcessorTest:test_processPayments(address[],uint128[],uint64[]) (runs: 256, μ: 8644606, ~: 6569421) +StreamingPaymentProcessorTest:test_processPayments_discardsInvalidPaymentOrders() (gas: 539358) StreamingPaymentProcessorTest:test_processPayments_failsWhenCalledByNonModule(address) (runs: 256, μ: 32868, ~: 32868) -StreamingPaymentProcessorTest:test_processPayments_paymentOrdersAreNotOverwritten(uint256,uint256,uint256,uint256) (runs: 256, μ: 1460672, ~: 1459681) -StreamingPaymentProcessorTest:test_processPayments_vestingInfoGetsDeletedPostFullPayment(address[],uint128[],uint64[]) (runs: 256, μ: 9955992, ~: 6885634) -StreamingPaymentProcessorTest:test_removePaymentAndClaimForSpecificWalletId(uint256,uint256,uint256,uint256) (runs: 256, μ: 1667402, ~: 1667586) -StreamingPaymentProcessorTest:test_removePaymentForSpecificWalletId_halfVestingDoneMultipleOrdersForSingleBeneficiary(uint256,uint256,uint256,uint256) (runs: 256, μ: 1567955, ~: 1568124) -StreamingPaymentsLifecycle:test_e2e_StreamingPaymentsLifecycleAdminFunctions() (gas: 4043140) -StreamingPaymentsLifecycle:test_e2e_StreamingPaymentsLifecycleUserFunctions() (gas: 3169250) -TokenGatedRoleAuthorizerTest:testAdminCannotAddNonTokenWhenTokenGated() (gas: 289644) -TokenGatedRoleAuthorizerTest:testCanAddTokenWhenTokenGated() (gas: 336519) -TokenGatedRoleAuthorizerTest:testCannotAddNonTokenWhenTokenGated() (gas: 183351) -TokenGatedRoleAuthorizerTest:testFuzzNFTAuthorization(address[],bool[]) (runs: 256, μ: 739121, ~: 619748) -TokenGatedRoleAuthorizerTest:testFuzzTokenAuthorization(uint256,address[],uint256[]) (runs: 256, μ: 2567037, ~: 2227068) -TokenGatedRoleAuthorizerTest:testMakeRoleTokenGated() (gas: 339144) -TokenGatedRoleAuthorizerTest:testMakingFunctionTokenGatedFailsIfAlreadyInUse() (gas: 126731) -TokenGatedRoleAuthorizerTest:testSetThreshold() (gas: 181280) -TokenGatedRoleAuthorizerTest:testSetThresholdFailsIfInvalid() (gas: 153565) -TokenGatedRoleAuthorizerTest:testSetThresholdFailsIfNotTokenGated() (gas: 237759) -TokenGatedRoleAuthorizerTest:testSetThresholdFromAdminFailsIfInvalid() (gas: 291234) -TokenGatedRoleAuthorizerTest:testSetTokenGatedFailsIfRoleAlreadyInUse() (gas: 218657) -TokenGatedRoleAuthorizerTest:testSetTokenGatingByAdmin() (gas: 149645) -TokenGatedRoleAuthorizerUpstreamTests:testAdminCannotModifyRoleIfAdminBurned() (gas: 1511592) -TokenGatedRoleAuthorizerUpstreamTests:testAdminIgnoresIfRoleIsSelfManaged() (gas: 1487258) -TokenGatedRoleAuthorizerUpstreamTests:testBurnAdminChangesRoleState() (gas: 253) -TokenGatedRoleAuthorizerUpstreamTests:testBurnedModuleCorrectlyReturnToManagedState() (gas: 1429206) -TokenGatedRoleAuthorizerUpstreamTests:testChangeRoleAdminOnModuleRole() (gas: 1494804) -TokenGatedRoleAuthorizerUpstreamTests:testChangeRoleAdminOnModuleRoleFailsIfNotAdmin() (gas: 1375478) -TokenGatedRoleAuthorizerUpstreamTests:testGrantAdminRole() (gas: 116091) -TokenGatedRoleAuthorizerUpstreamTests:testGrantAdminRoleFailsIfNotOwner() (gas: 52415) -TokenGatedRoleAuthorizerUpstreamTests:testGrantGlobalRole() (gas: 121056) -TokenGatedRoleAuthorizerUpstreamTests:testGrantGlobalRoleFailsIfNotOwner() (gas: 54999) -TokenGatedRoleAuthorizerUpstreamTests:testGrantManagerRole(address[]) (runs: 256, μ: 1085932, ~: 1170032) -TokenGatedRoleAuthorizerUpstreamTests:testGrantManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 766235, ~: 795531) -TokenGatedRoleAuthorizerUpstreamTests:testGrantOwnerRole(address[]) (runs: 256, μ: 1100252, ~: 1191945) -TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModule() (gas: 1439620) -TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModuleFailsIfCalledByNonModule() (gas: 1349199) -TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1319402) -TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModuleFailsIfModuleNotSelfManaged() (gas: 1330085) -TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModuleIdempotence() (gas: 1440992) -TokenGatedRoleAuthorizerUpstreamTests:testInit2RoleAuthorizer() (gas: 57895) -TokenGatedRoleAuthorizerUpstreamTests:testInitWithInitialOwner(address) (runs: 256, μ: 2919027, ~: 2919027) -TokenGatedRoleAuthorizerUpstreamTests:testInitWithoutInitialOwners() (gas: 2882527) -TokenGatedRoleAuthorizerUpstreamTests:testModifyRoleByAdminFailsIfAdminBurned() (gas: 1539592) -TokenGatedRoleAuthorizerUpstreamTests:testModuleOnlyUsesOrchestratorRolesWhenNotSelfManaged() (gas: 1429186) -TokenGatedRoleAuthorizerUpstreamTests:testModuleOnlyUsesOwnRolesWhenSelfManaged() (gas: 1442817) -TokenGatedRoleAuthorizerUpstreamTests:testModuleReturnToManagedMode() (gas: 231) -TokenGatedRoleAuthorizerUpstreamTests:testReinitFails() (gas: 1541148) -TokenGatedRoleAuthorizerUpstreamTests:testRemoveLastOwnerFails() (gas: 32354) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeGlobalRole() (gas: 99172) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeGlobalRoleFailsIfNotOwner() (gas: 154819) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeManagerRole(address[]) (runs: 256, μ: 925925, ~: 1004350) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 766269, ~: 795566) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeOwnerRole() (gas: 100270) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModule() (gas: 1372494) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModuleFailsIfCalledByNonModule() (gas: 1349152) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1321472) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModuleFailsIfModuleNotSelfManaged() (gas: 1332122) -TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModuleIdempotence() (gas: 1354232) -TokenGatedRoleAuthorizerUpstreamTests:testtoggleModuleSelfManagement() (gas: 1323988) +StreamingPaymentProcessorTest:test_processPayments_paymentOrdersAreNotOverwritten(uint256,uint256,uint256,uint256) (runs: 256, μ: 1460339, ~: 1460788) +StreamingPaymentProcessorTest:test_processPayments_vestingInfoGetsDeletedPostFullPayment(address[],uint128[],uint64[]) (runs: 256, μ: 9753138, ~: 6564922) +StreamingPaymentProcessorTest:test_removePaymentAndClaimForSpecificWalletId(uint256,uint256,uint256,uint256) (runs: 256, μ: 1665289, ~: 1665463) +StreamingPaymentProcessorTest:test_removePaymentForSpecificWalletId_halfVestingDoneMultipleOrdersForSingleBeneficiary(uint256,uint256,uint256,uint256) (runs: 256, μ: 1565882, ~: 1566037) +StreamingPaymentsLifecycle:test_e2e_StreamingPaymentsLifecycleAdminFunctions() (gas: 4039030) +StreamingPaymentsLifecycle:test_e2e_StreamingPaymentsLifecycleUserFunctions() (gas: 3166488) +TokenGatedRoleAuthorizerTest:testAdminCannotAddNonTokenWhenTokenGated() (gas: 288861) +TokenGatedRoleAuthorizerTest:testCanAddTokenWhenTokenGated() (gas: 331325) +TokenGatedRoleAuthorizerTest:testCannotAddNonTokenWhenTokenGated() (gas: 179743) +TokenGatedRoleAuthorizerTest:testFuzzNFTAuthorization(address[],bool[]) (runs: 256, μ: 736348, ~: 616985) +TokenGatedRoleAuthorizerTest:testFuzzTokenAuthorization(uint256,address[],uint256[]) (runs: 256, μ: 2563872, ~: 2241005) +TokenGatedRoleAuthorizerTest:testMakeRoleTokenGated() (gas: 333862) +TokenGatedRoleAuthorizerTest:testMakingFunctionTokenGatedFailsIfAlreadyInUse() (gas: 122938) +TokenGatedRoleAuthorizerTest:testSetThreshold() (gas: 177673) +TokenGatedRoleAuthorizerTest:testSetThresholdFailsIfInvalid() (gas: 151389) +TokenGatedRoleAuthorizerTest:testSetThresholdFailsIfNotTokenGated() (gas: 238819) +TokenGatedRoleAuthorizerTest:testSetThresholdFromAdminFailsIfInvalid() (gas: 290735) +TokenGatedRoleAuthorizerTest:testSetThresholdFromModule() (gas: 183132) +TokenGatedRoleAuthorizerTest:testSetThresholdFromModuleFailsIfInvalid() (gas: 178492) +TokenGatedRoleAuthorizerTest:testSetThresholdFromModuleFailsIfNotTokenGated() (gas: 138016) +TokenGatedRoleAuthorizerTest:testSetTokenGatedFailsIfRoleAlreadyInUse() (gas: 218866) +TokenGatedRoleAuthorizerTest:testSetTokenGatingByAdmin() (gas: 139350) +TokenGatedRoleAuthorizerUpstreamTests:testAdminCannotModifyRoleIfAdminBurned() (gas: 1489414) +TokenGatedRoleAuthorizerUpstreamTests:testBurnAdminChangesRoleState() (gas: 231) +TokenGatedRoleAuthorizerUpstreamTests:testChangeRoleAdminOnModuleRole() (gas: 1467243) +TokenGatedRoleAuthorizerUpstreamTests:testChangeRoleAdminOnModuleRoleFailsIfNotAdmin() (gas: 1347554) +TokenGatedRoleAuthorizerUpstreamTests:testGrantAdminRole() (gas: 118874) +TokenGatedRoleAuthorizerUpstreamTests:testGrantAdminRoleFailsIfNotOwner() (gas: 56988) +TokenGatedRoleAuthorizerUpstreamTests:testGrantGlobalRole() (gas: 121535) +TokenGatedRoleAuthorizerUpstreamTests:testGrantGlobalRoleFailsIfNotOwner() (gas: 57241) +TokenGatedRoleAuthorizerUpstreamTests:testGrantManagerRole(address[]) (runs: 256, μ: 1084795, ~: 1179646) +TokenGatedRoleAuthorizerUpstreamTests:testGrantManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 775353, ~: 835682) +TokenGatedRoleAuthorizerUpstreamTests:testGrantOwnerRole(address[]) (runs: 256, μ: 1102904, ~: 1195919) +TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModule() (gas: 1409868) +TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModuleFailsIfCalledByNonModule() (gas: 1321235) +TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1292478) +TokenGatedRoleAuthorizerUpstreamTests:testGrantRoleFromModuleIdempotence() (gas: 1411152) +TokenGatedRoleAuthorizerUpstreamTests:testInit2RoleAuthorizer() (gas: 57918) +TokenGatedRoleAuthorizerUpstreamTests:testInitWithInitialOwner(address) (runs: 256, μ: 2662619, ~: 2662619) +TokenGatedRoleAuthorizerUpstreamTests:testInitWithoutInitialOwners() (gas: 2627170) +TokenGatedRoleAuthorizerUpstreamTests:testModifyRoleByAdminFailsIfAdminBurned() (gas: 1518921) +TokenGatedRoleAuthorizerUpstreamTests:testReinitFails() (gas: 1651004) +TokenGatedRoleAuthorizerUpstreamTests:testRemoveLastOwnerFails() (gas: 34180) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeGlobalRole() (gas: 99883) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeGlobalRoleFailsIfNotOwner() (gas: 155568) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeManagerRole(address[]) (runs: 256, μ: 929804, ~: 1016258) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeManagerRoleFailsIfNotOwner(address[]) (runs: 256, μ: 775112, ~: 835419) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeOwnerRole() (gas: 99162) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModule() (gas: 1342726) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModuleFailsIfCalledByNonModule() (gas: 1321215) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModuleFailsIfModuleNotInOrchestrator() (gas: 1294467) +TokenGatedRoleAuthorizerUpstreamTests:testRevokeRoleFromModuleIdempotence() (gas: 1326253) VirtualTokenSupplyBaseTest:testAddTokenAmount(uint256) (runs: 256, μ: 14709, ~: 14906) VirtualTokenSupplyBaseTest:testSubTokenAmount(uint256) (runs: 256, μ: 14494, ~: 14746) VirtualTokenSupplyBaseTest:testSubTokenAmountFails(uint256) (runs: 256, μ: 11182, ~: 11182) -baseModuleTest:testGrantModuleRole(uint8,address) (runs: 256, μ: 63902, ~: 63902) -baseModuleTest:testInit() (gas: 50821) -baseModuleTest:testInitFailsForInvalidOrchestrator() (gas: 1289358) -baseModuleTest:testInitFailsForNonInitializerFunction() (gas: 1271312) -baseModuleTest:testInitFailsIfMetadataInvalid() (gas: 1350377) +baseModuleTest:testGrantModuleRole(bytes32,address) (runs: 256, μ: 60300, ~: 60300) +baseModuleTest:testInit() (gas: 50755) +baseModuleTest:testInitFailsForInvalidOrchestrator() (gas: 1284744) +baseModuleTest:testInitFailsForNonInitializerFunction() (gas: 1266698) +baseModuleTest:testInitFailsIfMetadataInvalid() (gas: 1345763) baseModuleTest:testReinitFails() (gas: 33629) -baseModuleTest:testRevokeModuleRole(uint8,address) (runs: 256, μ: 52335, ~: 52331) \ No newline at end of file +baseModuleTest:testRevokeModuleRole(bytes32,address) (runs: 256, μ: 49213, ~: 49172) \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index bd03c845e..c90cdcbb4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = https://github.com/foundry-rs/forge-std [submodule "lib/openzeppelin-contracts"] path = lib/openzeppelin-contracts - url = https://github.com/OpenZeppelin/openzeppelin-contracts + url = https://github.com/openzeppelin/openzeppelin-contracts [submodule "lib/openzeppelin-contracts-upgradeable"] path = lib/openzeppelin-contracts-upgradeable - url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable \ No newline at end of file + url = https://github.com/openzeppelin/openzeppelin-contracts-upgradeable diff --git a/lcov.info b/lcov.info index a8e39798b..5835a4ca5 100644 --- a/lcov.info +++ b/lcov.info @@ -272,13 +272,13 @@ DA:210,0 DA:211,0 DA:216,0 DA:218,0 -DA:222,0 -DA:224,0 -DA:226,0 -DA:228,0 -DA:230,0 -DA:233,0 -DA:235,0 +DA:223,0 +DA:225,0 +DA:227,0 +DA:229,0 +DA:231,0 +DA:234,0 +DA:236,0 FNF:1 FNH:0 LF:61 @@ -406,51 +406,51 @@ end_of_record TN: SF:src/factories/OrchestratorFactory.sol FN:73,OrchestratorFactory.createOrchestrator -FNDA:13806,OrchestratorFactory.createOrchestrator -DA:80,13806 -DA:83,13806 -DA:86,13806 -DA:93,13806 -DA:100,13806 -DA:107,13806 -DA:108,13806 -DA:109,13806 -DA:110,12806 -DA:117,13806 +FNDA:12940,OrchestratorFactory.createOrchestrator +DA:80,12940 +DA:83,12940 +DA:86,12940 +DA:93,12940 +DA:100,12940 +DA:107,12940 +DA:108,12940 +DA:109,12940 +DA:110,12788 +DA:117,12940 BRDA:117,0,0,- -BRDA:117,0,1,13806 +BRDA:117,0,1,12940 DA:118,0 -DA:122,13806 -DA:134,13806 -DA:135,12806 +DA:122,12940 +DA:134,12940 +DA:135,12788 BRDA:135,1,0,- BRDA:135,1,1,3 DA:136,3 -DA:143,13806 +DA:143,12940 BRDA:143,2,0,- BRDA:143,2,1,- DA:144,0 -DA:148,13806 +DA:148,12940 BRDA:148,3,0,- BRDA:148,3,1,- DA:149,0 -DA:153,13806 +DA:153,12940 BRDA:153,4,0,- BRDA:153,4,1,- DA:155,0 -DA:160,13806 +DA:160,12940 FN:164,OrchestratorFactory.getOrchestratorByID -FNDA:6473,OrchestratorFactory.getOrchestratorByID -DA:170,6254 +FNDA:6667,OrchestratorFactory.getOrchestratorByID +DA:170,6442 FN:173,OrchestratorFactory.getOrchestratorIDCounter FNDA:256,OrchestratorFactory.getOrchestratorIDCounter DA:174,256 FN:177,OrchestratorFactory.decoder -FNDA:108448,OrchestratorFactory.decoder -DA:182,108448 +FNDA:103216,OrchestratorFactory.decoder +DA:182,103216 FN:185,OrchestratorFactory._dependencyInjectionRequired -FNDA:54224,OrchestratorFactory._dependencyInjectionRequired -DA:190,54224 +FNDA:51608,OrchestratorFactory._dependencyInjectionRequired +DA:190,51608 FNF:5 FNH:5 LF:26 @@ -461,8 +461,8 @@ end_of_record TN: SF:src/factories/beacon/Beacon.sol FN:40,Beacon.implementation -FNDA:13322,Beacon.implementation -DA:41,13322 +FNDA:13334,Beacon.implementation +DA:41,13334 FN:51,Beacon.upgradeTo FNDA:260,Beacon.upgradeTo DA:52,4 @@ -488,8 +488,8 @@ end_of_record TN: SF:src/factories/beacon/BeaconProxy.sol FN:41,BeaconProxy._implementation -FNDA:14565,BeaconProxy._implementation -DA:42,14565 +FNDA:14577,BeaconProxy._implementation +DA:42,14577 FNF:1 FNH:1 LF:1 @@ -499,153 +499,134 @@ BRH:0 end_of_record TN: SF:src/modules/authorizer/RoleAuthorizer.sol -FN:76,RoleAuthorizer.init +FN:57,RoleAuthorizer.init FNDA:521,RoleAuthorizer.init -DA:81,519 -DA:83,519 +DA:62,519 +DA:64,519 +DA:65,519 +DA:67,519 +FN:70,RoleAuthorizer.__RoleAuthorizer_init +FNDA:519,RoleAuthorizer.__RoleAuthorizer_init +DA:79,519 DA:84,519 DA:86,519 -FN:89,RoleAuthorizer.__RoleAuthorizer_init -FNDA:519,RoleAuthorizer.__RoleAuthorizer_init -DA:98,519 -DA:100,519 -DA:104,519 -DA:109,519 -DA:111,519 -DA:115,519 -DA:117,519 -DA:121,519 -BRDA:121,0,0,517 -BRDA:121,0,1,519 -DA:122,517 -DA:123,517 -FN:133,RoleAuthorizer._revokeRole -FNDA:5496,RoleAuthorizer._revokeRole -DA:139,5494 -FN:149,RoleAuthorizer.isAuthorized -FNDA:55,RoleAuthorizer.isAuthorized -DA:151,55 -FN:155,RoleAuthorizer.isAuthorized -FNDA:1036,RoleAuthorizer.isAuthorized -DA:162,1036 -DA:165,1036 -BRDA:165,1,0,4 -BRDA:165,1,1,1032 -DA:166,4 -DA:168,1032 -DA:170,1036 -FN:174,RoleAuthorizer.generateRoleId -FNDA:2662,RoleAuthorizer.generateRoleId -DA:180,32959 -FN:186,RoleAuthorizer.toggleModuleSelfManagement -FNDA:51,RoleAuthorizer.toggleModuleSelfManagement -DA:187,51 -BRDA:187,2,0,11 -BRDA:187,2,1,40 -DA:188,11 -DA:189,11 -DA:191,40 -DA:192,40 -FN:197,RoleAuthorizer.grantRoleFromModule -FNDA:30,RoleAuthorizer.grantRoleFromModule -DA:202,20 -DA:203,20 -FN:207,RoleAuthorizer.revokeRoleFromModule +DA:90,519 +DA:92,519 +DA:96,519 +BRDA:96,0,0,517 +BRDA:96,0,1,519 +DA:97,517 +DA:98,517 +FN:108,RoleAuthorizer._revokeRole +FNDA:5779,RoleAuthorizer._revokeRole +DA:114,5777 +FN:121,RoleAuthorizer.hasModuleRole +FNDA:26756,RoleAuthorizer.hasModuleRole +DA:128,26756 +DA:129,26756 +FN:133,RoleAuthorizer.generateRoleId +FNDA:595,RoleAuthorizer.generateRoleId +DA:139,28980 +FN:143,RoleAuthorizer.grantRoleFromModule +FNDA:20,RoleAuthorizer.grantRoleFromModule +DA:147,14 +DA:148,14 +FN:152,RoleAuthorizer.revokeRoleFromModule FNDA:9,RoleAuthorizer.revokeRoleFromModule -DA:212,7 -DA:213,7 -FN:217,RoleAuthorizer.transferAdminRole +DA:156,7 +DA:157,7 +FN:161,RoleAuthorizer.transferAdminRole FNDA:4,RoleAuthorizer.transferAdminRole -DA:221,2 -FN:225,RoleAuthorizer.burnAdminRole -FNDA:38,RoleAuthorizer.burnAdminRole -DA:230,38 -DA:231,38 -FN:235,RoleAuthorizer.grantGlobalRole +DA:165,2 +FN:169,RoleAuthorizer.burnAdminFromModuleRole +FNDA:24,RoleAuthorizer.burnAdminFromModuleRole +DA:173,24 +DA:174,24 +FN:178,RoleAuthorizer.grantGlobalRole FNDA:8,RoleAuthorizer.grantGlobalRole -DA:239,6 -DA:240,6 -FN:244,RoleAuthorizer.revokeGlobalRole +DA:182,6 +DA:183,6 +FN:187,RoleAuthorizer.revokeGlobalRole FNDA:4,RoleAuthorizer.revokeGlobalRole -DA:248,2 -DA:249,2 -FN:253,RoleAuthorizer.getOwnerRole -FNDA:11537,RoleAuthorizer.getOwnerRole -DA:254,11537 -FN:258,RoleAuthorizer.getManagerRole -FNDA:0,RoleAuthorizer.getManagerRole -DA:259,0 -FNF:15 -FNH:14 -LF:40 -LH:39 -BRF:6 -BRH:6 +DA:191,2 +DA:192,2 +FN:196,RoleAuthorizer.getOwnerRole +FNDA:11434,RoleAuthorizer.getOwnerRole +DA:197,11434 +FN:201,RoleAuthorizer.getManagerRole +FNDA:2048,RoleAuthorizer.getManagerRole +DA:202,2048 +FNF:13 +FNH:13 +LF:29 +LH:29 +BRF:2 +BRH:2 end_of_record TN: SF:src/modules/authorizer/TokenGatedRoleAuthorizer.sol -FN:62,TokenGatedRoleAuthorizer.isAuthorized -FNDA:26583,TokenGatedRoleAuthorizer.isAuthorized -DA:69,26583 -DA:71,26583 -BRDA:71,0,0,26573 -BRDA:71,0,1,4 -DA:72,26577 -DA:74,26577 -BRDA:74,1,0,26573 -BRDA:74,1,1,4 -DA:75,26573 -DA:77,4 -DA:81,6 -DA:82,6 -FN:90,TokenGatedRoleAuthorizer._grantRole -FNDA:8808,TokenGatedRoleAuthorizer._grantRole -DA:95,8808 -BRDA:95,2,0,- -BRDA:95,2,1,521 -DA:96,521 -DA:102,8808 -FN:109,TokenGatedRoleAuthorizer.hasTokenRole -FNDA:26573,TokenGatedRoleAuthorizer.hasTokenRole -DA:114,53146 -DA:116,53146 -DA:117,53146 -DA:118,53146 -DA:119,53146 -DA:122,53146 -DA:135,28902 -FN:139,TokenGatedRoleAuthorizer.getThresholdValue -FNDA:1,TokenGatedRoleAuthorizer.getThresholdValue -DA:144,1 -DA:145,1 -FN:152,TokenGatedRoleAuthorizer.makeRoleTokenGatedFromModule -FNDA:523,TokenGatedRoleAuthorizer.makeRoleTokenGatedFromModule -DA:158,522 -DA:160,522 -DA:161,522 -FN:165,TokenGatedRoleAuthorizer.grantTokenRoleFromModule -FNDA:522,TokenGatedRoleAuthorizer.grantTokenRoleFromModule -DA:170,522 -DA:171,522 -DA:172,522 -FN:179,TokenGatedRoleAuthorizer.setTokenGated +FN:68,TokenGatedRoleAuthorizer.hasRole +FNDA:15852,TokenGatedRoleAuthorizer.hasRole +DA:75,69496 +BRDA:75,0,0,27279 +BRDA:75,0,1,42217 +DA:76,27279 +DA:78,42217 +FN:86,TokenGatedRoleAuthorizer._grantRole +FNDA:8512,TokenGatedRoleAuthorizer._grantRole +DA:91,8512 +BRDA:91,1,0,- +BRDA:91,1,1,523 +DA:92,523 +DA:98,8512 +FN:105,TokenGatedRoleAuthorizer.hasTokenRole +FNDA:26756,TokenGatedRoleAuthorizer.hasTokenRole +DA:111,26756 +FN:115,TokenGatedRoleAuthorizer.getThresholdValue +FNDA:2,TokenGatedRoleAuthorizer.getThresholdValue +DA:120,2 +DA:121,2 +FN:128,TokenGatedRoleAuthorizer.makeRoleTokenGatedFromModule +FNDA:525,TokenGatedRoleAuthorizer.makeRoleTokenGatedFromModule +DA:133,524 +DA:135,524 +DA:136,524 +FN:140,TokenGatedRoleAuthorizer.grantTokenRoleFromModule +FNDA:524,TokenGatedRoleAuthorizer.grantTokenRoleFromModule +DA:145,524 +DA:146,524 +DA:147,524 +FN:151,TokenGatedRoleAuthorizer.setThresholdFromModule +FNDA:3,TokenGatedRoleAuthorizer.setThresholdFromModule +DA:155,3 +DA:156,3 +FN:163,TokenGatedRoleAuthorizer.setTokenGated FNDA:6,TokenGatedRoleAuthorizer.setTokenGated -DA:184,4 -DA:185,4 -FN:189,TokenGatedRoleAuthorizer.setThreshold +DA:168,4 +DA:169,4 +FN:173,TokenGatedRoleAuthorizer.setThreshold FNDA:2,TokenGatedRoleAuthorizer.setThreshold -DA:193,2 -FN:204,TokenGatedRoleAuthorizer._setThreshold -FNDA:524,TokenGatedRoleAuthorizer._setThreshold -DA:209,520 -DA:210,520 -DA:211,520 -FNF:9 -FNH:9 -LF:32 -LH:32 -BRF:6 -BRH:5 +DA:177,2 +FN:188,TokenGatedRoleAuthorizer._setThreshold +FNDA:529,TokenGatedRoleAuthorizer._setThreshold +DA:193,523 +DA:194,523 +DA:195,523 +FN:201,TokenGatedRoleAuthorizer._hasTokenRole +FNDA:54035,TokenGatedRoleAuthorizer._hasTokenRole +DA:206,54035 +DA:208,54035 +DA:209,53512 +DA:210,53512 +DA:211,53512 +DA:214,53512 +DA:227,29379 +FNF:11 +FNH:11 +LF:30 +LH:30 +BRF:4 +BRH:3 end_of_record TN: SF:src/modules/base/Module.sol @@ -679,8 +660,8 @@ FN:200,Module.title FNDA:11,Module.title DA:201,11 FN:205,Module.orchestrator -FNDA:75204,Module.orchestrator -DA:206,604077 +FNDA:73689,Module.orchestrator +DA:206,238677 FN:212,Module.grantModuleRole FNDA:516,Module.grantModuleRole DA:216,516 @@ -720,43 +701,43 @@ DA:72,264 DA:74,264 FN:81,RebasingFundingManager.token FNDA:0,RebasingFundingManager.token -DA:82,70903 +DA:82,93211 FN:86,RebasingFundingManager._supplyTarget -FNDA:26500,RebasingFundingManager._supplyTarget -DA:92,26500 +FNDA:34697,RebasingFundingManager._supplyTarget +DA:92,34697 FN:98,RebasingFundingManager.deposit -FNDA:11757,RebasingFundingManager.deposit -DA:99,11757 +FNDA:15277,RebasingFundingManager.deposit +DA:99,15277 FN:102,RebasingFundingManager.depositFor -FNDA:7426,RebasingFundingManager.depositFor -DA:103,7426 +FNDA:9820,RebasingFundingManager.depositFor +DA:103,9820 FN:106,RebasingFundingManager.withdraw -FNDA:3341,RebasingFundingManager.withdraw -DA:107,3341 +FNDA:4508,RebasingFundingManager.withdraw +DA:107,4508 FN:110,RebasingFundingManager.withdrawTo -FNDA:3208,RebasingFundingManager.withdrawTo -DA:111,3208 +FNDA:4324,RebasingFundingManager.withdrawTo +DA:111,4324 FN:117,RebasingFundingManager.transferOrchestratorToken FNDA:772,RebasingFundingManager.transferOrchestratorToken DA:122,514 FN:128,RebasingFundingManager._deposit -FNDA:19183,RebasingFundingManager._deposit -DA:130,19183 +FNDA:25097,RebasingFundingManager._deposit +DA:130,25097 BRDA:130,0,0,256 -BRDA:130,0,1,18927 +BRDA:130,0,1,24841 DA:131,256 -DA:134,18927 +DA:134,24841 BRDA:134,1,0,- -BRDA:134,1,1,18927 +BRDA:134,1,1,24841 DA:135,0 -DA:138,18927 -DA:140,18927 -DA:142,18927 +DA:138,24841 +DA:140,24841 +DA:142,24841 FN:145,RebasingFundingManager._withdraw -FNDA:6549,RebasingFundingManager._withdraw -DA:146,6549 -DA:148,6549 -DA:150,6549 +FNDA:8832,RebasingFundingManager._withdraw +DA:146,8832 +DA:148,8832 +DA:150,8832 FN:153,RebasingFundingManager._transferOrchestratorToken FNDA:514,RebasingFundingManager._transferOrchestratorToken DA:154,514 @@ -1282,15 +1263,15 @@ end_of_record TN: SF:src/modules/fundingManager/token/ElasticReceiptTokenBase.sol FN:201,ElasticReceiptTokenBase.transfer -FNDA:493,ElasticReceiptTokenBase.transfer -DA:209,493 -DA:211,493 +FNDA:494,ElasticReceiptTokenBase.transfer +DA:209,494 +DA:211,494 DA:213,256 FN:217,ElasticReceiptTokenBase.transferFrom -FNDA:1265,ElasticReceiptTokenBase.transferFrom -DA:226,1265 -DA:228,1265 -DA:229,753 +FNDA:1260,ElasticReceiptTokenBase.transferFrom +DA:226,1260 +DA:228,1260 +DA:229,748 DA:231,512 FN:235,ElasticReceiptTokenBase.transferAll FNDA:256,ElasticReceiptTokenBase.transferAll @@ -1310,10 +1291,10 @@ DA:269,256 DA:272,512 DA:274,512 FN:278,ElasticReceiptTokenBase.approve -FNDA:2033,ElasticReceiptTokenBase.approve -DA:284,2033 -DA:286,2033 -DA:287,2033 +FNDA:2028,ElasticReceiptTokenBase.approve +DA:284,2028 +DA:286,2028 +DA:287,2028 FN:295,ElasticReceiptTokenBase.increaseAllowance FNDA:512,ElasticReceiptTokenBase.increaseAllowance DA:299,512 @@ -1349,8 +1330,8 @@ FN:398,ElasticReceiptTokenBase.totalSupply FNDA:779,ElasticReceiptTokenBase.totalSupply DA:399,779 FN:403,ElasticReceiptTokenBase.balanceOf -FNDA:53225,ElasticReceiptTokenBase.balanceOf -DA:404,53225 +FNDA:69650,ElasticReceiptTokenBase.balanceOf +DA:404,69650 FN:408,ElasticReceiptTokenBase.scaledTotalSupply FNDA:2,ElasticReceiptTokenBase.scaledTotalSupply DA:409,2 @@ -1364,67 +1345,67 @@ FN:426,ElasticReceiptTokenBase.DOMAIN_SEPARATOR FNDA:1,ElasticReceiptTokenBase.DOMAIN_SEPARATOR DA:427,2 FN:442,ElasticReceiptTokenBase._tokensToBits -FNDA:30582,ElasticReceiptTokenBase._tokensToBits -DA:443,30582 +FNDA:38769,ElasticReceiptTokenBase._tokensToBits +DA:443,38769 FN:449,ElasticReceiptTokenBase._bitsToTokens -FNDA:7723,ElasticReceiptTokenBase._bitsToTokens -DA:450,7723 +FNDA:10005,ElasticReceiptTokenBase._bitsToTokens +DA:450,10005 FN:459,ElasticReceiptTokenBase._mint -FNDA:22521,ElasticReceiptTokenBase._mint -DA:466,22487 -BRDA:466,4,0,362 -BRDA:466,4,1,22125 -DA:467,362 -DA:471,22125 -DA:472,22125 -DA:478,22125 -DA:479,22125 -BRDA:479,5,0,4222 -BRDA:479,5,1,22125 -DA:480,4222 -DA:484,22125 -DA:485,22125 -DA:488,22125 +FNDA:28435,ElasticReceiptTokenBase._mint +DA:466,28397 +BRDA:466,4,0,363 +BRDA:466,4,1,28034 +DA:467,363 +DA:471,28034 +DA:472,28034 +DA:478,28034 +DA:479,28034 +BRDA:479,5,0,4217 +BRDA:479,5,1,28034 +DA:480,4217 +DA:484,28034 +DA:485,28034 +DA:488,28034 FN:498,ElasticReceiptTokenBase._burn -FNDA:6699,ElasticReceiptTokenBase._burn -DA:506,6699 -DA:507,6699 -DA:510,6699 -DA:511,6699 -DA:516,6699 -DA:517,6699 -DA:520,6549 -DA:521,6549 -DA:524,6549 +FNDA:8981,ElasticReceiptTokenBase._burn +DA:506,8981 +DA:507,8981 +DA:510,8981 +DA:511,8981 +DA:516,8981 +DA:517,8981 +DA:520,8832 +DA:521,8832 +DA:524,8832 FN:533,ElasticReceiptTokenBase._rebase -FNDA:33272,ElasticReceiptTokenBase._rebase -DA:534,33272 -DA:538,33272 -BRDA:538,6,0,4586 -BRDA:538,6,1,28686 -DA:539,4586 -DA:543,28686 -DA:544,28686 -DA:547,28686 -DA:548,28686 +FNDA:41460,ElasticReceiptTokenBase._rebase +DA:534,41460 +DA:538,41460 +BRDA:538,6,0,4582 +BRDA:538,6,1,36878 +DA:539,4582 +DA:543,36878 +DA:544,36878 +DA:547,36878 +DA:548,36878 FN:553,ElasticReceiptTokenBase._activeBits -FNDA:57512,ElasticReceiptTokenBase._activeBits -DA:554,57512 +FNDA:73895,ElasticReceiptTokenBase._activeBits +DA:554,73895 FN:559,ElasticReceiptTokenBase._transfer -FNDA:30838,ElasticReceiptTokenBase._transfer -DA:562,30838 -DA:563,30360 -DA:565,30360 -BRDA:565,7,0,2664 -BRDA:565,7,1,30360 -DA:566,2664 -DA:569,30360 +FNDA:39025,ElasticReceiptTokenBase._transfer +DA:562,39025 +DA:563,38551 +DA:565,38551 +BRDA:565,7,0,2735 +BRDA:565,7,1,38551 +DA:566,2735 +DA:569,38551 FN:574,ElasticReceiptTokenBase._useAllowance -FNDA:2033,ElasticReceiptTokenBase._useAllowance -DA:578,2033 -BRDA:578,8,0,1777 -BRDA:578,8,1,1265 -DA:579,1777 +FNDA:2028,ElasticReceiptTokenBase._useAllowance +DA:578,2028 +BRDA:578,8,0,1772 +BRDA:578,8,1,1260 +DA:579,1772 FNF:24 FNH:24 LF:78 @@ -1480,144 +1461,143 @@ end_of_record TN: SF:src/modules/logicModule/BountyManager.sol FN:84,BountyManager.validContributorsForBounty -FNDA:138340,BountyManager.validContributorsForBounty -DA:89,138340 -DA:91,138340 -BRDA:91,0,0,10 -BRDA:91,0,1,138330 -DA:92,10 -DA:94,138330 -DA:95,138330 -DA:96,138330 -DA:97,138330 -DA:98,138330 -DA:99,596209 -DA:102,596209 -BRDA:102,1,0,107 -BRDA:102,1,1,596102 -DA:103,107 -DA:106,596102 -DA:108,596102 -DA:109,596086 +FNDA:138596,BountyManager.validContributorsForBounty +DA:89,138596 +DA:91,138596 +BRDA:91,0,0,3 +BRDA:91,0,1,138593 +DA:92,3 +DA:94,138593 +DA:95,138593 +DA:96,138593 +DA:97,138593 +DA:98,138593 +DA:99,575377 +DA:102,575377 +BRDA:102,1,0,103 +BRDA:102,1,1,575274 +DA:103,103 +DA:106,575274 +DA:108,575274 +DA:109,575258 BRDA:107,2,0,16 -BRDA:107,2,1,596086 +BRDA:107,2,1,575258 DA:111,16 -DA:114,596086 -DA:116,596086 -DA:121,138207 -DA:122,138164 -BRDA:120,3,0,67 -BRDA:120,3,1,138140 -DA:124,67 +DA:114,575258 +DA:116,575258 +DA:121,138474 +DA:122,138430 +BRDA:120,3,0,77 +BRDA:120,3,1,138397 +DA:124,77 FN:142,BountyManager.contributorsNotChanged -FNDA:958,BountyManager.contributorsNotChanged -DA:146,958 -DA:149,958 -DA:150,958 -DA:152,12855 -DA:153,12768 -BRDA:151,4,0,87 -BRDA:151,4,1,12768 -DA:154,87 -DA:156,12768 -FN:191,BountyManager.init +FNDA:956,BountyManager.contributorsNotChanged +DA:146,956 +DA:149,956 +DA:150,956 +DA:152,12555 +DA:153,12469 +BRDA:151,4,0,86 +BRDA:151,4,1,12469 +DA:154,86 +DA:156,12469 +FN:195,BountyManager.init FNDA:5,BountyManager.init -DA:196,4 -DA:198,4 -DA:199,4 -FN:202,BountyManager.init2 +DA:200,4 +DA:202,4 +DA:203,4 +FN:206,BountyManager.init2 FNDA:3,BountyManager.init2 -DA:209,3 -FN:216,BountyManager.getBountyInformation -FNDA:4108,BountyManager.getBountyInformation -DA:222,3877 -FN:226,BountyManager.listBountyIds +FN:219,BountyManager.getBountyInformation +FNDA:4483,BountyManager.getBountyInformation +DA:225,4256 +FN:229,BountyManager.listBountyIds FNDA:0,BountyManager.listBountyIds -DA:227,0 -FN:231,BountyManager.isExistingBountyId +DA:230,0 +FN:234,BountyManager.isExistingBountyId FNDA:2,BountyManager.isExistingBountyId -DA:232,142448 -FN:236,BountyManager.getClaimInformation -FNDA:7674,BountyManager.getClaimInformation -DA:242,7435 -FN:246,BountyManager.listClaimIds +DA:235,143082 +FN:239,BountyManager.getClaimInformation +FNDA:7041,BountyManager.getClaimInformation +DA:245,6803 +FN:249,BountyManager.listClaimIds FNDA:0,BountyManager.listClaimIds -DA:247,0 -FN:251,BountyManager.isExistingClaimId +DA:250,0 +FN:254,BountyManager.isExistingClaimId FNDA:0,BountyManager.isExistingClaimId -DA:252,9639 -FN:256,BountyManager.listClaimIdsForContributorAddress -FNDA:308601,BountyManager.listClaimIdsForContributorAddress -DA:261,308601 -FN:268,BountyManager.addBounty -FNDA:130324,BountyManager.addBounty -DA:279,130199 -DA:282,130199 -DA:284,130199 -DA:286,130199 -DA:287,130199 -DA:288,130199 -DA:290,130199 -DA:294,130199 -FN:298,BountyManager.updateBounty +DA:255,8995 +FN:259,BountyManager.listClaimIdsForContributorAddress +FNDA:286654,BountyManager.listClaimIdsForContributorAddress +DA:264,286654 +FN:271,BountyManager.addBounty +FNDA:136339,BountyManager.addBounty +DA:282,136195 +DA:285,136195 +DA:287,136195 +DA:289,136195 +DA:290,136195 +DA:291,136195 +DA:293,136195 +DA:297,136195 +FN:301,BountyManager.updateBounty FNDA:259,BountyManager.updateBounty -DA:304,256 -DA:306,256 -FN:310,BountyManager.lockBounty -FNDA:82,BountyManager.lockBounty -DA:316,79 -DA:318,79 -FN:322,BountyManager.addClaim -FNDA:138000,BountyManager.addClaim -DA:333,137997 -DA:335,137798 -DA:338,137798 -DA:340,137798 -DA:343,137798 -DA:345,137798 -DA:346,137798 -DA:347,582015 -DA:349,582015 -DA:351,582015 -DA:355,137798 -DA:357,137798 -DA:359,137798 -FN:363,BountyManager.updateClaimContributors -FNDA:347,BountyManager.updateClaimContributors -DA:373,343 +DA:307,256 +DA:309,256 +FN:313,BountyManager.lockBounty +FNDA:84,BountyManager.lockBounty +DA:319,81 +DA:321,81 +FN:325,BountyManager.addClaim +FNDA:138257,BountyManager.addClaim +DA:336,138254 +DA:338,138056 +DA:341,138056 +DA:343,138056 +DA:346,138056 +DA:348,138056 +DA:349,138056 +DA:350,560997 +DA:352,560997 +DA:354,560997 +DA:358,138056 +DA:360,138056 +DA:362,138056 +FN:366,BountyManager.updateClaimContributors +FNDA:346,BountyManager.updateClaimContributors DA:376,342 -DA:378,342 -DA:379,342 -DA:381,684 -DA:383,684 -DA:387,342 -DA:389,342 -DA:391,342 -DA:392,11687 -DA:394,11687 -DA:396,11687 -DA:400,342 -FN:404,BountyManager.updateClaimDetails +DA:379,341 +DA:381,341 +DA:382,341 +DA:384,682 +DA:386,682 +DA:390,341 +DA:392,341 +DA:394,341 +DA:395,11485 +DA:397,11485 +DA:399,11485 +DA:403,341 +FN:407,BountyManager.updateClaimDetails FNDA:516,BountyManager.updateClaimDetails -DA:411,256 -DA:413,256 -FN:417,BountyManager.verifyClaim -FNDA:1103,BountyManager.verifyClaim -DA:424,958 -DA:426,871 -DA:428,871 -DA:431,871 -DA:434,871 -DA:435,12768 -DA:437,12768 -DA:446,12768 -DA:451,871 -DA:456,871 -DA:458,871 +DA:414,258 +DA:416,258 +FN:420,BountyManager.verifyClaim +FNDA:1093,BountyManager.verifyClaim +DA:427,956 +DA:429,870 +DA:431,870 +DA:434,870 +DA:437,870 +DA:438,12469 +DA:440,12469 +DA:449,12469 +DA:454,870 +DA:459,870 +DA:461,870 FNF:18 FNH:15 -LF:89 -LH:87 +LF:88 +LH:86 BRF:10 BRH:10 end_of_record @@ -1633,75 +1613,75 @@ BRDA:90,0,0,2 BRDA:90,0,1,2310 DA:91,2 FN:99,RecurringPaymentManager.getEpochLength -FNDA:38243,RecurringPaymentManager.getEpochLength -DA:100,38243 +FNDA:37793,RecurringPaymentManager.getEpochLength +DA:100,37793 FN:104,RecurringPaymentManager.getRecurringPaymentInformation -FNDA:320071,RecurringPaymentManager.getRecurringPaymentInformation -DA:110,319839 +FNDA:317237,RecurringPaymentManager.getRecurringPaymentInformation +DA:110,317014 FN:114,RecurringPaymentManager.listRecurringPaymentIds -FNDA:13634,RecurringPaymentManager.listRecurringPaymentIds -DA:115,13634 +FNDA:13998,RecurringPaymentManager.listRecurringPaymentIds +DA:115,13998 FN:119,RecurringPaymentManager.getPreviousPaymentId FNDA:0,RecurringPaymentManager.getPreviousPaymentId DA:120,0 FN:124,RecurringPaymentManager.isExistingRecurringPaymentId FNDA:0,RecurringPaymentManager.isExistingRecurringPaymentId -DA:125,321863 +DA:125,319029 FN:132,RecurringPaymentManager.getEpochFromTimestamp FNDA:0,RecurringPaymentManager.getEpochFromTimestamp DA:137,0 FN:141,RecurringPaymentManager.getCurrentEpoch -FNDA:136822,RecurringPaymentManager.getCurrentEpoch -DA:142,319663 +FNDA:141746,RecurringPaymentManager.getCurrentEpoch +DA:142,330559 FN:146,RecurringPaymentManager.getFutureEpoch FNDA:768,RecurringPaymentManager.getFutureEpoch DA:151,768 FN:158,RecurringPaymentManager.addRecurringPayment -FNDA:171232,RecurringPaymentManager.addRecurringPayment -DA:171,171180 -DA:174,171180 -DA:177,171180 -DA:178,171180 -DA:179,171180 -DA:180,171180 -DA:182,171180 -DA:190,171180 +FNDA:176829,RecurringPaymentManager.addRecurringPayment +DA:171,176780 +DA:174,176780 +DA:177,176780 +DA:178,176780 +DA:179,176780 +DA:180,176780 +DA:182,176780 +DA:190,176780 FN:194,RecurringPaymentManager.removeRecurringPayment -FNDA:7537,RecurringPaymentManager.removeRecurringPayment -DA:199,7536 -DA:202,7536 -DA:205,7536 -DA:207,7536 +FNDA:7923,RecurringPaymentManager.removeRecurringPayment +DA:199,7922 +DA:202,7922 +DA:205,7922 +DA:207,7922 FN:214,RecurringPaymentManager.trigger -FNDA:3051,RecurringPaymentManager.trigger -DA:215,3051 +FNDA:3040,RecurringPaymentManager.trigger +DA:215,3040 FN:219,RecurringPaymentManager.triggerFor FNDA:1024,RecurringPaymentManager.triggerFor DA:226,256 FN:229,RecurringPaymentManager._triggerFor -FNDA:10843,RecurringPaymentManager._triggerFor -DA:231,10843 -DA:233,10843 -DA:235,10843 -DA:237,10843 -DA:240,167175 -DA:241,156332 -DA:244,156332 -BRDA:244,1,0,15976 -BRDA:244,1,1,25759 -DA:245,25759 -DA:248,25759 -BRDA:248,2,0,15976 -BRDA:248,2,1,25759 -DA:250,25759 -DA:261,25759 -BRDA:261,3,0,15976 -BRDA:261,3,1,25759 -DA:262,15976 -DA:275,25759 -DA:280,156332 -DA:284,10843 -DA:286,10843 +FNDA:11218,RecurringPaymentManager._triggerFor +DA:231,11218 +DA:233,11218 +DA:235,11218 +DA:237,11218 +DA:240,166009 +DA:241,154791 +DA:244,154791 +BRDA:244,1,0,15732 +BRDA:244,1,1,25961 +DA:245,25961 +DA:248,25961 +BRDA:248,2,0,15732 +BRDA:248,2,1,25961 +DA:250,25961 +DA:261,25961 +BRDA:261,3,0,15732 +BRDA:261,3,1,25961 +DA:262,15732 +DA:275,25961 +DA:280,154791 +DA:284,11218 +DA:286,11218 FNF:14 FNH:11 LF:43 @@ -1712,10 +1692,10 @@ end_of_record TN: SF:src/modules/logicModule/paymentClient/ERC20PaymentClient.sol FN:62,ERC20PaymentClient._addPaymentOrder -FNDA:145935,ERC20PaymentClient._addPaymentOrder -DA:68,145932 -DA:71,145932 -DA:73,145932 +FNDA:145448,ERC20PaymentClient._addPaymentOrder +DA:68,145445 +DA:71,145445 +DA:73,145445 FN:79,ERC20PaymentClient._addPaymentOrders FNDA:1,ERC20PaymentClient._addPaymentOrders DA:80,1 @@ -1729,67 +1709,67 @@ DA:93,3 DA:95,3 DA:99,1 FN:106,ERC20PaymentClient.collectPaymentOrders -FNDA:7154,ERC20PaymentClient.collectPaymentOrders -DA:112,7154 +FNDA:7143,ERC20PaymentClient.collectPaymentOrders +DA:112,7143 BRDA:112,0,0,1 -BRDA:112,0,1,7153 +BRDA:112,0,1,7142 DA:113,1 -DA:118,7153 -DA:123,7153 -DA:124,7153 -DA:125,7153 -DA:126,129143 -DA:130,7153 -DA:133,7153 -DA:136,7153 -DA:140,7153 -DA:144,7153 +DA:118,7142 +DA:123,7142 +DA:124,7142 +DA:125,7142 +DA:126,128726 +DA:130,7142 +DA:133,7142 +DA:136,7142 +DA:140,7142 +DA:144,7142 FN:148,ERC20PaymentClient.paymentOrders -FNDA:8432,ERC20PaymentClient.paymentOrders -DA:154,8432 +FNDA:8421,ERC20PaymentClient.paymentOrders +DA:154,8421 FN:158,ERC20PaymentClient.outstandingTokenAmount FNDA:513,ERC20PaymentClient.outstandingTokenAmount DA:159,513 FN:165,ERC20PaymentClient._ensureValidRecipient -FNDA:171181,ERC20PaymentClient._ensureValidRecipient -DA:166,171181 +FNDA:176781,ERC20PaymentClient._ensureValidRecipient +DA:166,176781 BRDA:166,1,0,1 -BRDA:166,1,1,171180 +BRDA:166,1,1,176780 DA:167,1 FN:171,ERC20PaymentClient._ensureValidAmount -FNDA:171231,ERC20PaymentClient._ensureValidAmount -DA:172,171231 +FNDA:176828,ERC20PaymentClient._ensureValidAmount +DA:172,176828 BRDA:172,2,0,1 -BRDA:172,2,1,171230 +BRDA:172,2,1,176827 FN:175,ERC20PaymentClient._ensureValidPaymentOrder -FNDA:145938,ERC20PaymentClient._ensureValidPaymentOrder -DA:176,145938 +FNDA:145451,ERC20PaymentClient._ensureValidPaymentOrder +DA:176,145451 BRDA:176,3,0,1 -BRDA:176,3,1,145937 +BRDA:176,3,1,145450 DA:177,1 -DA:179,145937 +DA:179,145450 BRDA:179,4,0,2 -BRDA:179,4,1,145935 +BRDA:179,4,1,145448 DA:180,2 FN:188,ERC20PaymentClient._ensureTokenBalance -FNDA:3821,ERC20PaymentClient._ensureTokenBalance -DA:191,3821 -DA:192,3821 -DA:200,3821 +FNDA:3810,ERC20PaymentClient._ensureTokenBalance +DA:191,3810 +DA:192,3810 +DA:200,3810 BRDA:200,5,0,256 -BRDA:200,5,1,3565 +BRDA:200,5,1,3554 DA:201,256 FN:206,ERC20PaymentClient._ensureTokenAllowance -FNDA:3565,ERC20PaymentClient._ensureTokenAllowance -DA:210,3565 -DA:211,3565 -DA:213,3565 -BRDA:213,6,0,2464 -BRDA:213,6,1,3565 -DA:214,2464 +FNDA:3554,ERC20PaymentClient._ensureTokenAllowance +DA:210,3554 +DA:211,3554 +DA:213,3554 +BRDA:213,6,0,2459 +BRDA:213,6,1,3554 +DA:214,2459 FN:219,ERC20PaymentClient._isAuthorizedPaymentProcessor -FNDA:3565,ERC20PaymentClient._isAuthorizedPaymentProcessor -DA:225,3565 +FNDA:3554,ERC20PaymentClient._isAuthorizedPaymentProcessor +DA:225,3554 FNF:11 FNH:11 LF:43 @@ -1836,12 +1816,12 @@ FN:85,StreamingPaymentProcessor.init FNDA:259,StreamingPaymentProcessor.init DA:90,258 FN:94,StreamingPaymentProcessor.claimAll -FNDA:55105,StreamingPaymentProcessor.claimAll -DA:96,55105 -BRDA:95,0,0,9563 -BRDA:95,0,1,45542 -DA:101,9563 -DA:106,45542 +FNDA:54642,StreamingPaymentProcessor.claimAll +DA:96,54642 +BRDA:95,0,0,10270 +BRDA:95,0,1,44372 +DA:101,10270 +DA:106,44372 FN:110,StreamingPaymentProcessor.claimForSpecificWalletId FNDA:513,StreamingPaymentProcessor.claimForSpecificWalletId DA:116,513 @@ -1858,7 +1838,7 @@ FN:139,StreamingPaymentProcessor.processPayments FNDA:4358,StreamingPaymentProcessor.processPayments DA:145,3846 BRDA:145,3,0,- -BRDA:145,3,1,92723 +BRDA:145,3,1,92577 DA:147,3590 DA:148,3590 DA:149,3590 @@ -1873,14 +1853,14 @@ DA:160,3590 DA:161,3590 DA:163,3590 DA:165,3590 -DA:166,92723 -DA:167,92723 -DA:168,92723 -DA:169,92723 -DA:170,92723 -DA:172,92723 -DA:181,92723 -DA:191,92723 +DA:166,92577 +DA:167,92577 +DA:168,92577 +DA:169,92577 +DA:170,92577 +DA:172,92577 +DA:181,92577 +DA:191,92577 FN:198,StreamingPaymentProcessor.cancelRunningPayments FNDA:1025,StreamingPaymentProcessor.cancelRunningPayments DA:203,513 @@ -1900,30 +1880,30 @@ BRDA:236,6,0,513 BRDA:236,6,1,513 DA:240,513 FN:248,StreamingPaymentProcessor.isActivePaymentReceiver -FNDA:20802,StreamingPaymentProcessor.isActivePaymentReceiver -DA:253,20802 +FNDA:20598,StreamingPaymentProcessor.isActivePaymentReceiver +DA:253,20598 FN:257,StreamingPaymentProcessor.startForSpecificWalletId -FNDA:13420,StreamingPaymentProcessor.startForSpecificWalletId -DA:262,992325 +FNDA:12368,StreamingPaymentProcessor.startForSpecificWalletId +DA:262,1008404 FN:266,StreamingPaymentProcessor.dueToForSpecificWalletId -FNDA:13420,StreamingPaymentProcessor.dueToForSpecificWalletId -DA:271,1086408 +FNDA:12368,StreamingPaymentProcessor.dueToForSpecificWalletId +DA:271,1100627 FN:275,StreamingPaymentProcessor.releasedForSpecificWalletId -FNDA:13421,StreamingPaymentProcessor.releasedForSpecificWalletId -DA:280,968389 +FNDA:12369,StreamingPaymentProcessor.releasedForSpecificWalletId +DA:280,985464 FN:284,StreamingPaymentProcessor.vestedAmountForSpecificWalletId -FNDA:23937,StreamingPaymentProcessor.vestedAmountForSpecificWalletId -DA:290,978905 +FNDA:22941,StreamingPaymentProcessor.vestedAmountForSpecificWalletId +DA:290,996036 FN:296,StreamingPaymentProcessor.releasableForSpecificWalletId -FNDA:884385,StreamingPaymentProcessor.releasableForSpecificWalletId -DA:301,954968 -DA:303,954968 +FNDA:904027,StreamingPaymentProcessor.releasableForSpecificWalletId +DA:301,973095 +DA:303,973095 FN:307,StreamingPaymentProcessor.unclaimable FNDA:261,StreamingPaymentProcessor.unclaimable -DA:312,55368 +DA:312,54905 FN:316,StreamingPaymentProcessor.token FNDA:1,StreamingPaymentProcessor.token -DA:317,74174 +DA:317,72659 FN:321,StreamingPaymentProcessor.viewAllPaymentOrders FNDA:2563,StreamingPaymentProcessor.viewAllPaymentOrders DA:327,2563 @@ -1936,35 +1916,35 @@ DA:336,5384 DA:340,5384 DA:344,2563 FN:354,StreamingPaymentProcessor._afterClaimCleanup -FNDA:70319,StreamingPaymentProcessor._afterClaimCleanup -DA:360,70319 -DA:363,70319 -DA:369,70319 -BRDA:369,7,0,68522 -BRDA:369,7,1,70319 -DA:370,68522 -DA:377,70319 +FNDA:68804,StreamingPaymentProcessor._afterClaimCleanup +DA:360,68804 +DA:363,68804 +DA:369,68804 +BRDA:369,7,0,67007 +BRDA:369,7,1,68804 +DA:370,67007 +DA:377,68804 FN:386,StreamingPaymentProcessor._findAddressInActiveVestings -FNDA:161241,StreamingPaymentProcessor._findAddressInActiveVestings -DA:390,161241 -DA:392,161241 -DA:393,161241 -DA:394,4506693 -BRDA:394,8,0,71088 -BRDA:394,8,1,4435605 -DA:395,71088 -DA:398,4435605 -DA:401,90153 +FNDA:159580,StreamingPaymentProcessor._findAddressInActiveVestings +DA:390,159580 +DA:392,159580 +DA:393,159580 +DA:394,4359294 +BRDA:394,8,0,69573 +BRDA:394,8,1,4289721 +DA:395,69573 +DA:398,4289721 +DA:401,90007 FN:411,StreamingPaymentProcessor._findActiveWalletId -FNDA:70832,StreamingPaymentProcessor._findActiveWalletId -DA:416,70832 -DA:418,70832 -DA:420,70832 -DA:421,71857 -DA:422,71857 -BRDA:422,9,0,70832 +FNDA:69317,StreamingPaymentProcessor._findActiveWalletId +DA:416,69317 +DA:418,69317 +DA:420,69317 +DA:421,70342 +DA:422,70342 +BRDA:422,9,0,69317 BRDA:422,9,1,1025 -DA:423,70832 +DA:423,69317 DA:426,1025 DA:430,0 FN:437,StreamingPaymentProcessor._cancelRunningOrders @@ -1972,120 +1952,120 @@ FNDA:513,StreamingPaymentProcessor._cancelRunningOrders DA:438,513 DA:439,513 DA:441,513 -DA:442,23497 -DA:443,22984 -DA:446,22984 +DA:442,23152 +DA:443,22639 +DA:446,22639 FN:457,StreamingPaymentProcessor._removePayment -FNDA:22985,StreamingPaymentProcessor._removePayment -DA:458,22985 -DA:460,22985 -DA:462,22985 -DA:463,22985 -DA:464,45972 -DA:465,22987 -DA:466,22987 -DA:471,22987 -DA:472,22987 -BRDA:470,10,0,17219 -BRDA:470,10,1,22987 -DA:474,17219 -DA:478,22987 +FNDA:22640,StreamingPaymentProcessor._removePayment +DA:458,22640 +DA:460,22640 +DA:462,22640 +DA:463,22640 +DA:464,45282 +DA:465,22642 +DA:466,22642 +DA:471,22642 +DA:472,22642 +BRDA:470,10,0,16600 +BRDA:470,10,1,22642 +DA:474,16600 +DA:478,22642 FN:489,StreamingPaymentProcessor._removePaymentForSpecificWalletId -FNDA:70319,StreamingPaymentProcessor._removePaymentForSpecificWalletId -DA:494,70319 -DA:495,70319 -DA:497,70319 +FNDA:68804,StreamingPaymentProcessor._removePaymentForSpecificWalletId +DA:494,68804 +DA:495,68804 +DA:497,68804 BRDA:497,11,0,- -BRDA:497,11,1,70319 +BRDA:497,11,1,68804 DA:498,0 -DA:506,70319 -DA:510,70319 +DA:506,68804 +DA:510,68804 FN:519,StreamingPaymentProcessor._removeVestingInformationForSpecificWalletId -FNDA:70319,StreamingPaymentProcessor._removeVestingInformationForSpecificWalletId -DA:524,70319 +FNDA:68804,StreamingPaymentProcessor._removeVestingInformationForSpecificWalletId +DA:524,68804 FN:532,StreamingPaymentProcessor._removePaymentReceiverFromActiveVestings -FNDA:68522,StreamingPaymentProcessor._removePaymentReceiverFromActiveVestings -DA:537,68522 -DA:538,68522 -DA:540,68522 +FNDA:67007,StreamingPaymentProcessor._removePaymentReceiverFromActiveVestings +DA:537,67007 +DA:538,67007 +DA:540,67007 BRDA:540,12,0,- -BRDA:540,12,1,68522 +BRDA:540,12,1,67007 DA:541,0 -DA:547,68522 -DA:548,68522 -DA:552,68522 +DA:547,67007 +DA:548,67007 +DA:552,67007 FN:564,StreamingPaymentProcessor._addPayment -FNDA:92723,StreamingPaymentProcessor._addPayment -DA:573,92723 -DA:574,92718 +FNDA:92577,StreamingPaymentProcessor._addPayment +DA:573,92577 +DA:574,92572 BRDA:572,13,0,5 -BRDA:572,13,1,92718 +BRDA:572,13,1,92572 DA:576,5 -DA:580,92718 -DA:582,92718 -DA:588,92718 -BRDA:587,14,0,90153 -BRDA:587,14,1,92718 -DA:591,90153 -DA:594,92718 -DA:596,92718 +DA:580,92572 +DA:582,92572 +DA:588,92572 +BRDA:587,14,0,90007 +BRDA:587,14,1,92572 +DA:591,90007 +DA:594,92572 +DA:596,92572 FN:609,StreamingPaymentProcessor._claimAll -FNDA:45542,StreamingPaymentProcessor._claimAll -DA:610,45542 -DA:612,45542 -DA:614,45542 -DA:615,92112 -DA:616,46570 -DA:621,46570 +FNDA:44372,StreamingPaymentProcessor._claimAll +DA:610,44372 +DA:612,44372 +DA:614,44372 +DA:615,89772 +DA:616,45400 +DA:621,45400 FN:634,StreamingPaymentProcessor._claimForSpecificWalletId -FNDA:70583,StreamingPaymentProcessor._claimForSpecificWalletId -DA:640,70583 -DA:641,70583 -DA:642,70583 -DA:645,70583 -DA:646,69557 +FNDA:69068,StreamingPaymentProcessor._claimForSpecificWalletId +DA:640,69068 +DA:641,69068 +DA:642,69068 +DA:645,69068 +DA:646,68042 BRDA:644,15,0,2 -BRDA:644,15,1,70583 +BRDA:644,15,1,69068 DA:648,2 DA:649,2 -DA:652,70583 -DA:654,70583 -DA:663,70583 -BRDA:663,16,0,70581 +DA:652,69068 +DA:654,69068 +DA:663,69068 +BRDA:663,16,0,69066 BRDA:663,16,1,2 -DA:664,70581 +DA:664,69066 DA:666,2 -DA:669,70583 -DA:670,70583 -DA:673,70583 -BRDA:673,17,0,52587 -BRDA:673,17,1,70583 -DA:674,52587 +DA:669,69068 +DA:670,69068 +DA:673,69068 +BRDA:673,17,0,51691 +BRDA:673,17,1,69068 +DA:674,51691 FN:684,StreamingPaymentProcessor._vestingAmountForSpecificWalletId -FNDA:978905,StreamingPaymentProcessor._vestingAmountForSpecificWalletId -DA:690,978905 -DA:692,978905 -DA:693,978905 -DA:694,978905 -DA:695,978905 -DA:697,978905 +FNDA:996036,StreamingPaymentProcessor._vestingAmountForSpecificWalletId +DA:690,996036 +DA:692,996036 +DA:693,996036 +DA:694,996036 +DA:695,996036 +DA:697,996036 BRDA:697,18,0,- -BRDA:697,18,1,978905 +BRDA:697,18,1,996036 DA:698,0 -DA:699,978905 -BRDA:699,19,0,129513 -BRDA:699,19,1,849392 -DA:700,129513 -DA:702,849392 +DA:699,996036 +BRDA:699,19,0,126635 +BRDA:699,19,1,869401 +DA:700,126635 +DA:702,869401 FN:710,StreamingPaymentProcessor.validAddress -FNDA:92723,StreamingPaymentProcessor.validAddress -DA:711,92723 +FNDA:92577,StreamingPaymentProcessor.validAddress +DA:711,92577 FN:720,StreamingPaymentProcessor.validSalary -FNDA:92719,StreamingPaymentProcessor.validSalary -DA:721,92719 +FNDA:92573,StreamingPaymentProcessor.validSalary +DA:721,92573 FN:727,StreamingPaymentProcessor.validStart -FNDA:92718,StreamingPaymentProcessor.validStart -DA:728,92718 +FNDA:92572,StreamingPaymentProcessor.validStart +DA:728,92572 FNF:31 FNH:31 LF:152 @@ -2168,29 +2148,29 @@ BRDA:106,2,1,516 DA:110,0 DA:114,516 DA:115,516 -DA:116,7158 -DA:119,7158 -DA:120,7156 +DA:116,7327 +DA:119,7327 +DA:120,7325 BRDA:118,3,0,3 -BRDA:118,3,1,7155 +BRDA:118,3,1,7324 DA:122,3 -DA:125,7155 +DA:125,7324 BRDA:125,4,0,256 -BRDA:125,4,1,6899 +BRDA:125,4,1,7068 DA:126,256 -DA:129,6899 -DA:130,6899 +DA:129,7068 +DA:130,7068 DA:134,257 DA:137,257 DA:138,257 DA:141,257 DA:142,257 FN:148,SingleVoteGovernor.getReceipt -FNDA:44837,SingleVoteGovernor.getReceipt -DA:153,44837 -DA:155,44837 +FNDA:43820,SingleVoteGovernor.getReceipt +DA:153,43820 +DA:155,43820 FN:161,SingleVoteGovernor.setThreshold -FNDA:4928,SingleVoteGovernor.setThreshold +FNDA:4954,SingleVoteGovernor.setThreshold DA:163,259 BRDA:163,5,0,256 BRDA:163,5,1,3 @@ -2198,7 +2178,7 @@ DA:164,256 DA:170,3 DA:171,3 FN:174,SingleVoteGovernor.setVotingDuration -FNDA:4733,SingleVoteGovernor.setVotingDuration +FNDA:4750,SingleVoteGovernor.setVotingDuration DA:177,6 DA:178,5 BRDA:176,6,0,2 @@ -2207,99 +2187,99 @@ DA:180,2 DA:183,4 DA:184,4 FN:190,SingleVoteGovernor.addVoter -FNDA:63818,SingleVoteGovernor.addVoter -DA:191,58954 -BRDA:191,7,0,53609 -BRDA:191,7,1,58954 -DA:192,53609 -DA:194,53609 -DA:196,53609 +FNDA:62057,SingleVoteGovernor.addVoter +DA:191,57311 +BRDA:191,7,0,52466 +BRDA:191,7,1,57311 +DA:192,52466 +DA:194,52466 +DA:196,52466 FN:200,SingleVoteGovernor.removeVoter -FNDA:14156,SingleVoteGovernor.removeVoter -DA:202,9207 +FNDA:13655,SingleVoteGovernor.removeVoter +DA:202,8961 BRDA:202,8,0,1 -BRDA:202,8,1,9206 +BRDA:202,8,1,8960 DA:203,1 -DA:207,9206 +DA:207,8960 BRDA:207,9,0,1 -BRDA:207,9,1,9205 +BRDA:207,9,1,8959 DA:208,1 -DA:211,9205 -BRDA:211,10,0,4604 -BRDA:211,10,1,9205 -DA:212,4604 -DA:214,4604 -DA:216,4604 +DA:211,8959 +BRDA:211,10,0,4481 +BRDA:211,10,1,8959 +DA:212,4481 +DA:214,4481 +DA:216,4481 FN:223,SingleVoteGovernor.createMotion -FNDA:60628,SingleVoteGovernor.createMotion -DA:229,55465 -DA:233,55465 -DA:236,55465 -DA:237,55465 -DA:239,55465 -DA:240,55465 -DA:241,55465 -DA:243,55465 -DA:247,55465 -DA:250,55465 +FNDA:60323,SingleVoteGovernor.createMotion +DA:229,55248 +DA:233,55248 +DA:236,55248 +DA:237,55248 +DA:239,55248 +DA:240,55248 +DA:241,55248 +DA:243,55248 +DA:247,55248 +DA:250,55248 FN:253,SingleVoteGovernor.castVote -FNDA:366292,SingleVoteGovernor.castVote -DA:258,351245 +FNDA:373083,SingleVoteGovernor.castVote +DA:258,357727 BRDA:258,11,0,256 -BRDA:258,11,1,350989 +BRDA:258,11,1,357471 DA:259,256 -DA:263,350989 -BRDA:263,12,0,63843 -BRDA:263,12,1,287146 -DA:264,63843 -DA:268,287146 -DA:271,287146 -BRDA:271,13,0,102291 -BRDA:271,13,1,184855 -DA:272,102291 -DA:276,184855 -BRDA:276,14,0,14055 -BRDA:276,14,1,170800 -DA:277,14055 -DA:280,170800 -BRDA:280,15,0,155098 -BRDA:280,15,1,15702 -DA:282,155098 -DA:284,15702 -BRDA:284,16,0,10389 -BRDA:284,16,1,5313 -DA:286,10389 -DA:288,5313 -BRDA:288,17,0,5313 -BRDA:288,17,1,5313 -DA:290,5313 -DA:294,170800 +DA:263,357471 +BRDA:263,12,0,70476 +BRDA:263,12,1,286995 +DA:264,70476 +DA:268,286995 +DA:271,286995 +BRDA:271,13,0,103935 +BRDA:271,13,1,183060 +DA:272,103935 +DA:276,183060 +BRDA:276,14,0,14379 +BRDA:276,14,1,168681 +DA:277,14379 +DA:280,168681 +BRDA:280,15,0,153102 +BRDA:280,15,1,15579 +DA:282,153102 +DA:284,15579 +BRDA:284,16,0,10261 +BRDA:284,16,1,5318 +DA:286,10261 +DA:288,5318 +BRDA:288,17,0,5318 +BRDA:288,17,1,5318 +DA:290,5318 +DA:294,168681 FN:297,SingleVoteGovernor.executeMotion -FNDA:48529,SingleVoteGovernor.executeMotion -DA:299,48529 -DA:302,48529 +FNDA:47886,SingleVoteGovernor.executeMotion +DA:299,47886 +DA:302,47886 BRDA:302,18,0,256 -BRDA:302,18,1,48273 +BRDA:302,18,1,47630 DA:303,256 -DA:307,48273 +DA:307,47630 BRDA:307,19,0,2 -BRDA:307,19,1,48271 +BRDA:307,19,1,47628 DA:308,2 -DA:312,48271 +DA:312,47628 BRDA:312,20,0,1 -BRDA:312,20,1,48270 +BRDA:312,20,1,47627 DA:313,1 -DA:317,48270 +DA:317,47627 BRDA:317,21,0,1 -BRDA:317,21,1,48269 +BRDA:317,21,1,47626 DA:318,1 -DA:322,48269 -DA:325,48269 -DA:326,48269 -DA:327,48269 -DA:330,48269 -DA:331,48269 -DA:333,48269 +DA:322,47626 +DA:325,47626 +DA:326,47626 +DA:327,47626 +DA:330,47626 +DA:331,47626 +DA:333,47626 FNF:9 FNH:9 LF:93 @@ -2309,100 +2289,100 @@ BRH:42 end_of_record TN: SF:src/orchestrator/Orchestrator.sol -FN:94,Orchestrator.init -FNDA:16110,Orchestrator.init -DA:103,15854 -DA:106,15854 -DA:108,15854 -DA:110,15854 -DA:111,15854 -DA:112,15854 -DA:117,15854 -DA:118,15854 -DA:119,15854 -FN:130,Orchestrator._isModuleUsedInOrchestrator +FN:98,Orchestrator.init +FNDA:15244,Orchestrator.init +DA:107,14988 +DA:110,14988 +DA:112,14988 +DA:114,14988 +DA:115,14988 +DA:116,14988 +DA:121,14988 +DA:122,14988 +DA:123,14988 +FN:134,Orchestrator._isModuleUsedInOrchestrator FNDA:4,Orchestrator._isModuleUsedInOrchestrator -DA:135,4 -DA:136,4 -DA:137,4 -DA:138,4 -DA:140,10 -DA:141,10 -DA:143,10 -BRDA:143,0,0,- -BRDA:143,0,1,4 -DA:145,4 -DA:146,4 -BRDA:144,1,0,- -BRDA:144,1,1,4 -DA:148,4 -DA:153,6 -DA:157,0 -FN:161,Orchestrator.findModuleAddressInOrchestrator +DA:139,4 +DA:140,4 +DA:141,4 +DA:142,4 +DA:144,10 +DA:145,10 +DA:147,10 +BRDA:147,0,0,- +BRDA:147,0,1,4 +DA:149,4 +DA:150,4 +BRDA:148,1,0,- +BRDA:148,1,1,4 +DA:152,4 +DA:157,6 +DA:161,0 +FN:165,Orchestrator.findModuleAddressInOrchestrator FNDA:4,Orchestrator.findModuleAddressInOrchestrator -DA:166,4 -DA:167,4 -DA:168,4 -BRDA:168,2,0,- -BRDA:168,2,1,4 -DA:169,0 +DA:170,4 +DA:171,4 DA:172,4 -FN:182,Orchestrator.verifyAddressIsAuthorizerModule +BRDA:172,2,0,- +BRDA:172,2,1,4 +DA:173,0 +DA:176,4 +FN:186,Orchestrator.verifyAddressIsAuthorizerModule FNDA:0,Orchestrator.verifyAddressIsAuthorizerModule -DA:187,0 -DA:189,0 -FN:198,Orchestrator.verifyAddressIsFundingManager +DA:191,0 +DA:193,0 +FN:201,Orchestrator.verifyAddressIsFundingManager FNDA:0,Orchestrator.verifyAddressIsFundingManager -DA:203,0 -DA:204,0 DA:206,0 -FN:214,Orchestrator.verifyAddressIsRecurringPaymentManager +DA:207,0 +DA:209,0 +FN:217,Orchestrator.verifyAddressIsRecurringPaymentManager FNDA:0,Orchestrator.verifyAddressIsRecurringPaymentManager -DA:217,0 -DA:218,0 DA:220,0 -FN:228,Orchestrator.verifyAddressIsPaymentProcessor +DA:221,0 +DA:223,0 +FN:231,Orchestrator.verifyAddressIsPaymentProcessor FNDA:0,Orchestrator.verifyAddressIsPaymentProcessor -DA:233,0 -DA:234,0 DA:236,0 -FN:248,Orchestrator.__ModuleManager_isAuthorized -FNDA:1586,Orchestrator.__ModuleManager_isAuthorized -DA:254,1586 -FN:261,Orchestrator.setAuthorizer +DA:237,0 +DA:239,0 +FN:251,Orchestrator.__ModuleManager_isAuthorized +FNDA:1572,Orchestrator.__ModuleManager_isAuthorized +DA:257,1572 +FN:264,Orchestrator.setAuthorizer FNDA:257,Orchestrator.setAuthorizer -DA:265,257 -DA:266,257 -DA:267,257 DA:268,257 -FN:272,Orchestrator.setFundingManager +DA:269,257 +DA:270,257 +DA:271,257 +FN:275,Orchestrator.setFundingManager FNDA:257,Orchestrator.setFundingManager -DA:276,257 -DA:277,257 -DA:278,257 DA:279,257 -FN:283,Orchestrator.setPaymentProcessor +DA:280,257 +DA:281,257 +DA:282,257 +FN:286,Orchestrator.setPaymentProcessor FNDA:257,Orchestrator.setPaymentProcessor -DA:287,257 -DA:288,257 -DA:289,257 DA:290,257 -FN:294,Orchestrator.executeTx +DA:291,257 +DA:292,257 +DA:293,257 +FN:297,Orchestrator.executeTx FNDA:1024,Orchestrator.executeTx -DA:299,512 -DA:300,512 -DA:301,512 +DA:302,512 DA:303,512 -BRDA:303,3,0,256 -BRDA:303,3,1,256 -DA:304,256 -DA:306,256 -FN:314,Orchestrator.token -FNDA:149672,Orchestrator.token -DA:315,149672 -FN:319,Orchestrator.version +DA:304,512 +DA:306,512 +BRDA:306,3,0,256 +BRDA:306,3,1,256 +DA:307,256 +DA:309,256 +FN:317,Orchestrator.token +FNDA:170454,Orchestrator.token +DA:318,170454 +FN:322,Orchestrator.version FNDA:1,Orchestrator.version -DA:320,1 +DA:323,1 FNF:14 FNH:10 LF:58 @@ -2413,72 +2393,72 @@ end_of_record TN: SF:src/orchestrator/base/ModuleManager.sol FN:101,ModuleManager.__ModuleManager_init -FNDA:16371,ModuleManager.__ModuleManager_init -DA:105,16370 -DA:107,16370 -DA:108,16370 -DA:112,16370 -BRDA:112,0,0,260 -BRDA:112,0,1,16110 -DA:113,260 -DA:116,16110 -DA:117,170584 -DA:119,170584 +FNDA:15505,ModuleManager.__ModuleManager_init +DA:105,15504 +DA:107,15504 +DA:108,15504 +DA:112,15504 +BRDA:112,0,0,262 +BRDA:112,0,1,15242 +DA:113,262 +DA:116,15242 +DA:117,169342 +DA:119,169342 FN:123,ModuleManager.__ModuleManager_addModule -FNDA:218146,ModuleManager.__ModuleManager_addModule -DA:128,218142 +FNDA:214306,ModuleManager.__ModuleManager_addModule +DA:128,214302 FN:147,ModuleManager.isModule -FNDA:99765,ModuleManager.isModule -DA:153,430824 +FNDA:101584,ModuleManager.isModule +DA:153,430147 FN:157,ModuleManager.listModules -FNDA:1278,ModuleManager.listModules -DA:158,1282 +FNDA:1276,ModuleManager.listModules +DA:158,1280 FN:162,ModuleManager.modulesSize FNDA:0,ModuleManager.modulesSize DA:163,0 FN:170,ModuleManager.addModule -FNDA:78308,ModuleManager.addModule -DA:177,78308 +FNDA:79307,ModuleManager.addModule +DA:177,79307 FN:181,ModuleManager.removeModule -FNDA:30519,ModuleManager.removeModule -DA:186,30778 +FNDA:30875,ModuleManager.removeModule +DA:186,31134 FN:193,ModuleManager.executeTxFromModule -FNDA:3312,ModuleManager.executeTxFromModule -DA:199,3311 -DA:200,3311 -DA:202,3311 -DA:204,3311 +FNDA:3301,ModuleManager.executeTxFromModule +DA:199,3300 +DA:200,3300 +DA:202,3300 +DA:204,3300 FN:212,ModuleManager._commitAddModule -FNDA:296450,ModuleManager._commitAddModule -DA:214,296450 -DA:215,296450 -DA:216,296450 +FNDA:293609,ModuleManager._commitAddModule +DA:214,293609 +DA:215,293609 +DA:216,293609 FN:221,ModuleManager._commitRemoveModule -FNDA:30778,ModuleManager._commitRemoveModule -DA:228,30778 -DA:230,30778 -DA:232,30778 -DA:233,30778 -DA:234,962344 -BRDA:234,1,0,30778 -BRDA:234,1,1,931566 -DA:235,30778 -DA:236,30778 -DA:241,30778 -DA:243,30778 -DA:245,30778 -DA:247,30778 +FNDA:31134,ModuleManager._commitRemoveModule +DA:228,31134 +DA:230,31134 +DA:232,31134 +DA:233,31134 +DA:234,984421 +BRDA:234,1,0,31134 +BRDA:234,1,1,953287 +DA:235,31134 +DA:236,31134 +DA:241,31134 +DA:243,31134 +DA:245,31134 +DA:247,31134 FN:250,ModuleManager._ensureValidModule -FNDA:296456,ModuleManager._ensureValidModule -DA:251,296456 +FNDA:293615,ModuleManager._ensureValidModule +DA:251,293615 BRDA:251,2,0,6 -BRDA:251,2,1,296450 +BRDA:251,2,1,293609 DA:252,6 FN:256,ModuleManager._ensureNotModule -FNDA:296713,ModuleManager._ensureNotModule -DA:257,296713 +FNDA:293872,ModuleManager._ensureNotModule +DA:257,293872 BRDA:257,3,0,257 -BRDA:257,3,1,296456 +BRDA:257,3,1,293615 DA:258,257 FNF:12 FNH:11 @@ -2742,15 +2722,15 @@ end_of_record TN: SF:test/modules/fundingManager/token/utils/mocks/ElasticReceiptTokenBaseMock.sol FN:28,ElasticReceiptTokenBaseMock._supplyTarget -FNDA:6516,ElasticReceiptTokenBaseMock._supplyTarget -DA:34,6516 +FNDA:6507,ElasticReceiptTokenBaseMock._supplyTarget +DA:34,6507 FN:37,ElasticReceiptTokenBaseMock.mint FNDA:3338,ElasticReceiptTokenBaseMock.mint DA:38,3338 -DA:39,2942 +DA:39,2937 FN:42,ElasticReceiptTokenBaseMock.burn -FNDA:150,ElasticReceiptTokenBaseMock.burn -DA:43,150 +FNDA:149,ElasticReceiptTokenBaseMock.burn +DA:43,149 DA:44,0 FNF:3 FNH:3 @@ -2808,7 +2788,7 @@ SF:test/orchestrator/helper/TypeSanityHelper.sol FN:16,TypeSanityHelper.assumeElemNotInSet FNDA:8960,TypeSanityHelper.assumeElemNotInSet DA:20,8960 -DA:21,606736 +DA:21,600558 FN:29,TypeSanityHelper.assumeValidOrchestratorId FNDA:2048,TypeSanityHelper.assumeValidOrchestratorId DA:30,2048 @@ -2816,20 +2796,20 @@ FN:41,TypeSanityHelper.assumeValidModules FNDA:3072,TypeSanityHelper.assumeValidModules DA:42,3072 DA:43,3072 -DA:44,220262 -DA:47,220262 -DA:50,220262 +DA:44,220128 +DA:47,220128 +DA:50,220128 FN:54,TypeSanityHelper.assumeValidModule FNDA:1024,TypeSanityHelper.assumeValidModule -DA:55,221286 -DA:57,221286 -DA:58,663858 +DA:55,221152 +DA:57,221152 +DA:58,663456 FN:62,TypeSanityHelper.createInvalidModules FNDA:2,TypeSanityHelper.createInvalidModules -DA:63,221288 -DA:65,221288 -DA:66,221288 -DA:68,221288 +DA:63,221154 +DA:65,221154 +DA:66,221154 +DA:68,221154 FN:75,TypeSanityHelper.assumeValidFunders FNDA:0,TypeSanityHelper.assumeValidFunders FNF:6 @@ -2842,11 +2822,11 @@ end_of_record TN: SF:test/utils/mocks/ERC20Mock.sol FN:14,ERC20Mock.mint -FNDA:42048,ERC20Mock.mint -DA:15,42048 +FNDA:47034,ERC20Mock.mint +DA:15,47034 FN:18,ERC20Mock.burn -FNDA:25017,ERC20Mock.burn -DA:19,25017 +FNDA:25203,ERC20Mock.burn +DA:19,25203 FN:22,ERC20Mock.blockAddress FNDA:1,ERC20Mock.blockAddress DA:23,1 @@ -2858,32 +2838,32 @@ FNDA:2,ERC20Mock.toggleReturnFalse DA:31,2 FN:34,ERC20Mock.isBlockedAddress FNDA:2,ERC20Mock.isBlockedAddress -DA:35,99883 +DA:35,106554 FN:38,ERC20Mock.transfer -FNDA:10112,ERC20Mock.transfer -DA:39,10112 +FNDA:12384,ERC20Mock.transfer +DA:39,12384 BRDA:39,0,0,- -BRDA:39,0,1,10112 +BRDA:39,0,1,12384 DA:40,0 -DA:42,10112 +DA:42,12384 BRDA:42,1,0,- -BRDA:42,1,1,10112 -DA:43,10112 -DA:44,10112 -DA:45,10112 +BRDA:42,1,1,12384 +DA:43,12384 +DA:44,12384 +DA:45,12384 FN:48,ERC20Mock.transferFrom -FNDA:89770,ERC20Mock.transferFrom -DA:53,89770 +FNDA:94169,ERC20Mock.transferFrom +DA:53,94169 BRDA:53,2,0,1 -BRDA:53,2,1,89769 +BRDA:53,2,1,94168 DA:54,1 -DA:56,89769 +DA:56,94168 BRDA:56,3,0,1 -BRDA:56,3,1,89768 -DA:57,89768 -DA:58,89768 -DA:59,89768 -DA:60,89768 +BRDA:56,3,1,94167 +DA:57,94167 +DA:58,94167 +DA:59,94167 +DA:60,94167 FNF:8 FNH:8 LF:19 @@ -2894,12 +2874,12 @@ end_of_record TN: SF:test/utils/mocks/ERC721Mock.sol FN:15,ERC721Mock.mint -FNDA:1524,ERC721Mock.mint -DA:16,1524 -DA:17,1524 +FNDA:1750,ERC721Mock.mint +DA:16,1750 +DA:17,1750 FN:20,ERC721Mock.burn -FNDA:1780,ERC721Mock.burn -DA:21,1780 +FNDA:2006,ERC721Mock.burn +DA:21,2006 FN:24,ERC721Mock.blockAddress FNDA:0,ERC721Mock.blockAddress DA:25,0 @@ -2925,8 +2905,8 @@ end_of_record TN: SF:test/utils/mocks/factories/ModuleFactoryMock.sol FN:20,ModuleFactoryMock.createModule -FNDA:53171,ModuleFactoryMock.createModule -DA:24,53171 +FNDA:50555,ModuleFactoryMock.createModule +DA:24,50555 FN:27,ModuleFactoryMock.getBeaconAndId FNDA:0,ModuleFactoryMock.getBeaconAndId DA:32,0 @@ -2998,77 +2978,76 @@ BRDA:36,0,0,- BRDA:36,0,1,259 DA:38,259 DA:40,259 -DA:42,259 -FN:46,AuthorizerMock.mockInit +DA:41,259 +FN:44,AuthorizerMock.mockInit FNDA:256,AuthorizerMock.mockInit -DA:48,256 +DA:46,256 +DA:47,256 +BRDA:47,1,0,- +BRDA:47,1,1,256 DA:49,256 -BRDA:49,1,0,- -BRDA:49,1,1,256 -DA:51,256 -FN:58,AuthorizerMock.isAuthorized -FNDA:3844,AuthorizerMock.isAuthorized -DA:59,3844 -FN:65,AuthorizerMock.isAuthorized -FNDA:0,AuthorizerMock.isAuthorized -DA:70,0 -FN:77,AuthorizerMock.generateRoleId -FNDA:270630,AuthorizerMock.generateRoleId -DA:82,631516 -FN:85,AuthorizerMock.grantRoleFromModule +FN:75,AuthorizerMock.generateRoleId +FNDA:276893,AuthorizerMock.generateRoleId +DA:80,277661 +FN:83,AuthorizerMock.grantRoleFromModule FNDA:512,AuthorizerMock.grantRoleFromModule -DA:86,512 -DA:87,512 -FN:90,AuthorizerMock.revokeRoleFromModule +DA:84,512 +DA:85,512 +FN:88,AuthorizerMock.revokeRoleFromModule FNDA:256,AuthorizerMock.revokeRoleFromModule -DA:91,256 -FN:94,AuthorizerMock.toggleModuleSelfManagement -FNDA:513,AuthorizerMock.toggleModuleSelfManagement -FN:96,AuthorizerMock.transferAdminRole +DA:89,256 +FN:92,AuthorizerMock.toggleModuleSelfManagement +FNDA:0,AuthorizerMock.toggleModuleSelfManagement +FN:94,AuthorizerMock.transferAdminRole FNDA:0,AuthorizerMock.transferAdminRole -FN:98,AuthorizerMock.burnAdminRole -FNDA:0,AuthorizerMock.burnAdminRole -FN:102,AuthorizerMock.getRoleAdmin +FN:96,AuthorizerMock.burnAdminFromModuleRole +FNDA:0,AuthorizerMock.burnAdminFromModuleRole +FN:100,AuthorizerMock.getRoleAdmin FNDA:0,AuthorizerMock.getRoleAdmin -DA:103,0 -FN:106,AuthorizerMock.getRoleMember +DA:101,0 +FN:104,AuthorizerMock.getRoleMember FNDA:0,AuthorizerMock.getRoleMember -DA:107,0 -FN:110,AuthorizerMock.getRoleMemberCount +DA:105,0 +FN:108,AuthorizerMock.getRoleMemberCount FNDA:0,AuthorizerMock.getRoleMemberCount -DA:111,0 -FN:114,AuthorizerMock.grantRole +DA:109,0 +FN:112,AuthorizerMock.grantRole FNDA:0,AuthorizerMock.grantRole -DA:115,0 -FN:118,AuthorizerMock.hasRole -FNDA:628930,AuthorizerMock.hasRole -DA:119,628930 -FN:122,AuthorizerMock.checkRoleMembership +DA:113,0 +FN:116,AuthorizerMock.hasRole +FNDA:651003,AuthorizerMock.hasRole +DA:117,651003 +FN:120,AuthorizerMock.hasModuleRole +FNDA:0,AuthorizerMock.hasModuleRole +DA:125,0 +DA:126,0 +DA:127,0 +FN:130,AuthorizerMock.checkRoleMembership FNDA:512,AuthorizerMock.checkRoleMembership -DA:127,512 -FN:130,AuthorizerMock.revokeRole +DA:135,512 +FN:138,AuthorizerMock.revokeRole FNDA:0,AuthorizerMock.revokeRole -DA:131,0 -FN:134,AuthorizerMock.renounceRole +DA:139,0 +FN:142,AuthorizerMock.renounceRole FNDA:0,AuthorizerMock.renounceRole -FN:136,AuthorizerMock.getOwnerRole -FNDA:180054,AuthorizerMock.getOwnerRole -DA:137,180054 -FN:140,AuthorizerMock.getManagerRole -FNDA:178774,AuthorizerMock.getManagerRole -DA:141,178774 -FN:148,AuthorizerMock.grantGlobalRole +FN:144,AuthorizerMock.getOwnerRole +FNDA:190135,AuthorizerMock.getOwnerRole +DA:145,190135 +FN:148,AuthorizerMock.getManagerRole +FNDA:184757,AuthorizerMock.getManagerRole +DA:149,184757 +FN:156,AuthorizerMock.grantGlobalRole FNDA:0,AuthorizerMock.grantGlobalRole -DA:149,0 -DA:150,0 -FN:157,AuthorizerMock.revokeGlobalRole -FNDA:0,AuthorizerMock.revokeGlobalRole +DA:157,0 DA:158,0 -DA:159,0 -FNF:24 -FNH:12 -LF:30 -LH:19 +FN:165,AuthorizerMock.revokeGlobalRole +FNDA:0,AuthorizerMock.revokeGlobalRole +DA:166,0 +DA:167,0 +FNF:23 +FNH:10 +LF:31 +LH:18 BRF:4 BRH:2 end_of_record @@ -3081,8 +3060,8 @@ FN:35,ERC20PaymentClientMock.setOrchestrator FNDA:768,ERC20PaymentClientMock.setOrchestrator DA:36,768 FN:42,ERC20PaymentClientMock.addPaymentOrder -FNDA:91432,ERC20PaymentClientMock.addPaymentOrder -DA:43,91432 +FNDA:91286,ERC20PaymentClientMock.addPaymentOrder +DA:43,91286 FN:47,ERC20PaymentClientMock.addPaymentOrderUnchecked FNDA:5,ERC20PaymentClientMock.addPaymentOrderUnchecked DA:49,5 @@ -3094,11 +3073,11 @@ DA:58,1 FN:64,ERC20PaymentClientMock._ensureTokenBalance FNDA:3844,ERC20PaymentClientMock._ensureTokenBalance DA:68,3844 -BRDA:68,0,0,3464 +BRDA:68,0,0,3469 BRDA:68,0,1,3844 DA:69,3844 -DA:71,3464 -DA:72,3464 +DA:71,3469 +DA:72,3469 FN:76,ERC20PaymentClientMock._ensureTokenAllowance FNDA:3844,ERC20PaymentClientMock._ensureTokenAllowance DA:80,3844 @@ -3145,8 +3124,8 @@ FN:47,FundingManagerMock.withdrawTo FNDA:0,FundingManagerMock.withdrawTo DA:48,0 FN:51,FundingManagerMock.transferOrchestratorToken -FNDA:3049,FundingManagerMock.transferOrchestratorToken -DA:52,3049 +FNDA:3038,FundingManagerMock.transferOrchestratorToken +DA:52,3038 FNF:8 FNH:3 LF:8 @@ -3157,15 +3136,15 @@ end_of_record TN: SF:test/utils/mocks/modules/PaymentProcessorMock.sol FN:15,PaymentProcessorMock.processPayments -FNDA:11454,PaymentProcessorMock.processPayments +FNDA:11828,PaymentProcessorMock.processPayments FN:17,PaymentProcessorMock.cancelRunningPayments FNDA:0,PaymentProcessorMock.cancelRunningPayments FN:19,PaymentProcessorMock.token FNDA:0,PaymentProcessorMock.token DA:20,0 FN:23,PaymentProcessorMock.deleteAllPayments -FNDA:3049,PaymentProcessorMock.deleteAllPayments -DA:24,3049 +FNDA:3038,PaymentProcessorMock.deleteAllPayments +DA:24,3038 FNF:4 FNH:2 LF:2 @@ -3274,8 +3253,8 @@ FN:28,ModuleManagerMock.initNoInitializer FNDA:1,ModuleManagerMock.initNoInitializer DA:29,1 FN:32,ModuleManagerMock.__ModuleManager_isAuthorized -FNDA:108783,ModuleManagerMock.__ModuleManager_isAuthorized -DA:38,108783 +FNDA:110152,ModuleManagerMock.__ModuleManager_isAuthorized +DA:38,110152 FNF:5 FNH:4 LF:5 diff --git a/script/setup/SetupToyOrchestratorScript.s.sol b/script/setup/SetupToyOrchestratorScript.s.sol index 344a326a0..a368a2307 100644 --- a/script/setup/SetupToyOrchestratorScript.s.sol +++ b/script/setup/SetupToyOrchestratorScript.s.sol @@ -216,7 +216,8 @@ contract SetupToyOrchestratorScript is Test, DeploymentScript { vm.startBroadcast(orchestratorOwnerPrivateKey); { orchestratorCreatedBountyManager.grantModuleRole( - uint8(IBountyManager.Roles.BountyAdmin), orchestratorOwner + orchestratorCreatedBountyManager.BOUNTY_ADMIN_ROLE(), + orchestratorOwner ); bytes memory details = "TEST BOUNTY"; diff --git a/src/modules/authorizer/IAuthorizer.sol b/src/modules/authorizer/IAuthorizer.sol index ba9a0ea55..0d62d7f37 100644 --- a/src/modules/authorizer/IAuthorizer.sol +++ b/src/modules/authorizer/IAuthorizer.sol @@ -26,45 +26,37 @@ interface IAuthorizer is IAccessControlEnumerableUpgradeable { error Module__RoleAuthorizer__OwnerRoleCannotBeEmpty(); //-------------------------------------------------------------------------- - // Overloaded and overriden functions - - /// @notice Returns if an address is authorized to perform a specific action - /// @param who The adress to be checked. - function isAuthorized(address who) external view returns (bool); + // Functions - /// @notice Overloads {isAuthorized} for a Module to ask whether an address holds the required role to execute + /// @notice Asks whether an address holds the required module role to execute /// the current transaction. /// @param role The identifier of the role we want to check /// @param who The address on which to perform the check. - /// @dev If the role is not self-managed, it will default to the orchestrator roles - /// @dev If not, it will use the calling address to generate the role ID. Therefore, for checking on anything other than itself, hasRole() should be used - function isAuthorized(uint8 role, address who) + /// @dev It will use the calling address to generate the role ID. Therefore, for checking on anything other than itself, hasRole() should be used + function hasModuleRole(bytes32 role, address who) external view returns (bool); - //-------------------------------------------------------------------------- - // Functions - /// @notice Helper function to generate a bytes32 role hash for a module role /// @param module The address of the module to generate the hash for /// @param role The ID number of the role to generate the hash for - function generateRoleId(address module, uint8 role) + function generateRoleId(address module, bytes32 role) external returns (bytes32); /// @notice Used by a Module to grant a role to a user. /// @param role The identifier of the role to grant /// @param target The address to which to grant the role. - function grantRoleFromModule(uint8 role, address target) external; + function grantRoleFromModule(bytes32 role, address target) external; /// @notice Used by a Module to revoke a role from a user. /// @param role The identifier of the role to revoke /// @param target The address to revoke the role from. - function revokeRoleFromModule(uint8 role, address target) external; + function revokeRoleFromModule(bytes32 role, address target) external; - /// @notice Toggles if a Module self-manages its roles or defaults to the orchestrator's roles. - function toggleModuleSelfManagement() external; + /* /// @notice Toggles if a Module self-manages its roles or defaults to the orchestrator's roles. + function toggleModuleSelfManagement() external; */ /// @notice Transfer the admin rights to a given role. /// @param roleId The role on which to peform the admin transfer @@ -74,25 +66,25 @@ interface IAuthorizer is IAccessControlEnumerableUpgradeable { /// @notice Irreversibly burns the admin of a given role. /// @param role The role to remove admin access from /// @dev The module itself can still grant and revoke it's own roles. This only burns third-party access to the role. - function burnAdminRole(uint8 role) external; + function burnAdminFromModuleRole(bytes32 role) external; /// @notice Grants a global role to a target /// @param role The role to grant /// @param target The address to grant the role to /// @dev Only the addresses with the Owner role should be able to call this function - function grantGlobalRole(uint8 role, address target) external; + function grantGlobalRole(bytes32 role, address target) external; /// @notice Revokes a global role from a target /// @param role The role to grant /// @param target The address to grant the role to /// @dev Only the addresses with the Owner role should be able to call this function - function revokeGlobalRole(uint8 role, address target) external; + function revokeGlobalRole(bytes32 role, address target) external; /// @notice Returns the role ID of the owner role /// @return The role ID - function getOwnerRole() external returns (bytes32); + function getOwnerRole() external view returns (bytes32); /// @notice Returns the role ID of the manager role /// @return The role ID - function getManagerRole() external returns (bytes32); + function getManagerRole() external view returns (bytes32); } diff --git a/src/modules/authorizer/ITokenGatedRoleAuthorizer.sol b/src/modules/authorizer/ITokenGatedRoleAuthorizer.sol index 7d5b51f1f..4f61177cb 100644 --- a/src/modules/authorizer/ITokenGatedRoleAuthorizer.sol +++ b/src/modules/authorizer/ITokenGatedRoleAuthorizer.sol @@ -52,13 +52,23 @@ interface ITokenGatedRoleAuthorizer is IAuthorizer { /// @param role The role to be made token-gated /// @dev This function is only callable by an active Module for itself. Admin should use setTokenGated(). /// @dev Calling this function does not specify WHICH token to use for gating. That has to be done with 'grantTokenFromModule()' - function makeRoleTokenGatedFromModule(uint8 role) external; + function makeRoleTokenGatedFromModule(bytes32 role) external; /// @notice One-step setup for Modules to create a token-gated role and set its threshold. /// @param role The role to be made token-gated /// @param token The token for which the threshold will be set. /// @param threshold The minimum balance of the token required to qualify for the role. - function grantTokenRoleFromModule(uint8 role, address token, uint threshold) + function grantTokenRoleFromModule( + bytes32 role, + address token, + uint threshold + ) external; + + /// @notice Allows a Module to set the Threshold of one of it's roles + /// @param role The token-gated role + /// @param token The token for which the threshold will be set. + /// @param threshold The new minimum balance of the token required to qualify for the role. + function setThresholdFromModule(bytes32 role, address token, uint threshold) external; /// @notice Sets if a role is token-gated or not. diff --git a/src/modules/authorizer/RoleAuthorizer.sol b/src/modules/authorizer/RoleAuthorizer.sol index 63f1efd55..707690b16 100644 --- a/src/modules/authorizer/RoleAuthorizer.sol +++ b/src/modules/authorizer/RoleAuthorizer.sol @@ -16,20 +16,9 @@ contract RoleAuthorizer is //-------------------------------------------------------------------------- // Storage - // Core roles for a orchestrator. They correspond to uint8(0) and uint(1) - // NOTE that orchestrator owner can register more global roles using numbers from 2 onward. They'l need to go through the DEFAULT_ADMIN_ROLE for this. - enum CoreRoles { - OWNER, // Partial Access to Protected Functions - MANAGER // Full Access to Protected Functions - } - - // Stores the if a module wants to use it's own roles - // If false it uses the orchestrator's core roles. - mapping(address => bool) public selfManagedModules; - // Stored for easy public reference. Other Modules can assume the following roles to exist - bytes32 public ORCHESTRATOR_OWNER_ROLE; - bytes32 public ORCHESTRATOR_MANAGER_ROLE; + bytes32 public constant ORCHESTRATOR_OWNER_ROLE = "0x01"; + bytes32 public constant ORCHESTRATOR_MANAGER_ROLE = "0x02"; bytes32 public constant BURN_ADMIN_ROLE = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; @@ -45,14 +34,6 @@ contract RoleAuthorizer is _; } - /// @notice Verifies that the calling module has turned on self-management - modifier onlySelfManaged() { - if (!selfManagedModules[_msgSender()]) { - revert Module__RoleAuthorizer__ModuleNotSelfManaged(); - } - _; - } - /// @notice Verifies that the owner being removed is not the last one modifier notLastOwner(bytes32 role) { if ( @@ -94,12 +75,6 @@ contract RoleAuthorizer is // so they can whitelist an address which then will have full write access to the roles in the system. This is mainly intended for safety/recovery situations, // Modules can opt out of this on a per-role basis by setting the admin role to "BURN_ADMIN_ROLE". - // Store RoleIDs for the Orchestrator roles: - ORCHESTRATOR_OWNER_ROLE = - generateRoleId(address(orchestrator()), uint8(CoreRoles.OWNER)); - ORCHESTRATOR_MANAGER_ROLE = - generateRoleId(address(orchestrator()), uint8(CoreRoles.MANAGER)); - //We preliminarily grant admin role to the caller _grantRole(ORCHESTRATOR_OWNER_ROLE, _msgSender()); @@ -142,36 +117,20 @@ contract RoleAuthorizer is //-------------------------------------------------------------------------- // Public functions - // View functions - /// @inheritdoc IAuthorizer - /// @dev Implements the function of the IAuthorizer interface by defauling to check if the caller holds the OWNER role. - function isAuthorized(address who) external view returns (bool) { - // In case no role is specfied, we ask if the caller is an owner - return hasRole(ORCHESTRATOR_OWNER_ROLE, who); - } - - /// @inheritdoc IAuthorizer - function isAuthorized(uint8 role, address who) + function hasModuleRole(bytes32 role, address who) external view virtual returns (bool) { //Note: since it uses msgSenderto generate ID, this should only be used by modules. Users should call hasRole() - bytes32 roleId; - // If the module uses its own roles, check if account has the role. - // else check if account has role in orchestrator - if (selfManagedModules[_msgSender()]) { - roleId = generateRoleId(_msgSender(), role); - } else { - roleId = generateRoleId(address(orchestrator()), role); - } + bytes32 roleId = generateRoleId(_msgSender(), role); return hasRole(roleId, who); } /// @inheritdoc IAuthorizer - function generateRoleId(address module, uint8 role) + function generateRoleId(address module, bytes32 role) public pure returns (bytes32) @@ -180,34 +139,19 @@ contract RoleAuthorizer is return keccak256(abi.encodePacked(module, role)); } - // State-altering functions - - /// @inheritdoc IAuthorizer - function toggleModuleSelfManagement() external onlyModule(_msgSender()) { - if (selfManagedModules[_msgSender()]) { - selfManagedModules[_msgSender()] = false; - emit setRoleSelfManagement(_msgSender(), false); - } else { - selfManagedModules[_msgSender()] = true; - emit setRoleSelfManagement(_msgSender(), true); - } - } - /// @inheritdoc IAuthorizer - function grantRoleFromModule(uint8 role, address target) + function grantRoleFromModule(bytes32 role, address target) external onlyModule(_msgSender()) - onlySelfManaged { bytes32 roleId = generateRoleId(_msgSender(), role); _grantRole(roleId, target); } /// @inheritdoc IAuthorizer - function revokeRoleFromModule(uint8 role, address target) + function revokeRoleFromModule(bytes32 role, address target) external onlyModule(_msgSender()) - onlySelfManaged { bytes32 roleId = generateRoleId(_msgSender(), role); _revokeRole(roleId, target); @@ -222,17 +166,16 @@ contract RoleAuthorizer is } /// @inheritdoc IAuthorizer - function burnAdminRole(uint8 role) + function burnAdminFromModuleRole(bytes32 role) external onlyModule(_msgSender()) - onlySelfManaged { bytes32 roleId = generateRoleId(_msgSender(), role); _setRoleAdmin(roleId, BURN_ADMIN_ROLE); } /// @inheritdoc IAuthorizer - function grantGlobalRole(uint8 role, address target) + function grantGlobalRole(bytes32 role, address target) external onlyRole(ORCHESTRATOR_OWNER_ROLE) { @@ -241,7 +184,7 @@ contract RoleAuthorizer is } /// @inheritdoc IAuthorizer - function revokeGlobalRole(uint8 role, address target) + function revokeGlobalRole(bytes32 role, address target) external onlyRole(ORCHESTRATOR_OWNER_ROLE) { @@ -250,12 +193,12 @@ contract RoleAuthorizer is } /// @inheritdoc IAuthorizer - function getOwnerRole() public view returns (bytes32) { + function getOwnerRole() public pure returns (bytes32) { return ORCHESTRATOR_OWNER_ROLE; } /// @inheritdoc IAuthorizer - function getManagerRole() public view returns (bytes32) { + function getManagerRole() public pure returns (bytes32) { return ORCHESTRATOR_MANAGER_ROLE; } } diff --git a/src/modules/authorizer/TokenGatedRoleAuthorizer.sol b/src/modules/authorizer/TokenGatedRoleAuthorizer.sol index e35dcf5cc..7251e2f8a 100644 --- a/src/modules/authorizer/TokenGatedRoleAuthorizer.sol +++ b/src/modules/authorizer/TokenGatedRoleAuthorizer.sol @@ -3,7 +3,15 @@ pragma solidity 0.8.19; // External Libraries import {ITokenGatedRoleAuthorizer} from "./ITokenGatedRoleAuthorizer.sol"; -import {IAuthorizer, RoleAuthorizer} from "./RoleAuthorizer.sol"; +import { + IAuthorizer, + RoleAuthorizer, + AccessControlEnumerableUpgradeable +} from "./RoleAuthorizer.sol"; +import { + AccessControlUpgradeable, + IAccessControlUpgradeable +} from "@oz-up/access/AccessControlUpgradeable.sol"; interface TokenInterface { function balanceOf(address _owner) external view returns (uint balance); @@ -57,29 +65,17 @@ contract TokenGatedRoleAuthorizer is //-------------------------------------------------------------------------- // Overloaded and overriden functions - /// @inheritdoc RoleAuthorizer - /// @dev We add a check to call a different function if the role is token-gated. - function isAuthorized(uint8 role, address who) + function hasRole(bytes32 roleId, address account) public view - override(RoleAuthorizer, IAuthorizer) + virtual + override(AccessControlUpgradeable, IAccessControlUpgradeable) returns (bool) { - //Note: since it uses msgSender to generate ID, this should only be used by modules. Users should call hasRole() - bytes32 roleId; - // If the module self-manages its roles, check if account has the role. - if (selfManagedModules[_msgSender()]) { - roleId = generateRoleId(_msgSender(), role); - //check if token gated: - if (isTokenGated[roleId]) { - return hasTokenRole(roleId, who); - } else { - return hasRole(roleId, who); - } - // If not, check the account against the orchestrator roles + if (isTokenGated[roleId]) { + return _hasTokenRole(roleId, account); } else { - roleId = generateRoleId(address(orchestrator()), role); - return hasRole(roleId, who); + return super.hasRole(roleId, account); } } @@ -109,30 +105,10 @@ contract TokenGatedRoleAuthorizer is function hasTokenRole(bytes32 role, address who) public view + onlyTokenGated(role) returns (bool) { - uint numberOfAllowedTokens = getRoleMemberCount(role); - - for (uint i; i < numberOfAllowedTokens; ++i) { - address tokenAddr = getRoleMember(role, i); - bytes32 thresholdId = keccak256(abi.encodePacked(role, tokenAddr)); - uint tokenThreshold = thresholdMap[thresholdId]; - - //Should work with both ERC20 and ERC721 - try TokenInterface(tokenAddr).balanceOf(who) returns ( - uint tokenBalance - ) { - if (tokenBalance >= tokenThreshold) { - return true; - } - } catch { - // If the call fails, we continue to the next token. - // Emitting an event here would make this function (and the functions calling it) non-view. - // note we already enforce Interface implementation when granting the role. - } - } - - return false; + return _hasTokenRole(role, who); } /// @inheritdoc ITokenGatedRoleAuthorizer @@ -149,10 +125,9 @@ contract TokenGatedRoleAuthorizer is // State-altering functions /// @inheritdoc ITokenGatedRoleAuthorizer - function makeRoleTokenGatedFromModule(uint8 role) + function makeRoleTokenGatedFromModule(bytes32 role) public onlyModule(_msgSender()) - onlySelfManaged onlyEmptyRole(generateRoleId(_msgSender(), role)) { bytes32 roleId = generateRoleId(_msgSender(), role); @@ -162,13 +137,22 @@ contract TokenGatedRoleAuthorizer is } /// @inheritdoc ITokenGatedRoleAuthorizer - function grantTokenRoleFromModule(uint8 role, address token, uint threshold) - external + function grantTokenRoleFromModule( + bytes32 role, + address token, + uint threshold + ) external onlyModule(_msgSender()) { + bytes32 roleId = generateRoleId(_msgSender(), role); + _grantRole(roleId, token); + _setThreshold(roleId, token, threshold); + } + + /// @inheritdoc ITokenGatedRoleAuthorizer + function setThresholdFromModule(bytes32 role, address token, uint threshold) + public onlyModule(_msgSender()) - onlySelfManaged { bytes32 roleId = generateRoleId(_msgSender(), role); - _grantRole(roleId, token); _setThreshold(roleId, token, threshold); } @@ -210,4 +194,36 @@ contract TokenGatedRoleAuthorizer is thresholdMap[thresholdId] = threshold; emit ChangedTokenThreshold(roleId, token, threshold); } + + /// @notice Internal function that checks if an account qualifies for a token-gated role. + /// @param role The role to be checked. + /// @param who The account to be checked. + function _hasTokenRole(bytes32 role, address who) + internal + view + returns (bool) + { + uint numberOfAllowedTokens = getRoleMemberCount(role); + + for (uint i; i < numberOfAllowedTokens; ++i) { + address tokenAddr = getRoleMember(role, i); + bytes32 thresholdId = keccak256(abi.encodePacked(role, tokenAddr)); + uint tokenThreshold = thresholdMap[thresholdId]; + + //Should work with both ERC20 and ERC721 + try TokenInterface(tokenAddr).balanceOf(who) returns ( + uint tokenBalance + ) { + if (tokenBalance >= tokenThreshold) { + return true; + } + } catch { + // If the call fails, we continue to the next token. + // Emitting an event here would make this function (and the functions calling it) non-view. + // note we already enforce Interface implementation when granting the role. + } + } + + return false; + } } diff --git a/src/modules/base/IModule.sol b/src/modules/base/IModule.sol index 5c716f6ac..075665bdd 100644 --- a/src/modules/base/IModule.sol +++ b/src/modules/base/IModule.sol @@ -84,7 +84,7 @@ interface IModule { /// @return The module's orchestrator. function orchestrator() external view returns (IOrchestrator); - function grantModuleRole(uint8 role, address addr) external; + function grantModuleRole(bytes32 role, address addr) external; - function revokeModuleRole(uint8 role, address addr) external; + function revokeModuleRole(bytes32 role, address addr) external; } diff --git a/src/modules/base/Module.sol b/src/modules/base/Module.sol index 4d1cb065d..261b5065d 100644 --- a/src/modules/base/Module.sol +++ b/src/modules/base/Module.sol @@ -89,18 +89,18 @@ abstract contract Module is IModule, Initializable, ContextUpgradeable { } /// @notice Modifier to guarantee function is only callable by addresses that hold a specific module-assigned role. - modifier onlyModuleRole(uint8 roleId) { + modifier onlyModuleRole(bytes32 role) { if ( !__Module_orchestrator.authorizer().hasRole( __Module_orchestrator.authorizer().generateRoleId( - address(this), roleId + address(this), role ), _msgSender() ) ) { revert Module__CallerNotAuthorized( __Module_orchestrator.authorizer().generateRoleId( - address(this), roleId + address(this), role ), _msgSender() ); @@ -209,20 +209,20 @@ abstract contract Module is IModule, Initializable, ContextUpgradeable { //-------------------------------------------------------------------------- // Role Management - function grantModuleRole(uint8 role, address addr) + function grantModuleRole(bytes32 role, address addr) external onlyOrchestratorOwner { IAuthorizer roleAuthorizer = __Module_orchestrator.authorizer(); - roleAuthorizer.grantRoleFromModule(uint8(role), addr); + roleAuthorizer.grantRoleFromModule(role, addr); } - function revokeModuleRole(uint8 role, address addr) + function revokeModuleRole(bytes32 role, address addr) external onlyOrchestratorOwner { IAuthorizer roleAuthorizer = __Module_orchestrator.authorizer(); - roleAuthorizer.revokeRoleFromModule(uint8(role), addr); + roleAuthorizer.revokeRoleFromModule(role, addr); } //-------------------------------------------------------------------------- diff --git a/src/modules/logicModule/BountyManager.sol b/src/modules/logicModule/BountyManager.sol index 9e296fc45..ce32b39cc 100644 --- a/src/modules/logicModule/BountyManager.sol +++ b/src/modules/logicModule/BountyManager.sol @@ -164,6 +164,10 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { /// @dev Marks the beginning of the list. uint internal constant _SENTINEL = type(uint).max; + bytes32 public constant BOUNTY_ADMIN_ROLE = "BOUNTY_ADMIN"; + bytes32 public constant CLAIM_ADMIN_ROLE = "CLAIM_ADMIN"; + bytes32 public constant VERIFY_ADMIN_ROLE = "VERIFY_ADMIN"; + //-------------------------------------------------------------------------- // Storage @@ -206,7 +210,6 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { { //Note: due to the authorizer still not being set during initialization, // this function has to be called after. - orchestrator().authorizer().toggleModuleSelfManagement(); } //-------------------------------------------------------------------------- @@ -271,7 +274,7 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { bytes calldata details ) external - onlyModuleRole(uint8(Roles.BountyAdmin)) + onlyModuleRole(BOUNTY_ADMIN_ROLE) validPayoutAmounts(minimumPayoutAmount, maximumPayoutAmount) returns (uint id) { @@ -297,7 +300,7 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { /// @inheritdoc IBountyManager function updateBounty(uint bountyId, bytes calldata details) external - onlyModuleRole(uint8(Roles.BountyAdmin)) + onlyModuleRole(BOUNTY_ADMIN_ROLE) validBountyId(bountyId) notLocked(bountyId) { @@ -309,7 +312,7 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { /// @inheritdoc IBountyManager function lockBounty(uint bountyId) external - onlyModuleRole(uint8(Roles.BountyAdmin)) + onlyModuleRole(BOUNTY_ADMIN_ROLE) validBountyId(bountyId) notLocked(bountyId) { @@ -325,7 +328,7 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { bytes calldata details ) external - onlyModuleRole(uint8(Roles.ClaimAdmin)) + onlyModuleRole(CLAIM_ADMIN_ROLE) validBountyId(bountyId) notLocked(bountyId) returns (uint id) @@ -368,7 +371,7 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { validClaimId(claimId) notClaimed(claimId) notLocked(_claimRegistry[claimId].bountyId) - onlyModuleRole(uint8(Roles.ClaimAdmin)) + onlyModuleRole(CLAIM_ADMIN_ROLE) { validContributorsForBounty( contributors, _bountyRegistry[_claimRegistry[claimId].bountyId] @@ -416,7 +419,7 @@ contract BountyManager is IBountyManager, ERC20PaymentClient { /// @inheritdoc IBountyManager function verifyClaim(uint claimId, Contributor[] calldata contributors) external - onlyModuleRole(uint8(Roles.VerifyAdmin)) + onlyModuleRole(VERIFY_ADMIN_ROLE) validClaimId(claimId) notClaimed(claimId) notLocked(_claimRegistry[claimId].bountyId) diff --git a/src/modules/logicModule/IBountyManager.sol b/src/modules/logicModule/IBountyManager.sol index 99d7b04c5..4273bfd74 100644 --- a/src/modules/logicModule/IBountyManager.sol +++ b/src/modules/logicModule/IBountyManager.sol @@ -5,15 +5,6 @@ import {IERC20PaymentClient} from "src/modules/logicModule/paymentClient/IERC20PaymentClient.sol"; interface IBountyManager is IERC20PaymentClient { - //-------------------------------------------------------------------------- - // Enums - - enum Roles { - BountyAdmin, - ClaimAdmin, - VerifyAdmin - } - //-------------------------------------------------------------------------- // Types diff --git a/src/orchestrator/IOrchestrator.sol b/src/orchestrator/IOrchestrator.sol index 0040a851e..91930274a 100644 --- a/src/orchestrator/IOrchestrator.sol +++ b/src/orchestrator/IOrchestrator.sol @@ -16,7 +16,7 @@ interface IOrchestrator is IModuleManager { // Errors /// @notice Function is only callable by authorized caller. - error Orchestrator__CallerNotAuthorized(); + error Orchestrator__CallerNotAuthorized(bytes32 role, address caller); /// @notice Execution of transaction failed. error Orchestrator__ExecuteTxFailed(); diff --git a/src/orchestrator/Orchestrator.sol b/src/orchestrator/Orchestrator.sol index ee7a29c07..94c919409 100644 --- a/src/orchestrator/Orchestrator.sol +++ b/src/orchestrator/Orchestrator.sol @@ -45,8 +45,10 @@ contract Orchestrator is IOrchestrator, ModuleManager { /// @notice Modifier to guarantee function is only callable by authorized /// address. modifier onlyOrchestratorOwner() { - if (!authorizer.isAuthorized(_msgSender())) { - revert Orchestrator__CallerNotAuthorized(); + bytes32 ownerRole = authorizer.getOwnerRole(); + + if (!authorizer.hasRole(ownerRole, _msgSender())) { + revert Orchestrator__CallerNotAuthorized(ownerRole, _msgSender()); } _; } @@ -57,11 +59,13 @@ contract Orchestrator is IOrchestrator, ModuleManager { /// @notice Modifier to guarantee function is only callable by authorized /// address or manager. modifier onlyOrchestratorOwnerOrManager() { - if ( - !authorizer.isAuthorized(_msgSender()) - && !authorizer.hasRole(authorizer.getManagerRole(), _msgSender()) - ) { - revert Orchestrator__CallerNotAuthorized(); + bytes32 ownerRole = authorizer.getOwnerRole(); + bytes32 managerRole = authorizer.getManagerRole(); + + if (!authorizer.hasRole(managerRole, _msgSender())) { + revert Orchestrator__CallerNotAuthorized(managerRole, _msgSender()); + } else if (!authorizer.hasRole(ownerRole, _msgSender())) { + revert Orchestrator__CallerNotAuthorized(ownerRole, _msgSender()); } _; } @@ -186,8 +190,7 @@ contract Orchestrator is IOrchestrator, ModuleManager { { IAuthorizer authorizerModule = IAuthorizer(authModule); - try authorizerModule.isAuthorized(address(uint160(1234))) returns (bool) - { + try authorizerModule.getOwnerRole() returns (bytes32) { return true; } catch { return false; @@ -251,7 +254,7 @@ contract Orchestrator is IOrchestrator, ModuleManager { override(ModuleManager) returns (bool) { - return authorizer.isAuthorized(who); + return authorizer.hasRole(authorizer.getOwnerRole(), who); } //-------------------------------------------------------------------------- diff --git a/test/e2e/BountyManagerLifecycle.t.sol b/test/e2e/BountyManagerLifecycle.t.sol index 1dddc38bf..ba9a6ba88 100644 --- a/test/e2e/BountyManagerLifecycle.t.sol +++ b/test/e2e/BountyManagerLifecycle.t.sol @@ -81,7 +81,7 @@ contract BountyManagerLifecycle is E2eTest { // we authorize the deployer of the orchestrator as the bounty admin bountyManager.grantModuleRole( - uint8(IBountyManager.Roles.BountyAdmin), address(this) + bountyManager.BOUNTY_ADMIN_ROLE(), address(this) ); // Funders deposit funds @@ -125,7 +125,7 @@ contract BountyManagerLifecycle is E2eTest { //auth.setIsAuthorized(address(0xA11CE), true); bountyManager.grantModuleRole( - uint8(IBountyManager.Roles.ClaimAdmin), address(0xA11CE) + bountyManager.CLAIM_ADMIN_ROLE(), address(0xA11CE) ); IBountyManager.Contributor[] memory contribs = @@ -144,7 +144,7 @@ contract BountyManagerLifecycle is E2eTest { //auth.setIsAuthorized(verifier1, true); bountyManager.grantModuleRole( - uint8(IBountyManager.Roles.VerifyAdmin), verifier1 + bountyManager.VERIFY_ADMIN_ROLE(), verifier1 ); vm.prank(verifier1); diff --git a/test/e2e/CreateNewOrchestrator.t.sol b/test/e2e/CreateNewOrchestrator.t.sol index 6f0fe6910..5f1e3fdf0 100644 --- a/test/e2e/CreateNewOrchestrator.t.sol +++ b/test/e2e/CreateNewOrchestrator.t.sol @@ -310,8 +310,7 @@ contract OrchestratorCreation is Test { //-------------------------------------------------------------------------------- // Adding Module - // TODO Substitute with BountyManager - //Create milestoneManagerConfigData + //Create bountyManagerConfigData //Note: This bytes array is used for transmitting data in a generalized way // to the modules during they initilization via the modulefactory // Some Modules might need additional Deployment/Configuration data diff --git a/test/e2e/SingleVoteGovernorLifecycle.sol b/test/e2e/SingleVoteGovernorLifecycle.sol index b6b0e0566..50a5eb0f5 100644 --- a/test/e2e/SingleVoteGovernorLifecycle.sol +++ b/test/e2e/SingleVoteGovernorLifecycle.sol @@ -99,7 +99,9 @@ contract SingleVoteGovernorLifecycle is E2eTest { authorizer.grantRole(ownerRole, address(singleVoteGovernor)); // we authorize governance to create bounties - bountyManager.grantModuleRole(uint8(0), address(singleVoteGovernor)); + bountyManager.grantModuleRole( + bountyManager.BOUNTY_ADMIN_ROLE(), address(singleVoteGovernor) + ); authorizer.renounceRole(ownerRole, address(this)); diff --git a/test/modules/authorizer/RoleAuthorizer.t.sol b/test/modules/authorizer/RoleAuthorizer.t.sol index 846cc1567..4e51d25d2 100644 --- a/test/modules/authorizer/RoleAuthorizer.t.sol +++ b/test/modules/authorizer/RoleAuthorizer.t.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.0; // SuT import {Test} from "forge-std/Test.sol"; +import "forge-std/console.sol"; import { RoleAuthorizer, @@ -25,7 +26,6 @@ import {PaymentProcessorMock} from contract RoleAuthorizerTest is Test { bool hasDependency; string[] dependencies = new string[](0); - address initialManager = address(this); // Mocks RoleAuthorizer _authorizer; @@ -36,10 +36,8 @@ contract RoleAuthorizerTest is Test { address ALBA = address(0xa1ba); //default authorized person address BOB = address(0xb0b); // example person to add - enum ModuleRoles { - ROLE_0, - ROLE_1 - } + bytes32 immutable ROLE_0 = "ROLE_0"; + bytes32 immutable ROLE_1 = "ROLE_1"; // Orchestrator Constants uint internal constant _ORCHESTRATOR_ID = 1; @@ -70,17 +68,22 @@ contract RoleAuthorizerTest is Test { ); address initialAuth = ALBA; + address initialManager = address(this); _authorizer.init( IOrchestrator(_orchestrator), _METADATA, abi.encode(initialAuth, initialManager) ); + + //console.log(_authorizer.hasRole(_authorizer.getManagerRole(), initialManager)); assertEq( _authorizer.hasRole(_authorizer.getManagerRole(), address(this)), true ); + //console.log(_authorizer.hasRole(_authorizer.getOwnerRole(), ALBA)); assertEq(_authorizer.hasRole(_authorizer.getOwnerRole(), ALBA), true); + //console.log(_authorizer.hasRole(_authorizer.getOwnerRole(), address(this))); assertEq( _authorizer.hasRole(_authorizer.getOwnerRole(), address(this)), false @@ -107,9 +110,9 @@ contract RoleAuthorizerTest is Test { assertEq(address(testAuthorizer.orchestrator()), address(_orchestrator)); - assertEq(testAuthorizer.isAuthorized(0, initialAuth), true); + assertEq(testAuthorizer.hasRole("0x01", initialAuth), true); - assertEq(testAuthorizer.isAuthorized(0, address(this)), false); + assertEq(testAuthorizer.hasRole("0x01", address(this)), false); assertEq( testAuthorizer.getRoleMemberCount(testAuthorizer.getOwnerRole()), 1 ); @@ -132,7 +135,7 @@ contract RoleAuthorizerTest is Test { assertEq(address(testAuthorizer.orchestrator()), address(_orchestrator)); - assertEq(testAuthorizer.isAuthorized(0, address(this)), true); + assertEq(testAuthorizer.hasRole("0x01", address(this)), true); assertEq( testAuthorizer.getRoleMemberCount(testAuthorizer.getOwnerRole()), 1 ); @@ -143,18 +146,18 @@ contract RoleAuthorizerTest is Test { Orchestrator newOrchestrator = Orchestrator(Clones.clone(address(new Orchestrator()))); - address[] memory initialAuth = new address[](1); - initialAuth[0] = address(this); + address initialOwner = address(this); + address initialManager = address(this); vm.expectRevert(); _authorizer.init( IOrchestrator(newOrchestrator), _METADATA, - abi.encode(initialAuth, initialManager) + abi.encode(initialOwner, initialManager) ); - assertEq(_authorizer.isAuthorized(0, address(this)), false); + assertEq(_authorizer.hasRole("0x01", address(this)), false); assertEq(address(_authorizer.orchestrator()), address(_orchestrator)); - assertEq(_authorizer.isAuthorized(0, ALBA), true); + assertEq(_authorizer.hasRole("0x01", ALBA), true); assertEq(_authorizer.getRoleMemberCount(_authorizer.getOwnerRole()), 1); } @@ -252,7 +255,7 @@ contract RoleAuthorizerTest is Test { vm.prank(address(ALBA)); _authorizer.revokeRole(ownerRole, ALBA); - assertEq(_authorizer.isAuthorized(ALBA), true); + assertEq(_authorizer.hasRole(ownerRole, ALBA), true); assertEq( _authorizer.getRoleMemberCount(_authorizer.getOwnerRole()), amountAuth @@ -262,8 +265,7 @@ contract RoleAuthorizerTest is Test { function testGrantManagerRole(address[] memory newAuthorized) public { // Here we test adding to a role with OWNER as admin - bytes32 managerRole = - _authorizer.generateRoleId(address(_orchestrator), 1); + bytes32 managerRole = _authorizer.getManagerRole(); uint amountManagers = _authorizer.getRoleMemberCount(managerRole); _validateAuthorizedList(newAuthorized); @@ -287,8 +289,7 @@ contract RoleAuthorizerTest is Test { public { // Here we test adding to a role that has OWNER as admin while not being OWNER - bytes32 managerRole = - _authorizer.generateRoleId(address(_orchestrator), 1); + bytes32 managerRole = _authorizer.getManagerRole(); vm.startPrank(address(ALBA)); _authorizer.grantRole(managerRole, BOB); //Meet your new Manager @@ -317,8 +318,7 @@ contract RoleAuthorizerTest is Test { function testRevokeManagerRole(address[] memory newAuthorized) public { // Here we test adding to a role with OWNER as admin - bytes32 managerRole = - _authorizer.generateRoleId(address(_orchestrator), 1); + bytes32 managerRole = _authorizer.getManagerRole(); uint amountManagers = _authorizer.getRoleMemberCount(managerRole); _validateAuthorizedList(newAuthorized); @@ -359,8 +359,7 @@ contract RoleAuthorizerTest is Test { address[] memory newAuthorized ) public { // Here we test adding to a role that has OWNER as admin while not being OWNER - bytes32 managerRole = - _authorizer.generateRoleId(address(_orchestrator), 1); + bytes32 managerRole = _authorizer.getManagerRole(); vm.startPrank(address(ALBA)); _authorizer.grantRole(managerRole, BOB); //Meet your new Manager @@ -394,19 +393,17 @@ contract RoleAuthorizerTest is Test { assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - ALBA + _authorizer.generateRoleId(newModule, ROLE_0), ALBA ), false ); vm.prank(newModule); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), ALBA); + _authorizer.grantRoleFromModule(ROLE_0, ALBA); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - ALBA + _authorizer.generateRoleId(newModule, ROLE_0), ALBA ), true ); @@ -417,11 +414,10 @@ contract RoleAuthorizerTest is Test { vm.prank(address(BOB)); vm.expectRevert(); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), ALBA); + _authorizer.grantRoleFromModule(ROLE_0, ALBA); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - ALBA + _authorizer.generateRoleId(newModule, ROLE_0), ALBA ), false ); @@ -440,37 +436,10 @@ contract RoleAuthorizerTest is Test { newModule ) ); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), ALBA); - assertEq( - _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - ALBA - ), - false - ); - } - - function testGrantRoleFromModuleFailsIfModuleNotSelfManaged() public { - address newModule = _setupMockSelfManagedModule(); - - vm.startPrank(newModule); - _authorizer.toggleModuleSelfManagement(); - - vm.expectRevert( - abi.encodeWithSelector( - IAuthorizer - .Module__RoleAuthorizer__ModuleNotSelfManaged - .selector - ) - ); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), ALBA); - - vm.stopPrank(); - + _authorizer.grantRoleFromModule(ROLE_0, ALBA); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - ALBA + _authorizer.generateRoleId(newModule, ROLE_0), ALBA ), false ); @@ -481,17 +450,16 @@ contract RoleAuthorizerTest is Test { vm.startPrank(newModule); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), ALBA); + _authorizer.grantRoleFromModule(ROLE_0, ALBA); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), ALBA); + _authorizer.grantRoleFromModule(ROLE_0, ALBA); // No reverts happen vm.stopPrank(); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - ALBA + _authorizer.generateRoleId(newModule, ROLE_0), ALBA ), true ); @@ -507,32 +475,27 @@ contract RoleAuthorizerTest is Test { assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - BOB + _authorizer.generateRoleId(newModule, ROLE_0), BOB ), false ); vm.prank(newModule); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), address(BOB)); + _authorizer.grantRoleFromModule(ROLE_0, address(BOB)); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - BOB + _authorizer.generateRoleId(newModule, ROLE_0), BOB ), true ); vm.prank(newModule); - _authorizer.revokeRoleFromModule( - uint8(ModuleRoles.ROLE_0), address(BOB) - ); + _authorizer.revokeRoleFromModule(ROLE_0, address(BOB)); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - BOB + _authorizer.generateRoleId(newModule, ROLE_0), BOB ), false ); @@ -543,11 +506,10 @@ contract RoleAuthorizerTest is Test { vm.prank(address(BOB)); vm.expectRevert(); - _authorizer.revokeRoleFromModule(uint8(ModuleRoles.ROLE_0), BOB); + _authorizer.revokeRoleFromModule(ROLE_0, BOB); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - BOB + _authorizer.generateRoleId(newModule, ROLE_0), BOB ), false ); @@ -566,37 +528,10 @@ contract RoleAuthorizerTest is Test { newModule ) ); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), BOB); - assertEq( - _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - BOB - ), - false - ); - } - - function testRevokeRoleFromModuleFailsIfModuleNotSelfManaged() public { - address newModule = _setupMockSelfManagedModule(); - - vm.startPrank(newModule); - _authorizer.toggleModuleSelfManagement(); - - vm.expectRevert( - abi.encodeWithSelector( - IAuthorizer - .Module__RoleAuthorizer__ModuleNotSelfManaged - .selector - ) - ); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), BOB); - - vm.stopPrank(); - + _authorizer.grantRoleFromModule(ROLE_0, BOB); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - BOB + _authorizer.generateRoleId(newModule, ROLE_0), BOB ), false ); @@ -607,52 +542,50 @@ contract RoleAuthorizerTest is Test { vm.startPrank(newModule); - _authorizer.revokeRoleFromModule(uint8(ModuleRoles.ROLE_0), BOB); + _authorizer.revokeRoleFromModule(ROLE_0, BOB); - _authorizer.revokeRoleFromModule(uint8(ModuleRoles.ROLE_0), BOB); + _authorizer.revokeRoleFromModule(ROLE_0, BOB); // No reverts happen vm.stopPrank(); assertEq( _authorizer.hasRole( - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)), - BOB + _authorizer.generateRoleId(newModule, ROLE_0), BOB ), false ); } // Test grant and revoke global roles - // TODO // Grant global roles function testGrantGlobalRole() public { bytes32 globalRole = - _authorizer.generateRoleId(address(_orchestrator), uint8(3)); + _authorizer.generateRoleId(address(_orchestrator), bytes32("0x03")); vm.prank(ALBA); - _authorizer.grantGlobalRole(uint8(3), BOB); + _authorizer.grantGlobalRole(bytes32("0x03"), BOB); assertTrue(_authorizer.hasRole(globalRole, BOB)); } function testGrantGlobalRoleFailsIfNotOwner() public { bytes32 globalRole = - _authorizer.generateRoleId(address(_orchestrator), uint8(3)); + _authorizer.generateRoleId(address(_orchestrator), bytes32("0x03")); vm.prank(BOB); vm.expectRevert(); - _authorizer.grantGlobalRole(uint8(3), ALBA); + _authorizer.grantGlobalRole(bytes32("0x03"), ALBA); assertFalse(_authorizer.hasRole(globalRole, ALBA)); } // Revoke global roles function testRevokeGlobalRole() public { bytes32 globalRole = - _authorizer.generateRoleId(address(_orchestrator), uint8(3)); + _authorizer.generateRoleId(address(_orchestrator), bytes32("0x03")); vm.startPrank(ALBA); - _authorizer.grantGlobalRole(uint8(3), BOB); + _authorizer.grantGlobalRole(bytes32("0x03"), BOB); assertTrue(_authorizer.hasRole(globalRole, BOB)); - _authorizer.revokeGlobalRole(uint8(3), BOB); + _authorizer.revokeGlobalRole(bytes32("0x03"), BOB); assertEq(_authorizer.hasRole(globalRole, BOB), false); vm.stopPrank(); @@ -660,14 +593,14 @@ contract RoleAuthorizerTest is Test { function testRevokeGlobalRoleFailsIfNotOwner() public { bytes32 globalRole = - _authorizer.generateRoleId(address(_orchestrator), uint8(3)); + _authorizer.generateRoleId(address(_orchestrator), bytes32("0x03")); vm.prank(ALBA); - _authorizer.grantGlobalRole(uint8(3), BOB); + _authorizer.grantGlobalRole(bytes32("0x03"), BOB); assertTrue(_authorizer.hasRole(globalRole, BOB)); vm.prank(BOB); vm.expectRevert(); - _authorizer.revokeGlobalRole(uint8(3), BOB); + _authorizer.revokeGlobalRole(bytes32("0x03"), BOB); assertTrue(_authorizer.hasRole(globalRole, BOB)); } @@ -699,8 +632,7 @@ contract RoleAuthorizerTest is Test { //Then we set up a mock module address newModule = _setupMockSelfManagedModule(); - bytes32 roleId = - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)); + bytes32 roleId = _authorizer.generateRoleId(newModule, ROLE_0); // Now we set the OWNER as Role admin vm.startPrank(BOB); @@ -720,8 +652,7 @@ contract RoleAuthorizerTest is Test { //We set up a mock module address newModule = _setupMockSelfManagedModule(); - bytes32 roleId = - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)); + bytes32 roleId = _authorizer.generateRoleId(newModule, ROLE_0); bytes32 ownerRole = _authorizer.getOwnerRole(); //Buffer this to time revert // BOB is not allowed to do this @@ -731,40 +662,6 @@ contract RoleAuthorizerTest is Test { vm.stopPrank(); } - // Test that admin can change module roles if self managed and if not - function testAdminIgnoresIfRoleIsSelfManaged() public { - // First, we make ALBA admin - bytes32 adminRole = _authorizer.DEFAULT_ADMIN_ROLE(); - vm.prank(ALBA); - _authorizer.grantRole(adminRole, ALBA); - assertTrue(_authorizer.hasRole(adminRole, ALBA)); - - //Then we set up a mock module - address newModule = _setupMockSelfManagedModule(); - bytes32 roleId = - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)); - - // ALBA can now freely grant and revoke roles - assertEq(_authorizer.hasRole(roleId, BOB), false); - vm.startPrank(ALBA); - _authorizer.grantRole(roleId, BOB); - assertEq(_authorizer.hasRole(roleId, BOB), true); - _authorizer.revokeRole(roleId, BOB); - assertEq(_authorizer.hasRole(roleId, BOB), false); - vm.stopPrank(); - - // The module returns to Managed mode - vm.prank(newModule); - - // ALBA can still freely grant and revoke roles - assertEq(_authorizer.hasRole(roleId, BOB), false); - vm.startPrank(ALBA); - _authorizer.grantRole(roleId, BOB); - assertEq(_authorizer.hasRole(roleId, BOB), true); - _authorizer.revokeRole(roleId, BOB); - assertEq(_authorizer.hasRole(roleId, BOB), false); - vm.stopPrank(); - } // Test that ADMIN cannot change module roles if admin role was burned function testAdminCannotModifyRoleIfAdminBurned() public { @@ -776,8 +673,7 @@ contract RoleAuthorizerTest is Test { //Then we set up a mock module and buffer the role with burned admin address newModule = _setupMockSelfManagedModule(); - bytes32 roleId = - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_1)); + bytes32 roleId = _authorizer.generateRoleId(newModule, ROLE_1); // BOB can NOT grant and revoke roles even though he's admin assertEq(_authorizer.hasRole(roleId, BOB), false); @@ -791,67 +687,7 @@ contract RoleAuthorizerTest is Test { vm.stopPrank(); } - // Test toggleModuleSelfManagement - // Test selfManagement gets recognized - function testtoggleModuleSelfManagement() public { - // we set up a mock module and buffer the role with burned admin - address newModule = _setupMockSelfManagedModule(); - - // As per the genrating function, it starts as self-managed - assertTrue(_authorizer.selfManagedModules(newModule)); - // We return the module to managed state. - vm.prank(newModule); - _authorizer.toggleModuleSelfManagement(); - - //Now it isn't self-managed anymore - assertFalse(_authorizer.selfManagedModules(newModule)); - } - // Test module is using own roles when selfmanaged - - function testModuleOnlyUsesOwnRolesWhenSelfManaged() public { - // First, we set up a modul and authorize BOB - address newModule = _setupMockSelfManagedModule(); - - vm.startPrank(newModule); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), BOB); - - // BOB is authorized - assertTrue(_authorizer.isAuthorized(uint8(ModuleRoles.ROLE_0), BOB)); - - // But ALBA, as owner, is not - assertFalse(_authorizer.isAuthorized(uint8(0), ALBA)); - - vm.stopPrank(); - } - - function testModuleOnlyUsesOrchestratorRolesWhenNotSelfManaged() public { - // First, we set up a module and authorize BOB - address newModule = _setupMockSelfManagedModule(); - - vm.startPrank(newModule); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_0), BOB); - - // BOB is authorized - assertTrue(_authorizer.isAuthorized(uint8(ModuleRoles.ROLE_0), BOB)); - - // We return the module to managed state. - _authorizer.toggleModuleSelfManagement(); - - // BOB is not authorized anymore - assertFalse(_authorizer.isAuthorized(uint8(0), BOB)); - - // But ALBA, as owner, is - assertTrue(_authorizer.isAuthorized(uint8(0), ALBA)); - - vm.stopPrank(); - } - // Test module can correctly return to managed mode - - function testModuleReturnToManagedMode() public { - //testModuleOnlyUsesOrchestratorRolesWhenNotSelfManaged implicitly tests this - } - - // Test the burnAdminRole + // Test the burnAdminFromModuleRole // -> Test burnAdmin changes state function testBurnAdminChangesRoleState() public { // _setupMockSelfManagedModule implicitly test this @@ -867,10 +703,8 @@ contract RoleAuthorizerTest is Test { //Then we set up a mock module and buffer both roles address newModule = _setupMockSelfManagedModule(); - bytes32 roleId_0 = - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_0)); - bytes32 roleId_1 = - _authorizer.generateRoleId(newModule, uint8(ModuleRoles.ROLE_1)); + bytes32 roleId_0 = _authorizer.generateRoleId(newModule, ROLE_0); + bytes32 roleId_1 = _authorizer.generateRoleId(newModule, ROLE_1); vm.startPrank(BOB); @@ -891,31 +725,6 @@ contract RoleAuthorizerTest is Test { vm.stopPrank(); } - // -> Modules with burnt admin CAN return to managed state - function testBurnedModuleCorrectlyReturnToManagedState() public { - // Same as testModuleOnlyUsesOrchestratorRolesWhenNotSelfManaged but with ROLE_1 - - // First, we set up a module and authorize BOB - address newModule = _setupMockSelfManagedModule(); - - vm.startPrank(newModule); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_1), BOB); - - // BOB is authorized - assertTrue(_authorizer.isAuthorized(uint8(ModuleRoles.ROLE_1), BOB)); - - // We return the module to managed state. - _authorizer.toggleModuleSelfManagement(); - - // BOB is not authorized anymore - assertFalse(_authorizer.isAuthorized(uint8(1), BOB)); - - // But ALBA, as owner, is (uint8(0) because we are querying her owner role, not the orchestrator manager role) - assertTrue(_authorizer.isAuthorized(uint8(0), ALBA)); - - vm.stopPrank(); - } - // ========================================================================= // Test Helper Functions @@ -931,16 +740,12 @@ contract RoleAuthorizerTest is Test { _orchestrator.addModule(address(mockModule)); vm.startPrank(address(mockModule)); - _authorizer.toggleModuleSelfManagement(); - - _authorizer.burnAdminRole(uint8(ModuleRoles.ROLE_1)); + _authorizer.burnAdminFromModuleRole(ROLE_1); vm.stopPrank(); bytes32 burntAdmin = _authorizer.getRoleAdmin( - _authorizer.generateRoleId( - address(mockModule), uint8(ModuleRoles.ROLE_1) - ) + _authorizer.generateRoleId(address(mockModule), ROLE_1) ); assertTrue(burntAdmin == _authorizer.BURN_ADMIN_ROLE()); diff --git a/test/modules/authorizer/SingleVoteGovernor.t.sol b/test/modules/authorizer/SingleVoteGovernor.t.sol index 0cdb99cb8..9cacfda4a 100644 --- a/test/modules/authorizer/SingleVoteGovernor.t.sol +++ b/test/modules/authorizer/SingleVoteGovernor.t.sol @@ -224,13 +224,15 @@ contract SingleVoteGovernorTest is ModuleTest { function testInit() public override(ModuleTest) { assertEq(_orchestrator.isModule(address(_governor)), true); - assertEq(_authorizer.isAuthorized(address(_governor)), true); + bytes32 owner = _authorizer.getOwnerRole(); + + assertEq(_authorizer.hasRole(owner, address(_governor)), true); // Owner role assertEq(_governor.isVoter(ALBA), true); assertEq(_governor.isVoter(BOB), true); assertEq(_governor.isVoter(COBIE), true); - assertEq(_authorizer.isAuthorized(address(this)), false); - assertEq(_authorizer.isAuthorized(address(_orchestrator)), false); + assertEq(_authorizer.hasRole(owner, address(this)), false); + assertEq(_authorizer.hasRole(owner, address(_orchestrator)), false); assertEq(_governor.isVoter(address(this)), false); assertEq(_governor.isVoter(address(_orchestrator)), false); @@ -328,7 +330,10 @@ contract SingleVoteGovernorTest is ModuleTest { ) ); - assertEq(_authorizer.isAuthorized(address(_governor)), true); + assertEq( + _authorizer.hasRole(_authorizer.getOwnerRole(), address(_governor)), + true + ); assertEq(_governor.isVoter(ALBA), true); assertEq(_governor.isVoter(BOB), true); assertEq(_governor.isVoter(COBIE), true); @@ -970,7 +975,11 @@ contract SingleVoteGovernorTest is ModuleTest { vm.assume(_other != address(_governor)); vm.expectRevert( - IOrchestrator.Orchestrator__CallerNotAuthorized.selector + abi.encodeWithSelector( + IOrchestrator.Orchestrator__CallerNotAuthorized.selector, + _authorizer.getOwnerRole(), + _other + ) ); vm.prank(_other); _orchestrator.executeTx(address(0), ""); diff --git a/test/modules/authorizer/TokenGatedRoleAuthorizer.t.sol b/test/modules/authorizer/TokenGatedRoleAuthorizer.t.sol index 29cdc0086..c2ea44bc7 100644 --- a/test/modules/authorizer/TokenGatedRoleAuthorizer.t.sol +++ b/test/modules/authorizer/TokenGatedRoleAuthorizer.t.sol @@ -96,10 +96,8 @@ contract TokenGatedRoleAuthorizerTest is Test { ERC721Mock internal roleNft = new ERC721Mock("detrevnI epA thcaY bulC", "EPA"); - enum ModuleRoles { - ROLE_TOKEN, - ROLE_NFT - } + bytes32 immutable ROLE_TOKEN = "ROLE_TOKEN"; + bytes32 immutable ROLE_NFT = "ROLE_NFT"; // Orchestrator Constants uint internal constant _ORCHESTRATOR_ID = 1; @@ -152,10 +150,6 @@ contract TokenGatedRoleAuthorizerTest is Test { //Then, a ERC721 for BOB roleNft.mint(BOB); - - // By default, the mockModule will have self-management ON - vm.prank(address(mockModule)); - _authorizer.toggleModuleSelfManagement(); } //------------------------------------------------- @@ -164,15 +158,13 @@ contract TokenGatedRoleAuthorizerTest is Test { // function set up tokenGated role with threshold function setUpTokenGatedRole( address module, - uint8 role, + bytes32 role, address token, uint threshold ) internal returns (bytes32) { bytes32 roleId = _authorizer.generateRoleId(module, role); vm.startPrank(module); - if (!_authorizer.selfManagedModules(module)) { - _authorizer.toggleModuleSelfManagement(); - } + _authorizer.makeRoleTokenGatedFromModule(role); _authorizer.grantTokenRoleFromModule(role, address(token), threshold); vm.stopPrank(); @@ -180,15 +172,13 @@ contract TokenGatedRoleAuthorizerTest is Test { } //function set up nftGated role - function setUpNFTGatedRole(address module, uint8 role, address nft) + function setUpNFTGatedRole(address module, bytes32 role, address nft) internal returns (bytes32) { bytes32 roleId = _authorizer.generateRoleId(module, role); vm.startPrank(module); - if (!_authorizer.selfManagedModules(module)) { - _authorizer.toggleModuleSelfManagement(); - } + _authorizer.makeRoleTokenGatedFromModule(role); _authorizer.grantTokenRoleFromModule(role, address(nft), 1); vm.stopPrank(); @@ -209,16 +199,12 @@ contract TokenGatedRoleAuthorizerTest is Test { function testMakeRoleTokenGated() public { bytes32 roleId_1 = setUpTokenGatedRole( - address(mockModule), - uint8(ModuleRoles.ROLE_TOKEN), - address(roleToken), - 500 + address(mockModule), ROLE_TOKEN, address(roleToken), 500 ); assertTrue(_authorizer.isTokenGated(roleId_1)); - bytes32 roleId_2 = setUpNFTGatedRole( - address(mockModule), uint8(ModuleRoles.ROLE_NFT), address(roleNft) - ); + bytes32 roleId_2 = + setUpNFTGatedRole(address(mockModule), ROLE_NFT, address(roleNft)); assertTrue(_authorizer.isTokenGated(roleId_2)); } @@ -229,12 +215,7 @@ contract TokenGatedRoleAuthorizerTest is Test { //we set and unset on an empty role - // first we turn on self-management - vm.prank(address(mockModule)); - _authorizer.toggleModuleSelfManagement(); - - bytes32 roleId = - _authorizer.generateRoleId(address(mockModule), uint8(0)); + bytes32 roleId = _authorizer.generateRoleId(address(mockModule), "0x00"); //now we make it tokengated as admin vm.prank(CLOE); @@ -251,13 +232,12 @@ contract TokenGatedRoleAuthorizerTest is Test { //test makeTokenGated fails if not empty function testMakingFunctionTokenGatedFailsIfAlreadyInUse() public { - bytes32 roleId = _authorizer.generateRoleId( - address(mockModule), uint8(ModuleRoles.ROLE_TOKEN) - ); + bytes32 roleId = + _authorizer.generateRoleId(address(mockModule), ROLE_TOKEN); //we switch on self-management and whitelist an address vm.startPrank(address(mockModule)); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_TOKEN), CLOE); + _authorizer.grantRoleFromModule(ROLE_TOKEN, CLOE); vm.expectRevert( abi.encodeWithSelector( @@ -266,14 +246,14 @@ contract TokenGatedRoleAuthorizerTest is Test { .selector ) ); - _authorizer.makeRoleTokenGatedFromModule(uint8(ModuleRoles.ROLE_TOKEN)); + _authorizer.makeRoleTokenGatedFromModule(ROLE_TOKEN); assertFalse(_authorizer.isTokenGated(roleId)); //we revoke the whitelist - _authorizer.revokeRoleFromModule(uint8(ModuleRoles.ROLE_TOKEN), CLOE); + _authorizer.revokeRoleFromModule(ROLE_TOKEN, CLOE); // now it works: - _authorizer.makeRoleTokenGatedFromModule(uint8(ModuleRoles.ROLE_TOKEN)); + _authorizer.makeRoleTokenGatedFromModule(ROLE_TOKEN); assertTrue(_authorizer.isTokenGated(roleId)); } // smae but with admin @@ -282,13 +262,12 @@ contract TokenGatedRoleAuthorizerTest is Test { // we set BOB as admin makeAddressDefaultAdmin(BOB); - bytes32 roleId = _authorizer.generateRoleId( - address(mockModule), uint8(ModuleRoles.ROLE_TOKEN) - ); + bytes32 roleId = + _authorizer.generateRoleId(address(mockModule), ROLE_TOKEN); //we switch on self-management and whitelist an address vm.prank(address(mockModule)); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_TOKEN), CLOE); + _authorizer.grantRoleFromModule(ROLE_TOKEN, CLOE); vm.startPrank(BOB); @@ -325,23 +304,15 @@ contract TokenGatedRoleAuthorizerTest is Test { // -> yes case function testCanAddTokenWhenTokenGated() public { setUpTokenGatedRole( - address(mockModule), - uint8(ModuleRoles.ROLE_TOKEN), - address(roleToken), - 500 - ); - setUpNFTGatedRole( - address(mockModule), uint8(ModuleRoles.ROLE_NFT), address(roleNft) + address(mockModule), ROLE_TOKEN, address(roleToken), 500 ); + setUpNFTGatedRole(address(mockModule), ROLE_NFT, address(roleNft)); } // -> no case function testCannotAddNonTokenWhenTokenGated() public { setUpTokenGatedRole( - address(mockModule), - uint8(ModuleRoles.ROLE_TOKEN), - address(roleToken), - 500 + address(mockModule), ROLE_TOKEN, address(roleToken), 500 ); vm.prank(address(mockModule)); @@ -356,7 +327,7 @@ contract TokenGatedRoleAuthorizerTest is Test { CLOE ) ); - _authorizer.grantRoleFromModule(uint8(ModuleRoles.ROLE_TOKEN), CLOE); + _authorizer.grantRoleFromModule(ROLE_TOKEN, CLOE); } function testAdminCannotAddNonTokenWhenTokenGated() public { @@ -364,10 +335,7 @@ contract TokenGatedRoleAuthorizerTest is Test { makeAddressDefaultAdmin(BOB); bytes32 roleId = setUpTokenGatedRole( - address(mockModule), - uint8(ModuleRoles.ROLE_TOKEN), - address(roleToken), - 500 + address(mockModule), ROLE_TOKEN, address(roleToken), 500 ); vm.prank(BOB); @@ -389,10 +357,7 @@ contract TokenGatedRoleAuthorizerTest is Test { // yes case function testSetThreshold() public { bytes32 roleId = setUpTokenGatedRole( - address(mockModule), - uint8(ModuleRoles.ROLE_TOKEN), - address(roleToken), - 500 + address(mockModule), ROLE_TOKEN, address(roleToken), 500 ); assertEq(_authorizer.getThresholdValue(roleId, address(roleToken)), 500); } @@ -400,7 +365,7 @@ contract TokenGatedRoleAuthorizerTest is Test { // invalid threshold from module function testSetThresholdFailsIfInvalid() public { - uint8 role = uint8(ModuleRoles.ROLE_TOKEN); + bytes32 role = ROLE_TOKEN; vm.startPrank(address(mockModule)); _authorizer.makeRoleTokenGatedFromModule(role); @@ -423,10 +388,7 @@ contract TokenGatedRoleAuthorizerTest is Test { makeAddressDefaultAdmin(BOB); //First we set up a valid role bytes32 roleId = setUpTokenGatedRole( - address(mockModule), - uint8(ModuleRoles.ROLE_TOKEN), - address(roleToken), - 500 + address(mockModule), ROLE_TOKEN, address(roleToken), 500 ); // and we try to break it @@ -456,13 +418,12 @@ contract TokenGatedRoleAuthorizerTest is Test { ) ); _authorizer.grantTokenRoleFromModule( - uint8(ModuleRoles.ROLE_TOKEN), address(roleToken), 500 + ROLE_TOKEN, address(roleToken), 500 ); //also fails for the admin - bytes32 roleId = _authorizer.generateRoleId( - address(mockModule), uint8(ModuleRoles.ROLE_TOKEN) - ); + bytes32 roleId = + _authorizer.generateRoleId(address(mockModule), ROLE_TOKEN); vm.prank(BOB); vm.expectRevert( @@ -475,6 +436,57 @@ contract TokenGatedRoleAuthorizerTest is Test { _authorizer.setThreshold(roleId, address(roleToken), 500); } + // Test setThresholdFromModule + + function testSetThresholdFromModule() public { + bytes32 roleId = setUpTokenGatedRole( + address(mockModule), ROLE_TOKEN, address(roleToken), 500 + ); + vm.prank(address(mockModule)); + _authorizer.setThresholdFromModule(ROLE_TOKEN, address(roleToken), 1000); + assertEq( + _authorizer.getThresholdValue(roleId, address(roleToken)), 1000 + ); + } + + // invalid threshold from module + + function testSetThresholdFromModuleFailsIfInvalid() public { + bytes32 role = ROLE_TOKEN; + vm.startPrank(address(mockModule)); + _authorizer.makeRoleTokenGatedFromModule(role); + + _authorizer.grantTokenRoleFromModule(role, address(roleToken), 100); + + vm.expectRevert( + abi.encodeWithSelector( + ITokenGatedRoleAuthorizer + .Module__TokenGatedRoleAuthorizer__InvalidThreshold + .selector, + 0 + ) + ); + _authorizer.setThresholdFromModule(ROLE_TOKEN, address(roleToken), 0); + + vm.stopPrank(); + } + + function testSetThresholdFromModuleFailsIfNotTokenGated() public { + // we set BOB as admin + makeAddressDefaultAdmin(BOB); + + vm.prank(address(mockModule)); + //We didn't make the role token-gated beforehand + vm.expectRevert( + abi.encodeWithSelector( + ITokenGatedRoleAuthorizer + .Module__TokenGatedRoleAuthorizer__RoleNotTokenGated + .selector + ) + ); + _authorizer.setThresholdFromModule(ROLE_TOKEN, address(roleToken), 500); + } + //Test Authorization // Test token authorization @@ -494,10 +506,7 @@ contract TokenGatedRoleAuthorizerTest is Test { roleToken.burn(CLOE, 10); bytes32 roleId = setUpTokenGatedRole( - address(mockModule), - uint8(ModuleRoles.ROLE_TOKEN), - address(roleToken), - threshold + address(mockModule), ROLE_TOKEN, address(roleToken), threshold ); for (uint i = 0; i < callers.length; i++) { @@ -510,9 +519,7 @@ contract TokenGatedRoleAuthorizerTest is Test { //we ensure both ways to check give the same result vm.prank(address(mockModule)); - bool result = _authorizer.isAuthorized( - uint8(ModuleRoles.ROLE_TOKEN), callers[i] - ); + bool result = _authorizer.hasModuleRole(ROLE_TOKEN, callers[i]); assertEq(result, _authorizer.hasTokenRole(roleId, callers[i])); // we verify the result ir correct @@ -543,9 +550,8 @@ contract TokenGatedRoleAuthorizerTest is Test { //We burn the token created on setup roleNft.burn(roleNft.idCounter() - 1); - bytes32 roleId = setUpNFTGatedRole( - address(mockModule), uint8(ModuleRoles.ROLE_NFT), address(roleNft) - ); + bytes32 roleId = + setUpNFTGatedRole(address(mockModule), ROLE_NFT, address(roleNft)); for (uint i = 0; i < callers.length; i++) { if (callers[i] == address(0)) { @@ -558,9 +564,7 @@ contract TokenGatedRoleAuthorizerTest is Test { //we ensure both ways to check give the same result vm.prank(address(mockModule)); - bool result = _authorizer.isAuthorized( - uint8(ModuleRoles.ROLE_NFT), callers[i] - ); + bool result = _authorizer.hasModuleRole(ROLE_NFT, callers[i]); assertEq(result, _authorizer.hasTokenRole(roleId, callers[i])); // we verify the result ir correct diff --git a/test/modules/base/Module.t.sol b/test/modules/base/Module.t.sol index b7250367b..a77cefec0 100644 --- a/test/modules/base/Module.t.sol +++ b/test/modules/base/Module.t.sol @@ -35,14 +35,6 @@ contract baseModuleTest is ModuleTest { // SuT ModuleMock module; - enum mockRoles { - ROLE_1, - ROLE_2, - ROLE_3, - ROLE_4, - ROLE_5 - } - bytes _CONFIGDATA = bytes(""); function setUp() public { @@ -125,14 +117,11 @@ contract baseModuleTest is ModuleTest { //-------------------------------------------------------------------------- // Role Functions - function testGrantModuleRole(uint8 role, address addr) public { - vm.assume(role <= uint8(type(mockRoles).max)); + function testGrantModuleRole(bytes32 role, address addr) public { vm.assume(addr != address(0)); vm.startPrank(address(this)); - _authorizer.toggleModuleSelfManagement(); - module.grantModuleRole(role, addr); bytes32 roleId = _authorizer.generateRoleId(address(module), role); @@ -142,12 +131,10 @@ contract baseModuleTest is ModuleTest { vm.stopPrank(); } - function testRevokeModuleRole(uint8 role, address addr) public { - vm.assume(role <= uint8(type(mockRoles).max)); + function testRevokeModuleRole(bytes32 role, address addr) public { vm.assume(addr != address(0)); vm.startPrank(address(this)); - _authorizer.toggleModuleSelfManagement(); module.grantModuleRole(role, addr); module.revokeModuleRole(role, addr); diff --git a/test/modules/logicModule/BountyManager.t.sol b/test/modules/logicModule/BountyManager.t.sol index df196479c..a17b4a596 100644 --- a/test/modules/logicModule/BountyManager.t.sol +++ b/test/modules/logicModule/BountyManager.t.sol @@ -408,8 +408,7 @@ contract BountyManagerTest is ModuleTest { abi.encodeWithSelector( IModule.Module__CallerNotAuthorized.selector, _authorizer.generateRoleId( - address(bountyManager), - uint8(IBountyManager.Roles.BountyAdmin) + address(bountyManager), bountyManager.BOUNTY_ADMIN_ROLE() ), address(this) ) @@ -490,8 +489,7 @@ contract BountyManagerTest is ModuleTest { abi.encodeWithSelector( IModule.Module__CallerNotAuthorized.selector, _authorizer.generateRoleId( - address(bountyManager), - uint8(IBountyManager.Roles.ClaimAdmin) + address(bountyManager), bountyManager.CLAIM_ADMIN_ROLE() ), address(this) ) @@ -530,8 +528,7 @@ contract BountyManagerTest is ModuleTest { abi.encodeWithSelector( IModule.Module__CallerNotAuthorized.selector, _authorizer.generateRoleId( - address(bountyManager), - uint8(IBountyManager.Roles.BountyAdmin) + address(bountyManager), bountyManager.BOUNTY_ADMIN_ROLE() ), address(this) ) @@ -587,8 +584,7 @@ contract BountyManagerTest is ModuleTest { abi.encodeWithSelector( IModule.Module__CallerNotAuthorized.selector, _authorizer.generateRoleId( - address(bountyManager), - uint8(IBountyManager.Roles.BountyAdmin) + address(bountyManager), bountyManager.BOUNTY_ADMIN_ROLE() ), address(this) ) @@ -671,8 +667,7 @@ contract BountyManagerTest is ModuleTest { abi.encodeWithSelector( IModule.Module__CallerNotAuthorized.selector, _authorizer.generateRoleId( - address(bountyManager), - uint8(IBountyManager.Roles.ClaimAdmin) + address(bountyManager), bountyManager.CLAIM_ADMIN_ROLE() ), address(this) ) @@ -827,8 +822,7 @@ contract BountyManagerTest is ModuleTest { abi.encodeWithSelector( IModule.Module__CallerNotAuthorized.selector, _authorizer.generateRoleId( - address(bountyManager), - uint8(IBountyManager.Roles.VerifyAdmin) + address(bountyManager), bountyManager.VERIFY_ADMIN_ROLE() ), address(this) ) diff --git a/test/orchestrator/Orchestrator.t.sol b/test/orchestrator/Orchestrator.t.sol index e1dda6bcb..b07a25807 100644 --- a/test/orchestrator/Orchestrator.t.sol +++ b/test/orchestrator/Orchestrator.t.sol @@ -218,8 +218,11 @@ contract OrchestratorTest is Test { // verify whether the init value is set and not the value from the old // authorizer, to check whether the replacement is successful - assertFalse(orchestrator.authorizer().isAuthorized(address(this))); - assertTrue(orchestrator.authorizer().isAuthorized(address(0xA11CE))); + bytes32 ownerRole = orchestrator.authorizer().getOwnerRole(); + assertFalse(orchestrator.authorizer().hasRole(ownerRole, address(this))); + assertTrue( + orchestrator.authorizer().hasRole(ownerRole, address(0xA11CE)) + ); } function testSetFundingManager( @@ -452,7 +455,11 @@ contract OrchestratorTest is Test { authorizer.setIsAuthorized(address(this), false); vm.expectRevert( - IOrchestrator.Orchestrator__CallerNotAuthorized.selector + abi.encodeWithSelector( + IOrchestrator.Orchestrator__CallerNotAuthorized.selector, + authorizer.getOwnerRole(), + address(this) + ) ); orchestrator.executeTx(address(this), abi.encodeWithSignature("ok()")); } diff --git a/test/utils/mocks/modules/AuthorizerMock.sol b/test/utils/mocks/modules/AuthorizerMock.sol index 03957ee97..db09c728e 100644 --- a/test/utils/mocks/modules/AuthorizerMock.sol +++ b/test/utils/mocks/modules/AuthorizerMock.sol @@ -37,10 +37,8 @@ contract AuthorizerMock is IAuthorizer, Module { _authorized[authorized] = true; - _roleAuthorized[generateRoleId(address(orchestrator()), uint8(0))][msg - .sender] = true; - _roleAuthorized[generateRoleId(address(orchestrator()), uint8(1))][msg - .sender] = true; + _roleAuthorized["0x01"][msg.sender] = true; + _roleAuthorized["0x02"][msg.sender] = true; } function mockInit(bytes memory configData) public { @@ -55,7 +53,7 @@ contract AuthorizerMock is IAuthorizer, Module { // IAuthorizer Functions // Also accepts the owner role as authorized. - function isAuthorized(address who) external view returns (bool) { + /* function isAuthorized(address who) external view returns (bool) { return _authorized[who] || _allAuthorized || _roleAuthorized[generateRoleId(address(orchestrator()), uint8(0))][who]; } @@ -73,8 +71,8 @@ contract AuthorizerMock is IAuthorizer, Module { || _roleAuthorized[generateRoleId(address(orchestrator()), uint8(1))][who] || _allAuthorized; } - - function generateRoleId(address module, uint8 role) + */ + function generateRoleId(address module, bytes32 role) public pure returns (bytes32) @@ -82,12 +80,12 @@ contract AuthorizerMock is IAuthorizer, Module { return keccak256(abi.encodePacked(module, role)); } - function grantRoleFromModule(uint8 role, address target) external { + function grantRoleFromModule(bytes32 role, address target) external { console.log(_msgSender()); _roleAuthorized[generateRoleId(_msgSender(), role)][target] = true; } - function revokeRoleFromModule(uint8 role, address target) external { + function revokeRoleFromModule(bytes32 role, address target) external { _roleAuthorized[generateRoleId(_msgSender(), role)][target] = false; } @@ -95,7 +93,7 @@ contract AuthorizerMock is IAuthorizer, Module { function transferAdminRole(bytes32, bytes32) external {} - function burnAdminRole(uint8) external {} + function burnAdminFromModuleRole(bytes32) external {} //IAccessControlUpgradeable @@ -119,6 +117,16 @@ contract AuthorizerMock is IAuthorizer, Module { return _authorized[who] || _roleAuthorized[role][who] || _allAuthorized; } + function hasModuleRole(bytes32 role, address who) + external + view + returns (bool) + { + bytes32 roleId = generateRoleId(_msgSender(), role); + return + _authorized[who] || _roleAuthorized[roleId][who] || _allAuthorized; + } + function checkRoleMembership(bytes32 role, address who) external view @@ -133,19 +141,19 @@ contract AuthorizerMock is IAuthorizer, Module { function renounceRole(bytes32, address) external pure {} - function getOwnerRole() external view returns (bytes32) { - return generateRoleId(address(orchestrator()), uint8(0)); + function getOwnerRole() external pure returns (bytes32) { + return "0x01"; } - function getManagerRole() external view returns (bytes32) { - return generateRoleId(address(orchestrator()), uint8(1)); + function getManagerRole() external pure returns (bytes32) { + return "0x02"; } /// @notice Grants a global role to a target /// @param role The role to grant /// @param target The address to grant the role to /// @dev Only the addresses with the Owner role should be able to call this function - function grantGlobalRole(uint8 role, address target) external { + function grantGlobalRole(bytes32 role, address target) external { bytes32 roleID = generateRoleId(address(orchestrator()), role); grantRole(roleID, target); } @@ -154,7 +162,7 @@ contract AuthorizerMock is IAuthorizer, Module { /// @param role The role to grant /// @param target The address to grant the role to /// @dev Only the addresses with the Owner role should be able to call this function - function revokeGlobalRole(uint8 role, address target) external { + function revokeGlobalRole(bytes32 role, address target) external { bytes32 roleID = generateRoleId(address(orchestrator()), role); revokeRole(roleID, target); }